From f8d0dcac122feafe9ebd0aba502263f829c77667 Mon Sep 17 00:00:00 2001 From: tilghman Date: Tue, 3 Aug 2010 20:52:20 +0000 Subject: Merged revisions 280811 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r280811 | tilghman | 2010-08-03 15:49:10 -0500 (Tue, 03 Aug 2010) | 9 lines 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.6.2@280812 f38db490-d61c-443f-a65b-d21fe96a405b --- funcs/func_callerid.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'funcs') diff --git a/funcs/func_callerid.c b/funcs/func_callerid.c index 5e5585432..3c595daab 100644 --- a/funcs/func_callerid.c +++ b/funcs/func_callerid.c @@ -191,6 +191,7 @@ static int callerid_read(struct ast_channel *chan, const char *cmd, char *data, static int callerid_write(struct ast_channel *chan, const char *cmd, char *data, const char *value) { + int valid = 1; if (!value || !chan) return -1; @@ -267,6 +268,11 @@ static int callerid_write(struct ast_channel *chan, const char *cmd, char *data, chan->cid.cid_ton = atoi(value); } else { ast_log(LOG_ERROR, "Unknown callerid data type '%s'.\n", data); + valid = 0; + } + + if (valid) { + chan->cid.cid_tns = 1; } return 0; -- cgit v1.2.3