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

Freeswitch SVN anthm at freeswitch.org
Fri Jan 11 11:50:05 EST 2008


Author: anthm
Date: Fri Jan 11 11:50:05 2008
New Revision: 7176

Modified:
   freeswitch/trunk/src/switch_core_session.c
   freeswitch/trunk/src/switch_ivr_menu.c

Log:
fix for FSCORE-85

Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c	(original)
+++ freeswitch/trunk/src/switch_core_session.c	Fri Jan 11 11:50:05 2008
@@ -946,6 +946,9 @@
 
 	channel = switch_core_session_get_channel(session);
 	switch_channel_clear_flag(channel, CF_BREAK);
+
+	switch_assert(application_interface->application_function);
+
 	application_interface->application_function(session, arg);
 	
 	if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_EXECUTE_COMPLETE) == SWITCH_STATUS_SUCCESS) {

Modified: freeswitch/trunk/src/switch_ivr_menu.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_menu.c	(original)
+++ freeswitch/trunk/src/switch_ivr_menu.c	Fri Jan 11 11:50:05 2008
@@ -337,8 +337,6 @@
 		if (!switch_strlen_zero(menu->buf)) {
 			for (ap = menu->actions; ap; ap = ap->next) {
 				if (!strcmp(menu->buf, ap->bind)) {
-					char *membuf;
-
 					match++;
 					errs = 0;
 					if (ap->function) {
@@ -376,24 +374,23 @@
 						reps = -1;
 						status = switch_ivr_menu_execute(session, stack, aptr, obj);
 						break;
-					case SWITCH_IVR_ACTION_EXECAPP:{
+					case SWITCH_IVR_ACTION_EXECAPP:
+						{
 							const switch_application_interface_t *application_interface;
+							char *app_name;
+							char *app_arg = NULL;
+
+							status = SWITCH_STATUS_FALSE;
 
-							if ((membuf = strdup(aptr))) {
-								char *app_name = membuf;
-								char *app_arg = strchr(app_name, ' ');
-
-								if (app_arg) {
-									*app_arg = '\0';
-									app_arg++;
+							if (!switch_strlen_zero(aptr)) {
+								app_name = switch_core_session_strdup(session, aptr);
+								if ((app_arg = strchr(app_name, ' '))) {
+									*app_arg++ = '\0';
 								}
 
-								if (app_name && app_arg) {
-									if ((application_interface = switch_loadable_module_get_application_interface(app_name))) {
-										if (application_interface->application_function) {
-											switch_core_session_exec(session, application_interface, app_arg);
-										}
-									}
+								if ((application_interface = switch_loadable_module_get_application_interface(app_name))) {
+									switch_core_session_exec(session, application_interface, app_arg);
+									status = SWITCH_STATUS_SUCCESS;
 								}
 							}
 						}



More information about the Freeswitch-svn mailing list