Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b7c69be9
提交
b7c69be9
authored
5月 20, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1486
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
21c2b581
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
14 行增加
和
12 行删除
+14
-12
switch_rtp.c
src/switch_rtp.c
+14
-12
没有找到文件。
src/switch_rtp.c
浏览文件 @
b7c69be9
...
@@ -608,7 +608,7 @@ static void do_2833(switch_rtp_t *rtp_session)
...
@@ -608,7 +608,7 @@ static void do_2833(switch_rtp_t *rtp_session)
uint32_t
samples
=
rtp_session
->
packet_size
;
uint32_t
samples
=
rtp_session
->
packet_size
;
if
(
rtp_session
->
dtmf_data
.
out_digit_dur
>
0
)
{
if
(
rtp_session
->
dtmf_data
.
out_digit_dur
>
0
)
{
int
x
,
ts
,
loops
=
1
,
duration
;
int
x
,
loops
=
1
,
duration
;
rtp_session
->
dtmf_data
.
out_digit_sofar
+=
samples
;
rtp_session
->
dtmf_data
.
out_digit_sofar
+=
samples
;
if
(
rtp_session
->
dtmf_data
.
out_digit_sofar
>=
rtp_session
->
dtmf_data
.
out_digit_dur
)
{
if
(
rtp_session
->
dtmf_data
.
out_digit_sofar
>=
rtp_session
->
dtmf_data
.
out_digit_dur
)
{
...
@@ -620,19 +620,19 @@ static void do_2833(switch_rtp_t *rtp_session)
...
@@ -620,19 +620,19 @@ static void do_2833(switch_rtp_t *rtp_session)
duration
=
rtp_session
->
dtmf_data
.
out_digit_sofar
;
duration
=
rtp_session
->
dtmf_data
.
out_digit_sofar
;
}
}
ts
=
rtp_session
->
dtmf_data
.
timestamp_dtmf
+=
samples
;
//
ts = rtp_session->dtmf_data.timestamp_dtmf += samples;
rtp_session
->
dtmf_data
.
out_digit_packet
[
2
]
=
(
unsigned
char
)
(
duration
>>
8
);
rtp_session
->
dtmf_data
.
out_digit_packet
[
2
]
=
(
unsigned
char
)
(
duration
>>
8
);
rtp_session
->
dtmf_data
.
out_digit_packet
[
3
]
=
(
unsigned
char
)
duration
;
rtp_session
->
dtmf_data
.
out_digit_packet
[
3
]
=
(
unsigned
char
)
duration
;
for
(
x
=
0
;
x
<
loops
;
x
++
)
{
for
(
x
=
0
;
x
<
loops
;
x
++
)
{
switch_rtp_write_manual
(
rtp_session
,
switch_rtp_write_manual
(
rtp_session
,
rtp_session
->
dtmf_data
.
out_digit_packet
,
4
,
0
,
101
,
ts
,
rtp_session
->
dtmf_data
.
out_digit_packet
,
4
,
0
,
101
,
rtp_session
->
dtmf_data
.
timestamp_dtmf
,
loops
==
1
?
rtp_session
->
dtmf_data
.
out_digit_seq
++
:
rtp_session
->
dtmf_data
.
out_digit_seq
,
&
flags
);
rtp_session
->
dtmf_data
.
out_digit_seq
++
,
&
flags
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Send %s packet for [%c] ts=%d sofar=%u dur=%d
\n
"
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"Send %s packet for [%c] ts=%d sofar=%u dur=%d
\n
"
,
loops
==
1
?
"middle"
:
"end"
,
loops
==
1
?
"middle"
:
"end"
,
rtp_session
->
dtmf_data
.
out_digit
,
rtp_session
->
dtmf_data
.
out_digit
,
ts
,
rtp_session
->
dtmf_data
.
timestamp_dtmf
,
rtp_session
->
dtmf_data
.
out_digit_sofar
,
rtp_session
->
dtmf_data
.
out_digit_sofar
,
duration
);
duration
);
}
}
...
@@ -642,7 +642,7 @@ static void do_2833(switch_rtp_t *rtp_session)
...
@@ -642,7 +642,7 @@ static void do_2833(switch_rtp_t *rtp_session)
void
*
pop
;
void
*
pop
;
if
(
switch_queue_trypop
(
rtp_session
->
dtmf_data
.
dtmf_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_queue_trypop
(
rtp_session
->
dtmf_data
.
dtmf_queue
,
&
pop
)
==
SWITCH_STATUS_SUCCESS
)
{
int
x
,
ts
;
int
x
;
struct
rfc2833_digit
*
rdigit
=
pop
;
struct
rfc2833_digit
*
rdigit
=
pop
;
memset
(
rtp_session
->
dtmf_data
.
out_digit_packet
,
0
,
4
);
memset
(
rtp_session
->
dtmf_data
.
out_digit_packet
,
0
,
4
);
...
@@ -652,22 +652,24 @@ static void do_2833(switch_rtp_t *rtp_session)
...
@@ -652,22 +652,24 @@ static void do_2833(switch_rtp_t *rtp_session)
rtp_session
->
dtmf_data
.
out_digit_packet
[
0
]
=
(
unsigned
char
)
switch_char_to_rfc2833
(
rdigit
->
digit
);
rtp_session
->
dtmf_data
.
out_digit_packet
[
0
]
=
(
unsigned
char
)
switch_char_to_rfc2833
(
rdigit
->
digit
);
rtp_session
->
dtmf_data
.
out_digit_packet
[
1
]
=
7
;
rtp_session
->
dtmf_data
.
out_digit_packet
[
1
]
=
7
;
ts
=
rtp_session
->
dtmf_data
.
timestamp_dtmf
+=
samples
;
//ts = rtp_session->dtmf_data.timestamp_dtmf += samples;
rtp_session
->
dtmf_data
.
out_digit_seq
++
;
rtp_session
->
dtmf_data
.
timestamp_dtmf
++
;
for
(
x
=
0
;
x
<
3
;
x
++
)
{
for
(
x
=
0
;
x
<
3
;
x
++
)
{
switch_rtp_write_manual
(
rtp_session
,
switch_rtp_write_manual
(
rtp_session
,
rtp_session
->
dtmf_data
.
out_digit_packet
,
rtp_session
->
dtmf_data
.
out_digit_packet
,
4
,
4
,
1
,
1
,
101
,
101
,
ts
,
rtp_session
->
dtmf_data
.
timestamp_dtmf
,
rtp_session
->
dtmf_data
.
out_digit_seq
,
rtp_session
->
dtmf_data
.
out_digit_seq
++
,
&
flags
);
&
flags
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
SWITCH_LOG_DEBUG
,
"Send start packet for [%c] ts=%d sofar=%u dur=%d
\n
"
,
"Send start packet for [%c] ts=%d sofar=%u dur=%d
\n
"
,
rtp_session
->
dtmf_data
.
out_digit
,
rtp_session
->
dtmf_data
.
out_digit
,
ts
,
rtp_session
->
dtmf_data
.
timestamp_dtmf
,
rtp_session
->
dtmf_data
.
out_digit_sofar
,
rtp_session
->
dtmf_data
.
out_digit_sofar
,
0
);
0
);
}
}
...
@@ -1313,7 +1315,7 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session, void *dat
...
@@ -1313,7 +1315,7 @@ SWITCH_DECLARE(int) switch_rtp_write_manual(switch_rtp_t *rtp_session, void *dat
rtp_session
->
ts
+=
ts
;
rtp_session
->
ts
+=
ts
;
rtp_session
->
send_msg
.
header
.
seq
=
htons
(
mseq
);
rtp_session
->
send_msg
.
header
.
seq
=
htons
(
mseq
);
rtp_session
->
send_msg
.
header
.
ts
=
htonl
(
rtp_session
->
ts
);
rtp_session
->
send_msg
.
header
.
ts
=
htonl
(
ts
);
return
rtp_common_write
(
rtp_session
,
data
,
datalen
,
m
,
payload
,
flags
);
return
rtp_common_write
(
rtp_session
,
data
,
datalen
,
m
,
payload
,
flags
);
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论