[Asterisk-cvs] asterisk/channels chan_sip.c,1.510.2.47,1.510.2.48

russell at lists.digium.com russell at lists.digium.com
Sun Feb 6 22:13:21 CST 2005


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

Modified Files:
      Tag: v1-0
	chan_sip.c 
Log Message:
Make sure we always transmit the same from line (bug #3492)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.510.2.47
retrieving revision 1.510.2.48
diff -u -d -r1.510.2.47 -r1.510.2.48
--- chan_sip.c	7 Feb 2005 03:28:11 -0000	1.510.2.47
+++ chan_sip.c	7 Feb 2005 04:13:53 -0000	1.510.2.48
@@ -301,7 +301,8 @@
 	char useragent[256];			/* User agent in SIP request */
 	char context[AST_MAX_EXTENSION];	/* Context for this call */
 	char fromdomain[AST_MAX_EXTENSION];	/* Domain to show in the from field */
-	char fromuser[AST_MAX_EXTENSION];	/* Domain to show in the user field */
+	char fromuser[AST_MAX_EXTENSION];	/* User to show in the user field */
+	char fromname[AST_MAX_EXTENSION];	/* Name to show in the user field */
 	char tohost[AST_MAX_EXTENSION];		/* Host we should put in the "to" field */
 	char language[MAX_LANGUAGE];		/* Default language for this call */
 	char musicclass[MAX_LANGUAGE];          /* Music on Hold class */
@@ -3682,6 +3683,14 @@
 	/* Allow user to be overridden */
 	if (!ast_strlen_zero(p->fromuser))
 		l = p->fromuser;
+	else /* Save for any further attempts */
+		strncpy(p->fromuser, l, sizeof(p->fromuser) - 1);
+
+	/* Allow user to be overridden */
+	if (!ast_strlen_zero(p->fromname))
+		n = p->fromname;
+	else /* Save for any further attempts */
+		strncpy(p->fromname, n, sizeof(p->fromname) - 1);
 
 	if ((ourport != 5060) && ast_strlen_zero(p->fromdomain))
 		snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s:%d>;tag=as%08x", n, l, ast_strlen_zero(p->fromdomain) ? ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip) : p->fromdomain, ourport, p->tag);




More information about the svn-commits mailing list