Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
9edcbfe0
提交
9edcbfe0
authored
9月 27, 2016
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9522 more regression
上级
cbb97d40
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
74 行增加
和
57 行删除
+74
-57
switch_core_media.c
src/switch_core_media.c
+73
-57
switch_rtp.c
src/switch_rtp.c
+1
-0
没有找到文件。
src/switch_core_media.c
浏览文件 @
9edcbfe0
...
@@ -3729,7 +3729,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
...
@@ -3729,7 +3729,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
int
codec_ms
=
0
;
int
codec_ms
=
0
;
uint32_t
remote_codec_rate
=
0
,
fmtp_remote_codec_rate
=
0
;
uint32_t
remote_codec_rate
=
0
,
fmtp_remote_codec_rate
=
0
;
const
char
*
tmp
;
const
char
*
tmp
;
int
m_idx
=
0
;
int
m_idx
=
0
,
skip_rtcp
=
0
,
skip_video_rtcp
=
0
;
int
nm_idx
=
0
;
int
nm_idx
=
0
;
int
vmatch_pt
=
0
;
int
vmatch_pt
=
0
;
int
rtcp_auto_audio
=
0
,
rtcp_auto_video
=
0
;
int
rtcp_auto_audio
=
0
,
rtcp_auto_video
=
0
;
...
@@ -4139,11 +4139,18 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
...
@@ -4139,11 +4139,18 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
}
}
}
}
skip_rtcp
=
0
;
for
(
attr
=
m
->
m_attributes
;
attr
;
attr
=
attr
->
a_next
)
{
for
(
attr
=
m
->
m_attributes
;
attr
;
attr
=
attr
->
a_next
)
{
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp-mux"
)
||
!
strcasecmp
(
attr
->
a_name
,
"ice-ufrag"
))
{
skip_rtcp
=
1
;
}
}
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp"
)
&&
attr
->
a_value
)
{
for
(
attr
=
m
->
m_attributes
;
attr
;
attr
=
attr
->
a_next
)
{
switch_channel_set_variable
(
session
->
channel
,
"rtp_remote_audio_rtcp_port"
,
attr
->
a_value
);
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp"
)
&&
attr
->
a_value
&&
!
skip_rtcp
)
{
a_engine
->
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
attr
->
a_value
);
a_engine
->
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
attr
->
a_value
);
switch_channel_set_variable_printf
(
session
->
channel
,
"rtp_remote_audio_rtcp_port"
,
"%d"
,
a_engine
->
remote_rtcp_port
);
if
(
!
smh
->
mparams
->
rtcp_audio_interval_msec
)
{
if
(
!
smh
->
mparams
->
rtcp_audio_interval_msec
)
{
smh
->
mparams
->
rtcp_audio_interval_msec
=
SWITCH_RTCP_AUDIO_INTERVAL_MSEC
;
smh
->
mparams
->
rtcp_audio_interval_msec
=
SWITCH_RTCP_AUDIO_INTERVAL_MSEC
;
}
}
...
@@ -4691,6 +4698,67 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
...
@@ -4691,6 +4698,67 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
}
}
}
}
skip_video_rtcp
=
0
;
for
(
attr
=
m
->
m_attributes
;
attr
;
attr
=
attr
->
a_next
)
{
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp-mux"
)
||
!
strcasecmp
(
attr
->
a_name
,
"ice-ufrag"
))
{
skip_video_rtcp
=
1
;
}
}
for
(
attr
=
m
->
m_attributes
;
attr
;
attr
=
attr
->
a_next
)
{
if
(
!
strcasecmp
(
attr
->
a_name
,
"framerate"
)
&&
attr
->
a_value
)
{
//framerate = atoi(attr->a_value);
}
else
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp-fb"
))
{
if
(
!
zstr
(
attr
->
a_value
))
{
if
(
switch_stristr
(
"fir"
,
attr
->
a_value
))
{
v_engine
->
fir
++
;
}
if
(
switch_stristr
(
"pli"
,
attr
->
a_value
))
{
v_engine
->
pli
++
;
}
if
(
switch_stristr
(
"nack"
,
attr
->
a_value
))
{
v_engine
->
nack
++
;
}
if
(
switch_stristr
(
"tmmbr"
,
attr
->
a_value
))
{
v_engine
->
tmmbr
++
;
}
rtcp_auto_video
=
1
;
smh
->
mparams
->
rtcp_video_interval_msec
=
SWITCH_RTCP_VIDEO_INTERVAL_MSEC
;
}
}
else
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp"
)
&&
attr
->
a_value
&&
!
skip_video_rtcp
)
{
v_engine
->
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
attr
->
a_value
);
switch_channel_set_variable_printf
(
session
->
channel
,
"rtp_remote_video_rtcp_port"
,
"%d"
,
v_engine
->
remote_rtcp_port
);
if
(
!
smh
->
mparams
->
rtcp_video_interval_msec
)
{
smh
->
mparams
->
rtcp_video_interval_msec
=
SWITCH_RTCP_VIDEO_INTERVAL_MSEC
;
}
got_video_rtcp
=
1
;
}
else
if
(
!
got_video_crypto
&&
!
strcasecmp
(
attr
->
a_name
,
"crypto"
)
&&
!
zstr
(
attr
->
a_value
))
{
int
crypto_tag
;
if
(
!
(
smh
->
mparams
->
ndlb
&
SM_NDLB_ALLOW_CRYPTO_IN_AVP
)
&&
!
switch_true
(
switch_channel_get_variable
(
session
->
channel
,
"rtp_allow_crypto_in_avp"
)))
{
if
(
m
->
m_proto
!=
sdp_proto_srtp
&&
!
got_webrtc
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"a=crypto in RTP/AVP, refer to rfc3711
\n
"
);
match
=
0
;
goto
done
;
}
}
crypto
=
attr
->
a_value
;
crypto_tag
=
atoi
(
crypto
);
got_video_crypto
=
switch_core_session_check_incoming_crypto
(
session
,
"rtp_has_video_crypto"
,
SWITCH_MEDIA_TYPE_VIDEO
,
crypto
,
crypto_tag
,
sdp_type
);
}
}
if
(
switch_true
(
switch_channel_get_variable_dup
(
session
->
channel
,
"inherit_codec"
,
SWITCH_FALSE
,
-
1
)))
{
if
(
switch_true
(
switch_channel_get_variable_dup
(
session
->
channel
,
"inherit_codec"
,
SWITCH_FALSE
,
-
1
)))
{
vmatch_pt
=
1
;
vmatch_pt
=
1
;
}
}
...
@@ -4707,58 +4775,6 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
...
@@ -4707,58 +4775,6 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
}
}
}
}
for
(
attr
=
m
->
m_attributes
;
attr
;
attr
=
attr
->
a_next
)
{
if
(
!
strcasecmp
(
attr
->
a_name
,
"framerate"
)
&&
attr
->
a_value
)
{
//framerate = atoi(attr->a_value);
}
else
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp-fb"
))
{
if
(
!
zstr
(
attr
->
a_value
))
{
if
(
switch_stristr
(
"fir"
,
attr
->
a_value
))
{
v_engine
->
fir
++
;
}
if
(
switch_stristr
(
"pli"
,
attr
->
a_value
))
{
v_engine
->
pli
++
;
}
if
(
switch_stristr
(
"nack"
,
attr
->
a_value
))
{
v_engine
->
nack
++
;
}
if
(
switch_stristr
(
"tmmbr"
,
attr
->
a_value
))
{
v_engine
->
tmmbr
++
;
}
rtcp_auto_video
=
1
;
}
}
else
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp"
)
&&
attr
->
a_value
)
{
switch_channel_set_variable
(
session
->
channel
,
"rtp_remote_video_rtcp_port"
,
attr
->
a_value
);
v_engine
->
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
attr
->
a_value
);
if
(
!
smh
->
mparams
->
rtcp_video_interval_msec
)
{
smh
->
mparams
->
rtcp_video_interval_msec
=
SWITCH_RTCP_VIDEO_INTERVAL_MSEC
;
}
got_video_rtcp
=
1
;
}
else
if
(
!
got_video_crypto
&&
!
strcasecmp
(
attr
->
a_name
,
"crypto"
)
&&
!
zstr
(
attr
->
a_value
))
{
int
crypto_tag
;
if
(
!
(
smh
->
mparams
->
ndlb
&
SM_NDLB_ALLOW_CRYPTO_IN_AVP
)
&&
!
switch_true
(
switch_channel_get_variable
(
session
->
channel
,
"rtp_allow_crypto_in_avp"
)))
{
if
(
m
->
m_proto
!=
sdp_proto_srtp
&&
!
got_webrtc
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"a=crypto in RTP/AVP, refer to rfc3711
\n
"
);
match
=
0
;
goto
done
;
}
}
crypto
=
attr
->
a_value
;
crypto_tag
=
atoi
(
crypto
);
got_video_crypto
=
switch_core_session_check_incoming_crypto
(
session
,
"rtp_has_video_crypto"
,
SWITCH_MEDIA_TYPE_VIDEO
,
crypto
,
crypto_tag
,
sdp_type
);
}
}
if
(
!
(
rm_encoding
=
map
->
rm_encoding
))
{
if
(
!
(
rm_encoding
=
map
->
rm_encoding
))
{
rm_encoding
=
""
;
rm_encoding
=
""
;
}
}
...
@@ -4904,7 +4920,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
...
@@ -4904,7 +4920,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
}
}
if
(
rtcp_auto_audio
||
rtcp_auto_video
)
{
if
(
rtcp_auto_audio
||
rtcp_auto_video
)
{
if
(
rtcp_auto_audio
&&
!
got_audio_rtcp
&&
audio_port
)
{
if
(
rtcp_auto_audio
&&
!
skip_rtcp
&&
!
got_audio_rtcp
&&
audio_port
)
{
switch_channel_set_variable_printf
(
session
->
channel
,
"rtp_remote_audio_rtcp_port"
,
"%d"
,
audio_port
+
1
);
switch_channel_set_variable_printf
(
session
->
channel
,
"rtp_remote_audio_rtcp_port"
,
"%d"
,
audio_port
+
1
);
a_engine
->
remote_rtcp_port
=
audio_port
+
1
;
a_engine
->
remote_rtcp_port
=
audio_port
+
1
;
...
@@ -4912,7 +4928,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
...
@@ -4912,7 +4928,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
smh
->
mparams
->
rtcp_audio_interval_msec
=
SWITCH_RTCP_AUDIO_INTERVAL_MSEC
;
smh
->
mparams
->
rtcp_audio_interval_msec
=
SWITCH_RTCP_AUDIO_INTERVAL_MSEC
;
}
}
}
}
if
(
rtcp_auto_video
&&
!
got_video_rtcp
&&
video_port
)
{
if
(
rtcp_auto_video
&&
!
skip_video_rtcp
&&
!
got_video_rtcp
&&
video_port
)
{
switch_channel_set_variable_printf
(
session
->
channel
,
"rtp_remote_video_rtcp_port"
,
"%d"
,
video_port
+
1
);
switch_channel_set_variable_printf
(
session
->
channel
,
"rtp_remote_video_rtcp_port"
,
"%d"
,
video_port
+
1
);
v_engine
->
remote_rtcp_port
=
video_port
+
1
;
v_engine
->
remote_rtcp_port
=
video_port
+
1
;
if
(
!
smh
->
mparams
->
rtcp_video_interval_msec
)
{
if
(
!
smh
->
mparams
->
rtcp_video_interval_msec
)
{
...
...
src/switch_rtp.c
浏览文件 @
9edcbfe0
...
@@ -2785,6 +2785,7 @@ SWITCH_DECLARE(void) switch_rtp_reset_jb(switch_rtp_t *rtp_session)
...
@@ -2785,6 +2785,7 @@ SWITCH_DECLARE(void) switch_rtp_reset_jb(switch_rtp_t *rtp_session)
SWITCH_DECLARE
(
void
)
switch_rtp_reset_vb
(
switch_rtp_t
*
rtp_session
)
SWITCH_DECLARE
(
void
)
switch_rtp_reset_vb
(
switch_rtp_t
*
rtp_session
)
{
{
if
(
rtp_session
->
vb
)
{
if
(
rtp_session
->
vb
)
{
switch_jb_reset
(
rtp_session
->
vb
);
switch_jb_reset
(
rtp_session
->
vb
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论