From 0fb179acf2246b896f1a66cfb96da68e9d2675f7 Mon Sep 17 00:00:00 2001 From: Patrice Fournier Date: Mon, 30 Jun 2014 16:34:18 -0400 Subject: [PATCH] Add new option to request TEP to be used for an outbound fax call --- src/mod/applications/mod_spandsp/mod_spandsp.c | 7 +++++++ src/mod/applications/mod_spandsp/mod_spandsp.h | 1 + src/mod/applications/mod_spandsp/mod_spandsp_fax.c | 9 +++++++++ 3 files changed, 17 insertions(+) diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.c b/src/mod/applications/mod_spandsp/mod_spandsp.c index b3a4eeec8c..5cd3b1ebf8 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp.c @@ -508,6 +508,7 @@ switch_status_t load_configuration(switch_bool_t reload) spandsp_globals.enable_t38 = 1; + spandsp_globals.enable_tep = 0; spandsp_globals.total_sessions = 0; spandsp_globals.verbose = 0; spandsp_globals.use_ecm = 1; @@ -608,6 +609,12 @@ switch_status_t load_configuration(switch_bool_t reload) spandsp_globals.enable_grayscale_to_bilevel = 1; else spandsp_globals.enable_grayscale_to_bilevel = 0; + } else if (!strcmp(name, "enable-tep")) { + if (switch_true(value)) { + spandsp_globals.enable_tep= 1; + } else { + spandsp_globals.enable_tep = 0; + } } else if (!strcmp(name, "enable-t38")) { if (switch_true(value)) { spandsp_globals.enable_t38= 1; diff --git a/src/mod/applications/mod_spandsp/mod_spandsp.h b/src/mod/applications/mod_spandsp/mod_spandsp.h index ca4aa84060..c732c7b357 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp.h +++ b/src/mod/applications/mod_spandsp/mod_spandsp.h @@ -60,6 +60,7 @@ struct spandsp_globals { short int use_ecm; short int verbose; short int disable_v17; + short int enable_tep; short int enable_colour_fax; short int enable_image_resizing; short int enable_colour_to_bilevel; diff --git a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c index 09378d71f5..62b32c1701 100644 --- a/src/mod/applications/mod_spandsp/mod_spandsp_fax.c +++ b/src/mod/applications/mod_spandsp/mod_spandsp_fax.c @@ -90,6 +90,7 @@ struct pvt_s { int use_ecm; int disable_v17; + int enable_tep; int enable_colour_fax; int enable_image_resizing; int enable_colour_to_bilevel; @@ -835,6 +836,8 @@ static switch_status_t spanfax_init(pvt_t *pvt, transport_mode_t trans_mode) t38_gateway_set_supported_modems(pvt->t38_gateway_state, T30_SUPPORT_V17 | T30_SUPPORT_V29 | T30_SUPPORT_V27TER); } + t38_gateway_set_tep_mode(pvt->t38_gateway_state, pvt->enable_tep); + t38_gateway_set_ecm_capability(pvt->t38_gateway_state, pvt->use_ecm); switch_channel_set_variable(channel, "fax_ecm_requested", pvt->use_ecm ? "true" : "false"); @@ -1240,6 +1243,12 @@ static pvt_t *pvt_init(switch_core_session_t *session, mod_spandsp_fax_applicati pvt->use_ecm = spandsp_globals.use_ecm; } + if ((tmp = switch_channel_get_variable(channel, "fax_enable_tep"))) { + pvt->enable_tep = switch_true(tmp); + } else { + pvt->enable_tep = spandsp_globals.enable_tep; + } + if ((tmp = switch_channel_get_variable(channel, "fax_disable_v17"))) { pvt->disable_v17 = switch_true(tmp); } else {