diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-18 06:54:39 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-04-18 06:54:39 +0000 |
commit | 814fda13b9d5ac564f164b2102e62f1cf6ce62a2 (patch) | |
tree | 18c8d377ef57c0443d7fba7d3a408412be430963 /apps | |
parent | 7a3d6cc67c4bb6ecbc2a61ce2dc5cc4d1d0055b4 (diff) |
Merged revisions 114243 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r114243 | tilghman | 2008-04-18 01:53:47 -0500 (Fri, 18 Apr 2008) | 11 lines
Merged revisions 114242 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r114242 | tilghman | 2008-04-18 01:49:16 -0500 (Fri, 18 Apr 2008) | 3 lines
For consistency sake, ensure that the values that ${CALLINGPRES} returns are valid as an
input to SetCallingPres. (Closes issue #12472)
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@114244 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rw-r--r-- | apps/app_setcallerid.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/app_setcallerid.c b/apps/app_setcallerid.c index c76b80eef..f1c9df3cb 100644 --- a/apps/app_setcallerid.c +++ b/apps/app_setcallerid.c @@ -68,7 +68,11 @@ static int setcallerid_pres_exec(struct ast_channel *chan, void *data) deprecated = 1; ast_log(LOG_WARNING, "SetCallerPres is deprecated. Please use Set(CALLERPRES()=%s) instead.\n", (char *)data); } - pres = ast_parse_caller_presentation(data); + + /* For interface consistency, permit the argument to be specified as a number */ + if (sscanf(data, "%d", &pres) != 1 || pres < 0 || pres > 255 || (pres & 0x9c)) { + pres = ast_parse_caller_presentation(data); + } if (pres < 0) { ast_log(LOG_WARNING, "'%s' is not a valid presentation (see 'show application SetCallerPres')\n", |