aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-05 16:00:24 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-05 16:00:24 +0000
commit5432d7272660a21acfcc615fc08ad90effc77be2 (patch)
tree47139a11d09b8421a302be51b7837ee41a5c11bb /channels
parent6cc81c8912b9ae7efafbdc627914630473e5e8f0 (diff)
Commit 140417 had a logic flaw in it which
caused port 5060 to always be used when dialing a peer if no explicit port was specified. This broke the behavior of implicitly using the port from which the peer registered if no port is specified. This commit fixes the logic flaw. (closes issue #13424) Reported by: mdu113 Patches: 13424.patch uploaded by putnopvut (license 60) Tested by: mdu113 git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@141217 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c6
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;