]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix an issue where the port for p->ourip was being set to 0.
authorMark Michelson <mmichelson@digium.com>
Fri, 9 Jul 2010 19:29:30 +0000 (19:29 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 9 Jul 2010 19:29:30 +0000 (19:29 +0000)
This should fix all the CDR tests that were not passing. When they would
originate a call, all fields in the INVITE that contained the source port would
have the port set to 0. Most troubling of these was the Contact header. Tests
are passing locally now and should also pass on the bamboo build agents.

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

channels/chan_sip.c

index 2abec0b2bb3ed7bc6d4bb743b6e3b2ded44f2963..435c8520c8bda3d88a26c2fa184fe2555fdc8f4c 100644 (file)
@@ -3164,6 +3164,9 @@ static void ast_sip_ouraddrfor(const struct ast_sockaddr *them, struct ast_socka
                        if (!ast_sockaddr_is_any(&bindaddr)) {
                                ast_sockaddr_copy(us, &bindaddr);
                        }
+                       if (!ast_sockaddr_port(us)) {
+                               ast_sockaddr_set_port(us, ast_sockaddr_port(&bindaddr));
+                       }
                }
        } else if (!ast_sockaddr_is_any(&bindaddr)) {
                ast_sockaddr_copy(us, &bindaddr);