[Freeswitch-svn] [commit] r5546 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Wed Jul 25 20:51:32 EDT 2007


Author: anthm
Date: Wed Jul 25 20:51:32 2007
New Revision: 5546

Modified:
   freeswitch/trunk/src/switch_ivr_bridge.c

Log:
small tweak to last commit 

Modified: freeswitch/trunk/src/switch_ivr_bridge.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_bridge.c	(original)
+++ freeswitch/trunk/src/switch_ivr_bridge.c	Wed Jul 25 20:51:32 2007
@@ -187,22 +187,23 @@
 	msg.from = __FILE__;
 	switch_core_session_receive_message(session_a, &msg);
 
+	if (switch_channel_get_state(chan_a) < CS_HANGUP) {
+		if ((app_name = switch_channel_get_variable(chan_a, SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE))) {
+			switch_caller_extension_t *extension = NULL;
+			if ((extension = switch_caller_extension_new(session_a, app_name, app_name)) == 0) {
+				switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "memory error!\n");
+				goto end;
+			}
+			app_arg = switch_channel_get_variable(chan_a, SWITCH_EXEC_AFTER_BRIDGE_ARG_VARIABLE);
 
-	if ((app_name = switch_channel_get_variable(chan_a, SWITCH_EXEC_AFTER_BRIDGE_APP_VARIABLE))) {
-		switch_caller_extension_t *extension = NULL;
-		if ((extension = switch_caller_extension_new(session_a, app_name, app_name)) == 0) {
-			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "memory error!\n");
-			goto end;
-		}
-		app_arg = switch_channel_get_variable(chan_a, SWITCH_EXEC_AFTER_BRIDGE_ARG_VARIABLE);
-
-		switch_caller_extension_add_application(session_a, extension, (char *) app_name, app_arg);
-		switch_channel_set_caller_extension(chan_a, extension);
+			switch_caller_extension_add_application(session_a, extension, (char *) app_name, app_arg);
+			switch_channel_set_caller_extension(chan_a, extension);
 
-		if (switch_channel_get_state(chan_a) == CS_EXECUTE) {
-			switch_channel_set_flag(chan_a, CF_RESET);
-		} else {
-			switch_channel_set_state(chan_a, CS_EXECUTE);
+			if (switch_channel_get_state(chan_a) == CS_EXECUTE) {
+				switch_channel_set_flag(chan_a, CF_RESET);
+			} else {
+				switch_channel_set_state(chan_a, CS_EXECUTE);
+			}
 		}
 	}
 



More information about the Freeswitch-svn mailing list