Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
eb4cac9b
提交
eb4cac9b
authored
2月 14, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add vmname tag to httapi to play a voicemail recorded name
上级
f507f89e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
63 行增加
和
2 行删除
+63
-2
mod_httapi.c
src/mod/applications/mod_httapi/mod_httapi.c
+48
-2
mod_httapi_doc.txt
src/mod/applications/mod_httapi/mod_httapi_doc.txt
+15
-0
没有找到文件。
src/mod/applications/mod_httapi/mod_httapi.c
浏览文件 @
eb4cac9b
...
...
@@ -395,6 +395,7 @@ static switch_status_t parse_playback(const char *tag_name, client_t *client, sw
const
char
*
say_gender
=
NULL
;
const
char
*
sp_engine
=
NULL
;
const
char
*
sp_grammar
=
NULL
;
char
*
free_string
=
NULL
;
if
(
!
strcasecmp
(
tag_name
,
"say"
))
{
say_lang
=
switch_xml_attr
(
tag
,
"language"
);
...
...
@@ -431,6 +432,48 @@ static switch_status_t parse_playback(const char *tag_name, client_t *client, sw
}
else
{
play
=
1
;
}
}
else
if
(
!
strcasecmp
(
tag_name
,
"vmname"
))
{
const
char
*
id
=
switch_xml_attr
(
tag
,
"id"
);
char
*
cmd
,
*
resp
;
switch_stream_handle_t
stream
=
{
0
};
char
*
p
;
SWITCH_STANDARD_STREAM
(
stream
);
cmd
=
switch_mprintf
(
"%s|name_path"
,
id
);
switch_api_execute
(
"vm_prefs"
,
cmd
,
NULL
,
&
stream
);
resp
=
(
char
*
)
stream
.
data
;
if
(
!
zstr
(
resp
))
{
if
(
switch_stristr
(
"://"
,
resp
)
||
switch_file_exists
(
resp
,
NULL
)
==
SWITCH_STATUS_SUCCESS
)
{
play
=
1
;
file
=
free_string
=
resp
;
resp
=
NULL
;
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Invalid file! [%s]
\n
"
,
resp
);
switch_safe_free
(
resp
);
return
SWITCH_STATUS_FALSE
;
}
}
else
{
switch_safe_free
(
resp
);
say_lang
=
switch_xml_attr
(
tag
,
"language"
);
say_gender
=
switch_xml_attr
(
tag
,
"gender"
);
say_type
=
"name_spelled"
;
say_method
=
"pronounced"
;
free_string
=
strdup
(
id
);
if
((
p
=
strchr
(
free_string
,
'@'
)))
{
*
p
=
'\0'
;
}
say
=
1
;
body
=
free_string
;
switch_ivr_play_file
(
client
->
session
,
NULL
,
"voicemail/vm-person.wav"
,
&
nullargs
);
}
switch_safe_free
(
resp
);
}
...
...
@@ -618,11 +661,13 @@ static switch_status_t parse_playback(const char *tag_name, client_t *client, sw
}
}
}
if
(
dmachine
)
{
switch_ivr_dmachine_destroy
(
&
dmachine
);
}
printf
(
"WTF %d
\n
"
,
status
);
switch_safe_free
(
free_string
);
return
status
;
}
...
...
@@ -2790,6 +2835,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_httapi_load)
bind_parser
(
"record"
,
parse_record
);
bind_parser
(
"recordCall"
,
parse_record_call
);
bind_parser
(
"playback"
,
parse_playback
);
bind_parser
(
"vmName"
,
parse_playback
);
bind_parser
(
"speak"
,
parse_playback
);
bind_parser
(
"say"
,
parse_playback
);
bind_parser
(
"conference"
,
parse_conference
);
...
...
src/mod/applications/mod_httapi/mod_httapi_doc.txt
浏览文件 @
eb4cac9b
...
...
@@ -80,6 +80,21 @@ asr-engine : ASR engine to use
asr-grammar : ASR grammar to use
<vmname file name action digit-timeout input-timeout loops><bind action strip>*EXPR*</bind></playback>
: Plays a vm name and optionally collects input.
ATTRS:
file : The file
name : Param name to save result.
error-file : Error file to play on invalid input.
action : Change the new target url.
temp-action : Change url to submit to. just for the next loop.
digit-timeout : Timeout waiting for digits after file plays (when input bindings are present)
input-timeout : Timeout waiting for more digits in a multi-digit input.
loops : max times to play the file when input bindings are present.
<record file name error-file action digit-timeout input-timeout><bind action strip>*EXPR*</bind></record>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论