From 6ba8a7efc94353bf13bfcdc55fec338223b5ab05 Mon Sep 17 00:00:00 2001 From: russell Date: Sat, 7 May 2011 23:26:05 +0000 Subject: Merged revisions 318055 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r318055 | russell | 2011-05-07 18:24:18 -0500 (Sat, 07 May 2011) | 7 lines 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: http://svn.digium.com/svn/asterisk/trunk@318056 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_iax2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'channels') diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 45410f64f..dab0bd9d1 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -4638,7 +4638,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)); -- cgit v1.2.3