From a55b5347ba62420e1c705f05723d421876367ee3 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Tue, 25 Jun 2013 23:41:30 -0400 Subject: [PATCH] mod_freetdm: Expose new ringback E&M parameters in the XML config --- libs/freetdm/mod_freetdm/mod_freetdm.c | 9 +++++++++ libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/freetdm/mod_freetdm/mod_freetdm.c b/libs/freetdm/mod_freetdm/mod_freetdm.c index 316f5607c2..f980930f94 100755 --- a/libs/freetdm/mod_freetdm/mod_freetdm.c +++ b/libs/freetdm/mod_freetdm/mod_freetdm.c @@ -3785,7 +3785,10 @@ static switch_status_t load_config(void) char *hold_music = NULL; char *fail_dial_regex = NULL; char str_false[] = "false"; + char str_empty[] = ""; char *answer_supervision = str_false; + char *ringback_during_collect = str_false; + char *ringback_file = str_empty; uint32_t span_id = 0, to = 0, max = 0, dial_timeout_int = 0; ftdm_span_t *span = NULL; analog_option_t analog_options = ANALOG_OPTION_NONE; @@ -3814,6 +3817,10 @@ static switch_status_t load_config(void) max_digits = val; } else if (!strcasecmp(var, "answer-supervision")) { answer_supervision = val; + } else if (!strcasecmp(var, "ringback-during-collect")) { + ringback_during_collect = val; + } else if (!strcasecmp(var, "ringback-file")) { + ringback_file = val; } else if (!strcasecmp(var, "enable-analog-option")) { analog_options = enable_analog_option(val, analog_options); } @@ -3867,6 +3874,8 @@ static switch_status_t load_config(void) if (ftdm_configure_span(span, "analog_em", on_analog_signal, "tonemap", tonegroup, "answer_supervision", answer_supervision, + "ringback_during_collect", ringback_during_collect, + "ringback_file", ringback_file, "digit_timeout", &to, "dial_timeout", &dial_timeout_int, "max_dialstr", &max, diff --git a/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c b/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c index cace914243..c3f7c20bbe 100644 --- a/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c +++ b/libs/freetdm/src/ftmod/ftmod_analog_em/ftmod_analog_em.c @@ -738,7 +738,7 @@ read_try: rlen = fread(frame, 1, len, ringback_f); if (rlen != len) { if (!feof(ringback_f)) { - ftdm_log(FTDM_LOG_ERROR, "Error reading from ringback file"); + ftdm_log(FTDM_LOG_ERROR, "Error reading from ringback file: %zd != %zd\n", rlen, len); } if (failed_read) { continue;