Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d0e77901
提交
d0e77901
authored
7月 11, 2017
作者:
Matt Williamson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10490 [mod_unimrcp] application/xml content-type for unimrcp grammar
上级
571bff4d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
1 行删除
+12
-1
mod_unimrcp.c
src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c
+12
-1
没有找到文件。
src/mod/asr_tts/mod_unimrcp/mod_unimrcp.c
浏览文件 @
d0e77901
...
...
@@ -144,6 +144,9 @@ struct profile {
/** MIME type to use for SRGS ABNF grammars */
const
char
*
srgs_mime_type
;
/** MIME type to use for Google Speech module context */
const
char
*
xml_mime_type
;
/** MIME type to use for SSML (TTS) */
const
char
*
ssml_mime_type
;
...
...
@@ -209,6 +212,7 @@ static int get_next_speech_channel_number(void);
#define GSL_ID ";GSL2.0"
#define ABNF_ID "#ABNF"
#define JSGF_ID "#JSGF"
#define GSR_ID "<speech-context"
#define BUILTIN_ID "builtin:"
#define SESSION_ID "session:"
#define HTTP_ID "http://"
...
...
@@ -428,7 +432,9 @@ enum grammar_type {
/* application/x-nuance-gsl */
GRAMMAR_TYPE_NUANCE_GSL
,
/* application/x-jsgf */
GRAMMAR_TYPE_JSGF
GRAMMAR_TYPE_JSGF
,
/* application/xml */
GRAMMAR_TYPE_XML
};
typedef
enum
grammar_type
grammar_type_t
;
...
...
@@ -550,6 +556,7 @@ static switch_status_t profile_create(profile_t ** profile, const char *name, sw
lprofile
->
gsl_mime_type
=
"application/x-nuance-gsl"
;
lprofile
->
jsgf_mime_type
=
"application/x-jsgf"
;
lprofile
->
ssml_mime_type
=
"application/ssml+xml"
;
lprofile
->
xml_mime_type
=
"application/xml"
;
switch_core_hash_init
(
&
lprofile
->
default_synth_params
);
switch_core_hash_init
(
&
lprofile
->
default_recog_params
);
*
profile
=
lprofile
;
...
...
@@ -2161,6 +2168,8 @@ static const char *grammar_type_to_mime(grammar_type_t type, profile_t *profile)
return
profile
->
gsl_mime_type
;
case
GRAMMAR_TYPE_JSGF
:
return
profile
->
jsgf_mime_type
;
case
GRAMMAR_TYPE_XML
:
return
profile
->
xml_mime_type
;
}
return
""
;
}
...
...
@@ -3270,6 +3279,8 @@ static switch_status_t recog_asr_load_grammar(switch_asr_handle_t *ah, const cha
type
=
GRAMMAR_TYPE_SRGS
;
}
else
if
(
text_starts_with
(
grammar_data
,
JSGF_ID
))
{
type
=
GRAMMAR_TYPE_JSGF
;
}
else
if
(
text_starts_with
(
grammar_data
,
GSR_ID
))
{
type
=
GRAMMAR_TYPE_XML
;
}
else
{
switch_log_printf
(
SWITCH_CHANNEL_UUID_LOG
(
schannel
->
session_uuid
),
SWITCH_LOG_ERROR
,
"(%s) unable to determine grammar type: %s
\n
"
,
schannel
->
name
,
grammar_data
);
status
=
SWITCH_STATUS_FALSE
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论