From: Joshua Colp Date: Sun, 16 Jul 2017 17:18:39 +0000 (+0000) Subject: res_rtp_asterisk: Use RTP component for ICE if RTCP-MUX is in use. X-Git-Tag: 14.7.0-rc1~133^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9576dfdd36d363695ed9bd852d3aabf55bc4fc9f;p=thirdparty%2Fasterisk.git res_rtp_asterisk: Use RTP component for ICE if RTCP-MUX is in use. This change makes it so that if an RTCP packet is being sent the RTP ICE component is used for sending if RTCP-MUX is in use. ASTERISK-27133 Change-Id: I6200f611ede709602ee9b89501720c29545ed68b --- diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index 2a2fbf7443..ea47423f79 100644 --- a/res/res_rtp_asterisk.c +++ b/res/res_rtp_asterisk.c @@ -2587,17 +2587,22 @@ static int __rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t siz #ifdef HAVE_PJPROJECT if (rtp->ice) { + enum ast_rtp_ice_component_type component = rtcp ? AST_RTP_ICE_COMPONENT_RTCP : AST_RTP_ICE_COMPONENT_RTP; pj_status_t status; struct ice_wrap *ice; + /* If RTCP is sharing the same socket then use the same component */ + if (rtcp && rtp->rtcp->s == rtp->s) { + component = AST_RTP_ICE_COMPONENT_RTP; + } + pj_thread_register_check(); /* Release the instance lock to avoid deadlock with PJPROJECT group lock */ ice = rtp->ice; ao2_ref(ice, +1); ao2_unlock(instance); - status = pj_ice_sess_send_data(ice->real_ice, - rtcp ? AST_RTP_ICE_COMPONENT_RTCP : AST_RTP_ICE_COMPONENT_RTP, temp, len); + status = pj_ice_sess_send_data(ice->real_ice, component, temp, len); ao2_ref(ice, -1); ao2_lock(instance); if (status == PJ_SUCCESS) {