From 2d9034d87edefd3c0969d808b4e3c30d25806cbb Mon Sep 17 00:00:00 2001
From: Joshua Colp <jcolp@digium.com>
Date: Fri, 19 Oct 2007 15:10:24 +0000
Subject: [PATCH] Merged revisions 86469 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r86469 | file | 2007-10-19 12:08:12 -0300 (Fri, 19 Oct 2007) | 4 lines

Set port number in received as information for registrations as well.
(closes issue #11028)
Reported by: brad-x

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_sip.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index a31f5c5905..e5e8e1c813 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -8212,9 +8212,10 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
 		}
 		/* Copy back Call-ID in case create_addr changed it */
 		ast_string_field_set(r, callid, p->callid);
-		if (r->portno)
+		if (r->portno) {
 			p->sa.sin_port = htons(r->portno);
-		else 	/* Set registry port to the port set from the peer definition/srv or default */
+			p->recv.sin_port = htons(r->portno);
+		} else 	/* Set registry port to the port set from the peer definition/srv or default */
 			r->portno = ntohs(p->sa.sin_port);
 		ast_set_flag(&p->flags[0], SIP_OUTGOING);	/* Registration is outgoing call */
 		r->call = dialog_ref(p);		/* Save pointer to SIP dialog */
-- 
GitLab