提交 c7c528cd authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-4867 --resolve

上级 0b148a85
......@@ -541,6 +541,10 @@ SWITCH_DECLARE(switch_channel_state_t) switch_channel_perform_hangup(switch_chan
\return number of digits in the queue
*/
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(_In_ switch_channel_t *channel);
SWITCH_DECLARE(switch_status_t) switch_channel_dtmf_lock(switch_channel_t *channel);
SWITCH_DECLARE(switch_status_t) switch_channel_try_dtmf_lock(switch_channel_t *channel);
SWITCH_DECLARE(switch_status_t) switch_channel_dtmf_unlock(switch_channel_t *channel);
/*!
\brief Queue DTMF on a given channel
......
......@@ -363,6 +363,21 @@ SWITCH_DECLARE(switch_status_t) switch_channel_alloc(switch_channel_t **channel,
return SWITCH_STATUS_SUCCESS;
}
SWITCH_DECLARE(switch_status_t) switch_channel_dtmf_lock(switch_channel_t *channel)
{
return switch_mutex_lock(channel->dtmf_mutex);
}
SWITCH_DECLARE(switch_status_t) switch_channel_try_dtmf_lock(switch_channel_t *channel)
{
return switch_mutex_trylock(channel->dtmf_mutex);
}
SWITCH_DECLARE(switch_status_t) switch_channel_dtmf_unlock(switch_channel_t *channel)
{
return switch_mutex_unlock(channel->dtmf_mutex);
}
SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel_t *channel)
{
switch_size_t has;
......
......@@ -151,7 +151,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
for(i = 0; i < 2; i++) {
if (session->dmachine[i] && !switch_channel_test_flag(session->channel, CF_BROADCAST)) {
switch_ivr_dmachine_ping(session->dmachine[i], NULL);
if (switch_channel_try_dtmf_lock(session->channel) == SWITCH_STATUS_SUCCESS) {
switch_ivr_dmachine_ping(session->dmachine[i], NULL);
switch_channel_dtmf_unlock(session->channel);
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论