aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-09 02:29:10 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-09 02:29:10 +0000
commit2f2068aaaba6c20e34f7dc3afd222ab7a65f8b64 (patch)
tree90344439fcce37d524c5ef21d449773120fa35ab
parente7777233fd25f33e5bd06ade95a90cb9aac48e97 (diff)
Only accept first callerid number (bug #2395)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3750 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xcallerid.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/callerid.c b/callerid.c
index 283a5dee8..f616cae80 100755
--- a/callerid.c
+++ b/callerid.c
@@ -3,9 +3,9 @@
*
* CallerID Generation support
*
- * Copyright (C) 2001, Linux Support Services, Inc.
+ * Copyright (C) 2001-2004, Digium, Inc.
*
- * Mark Spencer <markster@linux-support.net>
+ * Mark Spencer <markster@digium.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License.
@@ -261,9 +261,11 @@ int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int len, int
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 */