]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix for FSCORE-85
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 Jan 2008 16:50:05 +0000 (16:50 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 Jan 2008 16:50:05 +0000 (16:50 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7176 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_core_session.c
src/switch_ivr_menu.c

index 833991db2c32afb7d0f9df404e87895fa55d2a6e..1a9b492fb8b0484e9a40dce02083b2412c5d1c77 100644 (file)
@@ -946,6 +946,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_exec(switch_core_session_t *
 
        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) {
index de9f8130c67dd4203814135afa141264d1a64a8e..1dc27738e1bb45736860d9e203ff18f1515075c9 100644 (file)
@@ -337,8 +337,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_execute(switch_core_session_t *s
                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 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_menu_execute(switch_core_session_t *s
                                                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;
 
-                                                       if ((membuf = strdup(aptr))) {
-                                                               char *app_name = membuf;
-                                                               char *app_arg = strchr(app_name, ' ');
+                                                       status = SWITCH_STATUS_FALSE;
 
-                                                               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;
                                                                }
                                                        }
                                                }