]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-9959 [mod_spandsp] Add two new channel variables
authorChris Rienzo <chris.rienzo@citrix.com>
Thu, 19 Jan 2017 19:50:51 +0000 (14:50 -0500)
committerChris Rienzo <chris.rienzo@citrix.com>
Thu, 19 Jan 2017 19:50:51 +0000 (14:50 -0500)
   fax_t38_tx_reinvite_packet_count - overrides t38-tx-reinvite-packet-count param in spandsp.conf
   fax_t38_rx_reinvite_packet_count - overrides t38-rx-reinvite-packet-count param in spandsp.conf

src/mod/applications/mod_spandsp/mod_spandsp_fax.c

index acb707588ac518887d1fbb3787a844956c60b2e6..65e7e54708c5a867b59992901c57584907f7ace7 100644 (file)
@@ -1474,9 +1474,19 @@ 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 = spandsp_globals.t38_tx_reinvite_packet_count;
+               const char *packet_count = switch_channel_get_variable(channel, "fax_t38_tx_reinvite_packet_count");
+               if (!zstr(packet_count) && switch_is_number(packet_count)) {
+                       req_counter = atoi(packet_count);
+               } else {
+                       req_counter = spandsp_globals.t38_tx_reinvite_packet_count;
+               }
        } else {
-               req_counter = spandsp_globals.t38_rx_reinvite_packet_count;
+               const char *packet_count = switch_channel_get_variable(channel, "fax_t38_rx_reinvite_packet_count");
+               if (!zstr(packet_count) && switch_is_number(packet_count)) {
+                       req_counter = atoi(packet_count);
+               } else {
+                       req_counter = spandsp_globals.t38_rx_reinvite_packet_count;
+               }
        }
 
        while (switch_channel_ready(channel)) {