Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
01d0f1bd
提交
01d0f1bd
authored
10月 27, 2010
作者:
Giovanni Maruzzelli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
skypopen: better management of 'hupall' and KILL
上级
5d03777f
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
69 行增加
和
8 行删除
+69
-8
mod_skypopen.c
src/mod/endpoints/mod_skypopen/mod_skypopen.c
+65
-8
skypopen_protocol.c
src/mod/endpoints/mod_skypopen/skypopen_protocol.c
+4
-0
没有找到文件。
src/mod/endpoints/mod_skypopen/mod_skypopen.c
浏览文件 @
01d0f1bd
...
@@ -461,6 +461,7 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
...
@@ -461,6 +461,7 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
{
{
private_t
*
tech_pvt
=
NULL
;
private_t
*
tech_pvt
=
NULL
;
switch_status_t
status
;
switch_status_t
status
;
int
conta
;
tech_pvt
=
switch_core_session_get_private
(
session
);
tech_pvt
=
switch_core_session_get_private
(
session
);
...
@@ -490,6 +491,29 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
...
@@ -490,6 +491,29 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
if
(
tech_pvt
->
write_buffer
)
{
if
(
tech_pvt
->
write_buffer
)
{
switch_buffer_destroy
(
&
tech_pvt
->
write_buffer
);
switch_buffer_destroy
(
&
tech_pvt
->
write_buffer
);
}
}
DEBUGA_SKYPE
(
"audio tcp threads to DIE
\n
"
,
SKYPOPEN_P_LOG
);
conta
=
0
;
while
(
tech_pvt
->
tcp_srv_thread
){
switch_sleep
(
5000
);
conta
++
;
if
(
conta
==
100
){
ERRORA
(
"tcp_srv_thread is NOT dead
\n
"
,
SKYPOPEN_P_LOG
);
break
;
}
}
DEBUGA_SKYPE
(
"audio tcp srv thread DEAD %d
\n
"
,
SKYPOPEN_P_LOG
,
conta
);
conta
=
0
;
while
(
tech_pvt
->
tcp_cli_thread
){
switch_sleep
(
5000
);
conta
++
;
if
(
conta
==
100
){
ERRORA
(
"tcp_cli_thread is NOT dead
\n
"
,
SKYPOPEN_P_LOG
);
break
;
}
}
DEBUGA_SKYPE
(
"audio tcp cli thread DEAD %d
\n
"
,
SKYPOPEN_P_LOG
,
conta
);
//DEBUGA_SKYPE("debugging_hangup 13\n", SKYPOPEN_P_LOG);
//DEBUGA_SKYPE("debugging_hangup 13\n", SKYPOPEN_P_LOG);
switch_mutex_lock
(
tech_pvt
->
mutex_thread_audio_cli
);
switch_mutex_lock
(
tech_pvt
->
mutex_thread_audio_cli
);
//DEBUGA_SKYPE("debugging_hangup cli lock\n", SKYPOPEN_P_LOG);
//DEBUGA_SKYPE("debugging_hangup cli lock\n", SKYPOPEN_P_LOG);
...
@@ -526,6 +550,7 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
...
@@ -526,6 +550,7 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
DEBUGA_SKYPE
(
"!!!!!!NO tech_pvt!!!! CHANNEL DESTROY %s
\n
"
,
SKYPOPEN_P_LOG
,
switch_core_session_get_uuid
(
session
));
DEBUGA_SKYPE
(
"!!!!!!NO tech_pvt!!!! CHANNEL DESTROY %s
\n
"
,
SKYPOPEN_P_LOG
,
switch_core_session_get_uuid
(
session
));
}
}
DEBUGA_SKYPE
(
"CHANNEL DESTROYED %s
\n
"
,
SKYPOPEN_P_LOG
,
switch_core_session_get_uuid
(
session
));
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
@@ -613,6 +638,8 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
...
@@ -613,6 +638,8 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
}
}
//DEBUGA_SKYPE("debugging_hangup 12\n", SKYPOPEN_P_LOG);
//DEBUGA_SKYPE("debugging_hangup 12\n", SKYPOPEN_P_LOG);
switch_channel_set_state
(
channel
,
CS_DESTROY
);
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
@@ -653,7 +680,7 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
...
@@ -653,7 +680,7 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
{
{
switch_channel_t
*
channel
=
NULL
;
switch_channel_t
*
channel
=
NULL
;
private_t
*
tech_pvt
=
NULL
;
private_t
*
tech_pvt
=
NULL
;
char
msg_to_skype
[
256
];
//
char msg_to_skype[256];
channel
=
switch_core_session_get_channel
(
session
);
channel
=
switch_core_session_get_channel
(
session
);
switch_assert
(
channel
!=
NULL
);
switch_assert
(
channel
!=
NULL
);
...
@@ -664,8 +691,8 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
...
@@ -664,8 +691,8 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
if
(
tech_pvt
)
{
if
(
tech_pvt
)
{
switch
(
sig
)
{
switch
(
sig
)
{
case
SWITCH_SIG_KILL
:
case
SWITCH_SIG_KILL
:
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
DEBUGA_SKYPE
(
"%s CHANNEL got SWITCH_SIG_KILL
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
));
DEBUGA_SKYPE
(
"%s CHANNEL got SWITCH_SIG_KILL
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
));
tech_pvt
->
interface_state
=
SKYPOPEN_STATE_HANGUP_REQUESTED
;
if
(
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_REMOTEHOLD
)
{
if
(
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_REMOTEHOLD
)
{
DEBUGA_SKYPE
(
"FYI %s CHANNEL in CALLFLOW_STATUS_REMOTEHOLD got SWITCH_SIG_KILL
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
));
DEBUGA_SKYPE
(
"FYI %s CHANNEL in CALLFLOW_STATUS_REMOTEHOLD got SWITCH_SIG_KILL
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
));
}
}
...
@@ -676,21 +703,30 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
...
@@ -676,21 +703,30 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
WARNINGA
(
"FYI %s CHANNEL in %d state got SWITCH_SIG_KILL
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
),
WARNINGA
(
"FYI %s CHANNEL in %d state got SWITCH_SIG_KILL
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
),
switch_channel_get_state
(
channel
));
switch_channel_get_state
(
channel
));
}
}
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
#if 0
switch_clear_flag(tech_pvt, TFLAG_IO);
switch_clear_flag(tech_pvt, TFLAG_IO);
switch_clear_flag(tech_pvt, TFLAG_VOICE);
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
))
{
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_PROGRESS
))
{
switch_clear_flag
(
tech_pvt
,
TFLAG_PROGRESS
);
switch_clear_flag
(
tech_pvt
,
TFLAG_PROGRESS
);
}
}
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
switch_mutex_unlock
(
tech_pvt
->
flag_mutex
);
#if 0
sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", tech_pvt->ring_id);
sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", tech_pvt->ring_id);
skypopen_signaling_write(tech_pvt, msg_to_skype);
skypopen_signaling_write(tech_pvt, msg_to_skype);
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->ring_id);
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->ring_id);
skypopen_signaling_write(tech_pvt, msg_to_skype);
skypopen_signaling_write(tech_pvt, msg_to_skype);
#if 1
sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", tech_pvt->skype_call_id);
sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", tech_pvt->skype_call_id);
skypopen_signaling_write(tech_pvt, msg_to_skype);
skypopen_signaling_write(tech_pvt, msg_to_skype);
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->skype_call_id);
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->skype_call_id);
skypopen_signaling_write(tech_pvt, msg_to_skype);
skypopen_signaling_write(tech_pvt, msg_to_skype);
#endif
#endif//0
break
;
break
;
case
SWITCH_SIG_BREAK
:
case
SWITCH_SIG_BREAK
:
DEBUGA_SKYPE
(
"%s CHANNEL got SWITCH_SIG_BREAK
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
));
DEBUGA_SKYPE
(
"%s CHANNEL got SWITCH_SIG_BREAK
\n
"
,
SKYPOPEN_P_LOG
,
switch_channel_get_name
(
channel
));
...
@@ -1355,6 +1391,7 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
...
@@ -1355,6 +1391,7 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
if
(
res
==
CALLFLOW_INCOMING_HANGUP
||
tech_pvt
->
skype_callflow
==
CALLFLOW_INCOMING_HANGUP
)
{
if
(
res
==
CALLFLOW_INCOMING_HANGUP
||
tech_pvt
->
skype_callflow
==
CALLFLOW_INCOMING_HANGUP
)
{
switch_core_session_t
*
session
=
NULL
;
switch_core_session_t
*
session
=
NULL
;
switch_channel_t
*
channel
=
NULL
;
switch_channel_t
*
channel
=
NULL
;
int
conta
;
DEBUGA_SKYPE
(
"skype call ended
\n
"
,
SKYPOPEN_P_LOG
);
DEBUGA_SKYPE
(
"skype call ended
\n
"
,
SKYPOPEN_P_LOG
);
...
@@ -1374,12 +1411,34 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
...
@@ -1374,12 +1411,34 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
switch_core_session_rwunlock
(
session
);
switch_core_session_rwunlock
(
session
);
}
else
{
}
else
{
DEBUGA_SKYPE
(
"no session
\n
"
,
SKYPOPEN_P_LOG
);
DEBUGA_SKYPE
(
"no session
\n
"
,
SKYPOPEN_P_LOG
);
DEBUGA_SKYPE
(
"audio tcp threads to DIE
\n
"
,
SKYPOPEN_P_LOG
);
conta
=
0
;
while
(
tech_pvt
->
tcp_srv_thread
){
switch_sleep
(
5000
);
conta
++
;
if
(
conta
==
100
){
ERRORA
(
"tcp_srv_thread is NOT dead
\n
"
,
SKYPOPEN_P_LOG
);
break
;
}
}
DEBUGA_SKYPE
(
"audio tcp srv thread DEAD %d
\n
"
,
SKYPOPEN_P_LOG
,
conta
);
conta
=
0
;
while
(
tech_pvt
->
tcp_cli_thread
){
switch_sleep
(
5000
);
conta
++
;
if
(
conta
==
100
){
ERRORA
(
"tcp_cli_thread is NOT dead
\n
"
,
SKYPOPEN_P_LOG
);
break
;
}
}
DEBUGA_SKYPE
(
"audio tcp cli thread DEAD %d
\n
"
,
SKYPOPEN_P_LOG
,
conta
);
}
}
switch_mutex_lock
(
globals
.
mutex
);
switch_mutex_lock
(
globals
.
mutex
);
tech_pvt
->
ringing_state
=
SKYPOPEN_RINGING_INIT
;
tech_pvt
->
ringing_state
=
SKYPOPEN_RINGING_INIT
;
tech_pvt
->
interface_state
=
SKYPOPEN_STATE_DOWN
;
//
tech_pvt->interface_state = SKYPOPEN_STATE_DOWN;
*
tech_pvt
->
session_uuid_str
=
'\0'
;
*
tech_pvt
->
session_uuid_str
=
'\0'
;
*
tech_pvt
->
skype_call_id
=
'\0'
;
//
*tech_pvt->skype_call_id = '\0';
*
tech_pvt
->
initial_skype_user
=
'\0'
;
*
tech_pvt
->
initial_skype_user
=
'\0'
;
*
tech_pvt
->
answer_id
=
'\0'
;
*
tech_pvt
->
answer_id
=
'\0'
;
*
tech_pvt
->
answer_value
=
'\0'
;
*
tech_pvt
->
answer_value
=
'\0'
;
...
@@ -1387,10 +1446,8 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
...
@@ -1387,10 +1446,8 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
*
tech_pvt
->
ring_value
=
'\0'
;
*
tech_pvt
->
ring_value
=
'\0'
;
*
tech_pvt
->
callid_number
=
'\0'
;
*
tech_pvt
->
callid_number
=
'\0'
;
*
tech_pvt
->
callid_name
=
'\0'
;
*
tech_pvt
->
callid_name
=
'\0'
;
switch_mutex_unlock
(
globals
.
mutex
);
switch_sleep
(
300000
);
//0.3 sec
//switch_sleep(300000); //0.3 sec
switch_mutex_lock
(
globals
.
mutex
);
tech_pvt
->
skype_callflow
=
CALLFLOW_CALL_IDLE
;
tech_pvt
->
skype_callflow
=
CALLFLOW_CALL_IDLE
;
tech_pvt
->
interface_state
=
SKYPOPEN_STATE_IDLE
;
tech_pvt
->
interface_state
=
SKYPOPEN_STATE_IDLE
;
switch_mutex_unlock
(
globals
.
mutex
);
switch_mutex_unlock
(
globals
.
mutex
);
...
...
src/mod/endpoints/mod_skypopen/skypopen_protocol.c
浏览文件 @
01d0f1bd
...
@@ -851,6 +851,8 @@ void *skypopen_do_tcp_srv_thread_func(void *obj)
...
@@ -851,6 +851,8 @@ void *skypopen_do_tcp_srv_thread_func(void *obj)
if
(
!
(
running
&&
tech_pvt
->
running
))
if
(
!
(
running
&&
tech_pvt
->
running
))
break
;
break
;
while
(
tech_pvt
&&
tech_pvt
->
interface_state
!=
SKYPOPEN_STATE_DOWN
while
(
tech_pvt
&&
tech_pvt
->
interface_state
!=
SKYPOPEN_STATE_DOWN
&&
tech_pvt
->
interface_state
!=
SKYPOPEN_STATE_IDLE
&&
tech_pvt
->
interface_state
!=
SKYPOPEN_STATE_HANGUP_REQUESTED
&&
(
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_INPROGRESS
&&
(
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_INPROGRESS
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_EARLYMEDIA
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_EARLYMEDIA
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_REMOTEHOLD
||
tech_pvt
->
skype_callflow
==
SKYPOPEN_STATE_UP
))
{
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_REMOTEHOLD
||
tech_pvt
->
skype_callflow
==
SKYPOPEN_STATE_UP
))
{
...
@@ -1010,6 +1012,8 @@ void *skypopen_do_tcp_cli_thread_func(void *obj)
...
@@ -1010,6 +1012,8 @@ void *skypopen_do_tcp_cli_thread_func(void *obj)
if
(
!
(
running
&&
tech_pvt
->
running
))
if
(
!
(
running
&&
tech_pvt
->
running
))
break
;
break
;
while
(
tech_pvt
&&
tech_pvt
->
interface_state
!=
SKYPOPEN_STATE_DOWN
while
(
tech_pvt
&&
tech_pvt
->
interface_state
!=
SKYPOPEN_STATE_DOWN
&&
tech_pvt
->
interface_state
!=
SKYPOPEN_STATE_IDLE
&&
tech_pvt
->
interface_state
!=
SKYPOPEN_STATE_HANGUP_REQUESTED
&&
(
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_INPROGRESS
&&
(
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_INPROGRESS
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_EARLYMEDIA
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_EARLYMEDIA
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_REMOTEHOLD
||
tech_pvt
->
skype_callflow
==
SKYPOPEN_STATE_UP
))
{
||
tech_pvt
->
skype_callflow
==
CALLFLOW_STATUS_REMOTEHOLD
||
tech_pvt
->
skype_callflow
==
SKYPOPEN_STATE_UP
))
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论