Index: channels/chan_zap.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v retrieving revision 1.456 retrieving revision 1.457 diff -u -r1.456 -r1.457 --- channels/chan_zap.c 3 Jun 2005 03:24:37 -0000 1.456 +++ channels/chan_zap.c 6 Jun 2005 03:18:51 -0000 1.457 @@ -4360,13 +4360,15 @@ 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 Index: channels/chan_vpb.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_vpb.c,v retrieving revision 1.82 retrieving revision 1.86 diff -u -r1.82 -r1.86 --- channels/chan_vpb.c 27 Apr 2005 04:28:24 -0000 1.82 +++ channels/chan_vpb.c 8 Jun 2005 00:10:09 -0000 1.86 @@ -881,13 +885,15 @@ 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(p->owner->macrocontext) ? p->owner->context : p->owner->macrocontext; + + if (ast_exists_extension(p->owner, target_context, "fax", 1, p->owner->cid.cid_num)) { if (option_verbose > 2) ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", p->owner->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(p->owner, "FAXEXTEN", p->owner->exten); + if (ast_async_goto(p->owner, target_context, "fax", 1)) + ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", p->owner->name, target_context); } else ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n"); } else Index: channels/chan_modem_i4l.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_modem_i4l.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- channels/chan_modem_i4l.c 21 Apr 2005 06:02:43 -0000 1.25 +++ channels/chan_modem_i4l.c 6 Jun 2005 03:18:51 -0000 1.26 @@ -458,13 +458,15 @@ 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