]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Added debug-level param for spandsp tone detector
authorChristopher Rienzo <chris@rienzo.net>
Wed, 18 Jul 2012 20:41:07 +0000 (20:41 +0000)
committerChristopher Rienzo <chris@rienzo.net>
Wed, 18 Jul 2012 20:41:07 +0000 (20:41 +0000)
src/mod/applications/mod_spandsp/conf/autoload_configs/spandsp.conf.xml
src/mod/applications/mod_spandsp/mod_spandsp.c

index 6f062cc7312ce564cf0f5d9fb6b08c1fc232fd94..c2c943bf30f6b372fcaf2c5f173c3590e18ae3ff 100644 (file)
@@ -34,7 +34,7 @@
        <param name="file-prefix"       value="faxrx"/>
     </fax-settings>
 
-    <descriptors>
+    <descriptors debug-level="0">
 
      <!-- These tones are defined in Annex to ITU Operational Bulletin No. 781 - 1.II.2003 -->
      <!-- Various Tones Used in National Networks (According to ITU-T Recommendation E.180)(03/1998) -->
index f79bea68ac5164b69e7a7a61175517d448bcc241..8a382cfcb17871b19a457990fecc3e392bf8c6ee 100644 (file)
@@ -492,8 +492,6 @@ switch_status_t load_configuration(switch_bool_t reload)
     spandsp_globals.ident = "SpanDSP Fax Ident";
     spandsp_globals.header = "SpanDSP Fax Header";
     spandsp_globals.timezone = "";
-
-       /* TODO make configuration param */
        spandsp_globals.tonedebug = 0;
 
        if ((xml = switch_xml_open_cfg("spandsp.conf", &cfg, NULL)) || (xml = switch_xml_open_cfg("fax.conf", &cfg, NULL))) {
@@ -592,6 +590,16 @@ switch_status_t load_configuration(switch_bool_t reload)
 
         /* Configure call progress detector */
         if ((callprogress = switch_xml_child(cfg, "descriptors"))) {
+                       /* check if debugging is enabled */
+                       const char *debug = switch_xml_attr(callprogress, "debug-level");
+                       if (!zstr(debug) && switch_is_number(debug)) {
+                               int debug_val = atoi(debug);
+                               if (debug_val > 0) {
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setting tone detector debug-level to : %d\n", debug_val);
+                                       spandsp_globals.tonedebug = debug_val;
+                               }
+                       }
+
             for (xdescriptor = switch_xml_child(callprogress, "descriptor"); xdescriptor; xdescriptor = switch_xml_next(xdescriptor)) {
                 const char *name = switch_xml_attr(xdescriptor, "name");
                 const char *tone_name = NULL;