summaryrefslogtreecommitdiff
path: root/res/res_rtp_asterisk.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2013-02-28 21:37:57 +0000
committerJoshua Colp <jcolp@digium.com>2013-02-28 21:37:57 +0000
commit50a74cbd2a29b237e6d835310a11de8624d2d8e1 (patch)
treeff80dc7d077e8b073406e7ddb004555f37b3307a /res/res_rtp_asterisk.c
parent855bb334c8ad6cace55d875bc4aeddc1a81b005f (diff)
Fix a bug with ICE and strictrtp where media could get dropped.
If the end result of the ICE negotiation resulted in the path for media changing it was possible for the strictrtp code to discard the RTP packets. This change causes strictrtp to enter learning mode once again when the ICE negotiation has completed successfully. ........ Merged revisions 382296 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@382297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r--res/res_rtp_asterisk.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 05ebf0ae8..560314fe4 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1020,6 +1020,20 @@ static struct ast_rtp_engine asterisk_rtp_engine = {
#endif
};
+static void rtp_learning_seq_init(struct ast_rtp *rtp, uint16_t seq);
+
+static void ast_rtp_on_ice_complete(pj_ice_sess *ice, pj_status_t status)
+{
+ struct ast_rtp *rtp = ice->user_data;
+
+ if (status != PJ_SUCCESS || !strictrtp) {
+ return;
+ }
+
+ rtp->strict_rtp_state = STRICT_RTP_LEARN;
+ rtp_learning_seq_init(rtp, (uint16_t)rtp->seqno);
+}
+
static void ast_rtp_on_ice_rx_data(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, void *pkt, pj_size_t size, const pj_sockaddr_t *src_addr, unsigned src_addr_len)
{
struct ast_rtp *rtp = ice->user_data;
@@ -1066,6 +1080,7 @@ static pj_status_t ast_rtp_on_ice_tx_pkt(pj_ice_sess *ice, unsigned comp_id, uns
/* ICE Session interface declaration */
static pj_ice_sess_cb ast_rtp_ice_sess_cb = {
+ .on_ice_complete = ast_rtp_on_ice_complete,
.on_rx_data = ast_rtp_on_ice_rx_data,
.on_tx_pkt = ast_rtp_on_ice_tx_pkt,
};