Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1d76b2f9
提交
1d76b2f9
authored
10月 05, 2013
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tweaks to logging in spandsp
上级
a34095a4
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
122 行增加
和
27 行删除
+122
-27
fax_modems.c
libs/spandsp/src/fax_modems.c
+44
-0
bit_operations.h
libs/spandsp/src/spandsp/bit_operations.h
+2
-2
fax_modems.h
libs/spandsp/src/spandsp/fax_modems.h
+6
-0
t30_logging.h
libs/spandsp/src/spandsp/t30_logging.h
+6
-0
t30.c
libs/spandsp/src/t30.c
+34
-25
t30_logging.c
libs/spandsp/src/t30_logging.c
+30
-0
没有找到文件。
libs/spandsp/src/fax_modems.c
浏览文件 @
1d76b2f9
...
...
@@ -101,6 +101,50 @@
#define HDLC_FRAMING_OK_THRESHOLD 5
SPAN_DECLARE
(
const
char
*
)
fax_modem_to_str
(
int
modem
)
{
switch
(
modem
)
{
case
FAX_MODEM_NONE
:
return
"None"
;
case
FAX_MODEM_FLUSH
:
return
"Flush"
;
case
FAX_MODEM_SILENCE_TX
:
return
"Silence Tx"
;
case
FAX_MODEM_SILENCE_RX
:
return
"Silence Rx"
;
case
FAX_MODEM_CED_TONE_TX
:
return
"CED Tx"
;
case
FAX_MODEM_CNG_TONE_TX
:
return
"CNG Tx"
;
case
FAX_MODEM_NOCNG_TONE_TX
:
return
"No CNG Tx"
;
case
FAX_MODEM_CED_TONE_RX
:
return
"CED Rx"
;
case
FAX_MODEM_CNG_TONE_RX
:
return
"CNG Rx"
;
case
FAX_MODEM_V21_TX
:
return
"V.21 Tx"
;
case
FAX_MODEM_V17_TX
:
return
"V.17 Tx"
;
case
FAX_MODEM_V27TER_TX
:
return
"V.27ter Tx"
;
case
FAX_MODEM_V29_TX
:
return
"V.29 Tx"
;
case
FAX_MODEM_V21_RX
:
return
"V.21 Rx"
;
case
FAX_MODEM_V17_RX
:
return
"V.17 Rx"
;
case
FAX_MODEM_V27TER_RX
:
return
"V.27ter Rx"
;
case
FAX_MODEM_V29_RX
:
return
"V.29 Rx"
;
}
/*endswitch*/
return
"???"
;
}
/*- End of function --------------------------------------------------------*/
static
void
fax_modems_hdlc_accept
(
void
*
user_data
,
const
uint8_t
*
msg
,
int
len
,
int
ok
)
{
fax_modems_state_t
*
s
;
...
...
libs/spandsp/src/spandsp/bit_operations.h
浏览文件 @
1d76b2f9
...
...
@@ -42,7 +42,7 @@ extern "C"
/*! \brief Find the bit position of the highest set bit in a word
\param bits The word to be searched
\return The bit number of the highest set bit, or -1 if the word is zero. */
static
__inline__
int
top_bit
(
u
nsigned
in
t
bits
)
static
__inline__
int
top_bit
(
u
int32_
t
bits
)
{
#if defined(SPANDSP_USE_86_ASM)
int
res
;
...
...
@@ -141,7 +141,7 @@ static __inline__ int top_bit(unsigned int bits)
/*! \brief Find the bit position of the lowest set bit in a word
\param bits The word to be searched
\return The bit number of the lowest set bit, or -1 if the word is zero. */
static
__inline__
int
bottom_bit
(
u
nsigned
in
t
bits
)
static
__inline__
int
bottom_bit
(
u
int32_
t
bits
)
{
int
res
;
...
...
libs/spandsp/src/spandsp/fax_modems.h
浏览文件 @
1d76b2f9
...
...
@@ -59,6 +59,12 @@ extern "C"
{
#endif
/*! Convert a FAX modem type to a short text description.
\brief Convert a FAX modem type to a short text description.
\param modem The modem code.
\return A pointer to the description. */
SPAN_DECLARE
(
const
char
*
)
fax_modem_to_str
(
int
modem
);
/* N.B. the following are currently a work in progress */
SPAN_DECLARE_NONSTD
(
int
)
fax_modems_v17_v21_rx
(
void
*
user_data
,
const
int16_t
amp
[],
int
len
);
SPAN_DECLARE_NONSTD
(
int
)
fax_modems_v27ter_v21_rx
(
void
*
user_data
,
const
int16_t
amp
[],
int
len
);
...
...
libs/spandsp/src/spandsp/t30_logging.h
浏览文件 @
1d76b2f9
...
...
@@ -53,6 +53,12 @@ SPAN_DECLARE(void) t30_decode_dis_dtc_dcs(t30_state_t *s, const uint8_t *dis, in
\return A pointer to the description. */
SPAN_DECLARE
(
const
char
*
)
t30_completion_code_to_str
(
int
result
);
/*! Convert a T.30 modem type to a short text description.
\brief Convert a T.30 modem type to a short text description.
\param modem The modem code.
\return A pointer to the description. */
SPAN_DECLARE
(
const
char
*
)
t30_modem_to_str
(
int
modem
);
#if defined(__cplusplus)
}
#endif
...
...
libs/spandsp/src/t30.c
浏览文件 @
1d76b2f9
...
...
@@ -421,7 +421,7 @@ static const struct
{
7200
,
T30_MODEM_V29
,
T30_SUPPORT_V29
,
(
DISBIT4
|
DISBIT3
)},
{
4800
,
T30_MODEM_V27TER
,
T30_SUPPORT_V27TER
,
DISBIT4
},
{
2400
,
T30_MODEM_V27TER
,
T30_SUPPORT_V27TER
,
0
},
{
0
,
0
,
0
,
0
}
{
0
,
0
,
0
,
0
}
};
static
void
queue_phase
(
t30_state_t
*
s
,
int
phase
);
...
...
@@ -437,6 +437,7 @@ static void decode_20digit_msg(t30_state_t *s, char *msg, const uint8_t *pkt, in
static
void
decode_url_msg
(
t30_state_t
*
s
,
char
*
msg
,
const
uint8_t
*
pkt
,
int
len
);
static
int
decode_nsf_nss_nsc
(
t30_state_t
*
s
,
uint8_t
*
msg
[],
const
uint8_t
*
pkt
,
int
len
);
static
void
set_min_scan_time
(
t30_state_t
*
s
);
static
int
build_dcs
(
t30_state_t
*
s
);
static
void
timer_t2_start
(
t30_state_t
*
s
);
static
void
timer_t2a_start
(
t30_state_t
*
s
);
static
void
timer_t2b_start
(
t30_state_t
*
s
);
...
...
@@ -470,6 +471,27 @@ static int find_fallback_entry(int dcs_code)
}
/*- End of function --------------------------------------------------------*/
static
int
step_fallback_entry
(
t30_state_t
*
s
)
{
while
(
fallback_sequence
[
++
s
->
current_fallback
].
bit_rate
)
{
if
((
fallback_sequence
[
s
->
current_fallback
].
which
&
s
->
current_permitted_modems
))
break
;
}
if
(
fallback_sequence
[
s
->
current_fallback
].
bit_rate
==
0
)
{
/* Reset the fallback sequence */
s
->
current_fallback
=
0
;
return
-
1
;
}
/* We need to update the minimum scan time, in case we are in non-ECM mode. */
set_min_scan_time
(
s
);
/* Now we need to rebuild the DCS message we will send. */
build_dcs
(
s
);
return
s
->
current_fallback
;
}
/*- End of function --------------------------------------------------------*/
static
int
terminate_operation_in_progress
(
t30_state_t
*
s
)
{
/* Make sure any FAX in progress is tidied up. If the tidying up has
...
...
@@ -2242,23 +2264,6 @@ static int analyze_rx_dcs(t30_state_t *s, const uint8_t *msg, int len)
}
/*- End of function --------------------------------------------------------*/
static
int
step_fallback_entry
(
t30_state_t
*
s
)
{
while
(
fallback_sequence
[
++
s
->
current_fallback
].
which
)
{
if
((
fallback_sequence
[
s
->
current_fallback
].
which
&
s
->
current_permitted_modems
))
break
;
}
if
(
fallback_sequence
[
s
->
current_fallback
].
which
==
0
)
return
-
1
;
/* We need to update the minimum scan time, in case we are in non-ECM mode. */
set_min_scan_time
(
s
);
/* Now we need to rebuild the DCS message we will send. */
build_dcs
(
s
);
return
s
->
current_fallback
;
}
/*- End of function --------------------------------------------------------*/
static
void
send_dcn
(
t30_state_t
*
s
)
{
queue_phase
(
s
,
T30_PHASE_D_TX
);
...
...
@@ -2710,6 +2715,13 @@ static int process_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len)
send_dcn
(
s
);
return
-
1
;
}
/* Start document transmission */
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Put document with modem (%d) %s at %dbps
\n
"
,
fallback_sequence
[
s
->
current_fallback
].
modem_type
,
t30_modem_to_str
(
fallback_sequence
[
s
->
current_fallback
].
modem_type
),
fallback_sequence
[
s
->
current_fallback
].
bit_rate
);
s
->
retries
=
0
;
send_dcs_sequence
(
s
,
true
);
return
0
;
...
...
@@ -2773,9 +2785,10 @@ static int process_rx_dcs(t30_state_t *s, const uint8_t *msg, int len)
/* Start document reception */
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Get document at %dbps, modem %d
\n
"
,
fallback_sequence
[
s
->
current_fallback
].
bit_rate
,
fallback_sequence
[
s
->
current_fallback
].
modem_type
);
"Get document with modem (%d) %s at %dbps
\n
"
,
fallback_sequence
[
s
->
current_fallback
].
modem_type
,
t30_modem_to_str
(
fallback_sequence
[
s
->
current_fallback
].
modem_type
),
fallback_sequence
[
s
->
current_fallback
].
bit_rate
);
if
(
s
->
rx_file
[
0
]
==
'\0'
)
{
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"No document to receive
\n
"
);
...
...
@@ -3439,7 +3452,6 @@ static void process_state_d_post_tcf(t30_state_t *s, const uint8_t *msg, int len
if
(
step_fallback_entry
(
s
)
<
0
)
{
/* We have fallen back as far as we can go. Give up. */
s
->
current_fallback
=
0
;
t30_set_status
(
s
,
T30_ERR_CANNOT_TRAIN
);
send_dcn
(
s
);
break
;
...
...
@@ -4091,7 +4103,6 @@ static void process_state_ii_q(t30_state_t *s, const uint8_t *msg, int len)
if
(
step_fallback_entry
(
s
)
<
0
)
{
/* We have fallen back as far as we can go. Give up. */
s
->
current_fallback
=
0
;
t30_set_status
(
s
,
T30_ERR_CANNOT_TRAIN
);
send_dcn
(
s
);
break
;
...
...
@@ -4152,7 +4163,6 @@ static void process_state_ii_q(t30_state_t *s, const uint8_t *msg, int len)
if
(
step_fallback_entry
(
s
)
<
0
)
{
/* We have fallen back as far as we can go. Give up. */
s
->
current_fallback
=
0
;
t30_set_status
(
s
,
T30_ERR_CANNOT_TRAIN
);
send_dcn
(
s
);
break
;
...
...
@@ -4186,7 +4196,6 @@ static void process_state_ii_q(t30_state_t *s, const uint8_t *msg, int len)
if
(
step_fallback_entry
(
s
)
<
0
)
{
/* We have fallen back as far as we can go. Give up. */
s
->
current_fallback
=
0
;
t30_set_status
(
s
,
T30_ERR_CANNOT_TRAIN
);
send_dcn
(
s
);
break
;
...
...
libs/spandsp/src/t30_logging.c
浏览文件 @
1d76b2f9
...
...
@@ -246,6 +246,36 @@ SPAN_DECLARE(const char *) t30_completion_code_to_str(int result)
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
const
char
*
)
t30_modem_to_str
(
int
modem
)
{
switch
(
modem
)
{
case
T30_MODEM_NONE
:
return
"None"
;
case
T30_MODEM_PAUSE
:
return
"Pause"
;
case
T30_MODEM_CED
:
return
"CED"
;
case
T30_MODEM_CNG
:
return
"CNG"
;
case
T30_MODEM_V21
:
return
"V.21"
;
case
T30_MODEM_V27TER
:
return
"V.27ter"
;
case
T30_MODEM_V29
:
return
"V.29"
;
case
T30_MODEM_V17
:
return
"V.17"
;
case
T30_MODEM_V34HDX
:
return
"V.34HDX"
;
case
T30_MODEM_DONE
:
return
"Done"
;
}
/*endswitch*/
return
"???"
;
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
const
char
*
)
t30_frametype
(
uint8_t
x
)
{
switch
(
x
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论