[svn-commits] rizzo: branch 1.4 r44662 - /branches/1.4/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Oct 7 04:11:17 MST 2006


Author: rizzo
Date: Sat Oct  7 06:11:16 2006
New Revision: 44662

URL: http://svn.digium.com/view/asterisk?rev=44662&view=rev
Log:
remove hardwired usage of 5060, use DEFAULT_SIP_PORT instead


Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?rev=44662&r1=44661&r2=44662&view=diff
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Sat Oct  7 06:11:16 2006
@@ -6293,7 +6293,7 @@
 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));
@@ -6452,7 +6452,7 @@
 		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);
@@ -6473,7 +6473,7 @@
 			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);
 	}



More information about the svn-commits mailing list