Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
9415487a
提交
9415487a
authored
5月 03, 2016
作者:
Piotr Gregor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9124 [avmd] Extend XML config
Add number of continuous streak samples.
上级
6fc6efa0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
6 行删除
+23
-6
avmd.conf.xml
...applications/mod_avmd/conf/autoload_configs/avmd.conf.xml
+4
-0
mod_avmd.c
src/mod/applications/mod_avmd/mod_avmd.c
+19
-6
没有找到文件。
src/mod/applications/mod_avmd/conf/autoload_configs/avmd.conf.xml
浏览文件 @
9415487a
...
@@ -32,6 +32,10 @@
...
@@ -32,6 +32,10 @@
in the SMA buffer without reset -->
in the SMA buffer without reset -->
<param
name=
"require_continuous_streak"
value=
"1"
/>
<param
name=
"require_continuous_streak"
value=
"1"
/>
<!-- required number of consecutive elements in the SMA buffer
without reset -->
<param
name=
"sample_n_continuous_streak"
value=
"15"
/>
<!-- define number of samples to skip starting from the beginning
<!-- define number of samples to skip starting from the beginning
of the frame and after reset -->
of the frame and after reset -->
<param
name=
"sample_n_to_skeep"
value=
"6"
/>
<param
name=
"sample_n_to_skeep"
value=
"6"
/>
...
...
src/mod/applications/mod_avmd/mod_avmd.c
浏览文件 @
9415487a
...
@@ -99,12 +99,14 @@
...
@@ -99,12 +99,14 @@
#endif
#endif
/*! Syntax of the API call. */
/*! Syntax of the API call. */
#define AVMD_SYNTAX "<uuid> < start | stop | set [inbound|outbound|default] | load [inbound|outbound] | reload | show>"
#define AVMD_SYNTAX "<uuid> < start | stop | set [inbound|outbound|default] | load [inbound|outbound] | reload | show
>"
/*! Number of expected parameters in api call. */
/*! Number of expected parameters in api call. */
#define AVMD_PARAMS_MIN 1u
#define AVMD_PARAMS_MIN 1u
#define AVMD_PARAMS_MAX 2u
#define AVMD_PARAMS_MAX 2u
/* don't forget to update avmd_events_str table
* if you modify this */
enum
avmd_event
enum
avmd_event
{
{
AVMD_EVENT_BEEP
=
0
,
AVMD_EVENT_BEEP
=
0
,
...
@@ -136,6 +138,7 @@ struct avmd_settings {
...
@@ -136,6 +138,7 @@ struct avmd_settings {
uint8_t
report_status
;
uint8_t
report_status
;
uint8_t
fast_math
;
uint8_t
fast_math
;
uint8_t
require_continuous_streak
;
uint8_t
require_continuous_streak
;
uint16_t
sample_n_continuous_streak
;
uint16_t
sample_n_to_skeep
;
uint16_t
sample_n_to_skeep
;
uint8_t
simplified_estimation
;
uint8_t
simplified_estimation
;
uint8_t
inbound_channnel
;
uint8_t
inbound_channnel
;
...
@@ -211,7 +214,7 @@ static switch_status_t avmd_load_xml_inbound_configuration(switch_mutex_t *mutex
...
@@ -211,7 +214,7 @@ static switch_status_t avmd_load_xml_inbound_configuration(switch_mutex_t *mutex
/* API [load outbound], reload + set outbound */
/* API [load outbound], reload + set outbound */
static
switch_status_t
avmd_load_xml_outbound_configuration
(
switch_mutex_t
*
mutex
);
static
switch_status_t
avmd_load_xml_outbound_configuration
(
switch_mutex_t
*
mutex
);
/* bind callback */
/* bind
reloadxml
callback */
static
void
static
void
avmd_reloadxml_event_handler
(
switch_event_t
*
event
);
avmd_reloadxml_event_handler
(
switch_event_t
*
event
);
...
@@ -514,6 +517,7 @@ static void avmd_set_xml_default_configuration(switch_mutex_t *mutex)
...
@@ -514,6 +517,7 @@ static void avmd_set_xml_default_configuration(switch_mutex_t *mutex)
avmd_globals
.
settings
.
report_status
=
1
;
avmd_globals
.
settings
.
report_status
=
1
;
avmd_globals
.
settings
.
fast_math
=
0
;
avmd_globals
.
settings
.
fast_math
=
0
;
avmd_globals
.
settings
.
require_continuous_streak
=
1
;
avmd_globals
.
settings
.
require_continuous_streak
=
1
;
avmd_globals
.
settings
.
sample_n_continuous_streak
=
15
;
avmd_globals
.
settings
.
sample_n_to_skeep
=
6
;
avmd_globals
.
settings
.
sample_n_to_skeep
=
6
;
avmd_globals
.
settings
.
simplified_estimation
=
1
;
avmd_globals
.
settings
.
simplified_estimation
=
1
;
avmd_globals
.
settings
.
inbound_channnel
=
0
;
avmd_globals
.
settings
.
inbound_channnel
=
0
;
...
@@ -592,8 +596,16 @@ avmd_load_xml_configuration(switch_mutex_t *mutex)
...
@@ -592,8 +596,16 @@ avmd_load_xml_configuration(switch_mutex_t *mutex)
avmd_globals
.
settings
.
fast_math
=
switch_true
(
value
)
?
1
:
0
;
avmd_globals
.
settings
.
fast_math
=
switch_true
(
value
)
?
1
:
0
;
}
else
if
(
!
strcmp
(
name
,
"require_continuous_streak"
))
{
}
else
if
(
!
strcmp
(
name
,
"require_continuous_streak"
))
{
avmd_globals
.
settings
.
require_continuous_streak
=
switch_true
(
value
)
?
1
:
0
;
avmd_globals
.
settings
.
require_continuous_streak
=
switch_true
(
value
)
?
1
:
0
;
}
else
if
(
!
strcmp
(
name
,
"sample_n_continuous_streak"
))
{
if
(
avmd_parse_u16_user_input
(
value
,
&
avmd_globals
.
settings
.
sample_n_continuous_streak
,
0
,
UINT16_MAX
)
==
-
1
)
{
status
=
SWITCH_STATUS_TERM
;
goto
done
;
}
}
else
if
(
!
strcmp
(
name
,
"sample_n_to_skeep"
))
{
}
else
if
(
!
strcmp
(
name
,
"sample_n_to_skeep"
))
{
if
(
avmd_parse_u16_user_input
(
value
,
&
avmd_globals
.
settings
.
sample_n_to_skeep
,
0
,
UINT16_MAX
)
==
-
1
)
if
(
avmd_parse_u16_user_input
(
value
,
&
avmd_globals
.
settings
.
sample_n_to_skeep
,
0
,
UINT16_MAX
)
==
-
1
)
{
{
status
=
SWITCH_STATUS_TERM
;
status
=
SWITCH_STATUS_TERM
;
goto
done
;
goto
done
;
...
@@ -675,7 +687,8 @@ avmd_show(switch_stream_handle_t *stream, switch_mutex_t *mutex)
...
@@ -675,7 +687,8 @@ avmd_show(switch_stream_handle_t *stream, switch_mutex_t *mutex)
stream
->
write_function
(
stream
,
"debug
\t
%u
\n
"
,
avmd_globals
.
settings
.
debug
);
stream
->
write_function
(
stream
,
"debug
\t
%u
\n
"
,
avmd_globals
.
settings
.
debug
);
stream
->
write_function
(
stream
,
"report status
\t
%u
\n
"
,
avmd_globals
.
settings
.
report_status
);
stream
->
write_function
(
stream
,
"report status
\t
%u
\n
"
,
avmd_globals
.
settings
.
report_status
);
stream
->
write_function
(
stream
,
"fast_math
\t
%u
\n
"
,
avmd_globals
.
settings
.
fast_math
);
stream
->
write_function
(
stream
,
"fast_math
\t
%u
\n
"
,
avmd_globals
.
settings
.
fast_math
);
stream
->
write_function
(
stream
,
"require continuous treak
\t
%u
\n
"
,
avmd_globals
.
settings
.
require_continuous_streak
);
stream
->
write_function
(
stream
,
"require continuous streak
\t
%u
\n
"
,
avmd_globals
.
settings
.
require_continuous_streak
);
stream
->
write_function
(
stream
,
"sample n continuous streak
\t
%u
\n
"
,
avmd_globals
.
settings
.
sample_n_continuous_streak
);
stream
->
write_function
(
stream
,
"sample n to skeep
\t
%u
\n
"
,
avmd_globals
.
settings
.
sample_n_to_skeep
);
stream
->
write_function
(
stream
,
"sample n to skeep
\t
%u
\n
"
,
avmd_globals
.
settings
.
sample_n_to_skeep
);
stream
->
write_function
(
stream
,
"simplified estimation
\t
%u
\n
"
,
avmd_globals
.
settings
.
simplified_estimation
);
stream
->
write_function
(
stream
,
"simplified estimation
\t
%u
\n
"
,
avmd_globals
.
settings
.
simplified_estimation
);
stream
->
write_function
(
stream
,
"inbound channel
\t
%u
\n
"
,
avmd_globals
.
settings
.
inbound_channnel
);
stream
->
write_function
(
stream
,
"inbound channel
\t
%u
\n
"
,
avmd_globals
.
settings
.
inbound_channnel
);
...
@@ -1528,8 +1541,8 @@ static void avmd_process(avmd_session_t *s, switch_frame_t *frame)
...
@@ -1528,8 +1541,8 @@ static void avmd_process(avmd_session_t *s, switch_frame_t *frame)
/* DECISION */
/* DECISION */
/* If variance is less than threshold
/* If variance is less than threshold
* and we have at least two estimates
* and we have at least two estimates
and more than required by continuous
* then we have detection */
*
streak option
then we have detection */
#ifdef AVMD_REQUIRE_CONTINUOUS_STREAK
#ifdef AVMD_REQUIRE_CONTINUOUS_STREAK
if
(
v
<
VARIANCE_THRESHOLD
&&
(
s
->
sma_b
.
lpos
>
1
)
&&
(
s
->
samples_streak
==
0
))
{
if
(
v
<
VARIANCE_THRESHOLD
&&
(
s
->
sma_b
.
lpos
>
1
)
&&
(
s
->
samples_streak
==
0
))
{
#else
#else
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论