diff --git a/conf/vanilla/autoload_configs/spandsp.conf.xml b/conf/vanilla/autoload_configs/spandsp.conf.xml
index 2653c40bb8..2471ca52ce 100644
--- a/conf/vanilla/autoload_configs/spandsp.conf.xml
+++ b/conf/vanilla/autoload_configs/spandsp.conf.xml
@@ -34,6 +34,9 @@
+
+
+
diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c
index 4d70f04b1b..1158026215 100644
--- a/src/mod/applications/mod_spandsp/mod_spandsp.c
+++ b/src/mod/applications/mod_spandsp/mod_spandsp.c
@@ -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 = "";
diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.h b/src/mod/applications/mod_spandsp/mod_spandsp.h
index c732c7b357..7f2f5d04a3 100644
--- a/src/mod/applications/mod_spandsp/mod_spandsp.h
+++ b/src/mod/applications/mod_spandsp/mod_spandsp.h
@@ -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;
diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c
index 2c0ba42cc1..5a3eb61214 100644
--- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c
+++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c
@@ -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)) {