diff options
author | mattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-11 22:33:57 +0000 |
---|---|---|
committer | mattf <mattf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-10-11 22:33:57 +0000 |
commit | 938c1759c797ad65d9568276d1a0f4b083ba819c (patch) | |
tree | 29a0211f08496e1b5314096c188619d79dcb86a3 /funcs/func_callerid.c | |
parent | 263f210ff2752e6f7957aa164b38de995ee96454 (diff) |
See if I can fix this borked ANI2 code I added
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85498 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_callerid.c')
-rw-r--r-- | funcs/func_callerid.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c index e50731bf0..54899352a 100644 --- a/funcs/func_callerid.c +++ b/funcs/func_callerid.c @@ -92,7 +92,9 @@ static int callerid_read(struct ast_channel *chan, const char *cmd, char *data, ast_copy_string(buf, chan->cid.cid_num, len); } } else if (!strncasecmp("ani", data, 3)) { - if (chan->cid.cid_ani) { + if (!strncasecmp(data + 3, "2", 1)) { + snprintf(buf, len, "%d", chan->cid.cid_ani2); + } else if (chan->cid.cid_ani) { ast_copy_string(buf, chan->cid.cid_ani, len); } } else if (!strncasecmp("dnid", data, 4)) { @@ -107,8 +109,6 @@ static int callerid_read(struct ast_channel *chan, const char *cmd, char *data, ast_copy_string(buf, ast_named_caller_presentation(chan->cid.cid_pres), len); } else if (!strncasecmp("ton", data, 3)) { snprintf(buf, len, "%d", chan->cid.cid_ton); - } else if (!strncasecmp("ani2", data, 4)) { - snprintf(buf, len, "%d", chan->cid.cid_ani2); } else { ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data); } @@ -134,7 +134,11 @@ static int callerid_write(struct ast_channel *chan, const char *cmd, char *data, } else if (!strncasecmp("num", data, 3)) { ast_set_callerid(chan, value, NULL, NULL); } else if (!strncasecmp("ani", data, 3)) { - ast_set_callerid(chan, NULL, NULL, value); + if (!strncasecmp(data + 3, "2", 1)) { + int i = atoi(value); + chan->cid.cid_ani2 = i; + } else + ast_set_callerid(chan, NULL, NULL, value); } else if (!strncasecmp("dnid", data, 4)) { /* do we need to lock chan here? */ if (chan->cid.cid_dnid) @@ -173,9 +177,6 @@ static int callerid_write(struct ast_channel *chan, const char *cmd, char *data, } else if (!strncasecmp("ton", data, 3)) { int i = atoi(value); chan->cid.cid_ton = i; - } else if (!strncasecmp("ani2", data, 4)) { - int i = atoi(value); - chan->cid.cid_ani2 = i; } else { ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data); } |