From: Russell Bryant Date: Sat, 7 May 2011 23:24:18 +0000 (+0000) Subject: chan_iax2: Don't overwrite port found with an SRV lookup. X-Git-Tag: 1.8.5-rc1~11^2~136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1c168cd61373c6d31570a8007d318d0e84830885;p=thirdparty%2Fasterisk.git chan_iax2: Don't overwrite port found with an SRV lookup. (closes issue #17291) Reported by: jcovert Patches: chan_iax2.c.1.8.3-srvlookup-corrected.patch uploaded by jcovert (license 551) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@318055 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 0df06057aa..cbea143431 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -4555,7 +4555,9 @@ static int create_addr(const char *peername, struct ast_channel *c, struct socka return -1; } ast_sockaddr_to_sin(&sin_tmp, sin); - sin->sin_port = htons(IAX_DEFAULT_PORTNO); + if (sin->sin_port == 0) { + sin->sin_port = htons(IAX_DEFAULT_PORTNO); + } /* use global iax prefs for unknown peer/user */ /* But move the calling channel's native codec to the top of the preference list */ memcpy(&ourprefs, &prefs, sizeof(ourprefs));