Author: file Date: Wed Oct 15 20:26:18 2014 New Revision: 425647 URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=425647 Log: res_rtp_asterisk: Fix a bug where ICE state would get reset when it shouldn't.
In the case where the ICE negotiation had not yet started current state would get wiped when it shouldn't. This also removes channel binding as in practice this does not work well with other implementations. ........ Merged revisions 425644 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 425645 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 425646 from http://svn.asterisk.org/svn/asterisk/branches/13 Modified: trunk/ (props changed) trunk/res/res_rtp_asterisk.c Propchange: trunk/ ------------------------------------------------------------------------------ Binary property 'branch-13-merged' - no diff available. Modified: trunk/res/res_rtp_asterisk.c URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_rtp_asterisk.c?view=diff&rev=425647&r1=425646&r2=425647 ============================================================================== --- trunk/res/res_rtp_asterisk.c (original) +++ trunk/res/res_rtp_asterisk.c Wed Oct 15 20:26:18 2014 @@ -463,18 +463,6 @@ ast_sockaddr_set_port(cand_address, pj_sockaddr_get_port(&rtp->ice->comp[component - 1].valid_check->rcand->addr)); } -/*! \brief Helper function which sets up channel binding on a TURN session if applicable */ -static void turn_enable_bind_channel(struct ast_rtp *rtp, pj_turn_sock *turn, int component, int transport) -{ - if (!rtp->ice || !turn || (component < 1) || !rtp->ice->comp[component - 1].valid_check || - (rtp->ice->comp[component - 1].valid_check->lcand->transport_id != transport)) { - return; - } - - pj_turn_sock_bind_channel(turn, &rtp->ice->comp[component - 1].valid_check->rcand->addr, - sizeof(rtp->ice->comp[component - 1].valid_check->rcand->addr)); -} - /*! \brief Destructor for locally created ICE candidates */ static void ast_rtp_ice_candidate_destroy(void *obj) { @@ -599,6 +587,10 @@ struct ast_rtp *rtp = ast_rtp_instance_get_data(instance); pj_ice_sess_role role = rtp->ice->role; int res; + + if (!rtp->ice->is_nominating && !rtp->ice->is_complete) { + return 0; + } ast_rtp_ice_stop(instance); @@ -1625,11 +1617,9 @@ update_address_with_ice_candidate(rtp, AST_RTP_ICE_COMPONENT_RTP, &remote_address); ast_rtp_instance_set_remote_address(instance, &remote_address); - turn_enable_bind_channel(rtp, rtp->turn_rtp, AST_RTP_ICE_COMPONENT_RTP, TRANSPORT_TURN_RTP); if (rtp->rtcp) { update_address_with_ice_candidate(rtp, AST_RTP_ICE_COMPONENT_RTCP, &rtp->rtcp->them); - turn_enable_bind_channel(rtp, rtp->turn_rtcp, AST_RTP_ICE_COMPONENT_RTCP, TRANSPORT_TURN_RTCP); } } -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- svn-commits mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/svn-commits
