[Asterisk-cvs] asterisk/channels chan_sip.c,1.450,1.451

markster at lists.digium.com markster at lists.digium.com
Thu Jul 15 10:45:17 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory localhost.localdomain:/tmp/cvs-serv5046/channels

Modified Files:
	chan_sip.c 
Log Message:
Build contact without @ sign if there is no extension


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.450
retrieving revision 1.451
diff -u -d -r1.450 -r1.451
--- chan_sip.c	14 Jul 2004 11:51:44 -0000	1.450
+++ chan_sip.c	15 Jul 2004 14:31:20 -0000	1.451
@@ -3590,9 +3590,9 @@
 	char iabuf[INET_ADDRSTRLEN];
 	/* Construct Contact: header */
 	if (ourport != 5060)
-		snprintf(p->our_contact, sizeof(p->our_contact), "<sip:%s@%s:%d>", p->exten, ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip), ourport);
+		snprintf(p->our_contact, sizeof(p->our_contact), "<sip:%s%s%s:%d>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip), ourport);
 	else
-		snprintf(p->our_contact, sizeof(p->our_contact), "<sip:%s@%s>", p->exten, ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip));
+		snprintf(p->our_contact, sizeof(p->our_contact), "<sip:%s%s%s>", p->exten, ast_strlen_zero(p->exten) ? "" : "@", ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip));
 }
 
 /*--- initreqprep: Initiate SIP request to peer/user ---*/




More information about the svn-commits mailing list