Permit RTP to be reset
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4568 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
06d84a8a1f
commit
18c0c3f670
2 changed files with 22 additions and 2 deletions
|
@ -3,9 +3,9 @@
|
|||
*
|
||||
* Real-time Transport Protocol support
|
||||
*
|
||||
* Copyright (C) 1999, Mark Spencer
|
||||
* Copyright (C) 1999-2005, Digium
|
||||
*
|
||||
* Mark Spencer <markster@linux-support.net>
|
||||
* Mark Spencer <markster@digium.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License
|
||||
|
@ -60,6 +60,8 @@ void ast_rtp_get_us(struct ast_rtp *rtp, struct sockaddr_in *us);
|
|||
|
||||
void ast_rtp_destroy(struct ast_rtp *rtp);
|
||||
|
||||
void ast_rtp_reset(struct ast_rtp *rtp);
|
||||
|
||||
void ast_rtp_set_callback(struct ast_rtp *rtp, ast_rtp_callback callback);
|
||||
|
||||
void ast_rtp_set_data(struct ast_rtp *rtp, void *data);
|
||||
|
|
18
rtp.c
18
rtp.c
|
@ -976,6 +976,24 @@ void ast_rtp_stop(struct ast_rtp *rtp)
|
|||
}
|
||||
}
|
||||
|
||||
void ast_rtp_reset(struct ast_rtp *rtp)
|
||||
{
|
||||
memset(&rtp->rxcore, 0, sizeof(rtp->rxcore));
|
||||
memset(&rtp->txcore, 0, sizeof(rtp->txcore));
|
||||
memset(&rtp->dtmfmute, 0, sizeof(rtp->dtmfmute));
|
||||
rtp->lastts = 0;
|
||||
rtp->lastrxts = 0;
|
||||
rtp->lastividtimestamp = 0;
|
||||
rtp->lastovidtimestamp = 0;
|
||||
rtp->lasteventseqn = 0;
|
||||
rtp->lasttxformat = 0;
|
||||
rtp->lastrxformat = 0;
|
||||
rtp->dtmfcount = 0;
|
||||
rtp->dtmfduration = 0;
|
||||
rtp->seqno = 0;
|
||||
rtp->rxseqno = 0;
|
||||
}
|
||||
|
||||
void ast_rtp_destroy(struct ast_rtp *rtp)
|
||||
{
|
||||
if (rtp->smoother)
|
||||
|
|
Reference in a new issue