[asterisk-commits] tilghman: branch 1.4 r114242 - /branches/1.4/apps/app_setcallerid.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Apr 18 01:49:17 CDT 2008
Author: tilghman
Date: Fri Apr 18 01:49:16 2008
New Revision: 114242
URL: http://svn.digium.com/view/asterisk?view=rev&rev=114242
Log:
For consistency sake, ensure that the values that ${CALLINGPRES} returns are valid as an
input to SetCallingPres. (Closes issue #12472)
Modified:
branches/1.4/apps/app_setcallerid.c
Modified: branches/1.4/apps/app_setcallerid.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_setcallerid.c?view=diff&rev=114242&r1=114241&r2=114242
==============================================================================
--- branches/1.4/apps/app_setcallerid.c (original)
+++ branches/1.4/apps/app_setcallerid.c Fri Apr 18 01:49:16 2008
@@ -70,8 +70,11 @@
int pres = -1;
u = ast_module_user_add(chan);
-
- 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",
More information about the asterisk-commits
mailing list