Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
76e62fea
提交
76e62fea
authored
5月 25, 2010
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
openzap: disable loop on call start
上级
7256232a
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
23 行增加
和
9 行删除
+23
-9
ozmod_sangoma_boost.c
...enzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c
+23
-9
没有找到文件。
libs/openzap/src/ozmod/ozmod_sangoma_boost/ozmod_sangoma_boost.c
浏览文件 @
76e62fea
...
...
@@ -775,6 +775,7 @@ static void handle_call_answer(zap_span_t *span, sangomabc_connection_t *mcon, s
}
static
__inline__
void
advance_chan_states
(
zap_channel_t
*
zchan
);
static
__inline__
void
stop_loop
(
zap_channel_t
*
zchan
);
/**
* \brief Handler for call start event
...
...
@@ -786,6 +787,9 @@ static void handle_call_start(zap_span_t *span, sangomabc_connection_t *mcon, sa
{
zap_channel_t
*
zchan
;
int
hangup_cause
=
ZAP_CAUSE_CALL_REJECTED
;
int
retry
=
1
;
tryagain:
if
(
!
(
zchan
=
find_zchan
(
span
,
(
sangomabc_short_event_t
*
)
event
,
0
)))
{
if
((
zchan
=
find_zchan
(
span
,
(
sangomabc_short_event_t
*
)
event
,
1
)))
{
...
...
@@ -807,7 +811,12 @@ static void handle_call_start(zap_span_t *span, sangomabc_connection_t *mcon, sa
zap_log
(
ZAP_LOG_CRIT
,
"ZCHAN CALL STATE HANGUP -> Changed to HANGUP %d:%d
\n
"
,
event
->
span
+
1
,
event
->
chan
+
1
);
zap_set_state_r
(
zchan
,
ZAP_CHANNEL_STATE_HANGUP_COMPLETE
,
0
,
r
);
/* Do nothing because outgoing STOP will generaate a stop ack */
}
else
if
(
zchan
->
state
==
ZAP_CHANNEL_STATE_IN_LOOP
&&
retry
)
{
/* workaround ss7box sending us call start without sending first a loop stop */
stop_loop
(
zchan
);
advance_chan_states
(
zchan
);
retry
=
0
;
goto
tryagain
;
}
else
{
zap_log
(
ZAP_LOG_CRIT
,
"ZCHAN CALL ACK STATE INVALID %s s%dc%d
\n
"
,
zap_channel_state2str
(
zchan
->
state
),
event
->
span
+
1
,
event
->
chan
+
1
);
...
...
@@ -912,10 +921,21 @@ static void handle_call_loop_start(zap_span_t *span, sangomabc_connection_t *mco
zap_channel_command
(
zchan
,
ZAP_COMMAND_ENABLE_LOOP
,
NULL
);
}
static
__inline__
void
stop_loop
(
zap_channel_t
*
zchan
)
{
zap_status_t
res
=
ZAP_FAIL
;
zap_channel_command
(
zchan
,
ZAP_COMMAND_DISABLE_LOOP
,
NULL
);
/* even when we did not sent a msg we set this flag to avoid sending call stop in the DOWN state handler */
zap_set_flag
(
zchan
,
SFLAG_SENT_FINAL_MSG
);
zap_set_state_r
(
zchan
,
ZAP_CHANNEL_STATE_DOWN
,
0
,
res
);
if
(
res
!=
ZAP_STATE_CHANGE_SUCCESS
)
{
zap_log
(
ZAP_LOG_CRIT
,
"yay, could not set the state of the channel from IN_LOOP to DOWN
\n
"
);
}
}
static
void
handle_call_loop_stop
(
zap_span_t
*
span
,
sangomabc_connection_t
*
mcon
,
sangomabc_short_event_t
*
event
)
{
zap_channel_t
*
zchan
;
zap_status_t
res
=
ZAP_FAIL
;
if
(
!
(
zchan
=
find_zchan
(
span
,
(
sangomabc_short_event_t
*
)
event
,
1
)))
{
zap_log
(
ZAP_LOG_CRIT
,
"CANNOT STOP LOOP, INVALID CHAN REQUESTED %d:%d
\n
"
,
event
->
span
+
1
,
event
->
chan
+
1
);
return
;
...
...
@@ -924,13 +944,7 @@ static void handle_call_loop_stop(zap_span_t *span, sangomabc_connection_t *mcon
zap_log
(
ZAP_LOG_ERROR
,
"Got stop loop request in a channel that is not in loop, ignoring ...
\n
"
);
return
;
}
zap_channel_command
(
zchan
,
ZAP_COMMAND_DISABLE_LOOP
,
NULL
);
/* even when we did not sent a msg we set this flag to avoid sending call stop in the DOWN state handler */
zap_set_flag
(
zchan
,
SFLAG_SENT_FINAL_MSG
);
zap_set_state_r
(
zchan
,
ZAP_CHANNEL_STATE_DOWN
,
0
,
res
);
if
(
res
!=
ZAP_STATE_CHANGE_SUCCESS
)
{
zap_log
(
ZAP_LOG_CRIT
,
"yay, could not set the state of the channel from IN_LOOP to DOWN
\n
"
);
}
stop_loop
(
zchan
);
}
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论