[asterisk-commits] mmichelson: branch 1.4 r141217 - /branches/1.4/channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Sep 5 11:00:25 CDT 2008
Author: mmichelson
Date: Fri Sep 5 11:00:24 2008
New Revision: 141217
URL: http://svn.digium.com/view/asterisk?view=rev&rev=141217
Log:
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
Modified:
branches/1.4/channels/chan_sip.c
Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?view=diff&rev=141217&r1=141216&r2=141217
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Fri Sep 5 11:00:24 2008
@@ -2903,18 +2903,18 @@
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;
More information about the asterisk-commits
mailing list