Fix nat setting on RTP instances.
authorJoshua Colp <jcolp@digium.com>
Fri, 24 Apr 2009 13:49:03 +0000 (13:49 +0000)
committerJoshua Colp <jcolp@digium.com>
Fri, 24 Apr 2009 13:49:03 +0000 (13:49 +0000)
(closes issue #14827)
Reported by: pj

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190421 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 9430b3f..292d4cd 100644 (file)
@@ -4817,6 +4817,8 @@ static int dialog_initialize_rtp(struct sip_pvt *dialog)
 
        ast_rtp_instance_set_qos(dialog->rtp, global_tos_audio, 0, "SIP RTP");
 
+       do_setnat(dialog, ast_test_flag(&dialog->flags[0], SIP_NAT) & SIP_NAT_ROUTE);
+
        return 0;
 }
 
@@ -4860,7 +4862,6 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
                ast_udptl_destroy(dialog->udptl);
                dialog->udptl = NULL;
        }
-       do_setnat(dialog, ast_test_flag(&dialog->flags[0], SIP_NAT) & SIP_NAT_ROUTE);
 
        ast_string_field_set(dialog, engine, peer->engine);
 
@@ -5000,8 +5001,6 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer, struct sockadd
                return -1;
        }
 
-       do_setnat(dialog, ast_test_flag(&dialog->flags[0], SIP_NAT) & SIP_NAT_ROUTE);
-
        ast_string_field_set(dialog, tohost, peername);
 
        /* Get the outbound proxy information */