]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
allow chatplan apps to have null args
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 24 Sep 2011 14:53:28 +0000 (09:53 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 24 Sep 2011 14:53:34 +0000 (09:53 -0500)
src/mod/applications/mod_sms/mod_sms.c
src/switch_loadable_module.c

index 32200438e51be653d185705d35957178d14b49aa..df6ff5f00cdadc469df7f57019131edbbf6ec9ff 100644 (file)
@@ -194,7 +194,7 @@ static int parse_exten(switch_event_t *event, switch_xml_t xexten, switch_event_
                                        if (xinline) {
                                                switch_core_execute_chat_app(event, application, data);
                                        } else {
-                                               switch_event_add_header_string(*extension, SWITCH_STACK_BOTTOM, application, data);
+                                               switch_event_add_header_string(*extension, SWITCH_STACK_BOTTOM, application, zstr(data) ? "__undef" : data);
                                        }
                                }
                                proceed = 1;
@@ -251,7 +251,7 @@ static int parse_exten(switch_event_t *event, switch_xml_t xexten, switch_event_
                                        if (xinline) {
                                                switch_core_execute_chat_app(event, application, app_data);
                                        } else {
-                                               switch_event_add_header_string(*extension, SWITCH_STACK_BOTTOM, application, data);
+                                               switch_event_add_header_string(*extension, SWITCH_STACK_BOTTOM, application, zstr(data) ? "__undef" : data);
                                        }
                                }
                                switch_safe_free(substituted);
index c288571b191480bc39b0f9ca07eeb0c6328e3126..48e9226080e421f69b61da212dfbad918fcf1530 100644 (file)
@@ -706,6 +706,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_execute_chat_app(switch_event_t *mes
                switch_goto_status(SWITCH_STATUS_FALSE, end);
        }
 
+       if (data && !strcmp(data, "__undef")) {
+               data = NULL;
+       }
+
        expanded = switch_event_expand_headers(message, data);
        
        status = cai->chat_application_function(message, expanded);