Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
e9958c5b
提交
e9958c5b
authored
12月 15, 2010
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more jb work, add debug command and logging (sorry jlenk if this breaks win32)
上级
2324c299
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
47 行增加
和
7 行删除
+47
-7
switch_rtp.h
src/include/switch_rtp.h
+2
-0
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+11
-0
switch_ivr.c
src/switch_ivr.c
+1
-1
switch_rtp.c
src/switch_rtp.c
+33
-6
没有找到文件。
src/include/switch_rtp.h
浏览文件 @
e9958c5b
...
@@ -234,6 +234,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_jitter_buffer(switch_rtp_t *
...
@@ -234,6 +234,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_jitter_buffer(switch_rtp_t *
uint32_t
max_queue_frames
,
uint32_t
max_queue_frames
,
uint32_t
samples_per_packet
,
uint32_t
samples_per_second
);
uint32_t
samples_per_packet
,
uint32_t
samples_per_second
);
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_debug_jitter_buffer
(
switch_rtp_t
*
rtp_session
,
const
char
*
name
);
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_deactivate_jitter_buffer
(
switch_rtp_t
*
rtp_session
);
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_deactivate_jitter_buffer
(
switch_rtp_t
*
rtp_session
);
/*!
/*!
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
e9958c5b
...
@@ -1339,6 +1339,17 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -1339,6 +1339,17 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
if
(
msg
->
string_arg
)
{
if
(
msg
->
string_arg
)
{
char
*
p
;
char
*
p
;
const
char
*
s
;
if
(
!
strncasecmp
(
msg
->
string_arg
,
"debug:"
,
6
))
{
s
=
msg
->
string_arg
+
6
;
if
(
s
&&
!
strcmp
(
s
,
"off"
))
{
s
=
NULL
;
}
switch_rtp_debug_jitter_buffer
(
tech_pvt
->
rtp_session
,
s
);
goto
end
;
}
if
((
len
=
atoi
(
msg
->
string_arg
)))
{
if
((
len
=
atoi
(
msg
->
string_arg
)))
{
qlen
=
len
/
(
tech_pvt
->
read_impl
.
microseconds_per_packet
/
1000
);
qlen
=
len
/
(
tech_pvt
->
read_impl
.
microseconds_per_packet
/
1000
);
...
...
src/switch_ivr.c
浏览文件 @
e9958c5b
...
@@ -2300,7 +2300,7 @@ SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint3
...
@@ -2300,7 +2300,7 @@ SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint3
break
;
break
;
}
}
stfu_n_eat
(
jb
,
ts
,
0
,
read_frame
->
payload
,
read_frame
->
data
,
read_frame
->
datalen
);
stfu_n_eat
(
jb
,
ts
,
read_frame
->
payload
,
read_frame
->
data
,
read_frame
->
datalen
);
ts
+=
interval
;
ts
+=
interval
;
if
((
jb_frame
=
stfu_n_read_a_frame
(
jb
)))
{
if
((
jb_frame
=
stfu_n_read_a_frame
(
jb
)))
{
...
...
src/switch_rtp.c
浏览文件 @
e9958c5b
...
@@ -229,7 +229,7 @@ struct switch_rtp {
...
@@ -229,7 +229,7 @@ struct switch_rtp {
uint32_t
sync_packets
;
uint32_t
sync_packets
;
int
rtcp_interval
;
int
rtcp_interval
;
switch_bool_t
rtcp_fresh_frame
;
switch_bool_t
rtcp_fresh_frame
;
uint8_t
checked_jb
;
#ifdef ENABLE_ZRTP
#ifdef ENABLE_ZRTP
zrtp_session_t
*
zrtp_session
;
zrtp_session_t
*
zrtp_session
;
zrtp_profile_t
*
zrtp_profile
;
zrtp_profile_t
*
zrtp_profile
;
...
@@ -1652,6 +1652,32 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_deactivate_jitter_buffer(switch_rtp_t
...
@@ -1652,6 +1652,32 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_deactivate_jitter_buffer(switch_rtp_t
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
static
void
jb_logger
(
const
char
*
file
,
const
char
*
func
,
int
line
,
int
level
,
const
char
*
fmt
,
...)
{
int
ret
;
char
*
data
;
va_list
ap
;
va_start
(
ap
,
fmt
);
ret
=
stfu_vasprintf
(
&
data
,
fmt
,
ap
);
if
(
ret
!=
-
1
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG_CLEAN
,
SWITCH_LOG_CONSOLE
,
"%s"
,
data
);
free
(
data
);
}
//switch_log_printf(SWITCH_CHANNEL_ID_LOG_CLEAN, file, func, line, NULL, level, fmt, ap);
va_end
(
ap
);
}
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_debug_jitter_buffer
(
switch_rtp_t
*
rtp_session
,
const
char
*
name
)
{
stfu_n_debug
(
rtp_session
->
jb
,
name
);
stfu_global_set_logger
(
jb_logger
);
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_activate_jitter_buffer
(
switch_rtp_t
*
rtp_session
,
SWITCH_DECLARE
(
switch_status_t
)
switch_rtp_activate_jitter_buffer
(
switch_rtp_t
*
rtp_session
,
uint32_t
queue_frames
,
uint32_t
queue_frames
,
uint32_t
max_queue_frames
,
uint32_t
max_queue_frames
,
...
@@ -1674,6 +1700,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_jitter_buffer(switch_rtp_t *
...
@@ -1674,6 +1700,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_jitter_buffer(switch_rtp_t *
if
(
rtp_session
->
jb
)
{
if
(
rtp_session
->
jb
)
{
switch_core_session_t
*
session
=
switch_core_memory_pool_get_data
(
rtp_session
->
pool
,
"__session"
);
switch_core_session_t
*
session
=
switch_core_memory_pool_get_data
(
rtp_session
->
pool
,
"__session"
);
stfu_n_call_me
(
rtp_session
->
jb
,
jb_callback
,
session
);
stfu_n_call_me
(
rtp_session
->
jb
,
jb_callback
,
session
);
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
@@ -2108,9 +2135,8 @@ static void do_flush(switch_rtp_t *rtp_session)
...
@@ -2108,9 +2135,8 @@ static void do_flush(switch_rtp_t *rtp_session)
flushed
++
;
flushed
++
;
if
(
rtp_session
->
jb
)
{
if
(
0
&&
rtp_session
->
jb
)
{
stfu_n_eat
(
rtp_session
->
jb
,
ntohl
(
rtp_session
->
recv_msg
.
header
.
ts
),
stfu_n_eat
(
rtp_session
->
jb
,
ntohl
(
rtp_session
->
recv_msg
.
header
.
ts
),
ntohs
((
uint16_t
)
rtp_session
->
recv_msg
.
header
.
seq
),
rtp_session
->
recv_msg
.
header
.
pt
,
rtp_session
->
recv_msg
.
header
.
pt
,
rtp_session
->
recv_msg
.
body
,
bytes
-
rtp_header_len
);
rtp_session
->
recv_msg
.
body
,
bytes
-
rtp_header_len
);
}
}
...
@@ -2177,7 +2203,6 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
...
@@ -2177,7 +2203,6 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
}
}
stfu_n_eat
(
rtp_session
->
jb
,
ntohl
(
rtp_session
->
recv_msg
.
header
.
ts
),
stfu_n_eat
(
rtp_session
->
jb
,
ntohl
(
rtp_session
->
recv_msg
.
header
.
ts
),
ntohs
((
uint16_t
)
rtp_session
->
recv_msg
.
header
.
seq
),
rtp_session
->
recv_msg
.
header
.
pt
,
rtp_session
->
recv_msg
.
header
.
pt
,
rtp_session
->
recv_msg
.
body
,
*
bytes
-
rtp_header_len
);
rtp_session
->
recv_msg
.
body
,
*
bytes
-
rtp_header_len
);
*
bytes
=
0
;
*
bytes
=
0
;
...
@@ -2195,9 +2220,9 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
...
@@ -2195,9 +2220,9 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
*
bytes
=
jb_frame
->
dlen
+
rtp_header_len
;
*
bytes
=
jb_frame
->
dlen
+
rtp_header_len
;
rtp_session
->
recv_msg
.
header
.
ts
=
htonl
(
jb_frame
->
ts
);
rtp_session
->
recv_msg
.
header
.
ts
=
htonl
(
jb_frame
->
ts
);
rtp_session
->
recv_msg
.
header
.
pt
=
jb_frame
->
pt
;
rtp_session
->
recv_msg
.
header
.
pt
=
jb_frame
->
pt
;
rtp_session
->
recv_msg
.
header
.
seq
=
htons
((
uint16_t
)
jb_frame
->
seq
);
status
=
SWITCH_STATUS_SUCCESS
;
status
=
SWITCH_STATUS_SUCCESS
;
}
}
rtp_session
->
checked_jb
++
;
}
}
return
status
;
return
status
;
...
@@ -2342,6 +2367,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
...
@@ -2342,6 +2367,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
READ_INC
(
rtp_session
);
READ_INC
(
rtp_session
);
rtp_session
->
checked_jb
=
0
;
while
(
switch_rtp_ready
(
rtp_session
))
{
while
(
switch_rtp_ready
(
rtp_session
))
{
int
do_cng
=
0
;
int
do_cng
=
0
;
bytes
=
0
;
bytes
=
0
;
...
@@ -2894,7 +2921,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
...
@@ -2894,7 +2921,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
if
(
do_cng
)
{
if
(
do_cng
)
{
uint8_t
*
data
=
(
uint8_t
*
)
rtp_session
->
recv_msg
.
body
;
uint8_t
*
data
=
(
uint8_t
*
)
rtp_session
->
recv_msg
.
body
;
int
fdr
;
int
fdr
;
if
((
poll_status
=
switch_poll
(
rtp_session
->
read_pollfd
,
1
,
&
fdr
,
0
))
==
SWITCH_STATUS_SUCCESS
)
{
if
((
poll_status
=
switch_poll
(
rtp_session
->
read_pollfd
,
1
,
&
fdr
,
0
))
==
SWITCH_STATUS_SUCCESS
)
{
goto
recvfrom
;
goto
recvfrom
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论