summaryrefslogtreecommitdiff
path: root/main/rtp.c
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-12-02 12:05:40 +0000
committerOlle Johansson <oej@edvina.net>2006-12-02 12:05:40 +0000
commitc23bc46089970c9c7275b662bbd48b0ed7310fc6 (patch)
tree09ffb0a36d6c9a88e86937e5c2cff44de6ff208f /main/rtp.c
parenteef9f7958bea41d443fb4e0698636459ab28446a (diff)
- Disable RTP timeouts during T.38 transmission
- Encapsulate RTP timers to the RTP structure, so we have one set for video and one for audio - Document RTP keepalive configuration option - Cleanup and document the monitor support function to hangup on RTP timeouts - Add RTP keepalive to SIP show settings Imported from 1.4 with modifications for trunk. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/rtp.c')
-rw-r--r--main/rtp.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c
index 3d394a043..93c92a845 100644
--- a/main/rtp.c
+++ b/main/rtp.c
@@ -128,6 +128,11 @@ struct ast_rtp {
double rxtransit; /*!< Relative transit time for previous packet */
int lasttxformat;
int lastrxformat;
+
+ int rtptimeout; /*!< RTP timeout time (negative or zero means disabled, negative value means temporarily disabled) */
+ int rtpholdtimeout; /*!< RTP timeout when on hold (negative or zero means disabled, negative value means temporarily disabled). */
+ int rtpkeepalive; /*!< Send RTP comfort noice packets for keepalive */
+
/* DTMF Reception Variables */
char resp;
unsigned int lasteventendseqn;
@@ -521,6 +526,53 @@ unsigned int ast_rtcp_calc_interval(struct ast_rtp *rtp)
return interval;
}
+/* \brief Put RTP timeout timers on hold during another transaction, like T.38 */
+void ast_rtp_set_rtptimers_onhold(struct ast_rtp *rtp)
+{
+ rtp->rtptimeout = (-1) * rtp->rtptimeout;
+ rtp->rtpholdtimeout = (-1) * rtp->rtpholdtimeout;
+}
+
+/*! \brief Set rtp timeout */
+void ast_rtp_set_rtptimeout(struct ast_rtp *rtp, int timeout)
+{
+ rtp->rtptimeout = timeout;
+}
+
+/*! \brief Set rtp hold timeout */
+void ast_rtp_set_rtpholdtimeout(struct ast_rtp *rtp, int timeout)
+{
+ rtp->rtpholdtimeout = timeout;
+}
+
+/*! \brief set RTP keepalive interval */
+void ast_rtp_set_rtpkeepalive(struct ast_rtp *rtp, int period)
+{
+ rtp->rtpkeepalive = period;
+}
+
+/*! \brief Get rtp timeout */
+int ast_rtp_get_rtptimeout(struct ast_rtp *rtp)
+{
+ if (rtp->rtptimeout < 0) /* We're not checking, but remembering the setting (during T.38 transmission) */
+ return 0;
+ return rtp->rtptimeout;
+}
+
+/*! \brief Get rtp hold timeout */
+int ast_rtp_get_rtpholdtimeout(struct ast_rtp *rtp)
+{
+ if (rtp->rtptimeout < 0) /* We're not checking, but remembering the setting (during T.38 transmission) */
+ return 0;
+ return rtp->rtpholdtimeout;
+}
+
+/*! \brief Get RTP keepalive interval */
+int ast_rtp_get_rtpkeepalive(struct ast_rtp *rtp)
+{
+ return rtp->rtpkeepalive;
+}
+
void ast_rtp_set_data(struct ast_rtp *rtp, void *data)
{
rtp->data = data;