diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-06 03:18:51 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-06-06 03:18:51 +0000 |
commit | 1d0c88f7f06401682a4e7feda499c9d5b40461cd (patch) | |
tree | d54610ac128b722dd1173334607edfce62d6bfad /channels | |
parent | e5006737913cf0182a428bea5fe509001aa4e98f (diff) |
handle going to 'fax' extension when inside a macro properly (bug #4368)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5856 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_modem_i4l.c | 10 | ||||
-rwxr-xr-x | channels/chan_vpb.c | 12 | ||||
-rwxr-xr-x | channels/chan_zap.c | 10 |
3 files changed, 19 insertions, 13 deletions
diff --git a/channels/chan_modem_i4l.c b/channels/chan_modem_i4l.c index 130ecdb81..65a28223c 100755 --- a/channels/chan_modem_i4l.c +++ b/channels/chan_modem_i4l.c @@ -458,13 +458,15 @@ static struct ast_frame *i4l_read(struct ast_modem_pvt *p) if (!p->faxhandled) { p->faxhandled++; if (strcmp(ast->exten, "fax")) { - if (ast_exists_extension(ast, ast_strlen_zero(ast->macrocontext) ? ast->context : ast->macrocontext, "fax", 1, ast->cid.cid_num)) { + const char *target_context = ast_strlen_zero(ast->macrocontext) ? ast->context : ast->macrocontext; + + if (ast_exists_extension(ast, target_context, "fax", 1, ast->cid.cid_num)) { if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", ast->name); /* Save the DID/DNIS when we transfer the fax call to a "fax" extension */ - pbx_builtin_setvar_helper(ast,"FAXEXTEN",ast->exten); - if (ast_async_goto(ast, ast->context, "fax", 1)) - ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, ast->context); + pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten); + if (ast_async_goto(ast, target_context, "fax", 1)) + ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context); } else ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n"); } else diff --git a/channels/chan_vpb.c b/channels/chan_vpb.c index 18fdb19f9..ea663228b 100755 --- a/channels/chan_vpb.c +++ b/channels/chan_vpb.c @@ -881,13 +881,15 @@ static inline int monitor_handle_owned(struct vpb_pvt *p, VPB_EVENT *e) else if (e->data == VPB_FAX){ if (!p->faxhandled){ if (strcmp(p->owner->exten, "fax")) { - if (ast_exists_extension(p->owner, ast_strlen_zero(p->owner->macrocontext) ? p->owner->context : p->owner->macrocontext, "fax", 1, p->owner->cid.cid_num)) { + const char *target_context = ast_strlen_zero(ast->macrocontext) ? ast->context : ast->macrocontext; + + if (ast_exists_extension(ast, target_context, "fax", 1, ast->cid.cid_num)) { if (option_verbose > 2) - ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", p->owner->name); + ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", ast->name); /* Save the DID/DNIS when we transfer the fax call to a "fax" extension */ - pbx_builtin_setvar_helper(p->owner,"FAXEXTEN",p->owner->exten); - if (ast_async_goto(p->owner, p->owner->context, "fax", 1)) - ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", p->owner->name, p->owner->context); + pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten); + if (ast_async_goto(ast, target_context, "fax", 1)) + ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context); } else ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n"); } else diff --git a/channels/chan_zap.c b/channels/chan_zap.c index db6310d7c..14b257cb6 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -4360,13 +4360,15 @@ struct ast_frame *zt_read(struct ast_channel *ast) if (!p->faxhandled) { p->faxhandled++; if (strcmp(ast->exten, "fax")) { - if (ast_exists_extension(ast, ast_strlen_zero(ast->macrocontext) ? ast->context : ast->macrocontext, "fax", 1, ast->cid.cid_num)) { + const char *target_context = ast_strlen_zero(ast->macrocontext) ? ast->context : ast->macrocontext; + + if (ast_exists_extension(ast, target_context, "fax", 1, ast->cid.cid_num)) { if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", ast->name); /* Save the DID/DNIS when we transfer the fax call to a "fax" extension */ - pbx_builtin_setvar_helper(ast,"FAXEXTEN",ast->exten); - if (ast_async_goto(ast, ast->context, "fax", 1)) - ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, ast->context); + pbx_builtin_setvar_helper(ast, "FAXEXTEN", ast->exten); + if (ast_async_goto(ast, target_context, "fax", 1)) + ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, target_context); } else ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n"); } else |