Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1d6d9601
提交
1d6d9601
authored
1月 12, 2011
作者:
Moises Silva
浏览文件
操作
浏览文件
下载
差异文件
Merge remote branch 'fsorig/master'
上级
771caca7
eb88304a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
36 行增加
和
24 行删除
+36
-24
esl.c
libs/esl/src/esl.c
+1
-1
switch_types.h
src/include/switch_types.h
+2
-1
switch_utils.h
src/include/switch_utils.h
+1
-1
switch_rtp.c
src/switch_rtp.c
+32
-21
没有找到文件。
libs/esl/src/esl.c
浏览文件 @
1d6d9601
...
...
@@ -1094,9 +1094,9 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_
esl_log
(
ESL_LOG_DEBUG
,
"RECV INNER HEADER [%s] = [%s]
\n
"
,
hname
,
hval
);
if
(
!
strcasecmp
(
hname
,
"event-name"
))
{
esl_event_del_header
(
handle
->
last_ievent
,
"event-name"
);
esl_name_event
(
hval
,
&
handle
->
last_ievent
->
event_id
);
}
esl_event_add_header_string
(
handle
->
last_ievent
,
ESL_STACK_BOTTOM
,
hname
,
hval
);
esl_name_event
(
hval
,
&
handle
->
last_ievent
->
event_id
);
}
beg
=
c
+
1
;
...
...
src/include/switch_types.h
浏览文件 @
1d6d9601
...
...
@@ -859,7 +859,7 @@ typedef enum {
SWITCH_STATUS_FALSE
,
SWITCH_STATUS_TIMEOUT
,
SWITCH_STATUS_RESTART
,
SWITCH_STATUS_
TERM
,
SWITCH_STATUS_
INTR
,
SWITCH_STATUS_NOTIMPL
,
SWITCH_STATUS_MEMERR
,
SWITCH_STATUS_NOOP
,
...
...
@@ -876,6 +876,7 @@ typedef enum {
SWITCH_STATUS_TOO_SMALL
,
SWITCH_STATUS_FOUND
,
SWITCH_STATUS_CONTINUE
,
SWITCH_STATUS_TERM
,
SWITCH_STATUS_NOT_INITALIZED
}
switch_status_t
;
...
...
src/include/switch_utils.h
浏览文件 @
1d6d9601
...
...
@@ -327,7 +327,7 @@ SWITCH_DECLARE(unsigned short) get_port(struct sockaddr *sa);
*/
SWITCH_DECLARE
(
int
)
switch_build_uri
(
char
*
uri
,
switch_size_t
size
,
const
char
*
scheme
,
const
char
*
user
,
const
switch_sockaddr_t
*
sa
,
int
flags
);
#define SWITCH_STATUS_IS_BREAK(x) (x == SWITCH_STATUS_BREAK || x == 730035 || x == 35)
#define SWITCH_STATUS_IS_BREAK(x) (x == SWITCH_STATUS_BREAK || x == 730035 || x == 35
|| x == SWITCH_STATUS_INTR
)
/*!
\brief Return a printable name of a switch_priority_t
...
...
src/switch_rtp.c
浏览文件 @
1d6d9601
...
...
@@ -2440,6 +2440,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
recvfrom
:
bytes
=
0
;
read_loops
++
;
poll_loop
=
0
;
if
(
!
switch_rtp_ready
(
rtp_session
))
{
break
;
...
...
@@ -2466,21 +2467,27 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
status
=
read_rtp_packet
(
rtp_session
,
&
bytes
,
flags
);
}
else
{
if
(
!
SWITCH_STATUS_IS_BREAK
(
poll_status
)
&&
poll_status
!=
SWITCH_STATUS_TIMEOUT
)
{
char
tmp
[
128
]
=
""
;
strerror_r
(
poll_status
,
tmp
,
sizeof
(
tmp
));
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Poll failed with error: %d [%s]
\n
"
,
poll_status
,
tmp
);
ret
=
-
1
;
goto
end
;
}
poll_loop
=
1
;
rtp_session
->
missed_count
+=
(
poll_sec
*
1000
)
/
(
rtp_session
->
ms_per_packet
?
rtp_session
->
ms_per_packet
/
1000
:
20
);
bytes
=
0
;
if
(
rtp_session
->
max_missed_packets
)
{
if
(
rtp_session
->
missed_count
>=
rtp_session
->
max_missed_packets
)
{
ret
=
-
2
;
goto
end
;
if
(
!
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_UDPTL
))
{
rtp_session
->
missed_count
+=
(
poll_sec
*
1000
)
/
(
rtp_session
->
ms_per_packet
?
rtp_session
->
ms_per_packet
/
1000
:
20
);
bytes
=
0
;
if
(
rtp_session
->
max_missed_packets
)
{
if
(
rtp_session
->
missed_count
>=
rtp_session
->
max_missed_packets
)
{
ret
=
-
2
;
goto
end
;
}
}
}
if
((
!
(
io_flags
&
SWITCH_IO_FLAG_NOBLOCK
))
&&
(
rtp_session
->
dtmf_data
.
out_digit_dur
==
0
||
switch_test_flag
(
rtp_session
,
SWITCH_RTP_FLAG_VIDEO
)))
{
return_cng_frame
();
...
...
@@ -3254,21 +3261,25 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp
switch_rtp_t
*
other_rtp_session
=
switch_channel_get_private
(
other_channel
,
"__zrtp_audio_rtp_session"
);
if
(
other_rtp_session
)
{
if
(
zrtp_status_ok
==
zrtp_session_get
(
other_rtp_session
->
zrtp_session
,
&
zrtp_session_info
))
{
if
(
rtp_session
->
zrtp_mitm_tries
>
ZRTP_MITM_TRIES
)
{
switch_clear_flag
(
other_rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV
);
switch_clear_flag
(
other_rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_SEND
);
switch_clear_flag
(
rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV
);
switch_clear_flag
(
rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_SEND
);
}
else
if
(
zrtp_status_ok
==
zrtp_resolve_mitm_call
(
other_rtp_session
->
zrtp_stream
,
rtp_session
->
zrtp_stream
))
{
switch_clear_flag
(
rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV
);
switch_clear_flag
(
rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_SEND
);
switch_clear_flag
(
other_rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV
);
switch_clear_flag
(
other_rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_SEND
);
zrtp_verified_set
(
zrtp_global
,
&
rtp_session
->
zrtp_session
->
zid
,
&
rtp_session
->
zrtp_session
->
peer_zid
,
zrtp_session_info
.
sas_is_verified
^
1
);
rtp_session
->
zrtp_mitm_tries
++
;
if
(
switch_channel_direction
(
channel
)
==
SWITCH_CALL_DIRECTION_INBOUND
)
{
switch_mutex_lock
(
other_rtp_session
->
read_mutex
);
if
(
zrtp_status_ok
==
zrtp_session_get
(
other_rtp_session
->
zrtp_session
,
&
zrtp_session_info
))
{
if
(
rtp_session
->
zrtp_mitm_tries
>
ZRTP_MITM_TRIES
)
{
switch_clear_flag
(
other_rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV
);
switch_clear_flag
(
other_rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_SEND
);
switch_clear_flag
(
rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV
);
switch_clear_flag
(
rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_SEND
);
}
else
if
(
zrtp_status_ok
==
zrtp_resolve_mitm_call
(
other_rtp_session
->
zrtp_stream
,
rtp_session
->
zrtp_stream
))
{
switch_clear_flag
(
rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV
);
switch_clear_flag
(
rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_SEND
);
switch_clear_flag
(
other_rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_RECV
);
switch_clear_flag
(
other_rtp_session
,
SWITCH_ZRTP_FLAG_SECURE_MITM_SEND
);
zrtp_verified_set
(
zrtp_global
,
&
rtp_session
->
zrtp_session
->
zid
,
&
rtp_session
->
zrtp_session
->
peer_zid
,
zrtp_session_info
.
sas_is_verified
^
1
);
rtp_session
->
zrtp_mitm_tries
++
;
}
}
switch_mutex_unlock
(
other_rtp_session
->
read_mutex
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论