]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7301 #comment set the tx-reinvite-packet-count to 400, seems we are too fast for...
authorBrian West <brian@freeswitch.org>
Thu, 19 Feb 2015 20:43:58 +0000 (14:43 -0600)
committerBrian West <brian@freeswitch.org>
Thu, 19 Feb 2015 20:43:58 +0000 (14:43 -0600)
conf/vanilla/autoload_configs/spandsp.conf.xml
src/mod/applications/mod_spandsp/mod_spandsp.c
src/mod/applications/mod_spandsp/mod_spandsp.h
src/mod/applications/mod_spandsp/mod_spandsp_fax.c

index 2653c40bb8a2c19781491df2f3863942e3d6990b..2471ca52ceca16ade6b5ae406756517ce38aacf0 100644 (file)
@@ -34,6 +34,9 @@
 
        <param name="spool-dir"         value="$${temp_dir}"/>
        <param name="file-prefix"       value="faxrx"/>
+       <!-- How many packets to process before sending the re-invite on tx/rx -->
+       <!-- <param name="t38-rx-reinvite-packet-count" value="50"/> -->
+       <!-- <param name="t38-tx-reinvite-packet-count" value="100"/> -->
     </fax-settings>
 
     <descriptors>
index 4d70f04b1bf40f764da6a2912e453b55778a2a40..115802621576d9da91972c3806cedc9038f77cea 100644 (file)
@@ -519,6 +519,8 @@ switch_status_t load_configuration(switch_bool_t reload)
        spandsp_globals.header = "SpanDSP Fax Header";
        spandsp_globals.timezone = "";
        spandsp_globals.tonedebug = 0;
+       spandsp_globals.t38_tx_reinvite_packet_count = 100;
+       spandsp_globals.t38_rx_reinvite_packet_count = 50;
 
        if ((xml = switch_xml_open_cfg("spandsp.conf", &cfg, NULL)) || (xml = switch_xml_open_cfg("fax.conf", &cfg, NULL))) {
                status = SWITCH_STATUS_SUCCESS;
@@ -627,6 +629,22 @@ switch_status_t load_configuration(switch_bool_t reload)
                                        } else {
                                                spandsp_globals.enable_t38_request = 0;
                                        }
+                               } else if (!strcmp(name, "t38-tx-reinvite-packet-count")) {
+                    int delay = atoi(value);
+
+                    if (delay >= 0 && delay < 1000) {
+                                               spandsp_globals.t38_tx_reinvite_packet_count = delay;
+                                       } else {
+                                               spandsp_globals.t38_tx_reinvite_packet_count = 100;
+                                       }
+                               } else if (!strcmp(name, "t38-rx-reinvite-packet-count")) {
+                    int delay = atoi(value);
+
+                                       if (delay >= 0 && delay < 1000) {
+                                               spandsp_globals.t38_rx_reinvite_packet_count = delay;
+                                       } else {
+                                               spandsp_globals.t38_rx_reinvite_packet_count = 0;
+                                       }
                                } else if (!strcmp(name, "ident")) {
                     if (!strcmp(value, "_undef_")) {
                         spandsp_globals.ident = "";
index c732c7b357e5a0c73bafe1589a65684b26e5409e..7f2f5d04a3e55abb3d46fdedf8d2b3ae2a7de58c 100644 (file)
@@ -82,6 +82,8 @@ struct spandsp_globals {
        char *modem_directory;
        switch_hash_t *tones;
        int tonedebug;
+    int t38_tx_reinvite_packet_count;
+    int t38_rx_reinvite_packet_count;
 };
 
 extern struct spandsp_globals spandsp_globals;
index 2c0ba42cc1a6b8a9182469c845a8e3d608e5b521..5a3eb61214fc9555463def78448daa3eb6c64295 100644 (file)
@@ -1483,9 +1483,9 @@ void mod_spandsp_fax_process_fax(switch_core_session_t *session, const char *dat
        switch_ivr_sleep(session, 250, SWITCH_TRUE, NULL);
 
        if (pvt->app_mode == FUNCTION_TX) {
-               req_counter = 100;
+               req_counter = spandsp_globals.t38_tx_reinvite_packet_count;
        } else {
-               req_counter = 50;
+               req_counter = spandsp_globals.t38_rx_reinvite_packet_count;
        }
 
        while (switch_channel_ready(channel)) {