From: Russell Bryant Date: Wed, 22 Jun 2005 14:01:26 +0000 (+0000) Subject: correctly jump to fax extension when inside of a macro (bug #4471) X-Git-Tag: 1.0.11.1~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d504015d4dfc84386845ab4bee813829666f335;p=thirdparty%2Fasterisk.git correctly jump to fax extension when inside of a macro (bug #4471) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/v1-0@5967 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_zap.c b/channels/chan_zap.c index c71fc79b40..f7f2969a2a 100755 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -4078,13 +4078,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->callerid)) { + char *target_context = ast_strlen_zero(ast->macrocontext) ? ast->context : ast->macrocontext; + + if (ast_exists_extension(ast, target_context, "fax", 1, ast->callerid)) { 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