Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c40aa9ee
提交
c40aa9ee
authored
12月 18, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add break
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@3705
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
e2180707
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
38 行增加
和
34 行删除
+38
-34
switch_types.h
src/include/switch_types.h
+2
-1
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+2
-2
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+26
-29
switch_rtp.c
src/switch_rtp.c
+8
-2
没有找到文件。
src/include/switch_types.h
浏览文件 @
c40aa9ee
...
...
@@ -500,7 +500,8 @@ SWITCH_SIG_XFER - Stop the current io but leave it viable
typedef
enum
{
SWITCH_SIG_NONE
,
SWITCH_SIG_KILL
,
SWITCH_SIG_XFER
SWITCH_SIG_XFER
,
SWITCH_SIG_BREAK
}
switch_signal_t
;
/*!
...
...
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
c40aa9ee
...
...
@@ -1917,9 +1917,9 @@ static int conference_function_kick_member(conference_obj_t *conference, confere
switch_clear_flag
(
member
,
MFLAG_RUNNING
);
switch_set_flag
(
member
,
MFLAG_KICKED
);
switch_mutex_unlock
(
member
->
flag_mutex
);
switch_core_session_kill_channel
(
member
->
session
,
SWITCH_SIG_BREAK
);
stream
->
write_function
(
stream
,
"OK kicked %u
\n
"
,
id
);
if
(
switch_event_create_subclass
(
&
event
,
SWITCH_EVENT_CUSTOM
,
CONF_EVENT_MAINT
)
==
SWITCH_STATUS_SUCCESS
)
{
switch_channel_t
*
channel
=
switch_core_session_get_channel
(
member
->
session
);
switch_channel_event_set_data
(
channel
,
event
);
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
c40aa9ee
...
...
@@ -267,10 +267,10 @@ struct private_object {
uint32_t
codec_ms
;
switch_caller_profile_t
*
caller_profile
;
int32_t
timestamp_send
;
int32_t
timestamp_recv
;
//
int32_t timestamp_recv;
switch_rtp_t
*
rtp_session
;
int
ssrc
;
switch_time_t
last_read
;
//
switch_time_t last_read;
sofia_profile_t
*
profile
;
char
*
local_sdp_audio_ip
;
switch_port_t
local_sdp_audio_port
;
...
...
@@ -1531,7 +1531,6 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
switch_io_flag_t
flags
,
int
stream_id
)
{
private_object_t
*
tech_pvt
=
NULL
;
size_t
bytes
=
0
,
samples
=
0
,
frames
=
0
,
ms
=
0
;
switch_channel_t
*
channel
=
NULL
;
int
payload
=
0
;
...
...
@@ -1557,19 +1556,15 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
tech_pvt
->
read_frame
.
datalen
=
0
;
switch_set_flag_locked
(
tech_pvt
,
TFLAG_READING
);
bytes
=
tech_pvt
->
read_codec
.
implementation
->
encoded_bytes_per_frame
;
samples
=
tech_pvt
->
read_codec
.
implementation
->
samples_per_frame
;
ms
=
tech_pvt
->
read_codec
.
implementation
->
microseconds_per_frame
;
#if 0
if (tech_pvt->last_read) {
#if 0
elapsed = (unsigned int)((switch_time_now() - tech_pvt->last_read) / 1000);
if (elapsed > 60000) {
return SWITCH_STATUS_TIMEOUT;
}
#endif
}
#endif
if
(
switch_test_flag
(
tech_pvt
,
TFLAG_IO
))
{
switch_status_t
status
;
...
...
@@ -1616,23 +1611,16 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
if
(
tech_pvt
->
read_frame
.
datalen
>
0
)
{
tech_pvt
->
last_read
=
switch_time_now
();
if
(
tech_pvt
->
read_codec
.
implementation
->
encoded_bytes_per_frame
)
{
bytes
=
tech_pvt
->
read_codec
.
implementation
->
encoded_bytes_per_frame
;
frames
=
(
tech_pvt
->
read_frame
.
datalen
/
bytes
);
}
else
frames
=
1
;
samples
=
frames
*
tech_pvt
->
read_codec
.
implementation
->
samples_per_frame
;
ms
=
frames
*
tech_pvt
->
read_codec
.
implementation
->
microseconds_per_frame
;
tech_pvt
->
timestamp_recv
+=
(
int32_t
)
samples
;
tech_pvt
->
read_frame
.
samples
=
(
int
)
samples
;
size_t
bytes
=
0
;
int
frames
=
0
;
//tech_pvt->last_read = switch_time_now();
bytes
=
tech_pvt
->
read_codec
.
implementation
->
encoded_bytes_per_frame
;
frames
=
(
tech_pvt
->
read_frame
.
datalen
/
bytes
);
tech_pvt
->
read_frame
.
samples
=
(
int
)
(
frames
*
tech_pvt
->
read_codec
.
implementation
->
samples_per_frame
);
break
;
}
}
}
}
switch_clear_flag_locked
(
tech_pvt
,
TFLAG_READING
);
...
...
@@ -1724,12 +1712,21 @@ static switch_status_t sofia_kill_channel(switch_core_session_t *session, int si
tech_pvt
=
(
private_object_t
*
)
switch_core_session_get_private
(
session
);
assert
(
tech_pvt
!=
NULL
);
switch_clear_flag_locked
(
tech_pvt
,
TFLAG_IO
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_HUP
);
if
(
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
switch_rtp_kill_socket
(
tech_pvt
->
rtp_session
);
}
switch
(
sig
)
{
case
SWITCH_SIG_BREAK
:
switch_rtp_set_flag
(
tech_pvt
->
rtp_session
,
SWITCH_RTP_FLAG_BREAK
);
break
;
case
SWITCH_SIG_KILL
:
default
:
switch_clear_flag_locked
(
tech_pvt
,
TFLAG_IO
);
switch_set_flag_locked
(
tech_pvt
,
TFLAG_HUP
);
if
(
switch_rtp_ready
(
tech_pvt
->
rtp_session
))
{
switch_rtp_kill_socket
(
tech_pvt
->
rtp_session
);
}
break
;
}
return
SWITCH_STATUS_SUCCESS
;
...
...
src/switch_rtp.c
浏览文件 @
c40aa9ee
...
...
@@ -776,7 +776,13 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
if
(
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_BREAK
))
{
switch_clear_flag_locked
(
rtp_session
,
SWITCH_RTP_FLAG_BREAK
);
return
0
;
memset
(
&
rtp_session
->
recv_msg
,
0
,
SWITCH_RTP_CNG_PAYLOAD
);
rtp_session
->
recv_msg
.
header
.
pt
=
SWITCH_RTP_CNG_PAYLOAD
;
*
flags
|=
SFF_CNG
;
/* Return a CNG frame */
*
payload_type
=
SWITCH_RTP_CNG_PAYLOAD
;
return
SWITCH_RTP_CNG_PAYLOAD
;
}
if
(
!
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_IO
))
{
...
...
@@ -857,7 +863,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
if
(
status
==
SWITCH_STATUS_BREAK
||
bytes
==
0
)
{
if
(
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_DATAWAIT
))
{
switch_yield
(
rtp_session
->
ms_per_packet
);
switch_yield
(
rtp_session
->
ms_per_packet
/
2
);
continue
;
}
return
0
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论