mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 19:08:14 +00:00
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@141217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2904,17 +2904,17 @@ static int create_addr(struct sip_pvt *dialog, const char *opeer)
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user