Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5646957c
提交
5646957c
authored
2月 25, 2014
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-5937
上级
514bbd38
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
214 行增加
和
197 行删除
+214
-197
switch_core_media.h
src/include/switch_core_media.h
+6
-46
switch_frame.h
src/include/switch_frame.h
+0
-1
switch_rtp.h
src/include/switch_rtp.h
+11
-17
switch_types.h
src/include/switch_types.h
+61
-0
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+4
-0
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+1
-1
switch_channel.c
src/switch_channel.c
+0
-19
switch_core_media.c
src/switch_core_media.c
+131
-112
switch_rtp.c
src/switch_rtp.c
+0
-1
没有找到文件。
src/include/switch_core_media.h
浏览文件 @
5646957c
...
@@ -39,17 +39,6 @@ SWITCH_BEGIN_EXTERN_C
...
@@ -39,17 +39,6 @@ SWITCH_BEGIN_EXTERN_C
#define SWITCH_MAX_CAND_ACL 25
#define SWITCH_MAX_CAND_ACL 25
typedef
enum
{
SDP_TYPE_REQUEST
,
SDP_TYPE_RESPONSE
}
switch_sdp_type_t
;
typedef
enum
{
ICE_GOOGLE_JINGLE
=
(
1
<<
0
),
ICE_VANILLA
=
(
1
<<
1
),
ICE_CONTROLLED
=
(
1
<<
2
)
}
switch_core_media_ice_type_t
;
typedef
enum
{
typedef
enum
{
DTMF_2833
,
DTMF_2833
,
DTMF_INFO
,
DTMF_INFO
,
...
@@ -157,41 +146,6 @@ typedef struct switch_core_media_params_s {
...
@@ -157,41 +146,6 @@ typedef struct switch_core_media_params_s {
}
switch_core_media_params_t
;
}
switch_core_media_params_t
;
typedef
struct
payload_map_s
{
switch_media_type_t
type
;
switch_sdp_type_t
sdp_type
;
uint32_t
ptime
;
uint32_t
rate
;
uint8_t
allocated
;
uint8_t
negotiated
;
uint8_t
current
;
unsigned
long
hash
;
char
*
rm_encoding
;
char
*
iananame
;
switch_payload_t
pt
;
unsigned
long
rm_rate
;
unsigned
long
adv_rm_rate
;
uint32_t
codec_ms
;
uint32_t
bitrate
;
char
*
rm_fmtp
;
switch_payload_t
agreed_pt
;
switch_payload_t
recv_pt
;
char
*
fmtp_out
;
char
*
remote_sdp_ip
;
switch_port_t
remote_sdp_port
;
int
channels
;
int
adv_channels
;
struct
payload_map_s
*
next
;
}
payload_map_t
;
static
inline
const
char
*
switch_media_type2str
(
switch_media_type_t
type
)
static
inline
const
char
*
switch_media_type2str
(
switch_media_type_t
type
)
{
{
switch
(
type
)
{
switch
(
type
)
{
...
@@ -311,6 +265,12 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
...
@@ -311,6 +265,12 @@ SWITCH_DECLARE(payload_map_t *) switch_core_media_add_payload_map(switch_core_se
uint32_t
ptime
,
uint32_t
ptime
,
uint8_t
negotiated
);
uint8_t
negotiated
);
SWITCH_DECLARE
(
switch_rtp_crypto_key_type_t
)
switch_core_media_crypto_str2type
(
const
char
*
str
);
SWITCH_DECLARE
(
const
char
*
)
switch_core_media_crypto_type2str
(
switch_rtp_crypto_key_type_t
type
);
SWITCH_DECLARE
(
int
)
switch_core_media_crypto_keylen
(
switch_rtp_crypto_key_type_t
type
);
SWITCH_END_EXTERN_C
SWITCH_END_EXTERN_C
#endif
#endif
/* For Emacs:
/* For Emacs:
...
...
src/include/switch_frame.h
浏览文件 @
5646957c
...
@@ -37,7 +37,6 @@
...
@@ -37,7 +37,6 @@
#define SWITCH_FRAME_H
#define SWITCH_FRAME_H
#include <switch.h>
#include <switch.h>
#include <switch_core_media.h>
SWITCH_BEGIN_EXTERN_C
SWITCH_BEGIN_EXTERN_C
/*! \brief An abstraction of a data frame */
/*! \brief An abstraction of a data frame */
...
...
src/include/switch_rtp.h
浏览文件 @
5646957c
...
@@ -41,18 +41,16 @@
...
@@ -41,18 +41,16 @@
SWITCH_BEGIN_EXTERN_C
SWITCH_BEGIN_EXTERN_C
#include <switch_core_media.h>
#define SWITCH_RTP_MAX_BUF_LEN 16384
#define SWITCH_RTP_MAX_BUF_LEN 16384
#define SWITCH_RTCP_MAX_BUF_LEN 16384
#define SWITCH_RTCP_MAX_BUF_LEN 16384
#define SWITCH_RTP_MAX_BUF_LEN_WORDS 4094
/* (max / 4) - 2 */
#define SWITCH_RTP_MAX_BUF_LEN_WORDS 4094
/* (max / 4) - 2 */
#define SWITCH_RTP_MAX_CRYPTO_LEN 64
#define SWITCH_RTP_MAX_CRYPTO_LEN 64
#define SWITCH_RTP_KEY_LEN 30
//
#define SWITCH_RTP_KEY_LEN 30
#define SWITCH_RTP_CRYPTO_KEY_32 "AES_CM_128_HMAC_SHA1_32"
//
#define SWITCH_RTP_CRYPTO_KEY_32 "AES_CM_128_HMAC_SHA1_32"
#define SWITCH_RTP_CRYPTO_KEY_80 "AES_CM_128_HMAC_SHA1_80"
#define SWITCH_RTP_CRYPTO_KEY_80 "AES_CM_128_HMAC_SHA1_80"
#define SWITCH_RTP_CRYPTO_KEY_128_8 "AEAD_AES_128_GCM_8"
#define SWITCH_RTP_CRYPTO_KEY_256_8 "AEAD_AES_256_GCM_8"
typedef
enum
{
typedef
enum
{
SWITCH_RTP_CRYPTO_SEND
,
SWITCH_RTP_CRYPTO_SEND
,
SWITCH_RTP_CRYPTO_RECV
,
SWITCH_RTP_CRYPTO_RECV
,
SWITCH_RTP_CRYPTO_SEND_RTCP
,
SWITCH_RTP_CRYPTO_SEND_RTCP
,
...
@@ -60,16 +58,12 @@ SWITCH_BEGIN_EXTERN_C
...
@@ -60,16 +58,12 @@ SWITCH_BEGIN_EXTERN_C
SWITCH_RTP_CRYPTO_MAX
SWITCH_RTP_CRYPTO_MAX
}
switch_rtp_crypto_direction_t
;
}
switch_rtp_crypto_direction_t
;
typedef
enum
{
typedef
struct
switch_srtp_crypto_suite_s
{
NO_CRYPTO
,
char
*
name
;
AES_CM_128_HMAC_SHA1_80
,
switch_rtp_crypto_key_type_t
type
;
AES_CM_128_HMAC_SHA1_32
,
int
keylen
;
AES_CM_256_HMAC_SHA1_80
,
}
switch_srtp_crypto_suite_t
;
AES_CM_192_HMAC_SHA1_80
,
AEAD_AES_256_GCM_8
,
AEAD_AES_128_GCM_8
,
AES_CM_128_NULL_AUTH
}
switch_rtp_crypto_key_type_t
;
struct
switch_rtp_crypto_key
{
struct
switch_rtp_crypto_key
{
uint32_t
index
;
uint32_t
index
;
...
...
src/include/switch_types.h
浏览文件 @
5646957c
...
@@ -2312,6 +2312,67 @@ typedef void (*switch_event_channel_func_t)(const char *event_channel, cJSON *js
...
@@ -2312,6 +2312,67 @@ typedef void (*switch_event_channel_func_t)(const char *event_channel, cJSON *js
struct
switch_live_array_s
;
struct
switch_live_array_s
;
typedef
struct
switch_live_array_s
switch_live_array_t
;
typedef
struct
switch_live_array_s
switch_live_array_t
;
typedef
enum
{
SDP_TYPE_REQUEST
,
SDP_TYPE_RESPONSE
}
switch_sdp_type_t
;
typedef
enum
{
AEAD_AES_256_GCM_8
,
AEAD_AES_128_GCM_8
,
AES_CM_256_HMAC_SHA1_80
,
AES_CM_192_HMAC_SHA1_80
,
AES_CM_128_HMAC_SHA1_80
,
AES_CM_256_HMAC_SHA1_32
,
AES_CM_192_HMAC_SHA1_32
,
AES_CM_128_HMAC_SHA1_32
,
AES_CM_128_NULL_AUTH
,
NO_CRYPTO
,
CRYPTO_INVALID
}
switch_rtp_crypto_key_type_t
;
typedef
struct
payload_map_s
{
switch_media_type_t
type
;
switch_sdp_type_t
sdp_type
;
uint32_t
ptime
;
uint32_t
rate
;
uint8_t
allocated
;
uint8_t
negotiated
;
uint8_t
current
;
unsigned
long
hash
;
char
*
rm_encoding
;
char
*
iananame
;
switch_payload_t
pt
;
unsigned
long
rm_rate
;
unsigned
long
adv_rm_rate
;
uint32_t
codec_ms
;
uint32_t
bitrate
;
char
*
rm_fmtp
;
switch_payload_t
agreed_pt
;
switch_payload_t
recv_pt
;
char
*
fmtp_out
;
char
*
remote_sdp_ip
;
switch_port_t
remote_sdp_port
;
int
channels
;
int
adv_channels
;
struct
payload_map_s
*
next
;
}
payload_map_t
;
typedef
enum
{
ICE_GOOGLE_JINGLE
=
(
1
<<
0
),
ICE_VANILLA
=
(
1
<<
1
),
ICE_CONTROLLED
=
(
1
<<
2
)
}
switch_core_media_ice_type_t
;
SWITCH_END_EXTERN_C
SWITCH_END_EXTERN_C
...
...
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
5646957c
...
@@ -33,6 +33,10 @@
...
@@ -33,6 +33,10 @@
#include <switch_stun.h>
#include <switch_stun.h>
#include <libdingaling.h>
#include <libdingaling.h>
#define SWITCH_RTP_KEY_LEN 30
#define SWITCH_RTP_CRYPTO_KEY_32 "AES_CM_128_HMAC_SHA1_32"
#define SWITCH_RTP_CRYPTO_KEY_80 "AES_CM_128_HMAC_SHA1_80"
#define MDL_RTCP_DUR 5000
#define MDL_RTCP_DUR 5000
#define DL_CAND_WAIT 10000000
#define DL_CAND_WAIT 10000000
#define DL_CAND_INITIAL_WAIT 2000000
#define DL_CAND_INITIAL_WAIT 2000000
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
5646957c
...
@@ -1220,7 +1220,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
...
@@ -1220,7 +1220,7 @@ 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"
)))
&&
(
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
)
||
switch_core_media_crypto_str2type
(
var
)
!=
CRYPTO_INVALID
))
{
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_SECURE
);
switch_channel_set_flag
(
tech_pvt
->
channel
,
CF_SECURE
);
}
}
...
...
src/switch_channel.c
浏览文件 @
5646957c
...
@@ -3331,21 +3331,6 @@ SWITCH_DECLARE(void) switch_channel_check_zrtp(switch_channel_t *channel)
...
@@ -3331,21 +3331,6 @@ SWITCH_DECLARE(void) switch_channel_check_zrtp(switch_channel_t *channel)
}
}
}
}
static
void
check_secure
(
switch_channel_t
*
channel
)
{
const
char
*
var
,
*
sec
;
if
(
!
switch_channel_media_ready
(
channel
)
&&
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_INBOUND
)
{
if
((
sec
=
switch_channel_get_variable
(
channel
,
"rtp_secure_media"
))
&&
switch_true
(
sec
))
{
if
(
!
(
var
=
switch_channel_get_variable
(
channel
,
"rtp_has_crypto"
)))
{
switch_log_printf
(
SWITCH_CHANNEL_CHANNEL_LOG
(
channel
),
SWITCH_LOG_WARNING
,
"rtp_secure_media invalid in this context.
\n
"
);
switch_channel_set_variable
(
channel
,
"rtp_secure_media"
,
NULL
);
}
}
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_perform_mark_pre_answered
(
switch_channel_t
*
channel
,
const
char
*
file
,
const
char
*
func
,
int
line
)
SWITCH_DECLARE
(
switch_status_t
)
switch_channel_perform_mark_pre_answered
(
switch_channel_t
*
channel
,
const
char
*
file
,
const
char
*
func
,
int
line
)
{
{
switch_event_t
*
event
;
switch_event_t
*
event
;
...
@@ -3433,8 +3418,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
...
@@ -3433,8 +3418,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_pre_answer(switch_channel
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
check_secure
(
channel
);
if
(
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_INBOUND
)
{
if
(
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_INBOUND
)
{
msg
.
message_id
=
SWITCH_MESSAGE_INDICATE_PROGRESS
;
msg
.
message_id
=
SWITCH_MESSAGE_INDICATE_PROGRESS
;
msg
.
from
=
channel
->
name
;
msg
.
from
=
channel
->
name
;
...
@@ -3720,8 +3703,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
...
@@ -3720,8 +3703,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_answer(switch_channel_t *
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
check_secure
(
channel
);
msg
.
message_id
=
SWITCH_MESSAGE_INDICATE_ANSWER
;
msg
.
message_id
=
SWITCH_MESSAGE_INDICATE_ANSWER
;
msg
.
from
=
channel
->
name
;
msg
.
from
=
channel
->
name
;
status
=
switch_core_session_perform_receive_message
(
channel
->
session
,
&
msg
,
file
,
func
,
line
);
status
=
switch_core_session_perform_receive_message
(
channel
->
session
,
&
msg
,
file
,
func
,
line
);
...
...
src/switch_core_media.c
浏览文件 @
5646957c
差异被折叠。
点击展开。
src/switch_rtp.c
浏览文件 @
5646957c
...
@@ -2731,7 +2731,6 @@ static int do_dtls(switch_rtp_t *rtp_session, switch_dtls_t *dtls)
...
@@ -2731,7 +2731,6 @@ static int do_dtls(switch_rtp_t *rtp_session, switch_dtls_t *dtls)
if
(
!
dtls
->
bytes
&&
!
ready
)
{
if
(
!
dtls
->
bytes
&&
!
ready
)
{
printf
(
"SKIP
\n
"
);
return
0
;
return
0
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论