mod_freetdm: Expose new ringback E&M parameters in the XML config

This commit is contained in:
Moises Silva 2013-06-25 23:41:30 -04:00
parent 95a2c11b0d
commit a55b5347ba
2 changed files with 10 additions and 1 deletions

View File

@ -3785,7 +3785,10 @@ static switch_status_t load_config(void)
char *hold_music = NULL; char *hold_music = NULL;
char *fail_dial_regex = NULL; char *fail_dial_regex = NULL;
char str_false[] = "false"; char str_false[] = "false";
char str_empty[] = "";
char *answer_supervision = str_false; 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; uint32_t span_id = 0, to = 0, max = 0, dial_timeout_int = 0;
ftdm_span_t *span = NULL; ftdm_span_t *span = NULL;
analog_option_t analog_options = ANALOG_OPTION_NONE; analog_option_t analog_options = ANALOG_OPTION_NONE;
@ -3814,6 +3817,10 @@ static switch_status_t load_config(void)
max_digits = val; max_digits = val;
} else if (!strcasecmp(var, "answer-supervision")) { } else if (!strcasecmp(var, "answer-supervision")) {
answer_supervision = val; 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")) { } else if (!strcasecmp(var, "enable-analog-option")) {
analog_options = enable_analog_option(val, analog_options); 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, if (ftdm_configure_span(span, "analog_em", on_analog_signal,
"tonemap", tonegroup, "tonemap", tonegroup,
"answer_supervision", answer_supervision, "answer_supervision", answer_supervision,
"ringback_during_collect", ringback_during_collect,
"ringback_file", ringback_file,
"digit_timeout", &to, "digit_timeout", &to,
"dial_timeout", &dial_timeout_int, "dial_timeout", &dial_timeout_int,
"max_dialstr", &max, "max_dialstr", &max,

View File

@ -738,7 +738,7 @@ read_try:
rlen = fread(frame, 1, len, ringback_f); rlen = fread(frame, 1, len, ringback_f);
if (rlen != len) { if (rlen != len) {
if (!feof(ringback_f)) { 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) { if (failed_read) {
continue; continue;