diff options
Diffstat (limited to 'apps/app_disa.c')
-rw-r--r-- | apps/app_disa.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/apps/app_disa.c b/apps/app_disa.c index a64d05371..20c9ce48c 100644 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -308,9 +308,11 @@ static int disa_exec(struct ast_channel *chan, const char *data) } } else { if (j == '#') { /* end of extension .. maybe */ - if (i == 0 && - (ast_matchmore_extension(chan, args.context, "#", 1, chan->cid.cid_num) || - ast_exists_extension(chan, args.context, "#", 1, chan->cid.cid_num)) ) { + if (i == 0 + && (ast_matchmore_extension(chan, args.context, "#", 1, + S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL)) + || ast_exists_extension(chan, args.context, "#", 1, + S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) ) { /* Let the # be the part of, or the entire extension */ } else { break; @@ -340,7 +342,8 @@ static int disa_exec(struct ast_channel *chan, const char *data) } /* if can do some more, do it */ - if (!ast_matchmore_extension(chan,args.context,exten,1, chan->cid.cid_num)) { + if (!ast_matchmore_extension(chan, args.context, exten, 1, + S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { break; } } @@ -352,13 +355,16 @@ static int disa_exec(struct ast_channel *chan, const char *data) int recheck = 0; struct ast_flags cdr_flags = { AST_CDR_FLAG_POSTED }; - if (!ast_exists_extension(chan, args.context, exten, 1, chan->cid.cid_num)) { + if (!ast_exists_extension(chan, args.context, exten, 1, + S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { pbx_builtin_setvar_helper(chan, "INVALID_EXTEN", exten); exten[0] = 'i'; exten[1] = '\0'; recheck = 1; } - if (!recheck || ast_exists_extension(chan, args.context, exten, 1, chan->cid.cid_num)) { + if (!recheck + || ast_exists_extension(chan, args.context, exten, 1, + S_COR(chan->caller.id.number.valid, chan->caller.id.number.str, NULL))) { ast_playtones_stop(chan); /* We're authenticated and have a target extension */ if (!ast_strlen_zero(args.cid)) { |