From b37dc86c743ded57cc022aaf843d018906337f38 Mon Sep 17 00:00:00 2001
From: Luigi Rizzo <rizzo@icir.org>
Date: Sat, 7 Oct 2006 11:11:39 +0000
Subject: [PATCH] remove hardwired usage of 5060, use DEFAULT_SIP_PORT instead

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

diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d52221f0e1..629cf77987 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6283,7 +6283,7 @@ static void extract_uri(struct sip_pvt *p, struct sip_request *req)
 static void build_contact(struct sip_pvt *p)
 {
 	/* Construct Contact: header */
-	if (ourport != 5060)	/* Needs to be 5060, according to the RFC */
+	if (ourport != DEFAULT_SIP_PORT)	/* Needs to be 5060, according to the RFC */
 		ast_string_field_build(p, our_contact, "<sip:%s%s%s:%d>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(p->ourip), ourport);
 	else
 		ast_string_field_build(p, our_contact, "<sip:%s%s%s>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(p->ourip));
@@ -6442,7 +6442,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
 		l = tmp2;
 	}
 
-	if ((ourport != 5060) && ast_strlen_zero(p->fromdomain))	/* Needs to be 5060 */
+	if (ourport != DEFAULT_SIP_PORT && ast_strlen_zero(p->fromdomain))	/* Needs to be 5060 */
 		snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s:%d>;tag=%s", n, l, S_OR(p->fromdomain, ast_inet_ntoa(p->ourip)), ourport, p->tag);
 	else
 		snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s>;tag=%s", n, l, S_OR(p->fromdomain, ast_inet_ntoa(p->ourip)), p->tag);
@@ -6463,7 +6463,7 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho
 			ast_build_string(&invite, &invite_max, "%s@", n);
 		}
 		ast_build_string(&invite, &invite_max, "%s", p->tohost);
-		if (ntohs(p->sa.sin_port) != 5060)		/* Needs to be 5060 */
+		if (ntohs(p->sa.sin_port) != DEFAULT_SIP_PORT)		/* Needs to be 5060 */
 			ast_build_string(&invite, &invite_max, ":%d", ntohs(p->sa.sin_port));
 		ast_build_string(&invite, &invite_max, "%s", urioptions);
 	}
-- 
GitLab