aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-03 20:49:10 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-08-03 20:49:10 +0000
commit994debde3c3d78011509a53fc68dd6ae27a6024e (patch)
tree86746dca3b3596169039acacee6b52a3c5266d8d /funcs
parent2cba58cde9075cb1103123bf396e4897ef23139a (diff)
Prevent DAHDI channels from overriding the callerid, once it's been set by the user.
(closes issue #16661) Reported by: jstapleton Patches: 20100414__issue16661.diff.txt uploaded by tilghman (license 14) 20100415__issue16661__1.6.2.diff.txt uploaded by tilghman (license 14) Tested by: jstapleton git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@280811 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r--funcs/func_callerid.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c
index 86c54883e..418878fda 100644
--- a/funcs/func_callerid.c
+++ b/funcs/func_callerid.c
@@ -114,6 +114,7 @@ static int callerid_read(struct ast_channel *chan, char *cmd, char *data,
static int callerid_write(struct ast_channel *chan, char *cmd, char *data,
const char *value)
{
+ int valid = 1;
if (!value || !chan)
return -1;
@@ -157,6 +158,11 @@ static int callerid_write(struct ast_channel *chan, char *cmd, char *data,
ast_channel_unlock(chan);
} else {
ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data);
+ valid = 0;
+ }
+
+ if (valid) {
+ chan->cid.cid_tns = 1;
}
return 0;