Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
0bf2a0e9
提交
0bf2a0e9
authored
12月 07, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix strange race moc experienced in uuid_bridge
上级
9ea3ce66
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
51 行增加
和
10 行删除
+51
-10
switch_channel.h
src/include/switch_channel.h
+1
-0
switch_channel.c
src/switch_channel.c
+9
-0
switch_ivr_bridge.c
src/switch_ivr_bridge.c
+41
-10
没有找到文件。
src/include/switch_channel.h
浏览文件 @
0bf2a0e9
...
...
@@ -389,6 +389,7 @@ SWITCH_DECLARE(uint32_t) switch_channel_test_flag_partner(switch_channel_t *chan
\param flag flag to set
*/
SWITCH_DECLARE
(
void
)
switch_channel_set_state_flag
(
switch_channel_t
*
channel
,
switch_channel_flag_t
flag
);
SWITCH_DECLARE
(
void
)
switch_channel_clear_state_flag
(
switch_channel_t
*
channel
,
switch_channel_flag_t
flag
);
/*!
\brief Clear given flag(s) from a channel
...
...
src/switch_channel.c
浏览文件 @
0bf2a0e9
...
...
@@ -1674,6 +1674,15 @@ SWITCH_DECLARE(void) switch_channel_set_state_flag(switch_channel_t *channel, sw
switch_mutex_unlock
(
channel
->
flag_mutex
);
}
SWITCH_DECLARE
(
void
)
switch_channel_clear_state_flag
(
switch_channel_t
*
channel
,
switch_channel_flag_t
flag
)
{
switch_assert
(
channel
!=
NULL
);
switch_mutex_lock
(
channel
->
flag_mutex
);
channel
->
state_flags
[
flag
]
=
0
;
switch_mutex_unlock
(
channel
->
flag_mutex
);
}
SWITCH_DECLARE
(
void
)
switch_channel_clear_flag
(
switch_channel_t
*
channel
,
switch_channel_flag_t
flag
)
{
int
ACTIVE
=
0
;
...
...
src/switch_ivr_bridge.c
浏览文件 @
0bf2a0e9
...
...
@@ -763,21 +763,48 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
return
SWITCH_STATUS_SUCCESS
;
}
switch_channel_clear_flag_recursive
(
channel
,
CF_BRIDGE_ORIGINATOR
);
if
((
other_uuid
=
switch_channel_get_variable
(
channel
,
SWITCH_UUID_BRIDGE
))
&&
(
other_session
=
switch_core_session_locate
(
other_uuid
)))
{
switch_channel_t
*
other_channel
=
switch_core_session_get_channel
(
other_session
);
switch_event_t
*
event
;
int
ready_a
,
ready_b
;
switch_channel_state_t
state
;
switch_channel_state_t
state
,
running_state
;
int
max
=
1000
,
loops
=
max
;
switch_channel_set_variable
(
channel
,
SWITCH_UUID_BRIDGE
,
NULL
);
for
(;;)
{
state
=
switch_channel_get_state
(
other_channel
);
running_state
=
switch_channel_get_running_state
(
other_channel
);
if
(
state
==
running_state
)
{
if
(
--
loops
<
1
)
{
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
switch_channel_hangup
(
other_channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
if
(
switch_channel_down_nosig
(
other_channel
)
||
switch_channel_down_nosig
(
channel
))
{
break
;
}
if
(
running_state
==
CS_RESET
)
{
switch_channel_set_state
(
other_channel
,
CS_SOFT_EXECUTE
);
}
switch_channel_wait_for_state
(
other_channel
,
channel
,
CS_RESET
);
if
(
running_state
==
CS_SOFT_EXECUTE
)
{
if
(
switch_channel_get_state
(
other_channel
)
==
CS_RESET
)
{
switch_channel_set_state
(
other_channel
,
CS_SOFT_EXECUTE
);
switch_channel_wait_for_state
(
other_channel
,
channel
,
CS_SOFT_EXECUTE
);
if
(
switch_channel_test_flag
(
other_channel
,
CF_BRIDGE_ORIGINATOR
))
{
goto
done
;
}
else
{
break
;
}
}
}
else
{
loops
=
max
;
}
switch_yield
(
20000
);
}
switch_core_session_reset
(
session
,
SWITCH_TRUE
,
SWITCH_TRUE
);
...
...
@@ -789,7 +816,7 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
}
else
{
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_ORIGINATOR_CANCEL
);
}
return
SWITCH_STATUS_FALSE
;
goto
done
;
}
ready_a
=
switch_channel_ready
(
channel
);
...
...
@@ -809,7 +836,7 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
}
}
switch_core_session_rwunlock
(
other_session
);
return
SWITCH_STATUS_FALSE
;
goto
done
;
}
/* fire events that will change the data table from "show channels" */
...
...
@@ -839,7 +866,9 @@ static switch_status_t uuid_bridge_on_soft_execute(switch_core_session_t *sessio
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
done:
switch_channel_clear_flag_recursive
(
channel
,
CF_BRIDGE_ORIGINATOR
);
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -1563,8 +1592,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_uuid_bridge(const char *originator_uu
//switch_channel_set_variable(originatee_channel, SWITCH_PARK_AFTER_BRIDGE_VARIABLE, NULL);
switch_channel_clear_state_handler
(
originator_channel
,
NULL
);
switch_channel_clear_state_handler
(
originatee_channel
,
NULL
);
switch_channel_
set_state_flag
(
originator_channel
,
CF_BRIDGE_ORIGINATOR
);
switch_channel_
clear_flag_recursive
(
originator_channel
,
CF_BRIDGE_ORIGINATOR
);
switch_channel_clear_flag_recursive
(
originatee_channel
,
CF_BRIDGE_ORIGINATOR
);
switch_channel_set_state_flag
(
originator_channel
,
CF_BRIDGE_ORIGINATOR
);
switch_channel_clear_state_flag
(
originatee_channel
,
CF_BRIDGE_ORIGINATOR
);
switch_channel_add_state_handler
(
originator_channel
,
&
uuid_bridge_state_handlers
);
switch_channel_add_state_handler
(
originatee_channel
,
&
uuid_bridge_state_handlers
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论