Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
3c4d46c1
提交
3c4d46c1
authored
4月 27, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1274
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
2a5d68df
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
44 行增加
和
25 行删除
+44
-25
mod_exosip.c
src/mod/endpoints/mod_exosip/mod_exosip.c
+10
-3
switch_ivr.c
src/switch_ivr.c
+34
-22
没有找到文件。
src/mod/endpoints/mod_exosip/mod_exosip.c
浏览文件 @
3c4d46c1
...
...
@@ -578,8 +578,9 @@ static switch_status exosip_read_frame(switch_core_session *session, switch_fram
size_t
bytes
=
0
,
samples
=
0
,
frames
=
0
,
ms
=
0
;
switch_channel
*
channel
=
NULL
;
int
payload
=
0
;
switch_time_t
now
,
started
=
switch_time_now
();
switch_time_t
now
,
started
=
switch_time_now
()
,
last_act
=
switch_time_now
()
;
unsigned
int
elapsed
;
uint32_t
hard_timeout
=
60000
*
3
;
channel
=
switch_core_session_get_channel
(
session
);
assert
(
channel
!=
NULL
);
...
...
@@ -626,14 +627,20 @@ static switch_status exosip_read_frame(switch_core_session *session, switch_fram
}
payload
=
tech_pvt
->
read_frame
.
payload
;
elapsed
=
(
unsigned
int
)((
switch_time_now
()
-
started
)
/
1000
);
if
(
timeout
>
-
1
)
{
elapsed
=
(
unsigned
int
)((
switch_time_now
()
-
started
)
/
1000
);
if
(
elapsed
>=
(
unsigned
int
)
timeout
)
{
return
SWITCH_STATUS_
SUCCESS
;
return
SWITCH_STATUS_
BREAK
;
}
}
elapsed
=
(
unsigned
int
)((
switch_time_now
()
-
last_act
)
/
1000
);
if
(
elapsed
>=
hard_timeout
)
{
return
SWITCH_STATUS_BREAK
;
}
/* RFC2833 ... TBD try harder to honor the duration etc.*/
if
(
payload
==
101
)
{
...
...
src/switch_ivr.c
浏览文件 @
3c4d46c1
...
...
@@ -813,9 +813,11 @@ static switch_status audio_bridge_on_loopback(switch_core_session *session)
if
((
arg
=
switch_channel_get_private
(
channel
)))
{
switch_channel_set_private
(
channel
,
NULL
);
audio_bridge_thread
(
NULL
,
(
void
*
)
arg
);
switch_channel_clear_state_handler
(
channel
,
&
audio_bridge_peer_state_handlers
);
}
else
{
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
}
switch_channel_clear_state_handler
(
channel
,
&
audio_bridge_peer_state_handlers
);
return
SWITCH_STATUS_FALSE
;
}
...
...
@@ -867,7 +869,7 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
{
struct
switch_core_thread_session
this_audio_thread
,
other_audio_thread
;
struct
switch_core_thread_session
*
this_audio_thread
,
*
other_audio_thread
;
switch_channel
*
caller_channel
,
*
peer_channel
;
time_t
start
;
int
stream_id
=
0
;
...
...
@@ -883,23 +885,24 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
peer_channel
=
switch_core_session_get_channel
(
peer_session
);
assert
(
peer_channel
!=
NULL
);
memset
(
&
other_audio_thread
,
0
,
sizeof
(
other_audio_thread
));
memset
(
&
this_audio_thread
,
0
,
sizeof
(
this_audio_thread
));
other_audio_thread
.
objs
[
0
]
=
session
;
other_audio_thread
.
objs
[
1
]
=
peer_session
;
other_audio_thread
.
objs
[
2
]
=
&
stream_id
;
other_audio_thread
.
objs
[
3
]
=
(
void
*
)
dtmf_callback
;
other_audio_thread
.
objs
[
4
]
=
session_data
;
other_audio_thread
.
objs
[
5
]
=
&
this_audio_thread
;
other_audio_thread
.
running
=
5
;
this_audio_thread
.
objs
[
0
]
=
peer_session
;
this_audio_thread
.
objs
[
1
]
=
session
;
this_audio_thread
.
objs
[
2
]
=
&
stream_id
;
this_audio_thread
.
objs
[
3
]
=
(
void
*
)
dtmf_callback
;
this_audio_thread
.
objs
[
4
]
=
peer_session_data
;
this_audio_thread
.
objs
[
5
]
=
&
other_audio_thread
;
this_audio_thread
.
running
=
2
;
other_audio_thread
=
switch_core_session_alloc
(
peer_session
,
sizeof
(
switch_core_thread_session
));
this_audio_thread
=
switch_core_session_alloc
(
peer_session
,
sizeof
(
switch_core_thread_session
));
other_audio_thread
->
objs
[
0
]
=
session
;
other_audio_thread
->
objs
[
1
]
=
peer_session
;
other_audio_thread
->
objs
[
2
]
=
&
stream_id
;
other_audio_thread
->
objs
[
3
]
=
(
void
*
)
dtmf_callback
;
other_audio_thread
->
objs
[
4
]
=
session_data
;
other_audio_thread
->
objs
[
5
]
=
this_audio_thread
;
other_audio_thread
->
running
=
5
;
this_audio_thread
->
objs
[
0
]
=
peer_session
;
this_audio_thread
->
objs
[
1
]
=
session
;
this_audio_thread
->
objs
[
2
]
=
&
stream_id
;
this_audio_thread
->
objs
[
3
]
=
(
void
*
)
dtmf_callback
;
this_audio_thread
->
objs
[
4
]
=
peer_session_data
;
this_audio_thread
->
objs
[
5
]
=
other_audio_thread
;
this_audio_thread
->
running
=
2
;
switch_channel_add_state_handler
(
peer_channel
,
&
audio_bridge_peer_state_handlers
);
...
...
@@ -978,14 +981,23 @@ SWITCH_DECLARE(switch_status) switch_ivr_multi_threaded_bridge(switch_core_sessi
switch_core_session_receive_message
(
session
,
&
msg
);
switch_channel_set_flag
(
peer_channel
,
CF_LOCK_THREAD
);
switch_channel_set_private
(
peer_channel
,
&
other_audio_thread
);
switch_channel_set_private
(
peer_channel
,
other_audio_thread
);
switch_channel_set_state
(
peer_channel
,
CS_LOOPBACK
);
audio_bridge_thread
(
NULL
,
(
void
*
)
&
this_audio_thread
);
audio_bridge_thread
(
NULL
,
(
void
*
)
this_audio_thread
);
if
(
switch_event_create
(
&
event
,
SWITCH_EVENT_CHANNEL_UNBRIDGE
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_event_set_data
(
caller_channel
,
event
);
switch_event_fire
(
&
event
);
}
this_audio_thread
->
objs
[
0
]
=
NULL
;
this_audio_thread
->
objs
[
1
]
=
NULL
;
this_audio_thread
->
objs
[
2
]
=
NULL
;
this_audio_thread
->
objs
[
3
]
=
NULL
;
this_audio_thread
->
objs
[
4
]
=
NULL
;
this_audio_thread
->
objs
[
5
]
=
NULL
;
this_audio_thread
->
running
=
2
;
switch_channel_clear_flag
(
peer_channel
,
CF_LOCK_THREAD
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Bridge Failed %s->%s
\n
"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论