本文整理汇总了C++中CoreSession::begin_allow_threads方法的典型用法代码示例。如果您正苦于以下问题:C++ CoreSession::begin_allow_threads方法的具体用法?C++ CoreSession::begin_allow_threads怎么用?C++ CoreSession::begin_allow_threads使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CoreSession
的用法示例。
在下文中一共展示了CoreSession::begin_allow_threads方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bridge
SWITCH_DECLARE(void) bridge(CoreSession &session_a, CoreSession &session_b)
{
switch_input_callback_function_t dtmf_func = NULL;
switch_input_args_t args;
switch_channel_t *channel_a = NULL, *channel_b = NULL;
const char *err = "Channels not ready\n";
if (session_a.allocated && session_a.session && session_b.allocated && session_b.session) {
channel_a = switch_core_session_get_channel(session_a.session);
channel_b = switch_core_session_get_channel(session_b.session);
if (switch_channel_ready(channel_a) && switch_channel_ready(channel_b)) {
session_a.begin_allow_threads();
if (!switch_channel_test_flag(channel_a, CF_OUTBOUND) && !switch_channel_media_ready(channel_a)) {
switch_channel_pre_answer(channel_a);
}
if (switch_channel_ready(channel_a) && switch_channel_ready(channel_b)) {
args = session_a.get_cb_args(); // get the cb_args data structure for session a
dtmf_func = args.input_callback; // get the call back function
err = NULL;
switch_ivr_multi_threaded_bridge(session_a.session, session_b.session, dtmf_func, args.buf, args.buf);
}
session_a.end_allow_threads();
}
}
if (err) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session_a.session), SWITCH_LOG_ERROR, "%s", err);
}
}