[Asterisk-cvs] asterisk callerid.c,1.19,1.20

markster at lists.digium.com markster at lists.digium.com
Wed Sep 8 22:26:59 CDT 2004


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

Modified Files:
	callerid.c 
Log Message:
Only accept first callerid number (bug #2395)


Index: callerid.c
===================================================================
RCS file: /usr/cvsroot/asterisk/callerid.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- callerid.c	23 Jul 2004 00:27:26 -0000	1.19
+++ callerid.c	9 Sep 2004 02:29:10 -0000	1.20
@@ -3,9 +3,9 @@
  *
  * CallerID Generation support 
  * 
- * Copyright (C) 2001, Linux Support Services, Inc.
+ * Copyright (C) 2001-2004, Digium, Inc.
  *
- * Mark Spencer <markster at linux-support.net>
+ * Mark Spencer <markster at digium.com>
  *
  * This program is free software, distributed under the terms of
  * the GNU General Public License.
@@ -261,9 +261,11 @@
 								ast_log(LOG_NOTICE, "Truncating long caller ID number from %d bytes to 32\n", cid->rawdata[x]);
 								res = 32; 
 							}
-							memcpy(cid->number, cid->rawdata + x + 1, res);
-							/* Null terminate */
-							cid->number[res] = '\0';
+							if (ast_strlen_zero(cid->number)) {
+								memcpy(cid->number, cid->rawdata + x + 1, res);
+								/* Null terminate */
+								cid->number[res] = '\0';
+							}
 							break;
 						case 7: /* Name */
 						case 8: /* Name */




More information about the svn-commits mailing list