diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-12-02 11:32:51 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-12-02 11:32:51 +0000 |
commit | 26ab0f0fd495ae94a975ae475f618bb4459bff80 (patch) | |
tree | 3ee171b5893dfa8d8efdf644a78be63d96dffeae /main | |
parent | eef3755e11518c7e7db722168eded36e103b6092 (diff) |
- Disable RTP hold timers while T.38 fax transmission happens
- Encapsulate RTP timers in the rtp structure so we have one for video and one for audio
The video one is not used in 1.4, really. Will be used for RTP keepalives when we can send
something that video phones support in the RTP stream.
I now this is a big architectual change at this stage for 1.4, but decided it was needed
to avoid future bug reports.
- Document the RTP NAT keepalive option in sip.conf.sample
Issue 7679 in the bug tracker. Please test.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48199 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/rtp.c | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/main/rtp.c b/main/rtp.c index 53ef9f1c0..8761f5d5b 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; |