summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2004-12-28 16:35:31 +0000
committerMark Spencer <markster@digium.com>2004-12-28 16:35:31 +0000
commitd331358a3b4ef9c16df0d54d642664eedc3d4856 (patch)
tree848ad080db1a3fb7db09cb3d15c1a4e682b2d654
parent907ed4d346bd035123b48230adb114a72e032aff (diff)
Permit RTP to be reset
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4568 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rwxr-xr-xinclude/asterisk/rtp.h6
-rwxr-xr-xrtp.c18
2 files changed, 22 insertions, 2 deletions
diff --git a/include/asterisk/rtp.h b/include/asterisk/rtp.h
index b8436578c..6b2df7c02 100755
--- a/include/asterisk/rtp.h
+++ b/include/asterisk/rtp.h
@@ -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);
diff --git a/rtp.c b/rtp.c
index 92dea1dca..7793054cc 100755
--- a/rtp.c
+++ b/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)