aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_setcallerid.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/app_setcallerid.c')
-rw-r--r--apps/app_setcallerid.c6
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",