Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4277fe8e
提交
4277fe8e
authored
10月 17, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix FSCORE-206
git-svn-id:
http://svn.openzap.org/svn/openzap/trunk@595
a93c3328-9c30-0410-af19-c9cd2b2d52af
上级
71e75316
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
15 行增加
和
4 行删除
+15
-4
mod_openzap.c
libs/freetdm/mod_openzap/mod_openzap.c
+15
-4
没有找到文件。
libs/freetdm/mod_openzap/mod_openzap.c
浏览文件 @
4277fe8e
...
@@ -71,7 +71,8 @@ typedef enum {
...
@@ -71,7 +71,8 @@ typedef enum {
TFLAG_DTMF
=
(
1
<<
1
),
TFLAG_DTMF
=
(
1
<<
1
),
TFLAG_CODEC
=
(
1
<<
2
),
TFLAG_CODEC
=
(
1
<<
2
),
TFLAG_BREAK
=
(
1
<<
3
),
TFLAG_BREAK
=
(
1
<<
3
),
TFLAG_HOLD
=
(
1
<<
4
)
TFLAG_HOLD
=
(
1
<<
4
),
TFLAG_DEAD
=
(
1
<<
5
)
}
TFLAGS
;
}
TFLAGS
;
static
struct
{
static
struct
{
...
@@ -341,7 +342,8 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses
...
@@ -341,7 +342,8 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses
switch_core_session_set_write_codec
(
tech_pvt
->
session
,
&
tech_pvt
->
write_codec
);
switch_core_session_set_write_codec
(
tech_pvt
->
session
,
&
tech_pvt
->
write_codec
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_CODEC
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_CODEC
);
tech_pvt
->
read_frame
.
codec
=
&
tech_pvt
->
read_codec
;
tech_pvt
->
read_frame
.
codec
=
&
tech_pvt
->
read_codec
;
switch_set_flag_locked
(
tech_pvt
,
TFLAG_IO
);
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
@@ -357,7 +359,6 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
...
@@ -357,7 +359,6 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
channel
=
switch_core_session_get_channel
(
session
);
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
assert
(
channel
!=
NULL
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_IO
);
/* Move channel's state machine to ROUTING */
/* Move channel's state machine to ROUTING */
switch_channel_set_state
(
channel
,
CS_ROUTING
);
switch_channel_set_state
(
channel
,
CS_ROUTING
);
...
@@ -493,6 +494,7 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
...
@@ -493,6 +494,7 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
switch
(
sig
)
{
switch
(
sig
)
{
case
SWITCH_SIG_KILL
:
case
SWITCH_SIG_KILL
:
switch_clear_flag_locked
(
tech_pvt
,
TFLAG_IO
);
switch_clear_flag_locked
(
tech_pvt
,
TFLAG_IO
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_DEAD
);
break
;
break
;
case
SWITCH_SIG_BREAK
:
case
SWITCH_SIG_BREAK
:
switch_set_flag_locked
(
tech_pvt
,
TFLAG_BREAK
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_BREAK
);
...
@@ -553,6 +555,10 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
...
@@ -553,6 +555,10 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
chunk
=
tech_pvt
->
zchan
->
effective_interval
*
2
;
chunk
=
tech_pvt
->
zchan
->
effective_interval
*
2
;
total_to
=
chunk
*
2
;
total_to
=
chunk
*
2
;
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_DEAD
))
{
return
SWITCH_STATUS_FALSE
;
}
top:
top:
if
(
switch_channel_test_flag
(
channel
,
CF_SUSPEND
))
{
if
(
switch_channel_test_flag
(
channel
,
CF_SUSPEND
))
{
...
@@ -566,9 +572,10 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
...
@@ -566,9 +572,10 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_HOLD
)
||
do_break
)
{
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_HOLD
)
||
do_break
)
{
switch_yield
(
tech_pvt
->
zchan
->
effective_interval
*
1000
);
switch_yield
(
tech_pvt
->
zchan
->
effective_interval
*
1000
);
*
frame
=
&
tech_pvt
->
cng_frame
;
tech_pvt
->
cng_frame
.
datalen
=
tech_pvt
->
zchan
->
packet_len
;
tech_pvt
->
cng_frame
.
datalen
=
tech_pvt
->
zchan
->
packet_len
;
tech_pvt
->
cng_frame
.
samples
=
tech_pvt
->
cng_frame
.
datalen
;
tech_pvt
->
cng_frame
.
samples
=
tech_pvt
->
cng_frame
.
datalen
;
tech_pvt
->
cng_frame
.
flags
=
SFF_CNG
;
*
frame
=
&
tech_pvt
->
cng_frame
;
if
(
tech_pvt
->
zchan
->
effective_codec
==
ZAP_CODEC_SLIN
)
{
if
(
tech_pvt
->
zchan
->
effective_codec
==
ZAP_CODEC_SLIN
)
{
tech_pvt
->
cng_frame
.
samples
/=
2
;
tech_pvt
->
cng_frame
.
samples
/=
2
;
}
}
...
@@ -651,6 +658,10 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
...
@@ -651,6 +658,10 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc
assert
(
tech_pvt
->
zchan
!=
NULL
);
assert
(
tech_pvt
->
zchan
!=
NULL
);
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_DEAD
))
{
return
SWITCH_STATUS_FALSE
;
}
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_HOLD
))
{
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_HOLD
))
{
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论