diff options
Diffstat (limited to 'apps/app_setcidname.c')
-rwxr-xr-x | apps/app_setcidname.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/apps/app_setcidname.c b/apps/app_setcidname.c index ee430911b..44b9dbd04 100755 --- a/apps/app_setcidname.c +++ b/apps/app_setcidname.c @@ -34,7 +34,7 @@ static char *descrip = " SetCIDName(cname[|a]): Set Caller*ID Name on a call to a new\n" "value, while preserving the original Caller*ID number. This is\n" "useful for providing additional information to the called\n" -"party. Sets ANI as well if a flag is used. Always returns 0\n"; +"party. Always returns 0\n"; STANDARD_LOCAL_USER; @@ -44,36 +44,16 @@ static int setcallerid_exec(struct ast_channel *chan, void *data) { int res = 0; char tmp[256] = ""; - char oldcid[256] = "", *l, *n; - char newcid[256] = ""; struct localuser *u; char *opt; - int anitoo = 0; if (data) strncpy(tmp, (char *)data, sizeof(tmp) - 1); opt = strchr(tmp, '|'); if (opt) { *opt = '\0'; - opt++; - if (*opt == 'a') - anitoo = 1; } LOCAL_USER_ADD(u); - if (chan->callerid) { - strncpy(oldcid, chan->callerid, sizeof(oldcid) - 1); - ast_callerid_parse(oldcid, &n, &l); - n = tmp; - if (!ast_strlen_zero(n)) { - if (l && !ast_strlen_zero(l)) - snprintf(newcid, sizeof(newcid), "\"%s\" <%s>", n, l); - else - strncpy(newcid, tmp, sizeof(newcid) - 1); - } else if (l && !ast_strlen_zero(l)) { - strncpy(newcid, l, sizeof(newcid) - 1); - } - } else - strncpy(newcid, tmp, sizeof(newcid) - 1); - ast_set_callerid(chan, !ast_strlen_zero(newcid) ? newcid : NULL, anitoo); + ast_set_callerid(chan, NULL, tmp, NULL); LOCAL_USER_REMOVE(u); return res; } |