Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1c120dd2
提交
1c120dd2
authored
1月 16, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
not too shabby audio and vid work both directions but browswer hates our srtcp ...
上级
1db0e26e
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
261 行增加
和
106 行删除
+261
-106
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+12
-5
sofia_glue.c
src/mod/endpoints/mod_sofia/sofia_glue.c
+1
-1
switch_core_media.c
src/switch_core_media.c
+234
-82
switch_rtp.c
src/switch_rtp.c
+14
-18
没有找到文件。
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
1c120dd2
...
@@ -93,10 +93,6 @@ static switch_status_t sofia_on_init(switch_core_session_t *session)
...
@@ -93,10 +93,6 @@ static switch_status_t sofia_on_init(switch_core_session_t *session)
}
}
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_OUTBOUND
)
||
switch_channel_test_flag
(
tech_pvt
->
channel
,
CF_RECOVERING
))
{
if
(
sofia_test_flag
(
tech_pvt
,
TFLAG_OUTBOUND
)
||
switch_channel_test_flag
(
tech_pvt
->
channel
,
CF_RECOVERING
))
{
switch_core_session_check_outgoing_crypto
(
session
,
SOFIA_SECURE_MEDIA_VARIABLE
);
if
(
sofia_glue_do_invite
(
session
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
sofia_glue_do_invite
(
session
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
switch_channel_hangup
(
channel
,
SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER
);
assert
(
switch_channel_get_state
(
channel
)
!=
CS_INIT
);
assert
(
switch_channel_get_state
(
channel
)
!=
CS_INIT
);
...
@@ -1250,7 +1246,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -1250,7 +1246,8 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
}
}
if
((
var
=
switch_channel_get_variable
(
channel
,
SOFIA_SECURE_MEDIA_VARIABLE
))
&&
if
(((
var
=
switch_channel_get_variable
(
channel
,
SOFIA_SECURE_MEDIA_VARIABLE
))
||
(
var
=
switch_channel_get_variable
(
channel
,
"rtp_secure_media"
)))
&&
(
switch_true
(
var
)
||
!
strcasecmp
(
var
,
SWITCH_RTP_CRYPTO_KEY_32
)
||
!
strcasecmp
(
var
,
SWITCH_RTP_CRYPTO_KEY_80
)))
{
(
switch_true
(
var
)
||
!
strcasecmp
(
var
,
SWITCH_RTP_CRYPTO_KEY_32
)
||
!
strcasecmp
(
var
,
SWITCH_RTP_CRYPTO_KEY_80
)))
{
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_SECURE
);
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_SECURE
);
}
}
...
@@ -4135,6 +4132,16 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
...
@@ -4135,6 +4132,16 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
tech_pvt
->
dest_to
=
tech_pvt
->
dest
;
tech_pvt
->
dest_to
=
tech_pvt
->
dest
;
}
}
if
((
hval
=
switch_event_get_header
(
var_event
,
"media_webrtc"
))
&&
switch_true
(
hval
))
{
switch_channel_set_variable
(
nchannel
,
"rtp_secure_media"
,
SWITCH_RTP_CRYPTO_KEY_80
);
}
if
((
hval
=
switch_event_get_header
(
var_event
,
SOFIA_SECURE_MEDIA_VARIABLE
))
||
(
hval
=
switch_event_get_header
(
var_event
,
"rtp_secure_media"
)))
{
switch_channel_set_variable
(
nchannel
,
"rtp_secure_media"
,
hval
);
}
sofia_glue_attach_private
(
nsession
,
profile
,
tech_pvt
,
dest
);
sofia_glue_attach_private
(
nsession
,
profile
,
tech_pvt
,
dest
);
if
(
tech_pvt
->
local_url
)
{
if
(
tech_pvt
->
local_url
)
{
...
...
src/mod/endpoints/mod_sofia/sofia_glue.c
浏览文件 @
1c120dd2
...
@@ -77,7 +77,7 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
...
@@ -77,7 +77,7 @@ void sofia_glue_attach_private(switch_core_session_t *session, sofia_profile_t *
switch_assert
(
session
!=
NULL
);
switch_assert
(
session
!=
NULL
);
switch_assert
(
profile
!=
NULL
);
switch_assert
(
profile
!=
NULL
);
switch_assert
(
tech_pvt
!=
NULL
);
switch_assert
(
tech_pvt
!=
NULL
);
switch_core_session_add_stream
(
session
,
NULL
);
switch_core_session_add_stream
(
session
,
NULL
);
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
switch_mutex_lock
(
tech_pvt
->
flag_mutex
);
...
...
src/switch_core_media.c
浏览文件 @
1c120dd2
差异被折叠。
点击展开。
src/switch_rtp.c
浏览文件 @
1c120dd2
...
@@ -672,7 +672,6 @@ static switch_status_t ice_out(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice)
...
@@ -672,7 +672,6 @@ static switch_status_t ice_out(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice)
if
((
ice
->
type
&
ICE_VANILLA
))
{
if
((
ice
->
type
&
ICE_VANILLA
))
{
char
sw
[
128
]
=
""
;
char
sw
[
128
]
=
""
;
//switch_stun_packet_attribute_add_use_candidate(packet);
switch_stun_packet_attribute_add_priority
(
packet
,
ice
->
priority
);
switch_stun_packet_attribute_add_priority
(
packet
,
ice
->
priority
);
...
@@ -683,12 +682,11 @@ static switch_status_t ice_out(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice)
...
@@ -683,12 +682,11 @@ static switch_status_t ice_out(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice)
switch_stun_packet_attribute_add_controlled
(
packet
);
switch_stun_packet_attribute_add_controlled
(
packet
);
}
else
{
}
else
{
switch_stun_packet_attribute_add_controlling
(
packet
);
switch_stun_packet_attribute_add_controlling
(
packet
);
switch_stun_packet_attribute_add_use_candidate
(
packet
);
}
}
switch_stun_packet_attribute_add_integrity
(
packet
,
ice
->
rpass
);
switch_stun_packet_attribute_add_integrity
(
packet
,
ice
->
rpass
);
switch_stun_packet_attribute_add_fingerprint
(
packet
);
switch_stun_packet_attribute_add_fingerprint
(
packet
);
}
}
...
@@ -804,7 +802,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
...
@@ -804,7 +802,7 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
ok
=
!
strcmp
(
ice
->
user_ice
,
username
);
ok
=
!
strcmp
(
ice
->
user_ice
,
username
);
}
}
//printf("ICE %s %s ok:%d %d %d\n", rtp_type(rtp_session), ice == &rtp_session->rtcp_ice ? "rtcp" : "rtp", ok, rtp_session->ice.ready, rtp_session->ice.rready);
//printf("
XXX
ICE %s %s ok:%d %d %d\n", rtp_type(rtp_session), ice == &rtp_session->rtcp_ice ? "rtcp" : "rtp", ok, rtp_session->ice.ready, rtp_session->ice.rready);
if
((
packet
->
header
.
type
==
SWITCH_STUN_BINDING_REQUEST
)
&&
ok
)
{
if
((
packet
->
header
.
type
==
SWITCH_STUN_BINDING_REQUEST
)
&&
ok
)
{
uint8_t
stunbuf
[
512
];
uint8_t
stunbuf
[
512
];
...
@@ -834,13 +832,6 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
...
@@ -834,13 +832,6 @@ static void handle_ice(switch_rtp_t *rtp_session, switch_rtp_ice_t *ice, void *d
switch_stun_packet_attribute_add_binded_address
(
rpacket
,
(
char
*
)
remote_ip
,
switch_sockaddr_get_port
(
from_addr
));
switch_stun_packet_attribute_add_binded_address
(
rpacket
,
(
char
*
)
remote_ip
,
switch_sockaddr_get_port
(
from_addr
));
if
((
ice
->
type
&
ICE_VANILLA
))
{
if
((
ice
->
type
&
ICE_VANILLA
))
{
//if (!(ice->type && ICE_CONTROLLED)) {
// switch_stun_packet_attribute_add_use_candidate(rpacket);
// switch_stun_packet_attribute_add_priority(rpacket, ice->priority);
//}
switch_stun_packet_attribute_add_integrity
(
rpacket
,
ice
->
pass
);
switch_stun_packet_attribute_add_integrity
(
rpacket
,
ice
->
pass
);
switch_stun_packet_attribute_add_fingerprint
(
rpacket
);
switch_stun_packet_attribute_add_fingerprint
(
rpacket
);
...
@@ -1859,7 +1850,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
...
@@ -1859,7 +1850,8 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
break
;
break
;
case
AES_CM_128_HMAC_SHA1_32
:
case
AES_CM_128_HMAC_SHA1_32
:
crypto_policy_set_aes_cm_128_hmac_sha1_32
(
&
policy
->
rtp
);
crypto_policy_set_aes_cm_128_hmac_sha1_32
(
&
policy
->
rtp
);
crypto_policy_set_aes_cm_128_hmac_sha1_32
(
&
policy
->
rtcp
);
crypto_policy_set_aes_cm_128_hmac_sha1_80
(
&
policy
->
rtcp
);
if
(
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_OUTBOUND
)
{
if
(
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_OUTBOUND
)
{
switch_channel_set_variable
(
channel
,
"sip_has_crypto"
,
"AES_CM_128_HMAC_SHA1_32"
);
switch_channel_set_variable
(
channel
,
"sip_has_crypto"
,
"AES_CM_128_HMAC_SHA1_32"
);
...
@@ -1877,12 +1869,12 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
...
@@ -1877,12 +1869,12 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_add_crypto_key(switch_rtp_t *rtp_sess
break
;
break
;
}
}
policy
->
next
=
NULL
;
policy
->
key
=
(
uint8_t
*
)
crypto_key
->
key
;
policy
->
key
=
(
uint8_t
*
)
crypto_key
->
key
;
policy
->
next
=
NULL
;
policy
->
rtp
.
sec_serv
=
sec_serv_conf_and_auth
;
//policy->rtp.sec_serv = sec_serv_conf_and_auth;
policy
->
rtcp
.
sec_serv
=
sec_serv_conf_and_auth
;
//policy->rtcp.sec_serv = sec_serv_conf_and_auth;
switch
(
direction
)
{
switch
(
direction
)
{
case
SWITCH_RTP_CRYPTO_RECV
:
case
SWITCH_RTP_CRYPTO_RECV
:
...
@@ -3581,6 +3573,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
...
@@ -3581,6 +3573,8 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
}
}
}
}
if
(
poll_status
==
SWITCH_STATUS_SUCCESS
)
{
if
(
poll_status
==
SWITCH_STATUS_SUCCESS
)
{
if
(
read_pretriggered
)
{
if
(
read_pretriggered
)
{
read_pretriggered
=
0
;
read_pretriggered
=
0
;
...
@@ -3738,6 +3732,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
...
@@ -3738,6 +3732,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
}
}
if
(
bytes
&&
rtp_session
->
recv_msg
.
header
.
version
==
2
&&
if
(
bytes
&&
rtp_session
->
recv_msg
.
header
.
version
==
2
&&
!
rtp_session
->
flags
[
SWITCH_RTP_FLAG_PROXY_MEDIA
]
&&
!
rtp_session
->
flags
[
SWITCH_RTP_FLAG_UDPTL
]
&&
!
rtp_session
->
flags
[
SWITCH_RTP_FLAG_PROXY_MEDIA
]
&&
!
rtp_session
->
flags
[
SWITCH_RTP_FLAG_UDPTL
]
&&
rtp_session
->
recv_msg
.
header
.
pt
!=
13
&&
rtp_session
->
recv_msg
.
header
.
pt
!=
13
&&
...
@@ -3745,6 +3740,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
...
@@ -3745,6 +3740,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
(
!
rtp_session
->
cng_pt
||
rtp_session
->
recv_msg
.
header
.
pt
!=
rtp_session
->
cng_pt
)
&&
(
!
rtp_session
->
cng_pt
||
rtp_session
->
recv_msg
.
header
.
pt
!=
rtp_session
->
cng_pt
)
&&
rtp_session
->
recv_msg
.
header
.
pt
!=
rtp_session
->
rpayload
&&
!
(
rtp_session
->
rtp_bugs
&
RTP_BUG_ACCEPT_ANY_PACKETS
))
{
rtp_session
->
recv_msg
.
header
.
pt
!=
rtp_session
->
rpayload
&&
!
(
rtp_session
->
rtp_bugs
&
RTP_BUG_ACCEPT_ANY_PACKETS
))
{
/* drop frames of incorrect payload number and return CNG frame instead */
/* drop frames of incorrect payload number and return CNG frame instead */
return_cng_frame
();
return_cng_frame
();
}
}
...
@@ -4015,7 +4011,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
...
@@ -4015,7 +4011,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
return_cng_frame
();
return_cng_frame
();
}
}
}
}
if
(
status
==
SWITCH_STATUS_BREAK
||
bytes
==
0
)
{
if
(
status
==
SWITCH_STATUS_BREAK
||
bytes
==
0
)
{
if
(
!
(
io_flags
&
SWITCH_IO_FLAG_SINGLE_READ
)
&&
rtp_session
->
flags
[
SWITCH_RTP_FLAG_DATAWAIT
])
{
if
(
!
(
io_flags
&
SWITCH_IO_FLAG_SINGLE_READ
)
&&
rtp_session
->
flags
[
SWITCH_RTP_FLAG_DATAWAIT
])
{
goto
do_continue
;
goto
do_continue
;
...
@@ -4556,7 +4552,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
...
@@ -4556,7 +4552,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
if
(
rtp_session
->
ice
.
ice_user
&&
!
(
rtp_session
->
ice
.
rready
))
{
if
(
rtp_session
->
ice
.
ice_user
&&
!
(
rtp_session
->
ice
.
rready
))
{
send
=
0
;
send
=
0
;
//printf("skip no stun love %d/%d\n", rtp_session->ice.ready, rtp_session->ice.rready);
//printf("
XXX
skip no stun love %d/%d\n", rtp_session->ice.ready, rtp_session->ice.rready);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论