]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't fail load of mod_spandsp just because we don't have tones in the conf file
authorBrian West <brian@freeswitch.org>
Wed, 2 Jun 2010 16:39:36 +0000 (11:39 -0500)
committerBrian West <brian@freeswitch.org>
Wed, 2 Jun 2010 16:39:36 +0000 (11:39 -0500)
src/mod/applications/mod_spandsp/mod_spandsp.c

index 3c1c64fe47dd9607dc160c4069f540cc3ad81ad7..69b551dba7591fb038f284be67a3ff845d66014f 100644 (file)
@@ -198,16 +198,16 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spandsp_init)
        SWITCH_ADD_APP(app_interface, "spandsp_stop_dtmf", "stop inband dtmf", "Stop detecting inband dtmf.", stop_dtmf_session_function, "", SAF_NONE);
        SWITCH_ADD_APP(app_interface, "spandsp_start_dtmf", "Detect dtmf", "Detect inband dtmf on the session", dtmf_session_function, "", SAF_MEDIA_TAP);
 
-       SWITCH_ADD_APP(app_interface, "start_tone_detect", "Start background tone detection with cadence", "", start_tone_detect_app, "[name]", SAF_NONE);
-       SWITCH_ADD_APP(app_interface, "stop_tone_detect", "Stop background tone detection with cadence", "", stop_tone_detect_app, "", SAF_NONE);
-       SWITCH_ADD_API(api_interface, "start_tone_detect", "Start background tone detection with cadence", start_tone_detect_api, "[name]");
-       SWITCH_ADD_API(api_interface, "stop_tone_detect", "Stop background tone detection with cadence", stop_tone_detect_api, "");
-
-
        mod_spandsp_fax_load(pool);
     mod_spandsp_codecs_load(module_interface, pool);
+
        if (mod_spandsp_dsp_load(module_interface, pool) != SWITCH_STATUS_SUCCESS) {
-               return SWITCH_STATUS_FALSE;
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't load spandsp.conf, not adding tone_detect applications\n");
+    } else {
+        SWITCH_ADD_APP(app_interface, "start_tone_detect", "Start background tone detection with cadence", "", start_tone_detect_app, "[name]", SAF_NONE);
+        SWITCH_ADD_APP(app_interface, "stop_tone_detect", "Stop background tone detection with cadence", "", stop_tone_detect_app, "", SAF_NONE);
+        SWITCH_ADD_API(api_interface, "start_tone_detect", "Start background tone detection with cadence", start_tone_detect_api, "[name]");
+        SWITCH_ADD_API(api_interface, "stop_tone_detect", "Stop background tone detection with cadence", stop_tone_detect_api, "");
        }
 
        if ((switch_event_bind_removable(modname, SWITCH_EVENT_RELOADXML, NULL, event_handler, NULL, &NODE) != SWITCH_STATUS_SUCCESS)) {