From: Tilghman Lesher Date: Fri, 18 Apr 2008 06:53:47 +0000 (+0000) Subject: Merged revisions 114242 via svnmerge from X-Git-Tag: 1.6.2.0-beta1~2443 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f33780bfab55524e701e89399bec23185ba9f9f;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/trunk@114243 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_setcallerid.c b/apps/app_setcallerid.c index c76b80eefc..f1c9df3cbd 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",