mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 04:31:50 +00:00
freetdm: Added dtmfdetect duration option
This commit is contained in:
@@ -4574,7 +4574,7 @@ FT_DECLARE(ftdm_status_t) ftdm_configure_span_channels(ftdm_span_t *span, const
|
||||
ftdm_assert_return(span->fio != NULL, FTDM_EINVAL, "span with no I/O configured\n");
|
||||
ftdm_assert_return(span->fio->configure_span != NULL, FTDM_NOTIMPL, "span I/O with no channel configuration implemented\n");
|
||||
|
||||
currindex = span->chan_count;
|
||||
currindex = span->chan_count;
|
||||
*configured = 0;
|
||||
*configured = span->fio->configure_span(span, str, chan_config->type, chan_config->name, chan_config->number);
|
||||
if (!*configured) {
|
||||
@@ -4604,8 +4604,10 @@ FT_DECLARE(ftdm_status_t) ftdm_configure_span_channels(ftdm_span_t *span, const
|
||||
}
|
||||
|
||||
if (chan_config->debugdtmf) {
|
||||
span->channels[chan_index]->dtmfdbg.requested = 1;
|
||||
span->channels[chan_index]->dtmfdbg.requested = 1;
|
||||
}
|
||||
|
||||
span->channels[chan_index]->dtmfdetect.duration_ms = chan_config->dtmfdetect_ms;
|
||||
}
|
||||
|
||||
return FTDM_SUCCESS;
|
||||
@@ -4628,6 +4630,7 @@ static ftdm_status_t load_config(void)
|
||||
|
||||
memset(&chan_config, 0, sizeof(chan_config));
|
||||
sprintf(chan_config.group_name, "__default");
|
||||
chan_config.dtmfdetect_ms = 45;
|
||||
|
||||
if (!ftdm_config_open_file(&cfg, cfg_name)) {
|
||||
return FTDM_FAIL;
|
||||
@@ -4802,6 +4805,10 @@ static ftdm_status_t load_config(void)
|
||||
} else if (!strcasecmp(var, "debugdtmf")) {
|
||||
chan_config.debugdtmf = ftdm_true(val);
|
||||
ftdm_log(FTDM_LOG_DEBUG, "Setting debugdtmf to '%s'\n", chan_config.debugdtmf ? "yes" : "no");
|
||||
} else if (!strncasecmp(var, "dtmfdetect_ms", sizeof("dtmfdetect_ms")-1)) {
|
||||
if (sscanf(val, "%d", &(chan_config.dtmfdetect_ms)) != 1) {
|
||||
ftdm_log(FTDM_LOG_ERROR, "invalid dtmfdetect_ms: '%s'\n", val);
|
||||
}
|
||||
} else if (!strncasecmp(var, "iostats", sizeof("iostats")-1)) {
|
||||
if (ftdm_true(val)) {
|
||||
chan_config.iostats = FTDM_TRUE;
|
||||
|
||||
Reference in New Issue
Block a user