Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
0499be4a
提交
0499be4a
authored
10月 27, 2010
作者:
Giovanni Maruzzelli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
skypopen: locking flags
上级
01d0f1bd
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
43 行增加
和
3 行删除
+43
-3
mod_skypopen.c
src/mod/endpoints/mod_skypopen/mod_skypopen.c
+41
-3
skypopen_protocol.c
src/mod/endpoints/mod_skypopen/skypopen_protocol.c
+2
-0
没有找到文件。
src/mod/endpoints/mod_skypopen/mod_skypopen.c
浏览文件 @
0499be4a
...
...
@@ -445,7 +445,9 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
channel
=
switch_core_session_get_channel
(
session
);
switch_assert
(
channel
!=
NULL
);
switch_channel_set_variable
(
channel
,
"skype_user"
,
tech_pvt
->
skype_user
);
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_set_flag
(
tech_pvt
,
TFLAG_IO
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
/* Move channel's state machine to ROUTING. This means the call is trying
to get from the initial start where the call because, to the point
...
...
@@ -469,6 +471,17 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
if
(
tech_pvt
)
{
DEBUGA_SKYPE
(
"%s CHANNEL DESTROY %s
\n
"
,
SKYPOPEN_P_LOG
,
tech_pvt
->
name
,
switch_core_session_get_uuid
(
session
));
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
#if 1
switch_clear_flag
(
tech_pvt
,
TFLAG_IO
);
switch_clear_flag
(
tech_pvt
,
TFLAG_VOICE
);
#endif//0
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_PROGRESS
))
{
switch_clear_flag
(
tech_pvt
,
TFLAG_PROGRESS
);
}
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
if
(
switch_core_codec_ready
(
&
tech_pvt
->
read_codec
))
{
switch_core_codec_destroy
(
&
tech_pvt
->
read_codec
);
}
...
...
@@ -578,8 +591,16 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
}
}
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
#if 1
switch_clear_flag
(
tech_pvt
,
TFLAG_IO
);
switch_clear_flag
(
tech_pvt
,
TFLAG_VOICE
);
#endif//0
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_PROGRESS
))
{
switch_clear_flag
(
tech_pvt
,
TFLAG_PROGRESS
);
}
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
//DEBUGA_SKYPE("debugging_hangup 2\n", SKYPOPEN_P_LOG);
tech_pvt
->
interface_state
=
SKYPOPEN_STATE_HANGUP_REQUESTED
;
...
...
@@ -705,10 +726,10 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
}
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
#if
0
#if
1
switch_clear_flag
(
tech_pvt
,
TFLAG_IO
);
switch_clear_flag
(
tech_pvt
,
TFLAG_VOICE
);
//
switch_set_flag(tech_pvt, TFLAG_HANGUP);
switch_set_flag
(
tech_pvt
,
TFLAG_HANGUP
);
#endif//0
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_PROGRESS
))
{
switch_clear_flag
(
tech_pvt
,
TFLAG_PROGRESS
);
...
...
@@ -891,10 +912,15 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
tech_pvt
->
read_frame
.
datalen
=
640
;
}
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_set_flag
(
tech_pvt
,
TFLAG_VOICE
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
while
(
switch_test_flag
(
tech_pvt
,
TFLAG_IO
))
{
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_BREAK
))
{
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_clear_flag
(
tech_pvt
,
TFLAG_BREAK
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
DEBUGA_SKYPE
(
"CHANNEL READ FRAME goto CNG
\n
"
,
SKYPOPEN_P_LOG
);
goto
cng
;
}
...
...
@@ -905,7 +931,9 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
}
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_IO
)
&&
switch_test_flag
(
tech_pvt
,
TFLAG_VOICE
))
{
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_clear_flag
(
tech_pvt
,
TFLAG_VOICE
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
if
(
!
tech_pvt
->
read_frame
.
datalen
)
{
DEBUGA_SKYPE
(
"CHANNEL READ CONTINUE
\n
"
,
SKYPOPEN_P_LOG
);
continue
;
...
...
@@ -1040,7 +1068,9 @@ static switch_status_t channel_answer_channel(switch_core_session_t *session)
tech_pvt
=
switch_core_session_get_private
(
session
);
switch_assert
(
tech_pvt
!=
NULL
);
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_clear_flag
(
tech_pvt
,
TFLAG_IO
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
skypopen_answer
(
tech_pvt
);
while
(
!
switch_test_flag
(
tech_pvt
,
TFLAG_IO
))
{
//FIXME that would be better with a timeout
...
...
@@ -1084,13 +1114,15 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
case
SWITCH_MESSAGE_INDICATE_PROGRESS
:
{
DEBUGA_SKYPE
(
"%s CHANNEL got SWITCH_MESSAGE_INDICATE_PROGRESS
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
));
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_set_flag
(
tech_pvt
,
TFLAG_PROGRESS
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
}
break
;
case
SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS
:
{
DEBUGA_SKYPE
(
"%s CHANNEL got SWITCH_MESSAGE_INDICATE_CLEAR_PROGRESS
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
));
if
(
switch_
se
t_flag
(
tech_pvt
,
TFLAG_PROGRESS
))
{
if
(
switch_
tes
t_flag
(
tech_pvt
,
TFLAG_PROGRESS
))
{
sprintf
(
msg_to_skype
,
"ALTER CALL %s END HANGUP"
,
tech_pvt
->
ring_id
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
sprintf
(
msg_to_skype
,
"ALTER CALL %s HANGUP"
,
tech_pvt
->
ring_id
);
...
...
@@ -1099,7 +1131,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
sprintf
(
msg_to_skype
,
"ALTER CALL %s HANGUP"
,
tech_pvt
->
skype_call_id
);
skypopen_signaling_write
(
tech_pvt
,
msg_to_skype
);
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_clear_flag
(
tech_pvt
,
TFLAG_PROGRESS
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
}
}
break
;
...
...
@@ -1110,7 +1144,9 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
//switch_set_flag(tech_pvt, TFLAG_IO);
channel_answer_channel
(
session
);
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_clear_flag
(
tech_pvt
,
TFLAG_PROGRESS
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
if
(
tech_pvt
->
read_buffer
)
{
switch_mutex_lock
(
tech_pvt
->
mutex_audio_srv
);
...
...
@@ -1349,7 +1385,9 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
caller_profile
->
destination_number
=
rdest
;
switch_channel_set_flag
(
channel
,
CF_OUTBOUND
);
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_set_flag
(
tech_pvt
,
TFLAG_OUTBOUND
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
switch_channel_set_state
(
channel
,
CS_INIT
);
skypopen_call
(
tech_pvt
,
rdest
,
30
);
switch_mutex_unlock
(
globals
.
mutex
);
...
...
src/mod/endpoints/mod_skypopen/skypopen_protocol.c
浏览文件 @
0499be4a
...
...
@@ -1904,7 +1904,9 @@ int inbound_channel_answered(private_t *tech_pvt)
channel
=
switch_core_session_get_channel
(
session
);
if
(
channel
)
{
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_set_flag
(
tech_pvt
,
TFLAG_IO
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
}
else
{
ERRORA
(
"no channel
\n
"
,
SKYPOPEN_P_LOG
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论