Merge "res_rtp_asterisk: Use RTP component for ICE if RTCP-MUX is in use." into 13

This commit is contained in:
Joshua Colp
2017-07-17 14:57:35 -05:00
committed by Gerrit Code Review

View File

@@ -2587,17 +2587,22 @@ static int __rtp_sendto(struct ast_rtp_instance *instance, void *buf, size_t siz
#ifdef HAVE_PJPROJECT #ifdef HAVE_PJPROJECT
if (rtp->ice) { 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; pj_status_t status;
struct ice_wrap *ice; 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(); pj_thread_register_check();
/* Release the instance lock to avoid deadlock with PJPROJECT group lock */ /* Release the instance lock to avoid deadlock with PJPROJECT group lock */
ice = rtp->ice; ice = rtp->ice;
ao2_ref(ice, +1); ao2_ref(ice, +1);
ao2_unlock(instance); ao2_unlock(instance);
status = pj_ice_sess_send_data(ice->real_ice, status = pj_ice_sess_send_data(ice->real_ice, component, temp, len);
rtcp ? AST_RTP_ICE_COMPONENT_RTCP : AST_RTP_ICE_COMPONENT_RTP, temp, len);
ao2_ref(ice, -1); ao2_ref(ice, -1);
ao2_lock(instance); ao2_lock(instance);
if (status == PJ_SUCCESS) { if (status == PJ_SUCCESS) {