Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
89f4cd75
提交
89f4cd75
authored
11月 21, 2012
作者:
Brian West
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix 2833 Debuging
上级
4f9de436
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
12 行删除
+12
-12
switch_rtp.c
src/switch_rtp.c
+12
-12
没有找到文件。
src/switch_rtp.c
浏览文件 @
89f4cd75
...
@@ -341,9 +341,10 @@ static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session);
...
@@ -341,9 +341,10 @@ static void do_2833(switch_rtp_t *rtp_session, switch_core_session_t *session);
static
handle_rfc2833_result_t
handle_rfc2833
(
switch_rtp_t
*
rtp_session
,
switch_size_t
bytes
,
int
*
do_cng
)
static
handle_rfc2833_result_t
handle_rfc2833
(
switch_rtp_t
*
rtp_session
,
switch_size_t
bytes
,
int
*
do_cng
)
{
{
#ifdef DEBUG_2833
#ifdef DEBUG_2833
if
(
rtp_session
->
dtmf_data
.
in_digit_sanity
&&
!
(
rtp_session
->
dtmf_data
.
in_digit_sanity
%
100
))
{
if
(
rtp_session
->
dtmf_data
.
in_digit_sanity
&&
!
(
rtp_session
->
dtmf_data
.
in_digit_sanity
%
100
))
{
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"sanity %d
\n
"
,
rtp_session
->
dtmf_data
.
in_digit_sanity
);
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"sanity %d
\n
"
,
rtp_session
->
dtmf_data
.
in_digit_sanity
);
}
}
#endif
#endif
...
@@ -396,8 +397,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
...
@@ -396,8 +397,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
}
}
}
}
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
session
),
SWITCH_LOG_ERROR
,
"packet[%d]: %02x %02x %02x %02x
\n
"
,
(
int
)
len
,
(
unsigned
)
packet
[
0
],
(
unsigned
)
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"packet[%d]: %02x %02x %02x %02x
\n
"
,
(
int
)
len
,
(
unsigned
)
packet
[
0
],
(
unsigned
)
packet
[
1
],
(
unsigned
)
packet
[
2
],
(
unsigned
)
packet
[
3
]);
packet
[
1
],
(
unsigned
)
packet
[
2
],
(
unsigned
)
packet
[
3
]);
#endif
#endif
if
(
in_digit_seq
>
rtp_session
->
dtmf_data
.
in_digit_seq
)
{
if
(
in_digit_seq
>
rtp_session
->
dtmf_data
.
in_digit_seq
)
{
...
@@ -405,7 +405,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
...
@@ -405,7 +405,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
rtp_session
->
dtmf_data
.
in_digit_seq
=
in_digit_seq
;
rtp_session
->
dtmf_data
.
in_digit_seq
=
in_digit_seq
;
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"read: %c %u %u %u %u %d %d %s
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"read: %c %u %u %u %u %d %d %s
\n
"
,
key
,
in_digit_seq
,
rtp_session
->
dtmf_data
.
in_digit_seq
,
key
,
in_digit_seq
,
rtp_session
->
dtmf_data
.
in_digit_seq
,
ts
,
duration
,
rtp_session
->
recv_msg
.
header
.
m
,
end
,
end
&&
!
rtp_session
->
dtmf_data
.
in_digit_ts
?
"ignored"
:
""
);
ts
,
duration
,
rtp_session
->
recv_msg
.
header
.
m
,
end
,
end
&&
!
rtp_session
->
dtmf_data
.
in_digit_ts
?
"ignored"
:
""
);
#endif
#endif
...
@@ -414,7 +414,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
...
@@ -414,7 +414,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
rtp_session
->
dtmf_data
.
in_digit_ts
)
{
rtp_session
->
dtmf_data
.
in_digit_ts
)
{
switch_dtmf_t
dtmf
=
{
key
,
switch_core_min_dtmf_duration
(
0
),
0
,
SWITCH_DTMF_RTP
};
switch_dtmf_t
dtmf
=
{
key
,
switch_core_min_dtmf_duration
(
0
),
0
,
SWITCH_DTMF_RTP
};
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"Early Queuing digit %c:%d
\n
"
,
dtmf
.
digit
,
dtmf
.
duration
/
8
);
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"Early Queuing digit %c:%d
\n
"
,
dtmf
.
digit
,
dtmf
.
duration
/
8
);
#endif
#endif
switch_rtp_queue_rfc2833_in
(
rtp_session
,
&
dtmf
);
switch_rtp_queue_rfc2833_in
(
rtp_session
,
&
dtmf
);
rtp_session
->
dtmf_data
.
in_digit_queued
=
1
;
rtp_session
->
dtmf_data
.
in_digit_queued
=
1
;
...
@@ -433,7 +433,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
...
@@ -433,7 +433,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
if
(
end
)
{
if
(
end
)
{
if
(
!
rtp_session
->
dtmf_data
.
in_digit_ts
&&
rtp_session
->
dtmf_data
.
last_in_digit_ts
!=
ts
)
{
if
(
!
rtp_session
->
dtmf_data
.
in_digit_ts
&&
rtp_session
->
dtmf_data
.
last_in_digit_ts
!=
ts
)
{
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"start with end packet %d
\n
"
,
ts
);
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"start with end packet %d
\n
"
,
ts
);
#endif
#endif
rtp_session
->
dtmf_data
.
last_in_digit_ts
=
ts
;
rtp_session
->
dtmf_data
.
last_in_digit_ts
=
ts
;
rtp_session
->
dtmf_data
.
in_digit_ts
=
ts
;
rtp_session
->
dtmf_data
.
in_digit_ts
=
ts
;
...
@@ -450,17 +450,17 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
...
@@ -450,17 +450,17 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
dtmf
.
duration
+=
rtp_session
->
dtmf_data
.
flip
*
0xFFFF
;
dtmf
.
duration
+=
rtp_session
->
dtmf_data
.
flip
*
0xFFFF
;
rtp_session
->
dtmf_data
.
flip
=
0
;
rtp_session
->
dtmf_data
.
flip
=
0
;
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"you're welcome!
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"you're welcome!
\n
"
);
#endif
#endif
}
}
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"done digit=%c ts=%u start_ts=%u dur=%u ddur=%u
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"done digit=%c ts=%u start_ts=%u dur=%u ddur=%u
\n
"
,
dtmf
.
digit
,
ts
,
rtp_session
->
dtmf_data
.
in_digit_ts
,
duration
,
dtmf
.
duration
);
dtmf
.
digit
,
ts
,
rtp_session
->
dtmf_data
.
in_digit_ts
,
duration
,
dtmf
.
duration
);
#endif
#endif
if
(
!
(
rtp_session
->
rtp_bugs
&
RTP_BUG_IGNORE_DTMF_DURATION
)
&&
!
rtp_session
->
dtmf_data
.
in_digit_queued
)
{
if
(
!
(
rtp_session
->
rtp_bugs
&
RTP_BUG_IGNORE_DTMF_DURATION
)
&&
!
rtp_session
->
dtmf_data
.
in_digit_queued
)
{
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"Queuing digit %c:%d
\n
"
,
dtmf
.
digit
,
dtmf
.
duration
/
8
);
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"Queuing digit %c:%d
\n
"
,
dtmf
.
digit
,
dtmf
.
duration
/
8
);
#endif
#endif
switch_rtp_queue_rfc2833_in
(
rtp_session
,
&
dtmf
);
switch_rtp_queue_rfc2833_in
(
rtp_session
,
&
dtmf
);
}
}
...
@@ -481,7 +481,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
...
@@ -481,7 +481,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
}
else
if
(
!
rtp_session
->
dtmf_data
.
in_digit_ts
)
{
}
else
if
(
!
rtp_session
->
dtmf_data
.
in_digit_ts
)
{
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"start %d
\n
"
,
ts
);
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"start %d
\n
"
,
ts
);
#endif
#endif
rtp_session
->
dtmf_data
.
in_digit_ts
=
ts
;
rtp_session
->
dtmf_data
.
in_digit_ts
=
ts
;
rtp_session
->
dtmf_data
.
last_in_digit_ts
=
ts
;
rtp_session
->
dtmf_data
.
last_in_digit_ts
=
ts
;
...
@@ -492,7 +492,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
...
@@ -492,7 +492,7 @@ static handle_rfc2833_result_t handle_rfc2833(switch_rtp_t *rtp_session, switch_
rtp_session
->
dtmf_data
.
last_duration
=
duration
;
rtp_session
->
dtmf_data
.
last_duration
=
duration
;
}
else
{
}
else
{
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"drop: %c %u %u %u %u %d %d
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"drop: %c %u %u %u %u %d %d
\n
"
,
key
,
in_digit_seq
,
rtp_session
->
dtmf_data
.
in_digit_seq
,
ts
,
duration
,
rtp_session
->
recv_msg
.
header
.
m
,
end
);
key
,
in_digit_seq
,
rtp_session
->
dtmf_data
.
in_digit_seq
,
ts
,
duration
,
rtp_session
->
recv_msg
.
header
.
m
,
end
);
#endif
#endif
switch_cond_next
();
switch_cond_next
();
...
@@ -2822,7 +2822,7 @@ static void do_flush(switch_rtp_t *rtp_session)
...
@@ -2822,7 +2822,7 @@ static void do_flush(switch_rtp_t *rtp_session)
if
(
bytes
>
rtp_header_len
&&
rtp_session
->
recv_te
&&
rtp_session
->
recv_msg
.
header
.
pt
==
rtp_session
->
recv_te
)
{
if
(
bytes
>
rtp_header_len
&&
rtp_session
->
recv_te
&&
rtp_session
->
recv_msg
.
header
.
pt
==
rtp_session
->
recv_te
)
{
handle_rfc2833
(
rtp_session
,
bytes
,
&
do_cng
);
handle_rfc2833
(
rtp_session
,
bytes
,
&
do_cng
);
#ifdef DEBUG_2833
#ifdef DEBUG_2833
switch_log_printf
(
SWITCH_CHANNEL_
SESSION_LOG
(
session
)
,
SWITCH_LOG_ERROR
,
"*** RTP packet handled in flush loop %d ***
\n
"
,
do_cng
);
switch_log_printf
(
SWITCH_CHANNEL_
LOG
,
SWITCH_LOG_ERROR
,
"*** RTP packet handled in flush loop %d ***
\n
"
,
do_cng
);
#endif
#endif
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论