[Asterisk-cvs] asterisk/channels chan_sip.c,1.499,1.500

markster at lists.digium.com markster at lists.digium.com
Mon Sep 13 08:22:56 CDT 2004


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

Modified Files:
	chan_sip.c 
Log Message:
Use fromdomain in creating callid if specified (bug #2427)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.499
retrieving revision 1.500
diff -u -d -r1.499 -r1.500
--- chan_sip.c	11 Sep 2004 13:50:26 -0000	1.499
+++ chan_sip.c	13 Sep 2004 12:24:38 -0000	1.500
@@ -1261,6 +1261,7 @@
 	struct sip_peer *p;
 	int found=0;
 	char *port;
+	char *callhost;
 	int portno;
 	char host[256], *hostn;
 	char peer[256]="";
@@ -1294,6 +1295,11 @@
 			strncpy(r->username, p->username, sizeof(r->username)-1);
 			strncpy(r->tohost, p->tohost, sizeof(r->tohost)-1);
 			strncpy(r->fullcontact, p->fullcontact, sizeof(r->fullcontact)-1);
+			if (!r->initreq.headers && !ast_strlen_zero(p->fromdomain)) {
+				if ((callhost = strchr(r->callid, '@'))) {
+					strncpy(callhost + 1, p->fromdomain, sizeof(r->callid) - (callhost - r->callid) - 2);
+				}
+			}
 			if (ast_strlen_zero(r->tohost)) {
 				if (p->addr.sin_addr.s_addr)
 					ast_inet_ntoa(r->tohost, sizeof(r->tohost), p->addr.sin_addr);




More information about the svn-commits mailing list