[Asterisk-cvs] asterisk/channels chan_sip.c,1.258,1.259

markster at lists.digium.com markster at lists.digium.com
Thu Nov 27 21:35:02 CST 2003


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv29023/channels

Modified Files:
	chan_sip.c 
Log Message:
Properly build Contact on INVITE when asking for authentication


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -d -r1.258 -r1.259
--- chan_sip.c	27 Nov 2003 22:09:42 -0000	1.258
+++ chan_sip.c	28 Nov 2003 04:01:25 -0000	1.259
@@ -3979,6 +3979,17 @@
 	memset(calleridname,0,sizeof(calleridname));
 	get_calleridname(from,calleridname);
 	of = ditch_braces(from);
+	if (!strlen(p->exten)) {
+		t = uri;
+		if (!strncmp(t, "sip:", 4))
+			t+= 4;
+		strncpy(p->exten, t, sizeof(p->exten) - 1);
+		t = strchr(p->exten, '@');
+		if (t)
+			*t = '\0';
+		if (!strlen(p->our_contact))
+			build_contact(p);
+	}
 	if (strncmp(of, "sip:", 4)) {
 		ast_log(LOG_NOTICE, "From address missing 'sip:', using it anyway\n");
 	} else




More information about the svn-commits mailing list