Fix an issue where the port for p->ourip was being set to 0.
[asterisk/asterisk.git] / channels / chan_sip.c
index 2abec0b..435c852 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);