Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
09a3e63b
提交
09a3e63b
authored
3月 20, 2013
作者:
Raymond Chandler
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add param to not fail module load on device fail
上级
2b8b6cef
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
16 行增加
和
2 行删除
+16
-2
portaudio.conf.xml
...ts/mod_portaudio/conf/autoload_configs/portaudio.conf.xml
+3
-0
mod_portaudio.c
src/mod/endpoints/mod_portaudio/mod_portaudio.c
+13
-2
没有找到文件。
src/mod/endpoints/mod_portaudio/conf/autoload_configs/portaudio.conf.xml
浏览文件 @
09a3e63b
...
...
@@ -31,6 +31,9 @@
<!--audio sample rate and interval -->
<param
name=
"sample-rate"
value=
"48000"
/>
<param
name=
"codec-ms"
value=
"20"
/>
<!--uncomment the following line to make mod_portaudio fail to load if it fails to find a device-->
<param
name=
"unload-on-device-fail"
value=
"true"
/>
</settings>
<!--
...
...
src/mod/endpoints/mod_portaudio/mod_portaudio.c
浏览文件 @
09a3e63b
...
...
@@ -25,6 +25,7 @@
*
* Anthony Minessale II <anthm@freeswitch.org>
* Moises Silva <moises.silva@gmail.com> (Multiple endpoints work sponsored by Comrex Corporation)
* Raymond Chandler <intralanman@freeswitch.org>
*
*
* mod_portaudio.c -- PortAudio Endpoint Module
...
...
@@ -185,6 +186,7 @@ static struct {
int
indev
;
int
outdev
;
int
call_id
;
int
unload_device_fail
;
switch_hash_t
*
call_hash
;
switch_mutex_t
*
device_lock
;
switch_mutex_t
*
pvt_lock
;
...
...
@@ -1653,6 +1655,7 @@ static switch_status_t load_config(void)
globals
.
no_ring_during_call
=
0
;
globals
.
indev
=
globals
.
outdev
=
globals
.
ringdev
=
-
1
;
globals
.
sample_rate
=
8000
;
globals
.
unload_device_fail
=
0
;
if
((
settings
=
switch_xml_child
(
cfg
,
"settings"
)))
{
for
(
param
=
switch_xml_child
(
settings
,
"param"
);
param
;
param
=
param
->
next
)
{
...
...
@@ -1729,6 +1732,8 @@ static switch_status_t load_config(void)
}
else
{
globals
.
ringdev
=
get_dev_by_name
(
val
,
0
);
}
}
else
if
(
!
strcasecmp
(
var
,
"unload-on-device-fail"
))
{
globals
.
unload_device_fail
=
switch_true
(
val
);
}
}
}
...
...
@@ -1761,21 +1766,27 @@ static switch_status_t load_config(void)
if
(
globals
.
indev
<
0
)
{
globals
.
indev
=
get_dev_by_name
(
NULL
,
1
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"global indev [%d]
\n
"
,
globals
.
indev
);
if
(
globals
.
indev
>
-
1
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Switching to default input device
\n
"
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Cannot find an input device
\n
"
);
status
=
SWITCH_STATUS_GENERR
;
if
(
globals
.
unload_device_fail
)
{
status
=
SWITCH_STATUS_GENERR
;
}
}
}
if
(
globals
.
outdev
<
0
)
{
globals
.
outdev
=
get_dev_by_name
(
NULL
,
0
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_DEBUG
,
"global outdev [%d]
\n
"
,
globals
.
outdev
);
if
(
globals
.
outdev
>
-
1
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"Switching to default output device
\n
"
);
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Cannot find an output device
\n
"
);
status
=
SWITCH_STATUS_GENERR
;
if
(
globals
.
unload_device_fail
)
{
status
=
SWITCH_STATUS_GENERR
;
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论