Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
76502d90
提交
76502d90
authored
1月 15, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip
上级
aea974a9
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
194 行增加
和
195 行删除
+194
-195
switch_core_media.c
src/switch_core_media.c
+32
-25
switch_rtp.c
src/switch_rtp.c
+162
-170
没有找到文件。
src/switch_core_media.c
浏览文件 @
76502d90
...
@@ -142,7 +142,7 @@ typedef struct switch_rtp_engine_s {
...
@@ -142,7 +142,7 @@ typedef struct switch_rtp_engine_s {
uint32_t
max_missed_packets
;
uint32_t
max_missed_packets
;
uint32_t
max_missed_hold_packets
;
uint32_t
max_missed_hold_packets
;
uint32_t
ssrc
;
uint32_t
ssrc
;
switch_port_t
remote_rtcp_port
;
switch_rtp_bug_flag_t
rtp_bugs
;
switch_rtp_bug_flag_t
rtp_bugs
;
/** ZRTP **/
/** ZRTP **/
...
@@ -2212,6 +2212,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
...
@@ -2212,6 +2212,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp"
)
&&
attr
->
a_value
)
{
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp"
)
&&
attr
->
a_value
)
{
switch_channel_set_variable
(
session
->
channel
,
"sip_remote_audio_rtcp_port"
,
attr
->
a_value
);
switch_channel_set_variable
(
session
->
channel
,
"sip_remote_audio_rtcp_port"
,
attr
->
a_value
);
a_engine
->
remote_rtcp_port
=
atoi
(
attr
->
a_value
);
}
else
if
(
!
strcasecmp
(
attr
->
a_name
,
"ptime"
)
&&
attr
->
a_value
)
{
}
else
if
(
!
strcasecmp
(
attr
->
a_name
,
"ptime"
)
&&
attr
->
a_value
)
{
ptime
=
atoi
(
attr
->
a_value
);
ptime
=
atoi
(
attr
->
a_value
);
}
else
if
(
!
strcasecmp
(
attr
->
a_name
,
"maxptime"
)
&&
attr
->
a_value
)
{
}
else
if
(
!
strcasecmp
(
attr
->
a_name
,
"maxptime"
)
&&
attr
->
a_value
)
{
...
@@ -2564,7 +2565,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
...
@@ -2564,7 +2565,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
}
}
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp"
)
&&
attr
->
a_value
)
{
if
(
!
strcasecmp
(
attr
->
a_name
,
"rtcp"
)
&&
attr
->
a_value
)
{
switch_channel_set_variable
(
session
->
channel
,
"sip_remote_video_rtcp_port"
,
attr
->
a_value
);
switch_channel_set_variable
(
session
->
channel
,
"sip_remote_video_rtcp_port"
,
attr
->
a_value
);
v_engine
->
remote_rtcp_port
=
atoi
(
attr
->
a_value
);
}
else
if
(
!
got_video_crypto
&&
!
strcasecmp
(
attr
->
a_name
,
"crypto"
)
&&
!
zstr
(
attr
->
a_value
))
{
}
else
if
(
!
got_video_crypto
&&
!
strcasecmp
(
attr
->
a_name
,
"crypto"
)
&&
!
zstr
(
attr
->
a_value
))
{
int
crypto_tag
;
int
crypto_tag
;
...
@@ -2887,10 +2888,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_proxy_remote_addr(switch_core_
...
@@ -2887,10 +2888,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_proxy_remote_addr(switch_core_
switch_channel_set_flag
(
session
->
channel
,
CF_VIDEO
);
switch_channel_set_flag
(
session
->
channel
,
CF_VIDEO
);
if
(
switch_rtp_ready
(
v_engine
->
rtp_session
))
{
if
(
switch_rtp_ready
(
v_engine
->
rtp_session
))
{
const
char
*
rport
=
NULL
;
const
char
*
rport
=
NULL
;
switch_port_t
remote_rtcp_port
=
0
;
switch_port_t
remote_rtcp_port
=
v_engine
->
remote_rtcp_port
;
if
((
rport
=
switch_channel_get_variable
(
session
->
channel
,
"sip_remote_video_rtcp_port"
)))
{
if
(
!
remote_rtcp_port
)
{
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
rport
);
if
((
rport
=
switch_channel_get_variable
(
session
->
channel
,
"sip_remote_video_rtcp_port"
)))
{
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
rport
);
}
}
}
...
@@ -3422,12 +3425,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
...
@@ -3422,12 +3425,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
if
(
a_engine
->
rtp_session
&&
switch_channel_test_flag
(
session
->
channel
,
CF_REINVITE
))
{
if
(
a_engine
->
rtp_session
&&
switch_channel_test_flag
(
session
->
channel
,
CF_REINVITE
))
{
const
char
*
rport
=
NULL
;
const
char
*
rport
=
NULL
;
switch_port_t
remote_rtcp_port
=
0
;
switch_port_t
remote_rtcp_port
=
a_engine
->
remote_rtcp_port
;
if
(
!
remote_rtcp_port
)
{
if
((
rport
=
switch_channel_get_variable
(
session
->
channel
,
"sip_remote_audio_rtcp_port"
)))
{
if
((
rport
=
switch_channel_get_variable
(
session
->
channel
,
"sip_remote_audio_rtcp_port"
)))
{
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
rport
);
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
rport
);
}
}
}
if
(
switch_rtp_set_remote_address
(
a_engine
->
rtp_session
,
a_engine
->
codec_params
.
remote_sdp_ip
,
a_engine
->
codec_params
.
remote_sdp_port
,
if
(
switch_rtp_set_remote_address
(
a_engine
->
rtp_session
,
a_engine
->
codec_params
.
remote_sdp_ip
,
a_engine
->
codec_params
.
remote_sdp_port
,
...
@@ -3592,19 +3595,21 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
...
@@ -3592,19 +3595,21 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
if
((
val
=
switch_channel_get_variable
(
session
->
channel
,
"rtcp_audio_interval_msec"
))
||
(
val
=
smh
->
mparams
->
rtcp_audio_interval_msec
))
{
if
((
val
=
switch_channel_get_variable
(
session
->
channel
,
"rtcp_audio_interval_msec"
))
||
(
val
=
smh
->
mparams
->
rtcp_audio_interval_msec
))
{
const
char
*
rport
=
switch_channel_get_variable
(
session
->
channel
,
"sip_remote_audio_rtcp_port"
);
const
char
*
rport
=
switch_channel_get_variable
(
session
->
channel
,
"sip_remote_audio_rtcp_port"
);
switch_port_t
remote_port
=
0
;
switch_port_t
remote_rtcp_port
=
a_engine
->
remote_rtcp_port
;
if
(
rport
)
{
remote_port
=
(
switch_port_t
)
atoi
(
rport
);
if
(
!
remote_rtcp_port
&&
rport
)
{
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
rport
);
}
}
if
(
!
strcasecmp
(
val
,
"passthru"
))
{
if
(
!
strcasecmp
(
val
,
"passthru"
))
{
switch_rtp_activate_rtcp
(
a_engine
->
rtp_session
,
-
1
,
remote_port
);
switch_rtp_activate_rtcp
(
a_engine
->
rtp_session
,
-
1
,
remote_
rtcp_
port
);
}
else
{
}
else
{
int
interval
=
atoi
(
val
);
int
interval
=
atoi
(
val
);
if
(
interval
<
100
||
interval
>
5000
)
{
if
(
interval
<
100
||
interval
>
5000
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"Invalid rtcp interval spec [%d] must be between 100 and 5000
\n
"
,
interval
);
"Invalid rtcp interval spec [%d] must be between 100 and 5000
\n
"
,
interval
);
}
else
{
}
else
{
switch_rtp_activate_rtcp
(
a_engine
->
rtp_session
,
interval
,
remote_port
);
switch_rtp_activate_rtcp
(
a_engine
->
rtp_session
,
interval
,
remote_
rtcp_
port
);
}
}
}
}
...
@@ -3814,12 +3819,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
...
@@ -3814,12 +3819,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
if
(
v_engine
->
rtp_session
&&
switch_channel_test_flag
(
session
->
channel
,
CF_REINVITE
))
{
if
(
v_engine
->
rtp_session
&&
switch_channel_test_flag
(
session
->
channel
,
CF_REINVITE
))
{
const
char
*
rport
=
NULL
;
const
char
*
rport
=
NULL
;
switch_port_t
remote_rtcp_port
=
0
;
switch_port_t
remote_rtcp_port
=
v_engine
->
remote_rtcp_port
;
switch_channel_clear_flag
(
session
->
channel
,
CF_REINVITE
);
switch_channel_clear_flag
(
session
->
channel
,
CF_REINVITE
);
if
((
rport
=
switch_channel_get_variable
(
session
->
channel
,
"sip_remote_video_rtcp_port"
)))
{
if
(
!
remote_rtcp_port
)
{
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
rport
);
if
((
rport
=
switch_channel_get_variable
(
session
->
channel
,
"sip_remote_video_rtcp_port"
)))
{
remote_rtcp_port
=
(
switch_port_t
)
atoi
(
rport
);
}
}
}
if
(
switch_rtp_set_remote_address
if
(
switch_rtp_set_remote_address
...
@@ -4557,9 +4564,9 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
...
@@ -4557,9 +4564,9 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
//
if (smh->mparams->rtcp_audio_interval_msec) {
if
(
smh
->
mparams
->
rtcp_audio_interval_msec
)
{
//
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtcp:%d IN %s %s\n", port + 1, family, ip);
switch_snprintf
(
buf
+
strlen
(
buf
),
SDPBUFLEN
-
strlen
(
buf
),
"a=rtcp:%d IN %s %s
\n
"
,
port
+
1
,
family
,
ip
);
//
}
}
//switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=ssrc:%u\n", a_engine->ssrc);
//switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=ssrc:%u\n", a_engine->ssrc);
...
@@ -4743,9 +4750,9 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
...
@@ -4743,9 +4750,9 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
//
if (smh->mparams->rtcp_audio_interval_msec) {
if
(
smh
->
mparams
->
rtcp_audio_interval_msec
)
{
//
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=rtcp:%d IN %s %s\n", v_port + 1, family, ip);
switch_snprintf
(
buf
+
strlen
(
buf
),
SDPBUFLEN
-
strlen
(
buf
),
"a=rtcp:%d IN %s %s
\n
"
,
v_port
+
1
,
family
,
ip
);
//
}
}
//switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=ssrc:%u\n", v_engine->ssrc);
//switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=ssrc:%u\n", v_engine->ssrc);
...
...
src/switch_rtp.c
浏览文件 @
76502d90
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论