diff options
author | Joshua Colp <jcolp@digium.com> | 2017-07-17 14:57:35 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-07-17 14:57:35 -0500 |
commit | f0558d58f0a3940b0b2d067ec8d85dc8bed1893a (patch) | |
tree | bfc2b108b71d8a807ac540b1b46fbf92d94f7392 | |
parent | 1108da4f95c8ef524681a68323959d66dfcb527f (diff) | |
parent | 51761b759d29439bc3e4e148b60bc2928946f104 (diff) |
Merge "res_rtp_asterisk: Use RTP component for ICE if RTCP-MUX is in use." into 13
-rw-r--r-- | res/res_rtp_asterisk.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c index da405e19c..e52175642 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) { |