diff options
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index a99428774..6e9d135a8 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -2903,18 +2903,18 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer) dialog->sa.sin_family = AF_INET; dialog->timer_t1 = 500; /* Default SIP retransmission timer T1 (RFC 3261) */ p = find_peer(peer, NULL, 1, 0); - - portno = port ? atoi(port) : STANDARD_SIP_PORT; if (p) { int res = create_addr_from_peer(dialog, p); - if (portno) { + if (port) { + portno = atoi(port); dialog->sa.sin_port = dialog->recv.sin_port = htons(portno); } ASTOBJ_UNREF(p, sip_destroy_peer); return res; } hostn = peer; + portno = port ? atoi(port) : STANDARD_SIP_PORT; if (srvlookup) { char service[MAXHOSTNAMELEN]; int tportno; |