diff options
author | Joshua Colp <jcolp@digium.com> | 2017-03-17 11:47:36 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-03-17 11:47:36 -0500 |
commit | 15c72b32397ccc482c3a19bb5226a5e4d71e1978 (patch) | |
tree | b644dfd633aa470fbe9f44b288a58386e5ad00d5 /res/res_pjsip_sdp_rtp.c | |
parent | 732367e8066539a6551e22f75fbf280fed780e9d (diff) | |
parent | 44568fc712c3ed9e820221830a68cd707e83dd44 (diff) |
Merge "res_pjsip_sdp_rtp: RTP instance does not use same IP as explicit transport"
Diffstat (limited to 'res/res_pjsip_sdp_rtp.c')
-rw-r--r-- | res/res_pjsip_sdp_rtp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c index 9f39256e5..178524afe 100644 --- a/res/res_pjsip_sdp_rtp.c +++ b/res/res_pjsip_sdp_rtp.c @@ -196,6 +196,20 @@ static int create_rtp(struct ast_sip_session *session, struct ast_sip_session_me if (session->endpoint->media.bind_rtp_to_media_address && !ast_strlen_zero(session->endpoint->media.address)) { ast_sockaddr_parse(&temp_media_address, session->endpoint->media.address, 0); media_address = &temp_media_address; + } else { + struct ast_sip_transport *transport = + ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "transport", + session->endpoint->transport); + + if (transport && transport->state) { + char hoststr[PJ_INET6_ADDRSTRLEN]; + + pj_sockaddr_print(&transport->state->host, hoststr, sizeof(hoststr), 0); + ast_debug(1, "Transport: %s bound to host: %s, using this for media.\n", + session->endpoint->transport, hoststr); + ast_sockaddr_parse(media_address, hoststr, 0); + } + ao2_cleanup(transport); } if (!(session_media->rtp = ast_rtp_instance_new(session->endpoint->media.rtp.engine, sched, media_address, NULL))) { |