Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv13446/channels

Modified Files:
      Tag: v1-0
        chan_zap.c 
Log Message:
correctly jump to fax extension when inside of a macro (bug #4471)


Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.344.2.20
retrieving revision 1.344.2.21
diff -u -d -r1.344.2.20 -r1.344.2.21
--- chan_zap.c  15 Jun 2005 21:42:31 -0000      1.344.2.20
+++ chan_zap.c  22 Jun 2005 14:01:26 -0000      1.344.2.21
@@ -4078,13 +4078,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->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

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to