提交 9c849f11 authored 作者: Anthony Minessale's avatar Anthony Minessale

fix spelling err

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5368 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 b590bbb5
...@@ -111,7 +111,8 @@ static struct { ...@@ -111,7 +111,8 @@ static struct {
uint32_t samples_per_frame; uint32_t samples_per_frame;
int dtmf_on; int dtmf_on;
int dtmf_off; int dtmf_off;
int suppres_dtmf_tone; int suppress_dtmf_tone;
int ignore_dtmf_tone;
int configured_spans; int configured_spans;
int configured_boost_spans; int configured_boost_spans;
char *dialplan; char *dialplan;
...@@ -525,7 +526,10 @@ static switch_status_t wanpipe_codec_init(private_object_t *tech_pvt) ...@@ -525,7 +526,10 @@ static switch_status_t wanpipe_codec_init(private_object_t *tech_pvt)
tech_pvt->tone_session.duration = globals.dtmf_on * (tech_pvt->tone_session.rate / 1000); tech_pvt->tone_session.duration = globals.dtmf_on * (tech_pvt->tone_session.rate / 1000);
tech_pvt->tone_session.wait = globals.dtmf_off * (tech_pvt->tone_session.rate / 1000); tech_pvt->tone_session.wait = globals.dtmf_off * (tech_pvt->tone_session.rate / 1000);
if (!globals.ignore_dtmf_tone) {
teletone_dtmf_detect_init (&tech_pvt->dtmf_detect, rate); teletone_dtmf_detect_init (&tech_pvt->dtmf_detect, rate);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Audio init %s\n", switch_channel_get_name(channel)); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Audio init %s\n", switch_channel_get_name(channel));
switch_set_flag(tech_pvt, TFLAG_CODEC); switch_set_flag(tech_pvt, TFLAG_CODEC);
...@@ -787,6 +791,7 @@ static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch ...@@ -787,6 +791,7 @@ static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch
tech_pvt->read_frame.datalen = bytes; tech_pvt->read_frame.datalen = bytes;
tech_pvt->read_frame.samples = bytes / 2; tech_pvt->read_frame.samples = bytes / 2;
if (!globals.ignore_dtmf_tone) {
teletone_dtmf_detect (&tech_pvt->dtmf_detect, tech_pvt->read_frame.data, tech_pvt->read_frame.samples); teletone_dtmf_detect (&tech_pvt->dtmf_detect, tech_pvt->read_frame.data, tech_pvt->read_frame.samples);
teletone_dtmf_get(&tech_pvt->dtmf_detect, digit_str, sizeof(digit_str)); teletone_dtmf_get(&tech_pvt->dtmf_detect, digit_str, sizeof(digit_str));
...@@ -795,7 +800,7 @@ static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch ...@@ -795,7 +800,7 @@ static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch
if (globals.debug) { if (globals.debug) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DTMF DETECTED: [%s]\n", digit_str); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "DTMF DETECTED: [%s]\n", digit_str);
} }
if (globals.suppres_dtmf_tone) { if (globals.suppress_dtmf_tone) {
tech_pvt->skip_read_frames = 20; tech_pvt->skip_read_frames = 20;
} }
} }
...@@ -804,7 +809,7 @@ static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch ...@@ -804,7 +809,7 @@ static switch_status_t wanpipe_read_frame(switch_core_session_t *session, switch
memset(tech_pvt->read_frame.data, 0, tech_pvt->read_frame.datalen); memset(tech_pvt->read_frame.data, 0, tech_pvt->read_frame.datalen);
tech_pvt->skip_read_frames--; tech_pvt->skip_read_frames--;
} }
}
#ifdef DOTRACE #ifdef DOTRACE
write(tech_pvt->fd2, tech_pvt->read_frame.data, (int) tech_pvt->read_frame.datalen); write(tech_pvt->fd2, tech_pvt->read_frame.data, (int) tech_pvt->read_frame.datalen);
#endif #endif
...@@ -2220,8 +2225,10 @@ static switch_status_t config_wanpipe(int reload) ...@@ -2220,8 +2225,10 @@ static switch_status_t config_wanpipe(int reload)
globals.dtmf_off = atoi(val); globals.dtmf_off = atoi(val);
} else if (!strcmp(var, "dialplan")) { } else if (!strcmp(var, "dialplan")) {
set_global_dialplan(val); set_global_dialplan(val);
} else if (!strcmp(var, "suppres-dtmf-tone")) { } else if (!strcmp(var, "suppress-dtmf-tone")) {
globals.suppres_dtmf_tone = switch_true(val); globals.suppress_dtmf_tone = switch_true(val);
} else if (!strcmp(var, "ignore-dtmf-tone")) {
globals.ignore_dtmf_tone = switch_true(val);
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论