[Asterisk-cvs] asterisk/channels chan_modem_i4l.c, 1.25, 1.26 chan_vpb.c, 1.82, 1.83 chan_zap.c, 1.456, 1.457

kpfleming at lists.digium.com kpfleming at lists.digium.com
Sun Jun 5 23:16:21 CDT 2005


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

Modified Files:
	chan_modem_i4l.c chan_vpb.c chan_zap.c 
Log Message:
handle going to 'fax' extension when inside a macro properly (bug #4368)


Index: 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 -d -r1.25 -r1.26
--- chan_modem_i4l.c	21 Apr 2005 06:02:43 -0000	1.25
+++ 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

Index: chan_vpb.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_vpb.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- chan_vpb.c	27 Apr 2005 04:28:24 -0000	1.82
+++ chan_vpb.c	6 Jun 2005 03:18:51 -0000	1.83
@@ -881,13 +881,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(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

Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.456
retrieving revision 1.457
diff -u -d -r1.456 -r1.457
--- chan_zap.c	3 Jun 2005 03:24:37 -0000	1.456
+++ 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




More information about the svn-commits mailing list