diff options
Diffstat (limited to 'channels/chan_modem_i4l.c')
-rwxr-xr-x | channels/chan_modem_i4l.c | 10 |
1 files changed, 6 insertions, 4 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 |