Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
338c1737
提交
338c1737
authored
7月 19, 2012
作者:
Christopher Rienzo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
parse uuid and descriptor name in start_tone_detect API
上级
0ac014da
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
24 行增加
和
11 行删除
+24
-11
mod_spandsp.c
src/mod/applications/mod_spandsp/mod_spandsp.c
+24
-11
没有找到文件。
src/mod/applications/mod_spandsp/mod_spandsp.c
浏览文件 @
338c1737
...
...
@@ -266,19 +266,30 @@ SWITCH_STANDARD_API(start_tone_detect_api)
{
switch_status_t
status
=
SWITCH_STATUS_SUCCESS
;
switch_core_session_t
*
psession
=
NULL
;
char
*
puuid
=
NULL
,
*
descriptor
=
NULL
;
if
(
zstr
(
cmd
))
{
stream
->
write_function
(
stream
,
"-ERR missing
descriptor name
\n
"
);
stream
->
write_function
(
stream
,
"-ERR missing
uuid
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
}
if
(
!
(
psession
=
switch_core_session_locate
(
cmd
)))
{
stream
->
write_function
(
stream
,
"-ERR Cannot locate session
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
puuid
=
strdup
((
char
*
)
cmd
);
if
((
descriptor
=
strchr
(
puuid
,
' '
)))
{
*
descriptor
++
=
'\0'
;
}
if
(
zstr
(
descriptor
))
{
stream
->
write_function
(
stream
,
"-ERR missing descriptor name
\n
"
);
goto
end
;
}
if
(
!
(
psession
=
switch_core_session_locate
(
puuid
)))
{
stream
->
write_function
(
stream
,
"-ERR Cannot locate session
\n
"
);
goto
end
;
}
status
=
callprogress_detector_start
(
psession
,
cmd
);
status
=
callprogress_detector_start
(
psession
,
descriptor
);
if
(
status
==
SWITCH_STATUS_SUCCESS
)
{
stream
->
write_function
(
stream
,
"+OK started
\n
"
);
...
...
@@ -288,10 +299,12 @@ SWITCH_STANDARD_API(start_tone_detect_api)
switch_core_session_rwunlock
(
psession
);
return
status
;
}
end
:
switch_safe_free
(
puuid
);
return
status
;
}
/**
* Stop tone detector application
...
...
@@ -319,7 +332,7 @@ SWITCH_STANDARD_API(stop_tone_detect_api)
switch_core_session_t
*
psession
=
NULL
;
if
(
zstr
(
cmd
))
{
stream
->
write_function
(
stream
,
"-ERR missing
descriptor name
\n
"
);
stream
->
write_function
(
stream
,
"-ERR missing
session UUID
\n
"
);
return
SWITCH_STATUS_SUCCESS
;
}
...
...
@@ -732,10 +745,10 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_spandsp_init)
if
(
mod_spandsp_dsp_load
(
module_interface
,
pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Couldn't load or process spandsp.conf, not adding tone_detect applications
\n
"
);
}
else
{
SWITCH_ADD_APP
(
app_interface
,
"start_tone_detect"
,
"Start background tone detection with cadence"
,
""
,
start_tone_detect_app
,
"
[name]
"
,
SAF_NONE
);
SWITCH_ADD_APP
(
app_interface
,
"start_tone_detect"
,
"Start background tone detection with cadence"
,
""
,
start_tone_detect_app
,
"
<name>
"
,
SAF_NONE
);
SWITCH_ADD_APP
(
app_interface
,
"stop_tone_detect"
,
"Stop background tone detection with cadence"
,
""
,
stop_tone_detect_app
,
""
,
SAF_NONE
);
SWITCH_ADD_API
(
api_interface
,
"start_tone_detect"
,
"Start background tone detection with cadence"
,
start_tone_detect_api
,
"
[name]
"
);
SWITCH_ADD_API
(
api_interface
,
"stop_tone_detect"
,
"Stop background tone detection with cadence"
,
stop_tone_detect_api
,
""
);
SWITCH_ADD_API
(
api_interface
,
"start_tone_detect"
,
"Start background tone detection with cadence"
,
start_tone_detect_api
,
"
<uuid> <name>
"
);
SWITCH_ADD_API
(
api_interface
,
"stop_tone_detect"
,
"Stop background tone detection with cadence"
,
stop_tone_detect_api
,
"
<uuid>
"
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论