Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5df3ff76
提交
5df3ff76
authored
6月 15, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
evil ass bug
git-svn-id:
http://svn.openzap.org/svn/openzap/trunk@260
a93c3328-9c30-0410-af19-c9cd2b2d52af
上级
3234f987
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
37 行增加
和
24 行删除
+37
-24
fsk.c
libs/openzap/src/fsk.c
+25
-19
openzap.h
libs/openzap/src/include/openzap.h
+1
-0
uart.c
libs/openzap/src/uart.c
+2
-2
zap_analog.c
libs/openzap/src/zap_analog.c
+5
-0
zap_callerid.c
libs/openzap/src/zap_callerid.c
+2
-0
zap_io.c
libs/openzap/src/zap_io.c
+2
-3
没有找到文件。
libs/openzap/src/fsk.c
浏览文件 @
5df3ff76
...
...
@@ -309,30 +309,36 @@ dsp_fsk_sample (dsp_fsk_handle_t *handle, double normalized_sample)
switch
(
handle
->
state
)
{
case
FSK_STATE_DATA
:
(
*
handle
->
attr
.
bithandler
)
(
handle
->
attr
.
bithandler_arg
,
handle
->
current_bit
);
{
(
*
handle
->
attr
.
bithandler
)
(
handle
->
attr
.
bithandler_arg
,
handle
->
current_bit
);
}
break
;
case
FSK_STATE_CHANSEIZE
:
if
(
handle
->
last_bit
!=
handle
->
current_bit
)
{
handle
->
conscutive_state_bits
++
;
}
else
{
handle
->
conscutive_state_bits
=
0
;
}
if
(
handle
->
conscutive_state_bits
>
15
)
{
handle
->
state
=
FSK_STATE_CARRIERSIG
;
handle
->
conscutive_state_bits
=
0
;
{
if
(
handle
->
last_bit
!=
handle
->
current_bit
)
{
handle
->
conscutive_state_bits
++
;
}
else
{
handle
->
conscutive_state_bits
=
0
;
}
if
(
handle
->
conscutive_state_bits
>
15
)
{
handle
->
state
=
FSK_STATE_CARRIERSIG
;
handle
->
conscutive_state_bits
=
0
;
}
}
break
;
case
FSK_STATE_CARRIERSIG
:
if
(
handle
->
current_bit
)
{
handle
->
conscutive_state_bits
++
;
}
else
{
handle
->
conscutive_state_bits
=
0
;
}
if
(
handle
->
conscutive_state_bits
>
15
)
{
handle
->
state
=
FSK_STATE_DATA
;
handle
->
conscutive_state_bits
=
0
;
{
if
(
handle
->
current_bit
)
{
handle
->
conscutive_state_bits
++
;
}
else
{
handle
->
conscutive_state_bits
=
0
;
}
if
(
handle
->
conscutive_state_bits
>
15
)
{
handle
->
state
=
FSK_STATE_DATA
;
handle
->
conscutive_state_bits
=
0
;
}
}
break
;
}
...
...
libs/openzap/src/include/openzap.h
浏览文件 @
5df3ff76
...
...
@@ -344,6 +344,7 @@ struct zap_channel {
zap_filehandle_t
fds
[
2
];
zap_fsk_data_state_t
fsk
;
uint8_t
fsk_buf
[
80
];
uint32_t
ring_count
;
struct
zap_caller_data
caller_data
;
struct
zap_span
*
span
;
struct
zap_io_interface
*
zio
;
...
...
libs/openzap/src/uart.c
浏览文件 @
5df3ff76
...
...
@@ -78,7 +78,7 @@ dsp_uart_handle_t *dsp_uart_create(dsp_uart_attr_t *attr)
handle
=
malloc
(
sizeof
(
*
handle
));
if
(
handle
)
{
memset
(
handle
,
0
,
sizeof
(
handle
));
memset
(
handle
,
0
,
sizeof
(
*
handle
));
/* fill the attributes member */
memcpy
(
&
handle
->
attr
,
attr
,
sizeof
(
*
attr
));
...
...
@@ -111,8 +111,8 @@ void dsp_uart_bit_handler(void *x, int bit)
handle
->
data
>>=
1
;
handle
->
data
|=
0x80
*
!!
bit
;
handle
->
nbits
++
;
if
(
handle
->
nbits
==
8
)
{
handle
->
attr
.
bytehandler
(
handle
->
attr
.
bytehandler_arg
,
handle
->
data
);
handle
->
nbits
=
0
;
...
...
libs/openzap/src/zap_analog.c
浏览文件 @
5df3ff76
...
...
@@ -426,7 +426,9 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj)
case
ZAP_CHANNEL_STATE_GET_CALLERID
:
{
zap_channel_done
(
chan
);
zap_channel_command
(
chan
,
ZAP_COMMAND_TRACE_INPUT
,
"/tmp/wtf.ul"
);
zap_channel_command
(
chan
,
ZAP_COMMAND_ENABLE_CALLERID_DETECT
,
NULL
);
continue
;
}
break
;
case
ZAP_CHANNEL_STATE_RING
:
...
...
@@ -619,7 +621,10 @@ static zap_status_t process_event(zap_span_t *span, zap_event_t *event)
if
(
event
->
channel
->
state
==
ZAP_CHANNEL_STATE_DOWN
&&
!
zap_test_flag
(
event
->
channel
,
ZAP_CHANNEL_INTHREAD
))
{
zap_set_state_locked
(
event
->
channel
,
ZAP_CHANNEL_STATE_GET_CALLERID
);
event
->
channel
->
ring_count
=
1
;
zap_thread_create_detached
(
zap_analog_channel_run
,
event
->
channel
);
}
else
{
event
->
channel
->
ring_count
++
;
}
}
break
;
...
...
libs/openzap/src/zap_callerid.c
浏览文件 @
5df3ff76
...
...
@@ -182,6 +182,8 @@ int zap_fsk_demod_init(zap_fsk_data_state_t *state, int rate, uint8_t *buf, zap_
dsp_fsk_destroy
(
&
state
->
fsk1200_handle
);
}
memset
(
state
,
0
,
sizeof
(
*
state
));
memset
(
buf
,
0
,
bufsize
);
state
->
buf
=
buf
;
state
->
bufsize
=
bufsize
;
...
...
libs/openzap/src/zap_io.c
浏览文件 @
5df3ff76
...
...
@@ -1408,13 +1408,12 @@ zap_status_t zap_channel_read(zap_channel_t *zchan, void *data, zap_size_t *data
if
(
zap_fsk_demod_feed
(
&
zchan
->
fsk
,
sln
,
slen
)
!=
ZAP_SUCCESS
)
{
uint32_t
type
,
mlen
;
char
str
[
128
],
*
sp
;
while
(
zap_fsk_data_parse
(
&
zchan
->
fsk
,
&
type
,
&
sp
,
&
mlen
)
==
ZAP_SUCCESS
)
{
*
(
str
+
mlen
)
=
'\0'
;
zap_copy_string
(
str
,
sp
,
++
mlen
);
zap_clean_string
(
str
);
zap_log
(
ZAP_LOG_
DEBUG
,
"FSK: TYPE %s LEN %d VAL [%s]
\n
"
,
zap_mdmf_type2str
(
type
),
mlen
-
1
,
str
);
zap_log
(
ZAP_LOG_
ERROR
,
"FSK: TYPE %s LEN %d VAL [%s]
\n
"
,
zap_mdmf_type2str
(
type
),
mlen
-
1
,
str
);
switch
(
type
)
{
case
MDMF_DDN
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论