diff options
Diffstat (limited to 'main/asterisk/ASTERISK-19106.patch')
-rw-r--r-- | main/asterisk/ASTERISK-19106.patch | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/main/asterisk/ASTERISK-19106.patch b/main/asterisk/ASTERISK-19106.patch index d2f44c1d93..77dcbb8fa5 100644 --- a/main/asterisk/ASTERISK-19106.patch +++ b/main/asterisk/ASTERISK-19106.patch @@ -1,8 +1,8 @@ -diff --git a/channels/chan_sip.c b/channels/chan_sip.c -index e7b678b..f1e5578 100644 ---- a/channels/chan_sip.c -+++ b/channels/chan_sip.c -@@ -13062,17 +13062,8 @@ static int sip_reg_timeout(const void *data) +Index: channels/chan_sip.c +=================================================================== +--- a/channels/chan_sip.c (revision 351503) ++++ b/channels/chan_sip.c (working copy) +@@ -13246,17 +13246,8 @@ } if (r->dnsmgr) { @@ -20,21 +20,31 @@ index e7b678b..f1e5578 100644 } /* If the initial tranmission failed, we may not have an existing dialog, -@@ -13187,14 +13178,14 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char * +@@ -13371,15 +13362,15 @@ } /* Use port number specified if no SRV record was found */ - if (!ast_sockaddr_port(&r->us) && r->portno) { -- ast_sockaddr_set_port(&r->us, r->portno); -+ if (!ast_sockaddr_port(&r->us)) { -+ ast_sockaddr_set_port(&r->us, r->portno ? r->portno : STANDARD_SIP_PORT); ++ if (!ast_sockaddr_isnull(&r->us) && !ast_sockaddr_port(&r->us) && r->portno) { + ast_sockaddr_set_port(&r->us, r->portno); } /* It is possible that DNS is unavailable at the time the peer is created. Here, if * we've updated the address in the registry, we copy it to the peer so that * create_addr() can copy it to the dialog via create_addr_from_peer */ - if ((peer = sip_find_peer(r->hostname, NULL, TRUE, FINDPEERS, FALSE, 0))) { +- if (ast_sockaddr_isnull(&peer->addr) && !(ast_sockaddr_isnull(&r->us))) { + if ((peer = sip_find_peer(S_OR(r->peername, r->hostname), NULL, TRUE, FINDPEERS, FALSE, 0))) { - if (ast_sockaddr_isnull(&peer->addr) && !(ast_sockaddr_isnull(&r->us))) { ++ if ((ast_sockaddr_isnull(&peer->addr) || !ast_sockaddr_port(&peer->addr)) && !(ast_sockaddr_isnull(&r->us))) { ast_sockaddr_copy(&peer->addr, &r->us); } + peer = sip_unref_peer(peer, "unref after sip_find_peer"); +@@ -14244,7 +14235,7 @@ + /* Don't trust the contact field. Just use what they came to us + with */ + ast_debug(1, "Store REGISTER's src-IP:port for call routing.\n"); +- peer->addr = pvt->recv; ++ ast_sockaddr_copy(&peer->addr, &pvt->recv); + } + + /* Check that they're allowed to register at this IP */ |