From c17cef1c383e34128cb8e3b3bdd573bad72caf75 Mon Sep 17 00:00:00 2001 From: Kevin Harwell Date: Tue, 9 Dec 2014 20:03:22 +0000 Subject: Direct Media calls within private network sometimes get one way audio When endpoints with direct_media enabled, behind a firewall (Asterisk on a separate network) and were bridged sometimes Asterisk would send the ip address of the firewall in the sdp to one of the phones in the reinvite resulting in one way audio. When sending the reinvite Asterisk will retrieve the media address from the associated rtp instance, but if frames were being read this can be overwritten with another address (in this case the firewall's). This patch ensures that Asterisk uses the original device address when using direct media. ASTERISK-24563 Reported by: Steve Pitts Review: https://reviewboard.asterisk.org/r/4216/ ........ Merged revisions 429195 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 429196 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@429197 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_sip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'channels') diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 2cbef5243..cea01d729 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -23075,7 +23075,7 @@ static void handle_response_invite(struct sip_pvt *p, int resp, const char *rest } else if (!reinvite) { struct ast_sockaddr remote_address = {{0,}}; - ast_rtp_instance_get_remote_address(p->rtp, &remote_address); + ast_rtp_instance_get_requested_target_address(p->rtp, &remote_address); if (ast_sockaddr_isnull(&remote_address) || (!ast_strlen_zero(p->theirprovtag) && strcmp(p->theirtag, p->theirprovtag))) { ast_log(LOG_WARNING, "Received response: \"200 OK\" from '%s' without SDP\n", p->relatedpeer->name); ast_set_flag(&p->flags[0], SIP_PENDINGBYE); @@ -32325,7 +32325,7 @@ static int sip_allow_anyrtp_remote(struct ast_channel *chan1, struct ast_rtp_ins if (ast_test_flag(&p->flags[0], SIP_DIRECT_MEDIA)) { struct ast_sockaddr us = { { 0, }, }, them = { { 0, }, }; - ast_rtp_instance_get_remote_address(instance, &them); + ast_rtp_instance_get_requested_target_address(instance, &them); ast_rtp_instance_get_local_address(instance, &us); if (ast_apply_acl(acl, &them, "SIP Direct Media ACL: ") == AST_SENSE_DENY) { -- cgit v1.2.3