diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-13 23:52:42 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-10-13 23:52:42 +0000 |
commit | 23cd76b172a83eec49e5e82920e24f2c3abe3933 (patch) | |
tree | 9888a5d73ef13973597f5cdd9fdcb2468c51e7b3 /apps/app_disa.c | |
parent | 6834b63b9900e0cb44deecdf81e0793304325e32 (diff) |
make DISA() use 'i' extension if it exists (issue #5439 with mods)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6779 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_disa.c')
-rwxr-xr-x | apps/app_disa.c | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/apps/app_disa.c b/apps/app_disa.c index 5e9f5ccd8..173441d46 100755 --- a/apps/app_disa.c +++ b/apps/app_disa.c @@ -329,25 +329,35 @@ static int disa_exec(struct ast_channel *chan, void *data) } } - if (k==3 && ast_exists_extension(chan, ourcontext, exten, 1, chan->cid.cid_num)) - { - ast_playtones_stop(chan); - /* We're authenticated and have a valid extension */ - if (ourcallerid && *ourcallerid) - { - ast_callerid_split(ourcallerid, ourcidname, sizeof(ourcidname), ourcidnum, sizeof(ourcidnum)); - ast_set_callerid(chan, ourcidnum, ourcidname, ourcidnum); + if (k == 3) { + int recheck = 0; + + if (!ast_exists_extension(chan, ourcontext, exten, 1, chan->cid.cid_num)) { + exten[0] = 'i'; + exten[1] = '\0'; + recheck = 1; } + if (!recheck || ast_exists_extension(chan, ourcontext, exten, 1, chan->cid.cid_num)) { + ast_playtones_stop(chan); + /* We're authenticated and have a target extension */ + if (ourcallerid && *ourcallerid) + { + ast_callerid_split(ourcallerid, ourcidname, sizeof(ourcidname), ourcidnum, sizeof(ourcidnum)); + ast_set_callerid(chan, ourcidnum, ourcidname, ourcidnum); + } + + if (!ast_strlen_zero(acctcode)) + strncpy(chan->accountcode, acctcode, sizeof(chan->accountcode) - 1); - if (!ast_strlen_zero(acctcode)) { - strncpy(chan->accountcode, acctcode, sizeof(chan->accountcode) - 1); + ast_cdr_reset(chan->cdr, AST_CDR_FLAG_POSTED); + ast_explicit_goto(chan, ourcontext, exten, 1); + LOCAL_USER_REMOVE(u); + return 0; } - ast_cdr_reset(chan->cdr, AST_CDR_FLAG_POSTED); - ast_goto_if_exists(chan, ourcontext, exten, 1); - LOCAL_USER_REMOVE(u); - return 0; } + /* Received invalid, but no "i" extension exists in the given context */ + reorder: ast_indicate(chan,AST_CONTROL_CONGESTION); |