aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_setcidname.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-02 00:58:31 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-02 00:58:31 +0000
commit6868babd229a635c5fd89c7b284025a92e0a3f9d (patch)
tree25a4ee6dff29d18acfdfbbc42485333db7aa5311 /apps/app_setcidname.c
parentb201da1a3eb1cae654cdd3fe89ef8f9e55dd0b83 (diff)
Huge callerid rework (might break H.323, others)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3874 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_setcidname.c')
-rwxr-xr-xapps/app_setcidname.c24
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;
}