Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
8d818c3b
提交
8d818c3b
authored
7月 28, 2014
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixes for DTC handling in the T.38 gateway
上级
4c2b84e8
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
23 行增加
和
21 行删除
+23
-21
tsb85.xml
libs/spandsp/spandsp/tsb85.xml
+7
-7
dtmf.c
libs/spandsp/src/dtmf.c
+3
-3
hdlc.c
libs/spandsp/src/hdlc.c
+1
-1
t30.c
libs/spandsp/src/t30.c
+4
-3
t38_gateway.c
libs/spandsp/src/t38_gateway.c
+8
-7
没有找到文件。
libs/spandsp/spandsp/tsb85.xml
浏览文件 @
8d818c3b
...
...
@@ -5679,7 +5679,7 @@
<step
dir=
"T"
type=
"HDLC"
modem=
"V.21"
tag=
"PPR"
value=
"FF C8 3D 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
/>
<step
dir=
"T"
type=
"POSTAMBLE"
/>
<step
dir=
"R"
type=
"HDLC"
modem=
"V.21"
tag=
"CTC"
value=
"FF C8 C8 00
1
0"
/>
<step
dir=
"R"
type=
"HDLC"
modem=
"V.21"
tag=
"CTC"
value=
"FF C8 C8 00
0
0"
/>
<step
dir=
"R"
type=
"SILENCE"
/>
<step
type=
"WAIT"
value=
"75"
/>
...
...
@@ -5687,7 +5687,7 @@
<step
dir=
"T"
type=
"HDLC"
modem=
"V.21"
tag=
"CTR"
value=
"FF C8 23"
/>
<step
dir=
"T"
type=
"POSTAMBLE"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
48
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
24
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"HDLC"
modem=
"V.21"
tag=
"PPS-EOP+"
value=
"FF C8 FD F4 ..."
/>
<step
dir=
"R"
type=
"SILENCE"
/>
...
...
@@ -5696,7 +5696,7 @@
<step
dir=
"T"
type=
"HDLC"
modem=
"V.21"
tag=
"PPR"
value=
"FF C8 3D 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
/>
<step
dir=
"T"
type=
"POSTAMBLE"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
48
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
24
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"HDLC"
modem=
"V.21"
tag=
"PPS-EOP+"
value=
"FF C8 FD F4 ..."
/>
<step
dir=
"R"
type=
"SILENCE"
/>
...
...
@@ -5705,7 +5705,7 @@
<step
dir=
"T"
type=
"HDLC"
modem=
"V.21"
tag=
"PPR"
value=
"FF C8 3D 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
/>
<step
dir=
"T"
type=
"POSTAMBLE"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
48
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
24
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"HDLC"
modem=
"V.21"
tag=
"PPS-EOP+"
value=
"FF C8 FD F4 ..."
/>
<step
dir=
"R"
type=
"SILENCE"
/>
...
...
@@ -5714,7 +5714,7 @@
<step
dir=
"T"
type=
"HDLC"
modem=
"V.21"
tag=
"PPR"
value=
"FF C8 3D 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
/>
<step
dir=
"T"
type=
"POSTAMBLE"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
48
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
24
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"HDLC"
modem=
"V.21"
tag=
"PPS-EOP+"
value=
"FF C8 FD F4 ..."
/>
<step
dir=
"R"
type=
"SILENCE"
/>
...
...
@@ -5793,7 +5793,7 @@
<step
dir=
"T"
type=
"HDLC"
modem=
"V.21"
tag=
"PPR"
value=
"FF C8 3D 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF"
/>
<step
dir=
"T"
type=
"POSTAMBLE"
/>
<step
dir=
"R"
type=
"HDLC"
modem=
"V.21"
tag=
"CTC+"
value=
"FF C8 C8 00
1
0"
/>
<step
dir=
"R"
type=
"HDLC"
modem=
"V.21"
tag=
"CTC+"
value=
"FF C8 C8 00
0
0"
/>
<step
dir=
"R"
type=
"SILENCE"
/>
<step
type=
"WAIT"
value=
"75"
/>
...
...
@@ -5801,7 +5801,7 @@
<step
dir=
"T"
type=
"HDLC"
tag=
"CTR"
value=
"FF C8 23"
/>
<step
dir=
"T"
type=
"POSTAMBLE"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
48
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"PP"
modem=
"V.27ter/
24
00"
frame_size=
"64"
timeout=
"60000"
/>
<step
dir=
"R"
type=
"HDLC"
modem=
"V.21"
tag=
"PPS-EOP+"
value=
"FF C8 FD F4 ..."
/>
<step
type=
"WAIT"
value=
"75"
/>
...
...
libs/spandsp/src/dtmf.c
浏览文件 @
8d818c3b
...
...
@@ -68,8 +68,6 @@
#define DEFAULT_DTMF_TX_ON_TIME 50
#define DEFAULT_DTMF_TX_OFF_TIME 55
#define DTMF_SAMPLES_PER_BLOCK 102
#if defined(SPANDSP_USE_FIXED_POINT)
/* The fixed point version scales the 16 bit signal down by 7 bits, so the Goertzels will fit in a 32 bit word */
#define FP_SCALE(x) ((int16_t) (x/128.0 + ((x >= 0.0) ? 0.5 : -0.5)))
...
...
@@ -80,6 +78,7 @@
#define DTMF_RELATIVE_PEAK_COL 6.309f
/* 8dB [10.0^(8.0/10.0)] */
#define DTMF_TO_TOTAL_ENERGY 83.868f
/* -0.85dB [DTMF_SAMPLES_PER_BLOCK*10^(-0.85/10.0)] */
#define DTMF_POWER_OFFSET 68.251f
/* 10*log(((32768.0/128.0)^2)*DTMF_SAMPLES_PER_BLOCK) */
#define DTMF_SAMPLES_PER_BLOCK 102
#else
#define FP_SCALE(x) (x)
#define DTMF_THRESHOLD 171032462.0f
/* -42dBm0 [((DTMF_SAMPLES_PER_BLOCK*32768.0/1.4142)*10^((-42 - DBM0_MAX_SINE_POWER)/20.0))^2] */
...
...
@@ -89,6 +88,7 @@
#define DTMF_RELATIVE_PEAK_COL 6.309f
/* 8dB [10.0^(8.0/10.0)] */
#define DTMF_TO_TOTAL_ENERGY 83.868f
/* -0.85dB [DTMF_SAMPLES_PER_BLOCK*10^(-0.85/10.0)] */
#define DTMF_POWER_OFFSET 110.395f
/* 10*log((32768.0^2)*DTMF_SAMPLES_PER_BLOCK) */
#define DTMF_SAMPLES_PER_BLOCK 102
#endif
static
const
float
dtmf_row
[]
=
...
...
@@ -604,7 +604,7 @@ SPAN_DECLARE(int) dtmf_tx_release(dtmf_tx_state_t *s)
SPAN_DECLARE
(
int
)
dtmf_tx_free
(
dtmf_tx_state_t
*
s
)
{
queue_release
(
&
s
->
queue
.
queue
);
dtmf_tx_release
(
s
);
span_free
(
s
);
return
0
;
}
...
...
libs/spandsp/src/hdlc.c
浏览文件 @
8d818c3b
...
...
@@ -197,7 +197,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
/* Check the flags are back-to-back when testing for valid preamble. This
greatly reduces the chances of false preamble detection, and anything
which doesn't send them back-to-back is badly broken. */
if
(
s
->
num_bits
!=
7
)
if
(
s
->
flags_seen
!=
s
->
framing_ok_threshold
-
1
&&
s
->
num_bits
!=
7
)
{
/* Don't set the flags seen indicator back to zero too aggressively.
We want to pick up with the minimum of discarded data when there
...
...
libs/spandsp/src/t30.c
浏览文件 @
8d818c3b
...
...
@@ -152,7 +152,8 @@ static const char *phase_names[] =
/* These state names are modelled after places in the T.30 flow charts. */
enum
{
T30_STATE_ANSWERING
=
1
,
T30_STATE_IDLE
=
0
,
T30_STATE_ANSWERING
,
T30_STATE_B
,
T30_STATE_C
,
T30_STATE_D
,
...
...
@@ -186,7 +187,7 @@ enum
static
const
char
*
state_names
[]
=
{
"
NON
E"
,
"
IDL
E"
,
"ANSWERING"
,
"B"
,
"C"
,
...
...
@@ -6402,7 +6403,6 @@ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status)
/* Cancel any receive timeout, and declare that a receive signal is present,
since the front end is explicitly telling us we have seen something. */
s
->
rx_signal_present
=
true
;
timer_t2_t4_stop
(
s
);
break
;
}
break
;
...
...
@@ -6593,6 +6593,7 @@ SPAN_DECLARE(int) t30_restart(t30_state_t *s, bool calling_party)
{
release_resources
(
s
);
s
->
calling_party
=
calling_party
;
s
->
state
=
T30_STATE_IDLE
;
s
->
phase
=
T30_PHASE_IDLE
;
s
->
next_phase
=
T30_PHASE_IDLE
;
s
->
current_fallback
=
0
;
...
...
libs/spandsp/src/t38_gateway.c
浏览文件 @
8d818c3b
...
...
@@ -58,6 +58,7 @@
#include "spandsp/alloc.h"
#include "spandsp/logging.h"
#include "spandsp/queue.h"
#include "spandsp/vector_int.h"
#include "spandsp/dc_restore.h"
#include "spandsp/bit_operations.h"
#include "spandsp/power_meter.h"
...
...
@@ -149,7 +150,7 @@
#define DATA_END_TX_COUNT 3
/*! The number of consecutive flags to declare HDLC framing is OK. */
#define HDLC_FRAMING_OK_THRESHOLD 5
#define HDLC_FRAMING_OK_THRESHOLD
5
enum
{
...
...
@@ -700,7 +701,7 @@ static void monitor_control_messages(t38_gateway_state_t *s,
/* If we are processing a message from the modem side, the contents determine the fast receive modem.
we are to use. If it comes from the T.38 side the contents do not. */
s
->
core
.
fast_bit_rate
=
modem_codes
[
i
].
bit_rate
;
if
(
from_modem
)
if
(
(
buf
[
2
]
==
T30_DTC
&&
!
from_modem
)
||
(
buf
[
2
]
!=
T30_DTC
&&
from_modem
)
)
s
->
core
.
fast_rx_modem
=
modem_codes
[
i
].
modem_type
;
/*endif*/
}
...
...
@@ -1863,7 +1864,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *t)
/* Check the flags are back-to-back when testing for valid preamble. This
greatly reduces the chances of false preamble detection, and anything
which doesn't send them back-to-back is badly broken. */
if
(
t
->
num_bits
!=
7
)
if
(
t
->
flags_seen
!=
t
->
framing_ok_threshold
-
1
&&
t
->
num_bits
!=
7
)
t
->
flags_seen
=
0
;
/*endif*/
if
(
++
t
->
flags_seen
>=
t
->
framing_ok_threshold
&&
!
t
->
framing_ok_announced
)
...
...
@@ -2070,15 +2071,15 @@ static void update_rx_timing(t38_gateway_state_t *s, int len)
{
case
TIMED_MODE_TCF_PREDICTABLE_MODEM_START_PAST_V21_MODEM
:
/* Timed announcement of training, 75ms after the DCS carrier fell. */
s
->
core
.
timed_mode
=
TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_ANNOUNCED
;
announce_training
(
s
);
s
->
core
.
timed_mode
=
TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_ANNOUNCED
;
break
;
case
TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_SEEN
:
/* Timed announcement of training, 75ms after the DCS carrier fell. */
announce_training
(
s
);
/* Use a timeout to ride over TEP, if it is present */
s
->
core
.
samples_to_timeout
=
ms_to_samples
(
500
);
s
->
core
.
timed_mode
=
TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_ANNOUNCED
;
announce_training
(
s
);
break
;
case
TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_ANNOUNCED
:
s
->
core
.
timed_mode
=
TIMED_MODE_IDLE
;
...
...
@@ -2172,7 +2173,7 @@ SPAN_DECLARE_NONSTD(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], i
if
(
s
->
audio
.
modems
.
transmit_on_idle
)
{
/* Pad to the requested length with silence */
memset
(
&
amp
[
len
],
0
,
(
max_len
-
len
)
*
sizeof
(
int16_t
)
);
vec_zeroi16
(
&
amp
[
len
],
max_len
-
len
);
len
=
max_len
;
}
/*endif*/
...
...
@@ -2180,7 +2181,7 @@ SPAN_DECLARE_NONSTD(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], i
if
(
s
->
audio
.
modems
.
audio_tx_log
>=
0
)
{
if
(
len
<
required_len
)
memset
(
&
amp
[
len
],
0
,
(
required_len
-
len
)
*
sizeof
(
int16_t
)
);
vec_zeroi16
(
&
amp
[
len
],
required_len
-
len
);
/*endif*/
write
(
s
->
audio
.
modems
.
audio_tx_log
,
amp
,
required_len
*
sizeof
(
int16_t
));
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论