Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b694cb09
提交
b694cb09
authored
10月 16, 2013
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
google changed something in DTLS
上级
b474c897
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
101 行增加
和
12 行删除
+101
-12
switch_event.h
src/include/switch_event.h
+2
-1
switch_core_cert.c
src/switch_core_cert.c
+1
-0
switch_core_media.c
src/switch_core_media.c
+11
-7
switch_event.c
src/switch_event.c
+87
-4
没有找到文件。
src/include/switch_event.h
浏览文件 @
b694cb09
...
...
@@ -451,7 +451,8 @@ SWITCH_DECLARE(void) switch_live_array_unlock(switch_live_array_t *la);
SWITCH_DECLARE
(
void
)
switch_live_array_set_user_data
(
switch_live_array_t
*
la
,
void
*
user_data
);
SWITCH_DECLARE
(
void
)
switch_live_array_set_command_handler
(
switch_live_array_t
*
la
,
switch_live_array_command_handler_t
command_handler
);
SWITCH_DECLARE
(
void
)
switch_live_array_parse_json
(
cJSON
*
json
,
switch_event_channel_id_t
channel_id
);
SWITCH_DECLARE
(
switch_bool_t
)
switch_live_array_add_alias
(
switch_live_array_t
*
la
,
const
char
*
event_channel
,
const
char
*
name
);
SWITCH_DECLARE
(
switch_bool_t
)
switch_live_array_clear_alias
(
switch_live_array_t
*
la
,
const
char
*
event_channel
,
const
char
*
name
);
///\}
...
...
src/switch_core_cert.c
浏览文件 @
b694cb09
...
...
@@ -97,6 +97,7 @@ static const EVP_MD *get_evp_by_name(const char *name)
{
if
(
!
strcasecmp
(
name
,
"md5"
))
return
EVP_md5
();
if
(
!
strcasecmp
(
name
,
"sha1"
))
return
EVP_sha1
();
if
(
!
strcasecmp
(
name
,
"sha-1"
))
return
EVP_sha1
();
if
(
!
strcasecmp
(
name
,
"sha-256"
))
return
EVP_sha256
();
if
(
!
strcasecmp
(
name
,
"sha-512"
))
return
EVP_sha512
();
...
...
src/switch_core_media.c
浏览文件 @
b694cb09
...
...
@@ -2038,7 +2038,11 @@ static void generate_local_fingerprint(switch_media_handle_t *smh, switch_media_
switch_rtp_engine_t
*
engine
=
&
smh
->
engines
[
type
];
if
(
!
engine
->
local_dtls_fingerprint
.
len
)
{
if
(
engine
->
remote_dtls_fingerprint
.
type
)
{
engine
->
local_dtls_fingerprint
.
type
=
engine
->
remote_dtls_fingerprint
.
type
;
}
else
{
engine
->
local_dtls_fingerprint
.
type
=
"sha-256"
;
}
switch_core_cert_gen_fingerprint
(
DTLS_SRTP_FNAME
,
&
engine
->
local_dtls_fingerprint
);
}
}
...
...
@@ -2118,11 +2122,11 @@ static void check_ice(switch_media_handle_t *smh, switch_media_type_t type, sdp_
switch_set_string
(
engine
->
local_dtls_fingerprint
.
str
,
p
);
}
if
(
strcasecmp
(
engine
->
remote_dtls_fingerprint
.
type
,
"sha-256"
))
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
smh
->
session
),
SWITCH_LOG_WARNING
,
"Unsupported fingerprint type.
\n
"
);
engine
->
local_dtls_fingerprint
.
type
=
NULL
;
engine
->
remote_dtls_fingerprint
.
type
=
NULL
;
}
//
if (strcasecmp(engine->remote_dtls_fingerprint.type, "sha-256")) {
//
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(smh->session), SWITCH_LOG_WARNING, "Unsupported fingerprint type.\n");
//
engine->local_dtls_fingerprint.type = NULL;
//
engine->remote_dtls_fingerprint.type = NULL;
//
}
generate_local_fingerprint
(
smh
,
type
);
...
...
src/switch_event.c
浏览文件 @
b694cb09
...
...
@@ -2963,6 +2963,12 @@ SWITCH_DECLARE(switch_status_t) switch_event_channel_bind(const char *event_chan
return
status
;
}
typedef
struct
alias_node_s
{
char
*
event_channel
;
char
*
name
;
struct
alias_node_s
*
next
;
}
alias_node_t
;
typedef
struct
la_node_s
{
char
*
name
;
cJSON
*
obj
;
...
...
@@ -2986,8 +2992,31 @@ struct switch_live_array_s {
switch_event_channel_id_t
channel_id
;
switch_live_array_command_handler_t
command_handler
;
void
*
user_data
;
alias_node_t
*
aliases
;
};
static
switch_status_t
la_broadcast
(
switch_live_array_t
*
la
,
cJSON
**
json
)
{
alias_node_t
*
np
;
if
(
la
->
aliases
)
{
switch_mutex_lock
(
la
->
mutex
);
for
(
np
=
la
->
aliases
;
np
;
np
=
np
->
next
)
{
cJSON
*
dup
=
cJSON_Duplicate
(
*
json
,
1
);
cJSON
*
data
=
cJSON_GetObjectItem
(
dup
,
"data"
);
cJSON_ReplaceItemInObject
(
dup
,
"eventChannel"
,
cJSON_CreateString
(
np
->
event_channel
));
cJSON_ReplaceItemInObject
(
data
,
"name"
,
cJSON_CreateString
(
np
->
name
));
switch_event_channel_broadcast
(
np
->
event_channel
,
&
dup
,
__FILE__
,
la
->
channel_id
);
}
switch_mutex_unlock
(
la
->
mutex
);
}
return
switch_event_channel_broadcast
(
la
->
event_channel
,
json
,
__FILE__
,
la
->
channel_id
);
}
SWITCH_DECLARE
(
switch_status_t
)
switch_live_array_visible
(
switch_live_array_t
*
la
,
switch_bool_t
visible
,
switch_bool_t
force
)
{
...
...
@@ -3004,7 +3033,7 @@ SWITCH_DECLARE(switch_status_t) switch_live_array_visible(switch_live_array_t *l
cJSON_AddItemToObject
(
data
,
"action"
,
cJSON_CreateString
(
visible
?
"hide"
:
"show"
));
cJSON_AddItemToObject
(
data
,
"wireSerno"
,
cJSON_CreateNumber
(
la
->
serno
++
));
switch_event_channel_broadcast
(
la
->
event_channel
,
&
msg
,
__FILE__
,
la
->
channel_id
);
la_broadcast
(
la
,
&
msg
);
la
->
visible
=
visible
;
}
...
...
@@ -3030,7 +3059,7 @@ SWITCH_DECLARE(switch_status_t) switch_live_array_clear(switch_live_array_t *la)
cJSON_AddItemToObject
(
data
,
"wireSerno"
,
cJSON_CreateNumber
(
-
1
));
cJSON_AddItemToObject
(
data
,
"data"
,
cJSON_CreateObject
());
switch_event_channel_broadcast
(
la
->
event_channel
,
&
msg
,
__FILE__
,
la
->
channel_id
);
la_broadcast
(
la
,
&
msg
);
while
(
np
)
{
cur
=
np
;
...
...
@@ -3146,6 +3175,60 @@ SWITCH_DECLARE(switch_bool_t) switch_live_array_isnew(switch_live_array_t *la)
return
la
->
new
;
}
SWITCH_DECLARE
(
switch_bool_t
)
switch_live_array_clear_alias
(
switch_live_array_t
*
la
,
const
char
*
event_channel
,
const
char
*
name
)
{
alias_node_t
*
np
,
*
last
=
NULL
;
switch_bool_t
r
=
SWITCH_FALSE
;
switch_mutex_lock
(
la
->
mutex
);
for
(
np
=
la
->
aliases
;
np
;
np
=
np
->
next
)
{
if
(
!
strcmp
(
np
->
event_channel
,
event_channel
)
&&
!
strcmp
(
np
->
name
,
name
))
{
r
=
SWITCH_TRUE
;
if
(
last
)
{
last
->
next
=
np
->
next
;
}
else
{
la
->
aliases
=
np
->
next
;
}
}
else
{
last
=
np
;
}
}
switch_mutex_unlock
(
la
->
mutex
);
return
r
;
}
SWITCH_DECLARE
(
switch_bool_t
)
switch_live_array_add_alias
(
switch_live_array_t
*
la
,
const
char
*
event_channel
,
const
char
*
name
)
{
alias_node_t
*
node
,
*
np
;
switch_bool_t
exist
=
SWITCH_FALSE
;
switch_mutex_lock
(
la
->
mutex
);
for
(
np
=
la
->
aliases
;
np
&&
np
->
next
;
np
=
np
->
next
)
{
if
(
!
strcmp
(
np
->
event_channel
,
event_channel
)
&&
!
strcmp
(
np
->
name
,
name
))
{
exist
=
SWITCH_TRUE
;
break
;
}
}
if
(
!
exist
)
{
node
=
switch_core_alloc
(
la
->
pool
,
sizeof
(
*
node
));
node
->
event_channel
=
switch_core_strdup
(
la
->
pool
,
event_channel
);
node
->
name
=
switch_core_strdup
(
la
->
pool
,
name
);
if
(
np
)
{
np
->
next
=
node
;
}
else
{
la
->
aliases
=
node
;
}
}
switch_mutex_unlock
(
la
->
mutex
);
return
!
exist
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_live_array_create
(
const
char
*
event_channel
,
const
char
*
name
,
switch_event_channel_id_t
channel_id
,
switch_live_array_t
**
live_arrayP
)
{
...
...
@@ -3259,7 +3342,7 @@ SWITCH_DECLARE(switch_status_t) switch_live_array_del(switch_live_array_t *la, c
cJSON_AddItemToObject
(
data
,
"data"
,
cur
->
obj
);
cur
->
obj
=
NULL
;
switch_event_channel_broadcast
(
la
->
event_channel
,
&
msg
,
__FILE__
,
la
->
channel_id
);
la_broadcast
(
la
,
&
msg
);
free
(
cur
->
name
);
free
(
cur
);
}
else
{
...
...
@@ -3360,7 +3443,7 @@ SWITCH_DECLARE(switch_status_t) switch_live_array_add(switch_live_array_t *la, c
cJSON_AddItemToObject
(
data
,
"wireSerno"
,
cJSON_CreateNumber
(
la
->
serno
++
));
cJSON_AddItemToObject
(
data
,
"data"
,
cJSON_Duplicate
(
node
->
obj
,
1
));
switch_event_channel_broadcast
(
la
->
event_channel
,
&
msg
,
__FILE__
,
la
->
channel_id
);
la_broadcast
(
la
,
&
msg
);
switch_mutex_unlock
(
la
->
mutex
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论