Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5c90322e
提交
5c90322e
authored
1月 24, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MILESTONE: kind of works on media and signaling
上级
62e62e1e
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
46 行增加
和
15 行删除
+46
-15
switch_core_media.h
src/include/switch_core_media.h
+1
-0
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+7
-0
sofia_reg.c
src/mod/endpoints/mod_sofia/sofia_reg.c
+9
-2
switch_core_media.c
src/switch_core_media.c
+29
-13
没有找到文件。
src/include/switch_core_media.h
浏览文件 @
5c90322e
...
...
@@ -247,6 +247,7 @@ SWITCH_DECLARE(void) switch_core_media_check_outgoing_proxy(switch_core_session_
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_codec_chosen
(
switch_core_session_t
*
session
,
switch_media_type_t
media
);
SWITCH_DECLARE
(
void
)
switch_core_media_recover_session
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_media_add_ice_acl
(
switch_core_session_t
*
session
,
switch_media_type_t
type
,
const
char
*
acl_name
);
SWITCH_DECLARE
(
void
)
switch_core_session_set_ice
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
void
)
switch_core_media_init
(
void
);
SWITCH_DECLARE
(
void
)
switch_core_media_deinit
(
void
);
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
5c90322e
...
...
@@ -4142,6 +4142,13 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
switch_channel_set_variable
(
nchannel
,
"rtp_secure_media"
,
hval
);
}
if
(
!
zstr
(
tech_pvt
->
dest
)
&&
switch_stristr
(
"transport=ws"
,
tech_pvt
->
dest
))
{
switch_channel_set_variable
(
nchannel
,
"rtp_secure_media"
,
SWITCH_RTP_CRYPTO_KEY_80
);
switch_channel_set_variable
(
nchannel
,
"media_webrtc"
,
"true"
);
switch_core_session_set_ice
(
nsession
);
}
sofia_glue_attach_private
(
nsession
,
profile
,
tech_pvt
,
dest
);
if
(
tech_pvt
->
local_url
)
{
...
...
src/mod/endpoints/mod_sofia/sofia_reg.c
浏览文件 @
5c90322e
...
...
@@ -1109,7 +1109,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
const
char
*
agent
=
"unknown"
;
const
char
*
pres_on_reg
=
NULL
;
int
send_pres
=
0
;
int
is_tls
=
0
,
is_tcp
=
0
;
int
is_tls
=
0
,
is_tcp
=
0
,
is_ws
=
0
;
char
expbuf
[
35
]
=
""
;
time_t
reg_time
=
switch_epoch_time_now
(
NULL
);
...
...
@@ -1184,7 +1184,12 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
is_nat
++
;
}
if
(
sip
->
sip_contact
->
m_url
->
url_type
==
url_sips
)
{
if
(
switch_stristr
(
"transport=ws"
,
sip
->
sip_contact
->
m_url
->
url_params
))
{
is_nat
++
;
is_ws
+=
1
;
}
if
(
sip
->
sip_contact
->
m_url
->
url_type
==
url_sips
&&
!
switch_stristr
(
"transport=ws"
,
sip
->
sip_contact
->
m_url
->
url_params
))
{
proto
=
"sips"
;
is_tls
+=
2
;
is_nat
++
;
...
...
@@ -1202,6 +1207,8 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
reg_desc
=
"Registered(TLS-NAT)"
;
}
else
if
(
is_tcp
)
{
reg_desc
=
"Registered(TCP-NAT)"
;
}
else
if
(
is_ws
)
{
reg_desc
=
"Registered(WS-NAT)"
;
}
else
{
reg_desc
=
"Registered(UDP-NAT)"
;
}
...
...
src/switch_core_media.c
浏览文件 @
5c90322e
...
...
@@ -1828,7 +1828,8 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_
}
else
if
(
!
strcasecmp
(
attr
->
a_name
,
"candidate"
))
{
if
(
!
engine
->
cand_acl_count
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
smh
->
session
),
SWITCH_LOG_WARNING
,
"NO candidate ACL defined, skipping candidate check.
\n
"
);
engine
->
cand_acl
[
engine
->
cand_acl_count
++
]
=
"wan.auto"
;
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
smh
->
session
),
SWITCH_LOG_WARNING
,
"NO candidate ACL defined, Defaulting to wan.auto
\n
"
);
goto
end
;
}
...
...
@@ -1937,6 +1938,22 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_
}
SWITCH_DECLARE
(
void
)
switch_core_session_set_ice
(
switch_core_session_t
*
session
)
{
switch_media_handle_t
*
smh
;
switch_assert
(
session
);
if
(
!
(
smh
=
session
->
media_handle
))
{
return
;
}
switch_channel_set_flag
(
session
->
channel
,
CF_WEBRTC
);
switch_channel_set_flag
(
session
->
channel
,
CF_ICE
);
smh
->
mparams
->
rtcp_audio_interval_msec
=
"5000"
;
smh
->
mparams
->
rtcp_video_interval_msec
=
"5000"
;
}
//?
SWITCH_DECLARE
(
uint8_t
)
switch_core_media_negotiate_sdp
(
switch_core_session_t
*
session
,
const
char
*
r_sdp
,
uint8_t
*
proceed
)
{
...
...
@@ -2129,10 +2146,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
if
(
m
->
m_proto
==
sdp_proto_extended_srtp
)
{
got_webrtc
++
;
switch_channel_set_flag
(
session
->
channel
,
CF_WEBRTC
);
switch_channel_set_flag
(
session
->
channel
,
CF_ICE
);
smh
->
mparams
->
rtcp_audio_interval_msec
=
"5000"
;
smh
->
mparams
->
rtcp_video_interval_msec
=
"5000"
;
switch_core_session_set_ice
(
session
);
}
if
(
m
->
m_proto
==
sdp_proto_srtp
||
m
->
m_proto
==
sdp_proto_extended_srtp
)
{
...
...
@@ -2397,7 +2411,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
}
if
(
zstr
(
map
->
rm_fmtp
))
{
if
(
!
strcasecmp
(
map
->
rm_encoding
,
"ilbc"
))
{
if
(
!
strcasecmp
(
map
->
rm_encoding
,
"ilbc"
)
||
!
strcasecmp
(
map
->
rm_encoding
,
"isac"
)
)
{
codec_ms
=
30
;
map_bit_rate
=
13330
;
}
...
...
@@ -2430,7 +2444,8 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
match
=
strcasecmp
(
rm_encoding
,
imp
->
iananame
)
?
0
:
1
;
}
if
(
match
&&
bit_rate
&&
map_bit_rate
&&
map_bit_rate
!=
bit_rate
&&
strcasecmp
(
map
->
rm_encoding
,
"ilbc"
))
{
if
(
match
&&
bit_rate
&&
map_bit_rate
&&
map_bit_rate
!=
bit_rate
&&
strcasecmp
(
map
->
rm_encoding
,
"ilbc"
)
&&
strcasecmp
(
map
->
rm_encoding
,
"isac"
))
{
/* if a bit rate is specified and doesn't match, this is not a codec match, except for ILBC */
match
=
0
;
}
...
...
@@ -4175,7 +4190,7 @@ static void generate_m(switch_core_session_t *session, char *buf, size_t buflen,
const
switch_codec_implementation_t
*
imp
=
smh
->
codecs
[
i
];
int
this_ptime
=
(
imp
->
microseconds_per_packet
/
1000
);
if
(
!
strcasecmp
(
imp
->
iananame
,
"ilbc"
))
{
if
(
!
strcasecmp
(
imp
->
iananame
,
"ilbc"
)
||
!
strcasecmp
(
imp
->
iananame
,
"isac"
)
)
{
this_ptime
=
20
;
}
...
...
@@ -4230,7 +4245,7 @@ static void generate_m(switch_core_session_t *session, char *buf, size_t buflen,
continue
;
}
if
(
!
strcasecmp
(
imp
->
iananame
,
"ilbc"
))
{
if
(
!
strcasecmp
(
imp
->
iananame
,
"ilbc"
)
||
!
strcasecmp
(
imp
->
iananame
,
"isac"
)
)
{
this_ptime
=
20
;
}
...
...
@@ -4841,10 +4856,11 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
}
mult
=
switch_channel_get_variable
(
session
->
channel
,
"sdp_m_per_ptime"
);
if
(
mult
&&
switch_false
(
mult
))
{
if
(
switch_channel_test_flag
(
session
->
channel
,
CF_WEBRTC
)
||
(
mult
&&
switch_false
(
mult
)
))
{
char
*
bp
=
buf
;
int
both
=
1
;
int
both
=
switch_channel_test_flag
(
session
->
channel
,
CF_WEBRTC
)
?
0
:
1
;
if
((
!
zstr
(
local_audio_crypto_key
)
&&
switch_channel_test_flag
(
session
->
channel
,
CF_SECURE
)))
{
generate_m
(
session
,
buf
,
SDPBUFLEN
,
port
,
family
,
ip
,
0
,
append_audio
,
sr
,
use_cng
,
cng_type
,
map
,
verbose_sdp
,
1
);
...
...
@@ -4872,7 +4888,7 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
this_ptime
=
imp
->
microseconds_per_packet
/
1000
;
if
(
!
strcasecmp
(
imp
->
iananame
,
"ilbc"
))
{
if
(
!
strcasecmp
(
imp
->
iananame
,
"ilbc"
)
&&
!
strcasecmp
(
imp
->
iananame
,
"isac"
)
)
{
this_ptime
=
20
;
}
...
...
@@ -6319,7 +6335,7 @@ static void add_audio_codec(sdp_rtpmap_t *map, int ptime, char *buf, switch_size
}
if
(
zstr
(
map
->
rm_fmtp
))
{
if
(
!
strcasecmp
(
map
->
rm_encoding
,
"ilbc"
))
{
if
(
!
strcasecmp
(
map
->
rm_encoding
,
"ilbc"
)
||
!
strcasecmp
(
map
->
rm_encoding
,
"isac"
)
)
{
ptime
=
codec_ms
=
30
;
map_bit_rate
=
13330
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论