介绍
顶顶通呼叫中心中间件通过asrproxy程序对接各种asr和tts,本文主要讲解 asrproxy程序 对接 mrcp v1 和 mrcp v2的配置。
asrproxy.json配置
asr配置
javascript
"asr":{
"interface": {
"mrcp": {
"count": 0,
"fault_threshold": 0,
"fault_try_interval": 600,
"type": "mrcp",
"engine": "uni2",
"grammar":"ahlt_ats.grxml",
"appid": "",
"key": "",
"secret": ""
}
},
"groups":{
"default":{
"mode":0,
"enable":[
"mrcp"
]
}
},
- grammar 语法配置文件,由ASR提供。
- engine mrcp的配置文件client-profiles/unimrcp.xml里面配置的mrcp-profile
tts 配置
javascript
"mrcp": {
"count": 0,
"fault_threshold": 0,
"fault_try_interval": 600,
"type": "mrcp",
"engine": "uni2-tts",
"appid": "",
"key": "",
"secret": ""
}
},
"groups":{
"default":{
"mode":1,
"enable":[
"mrcp"
]
}
},
- engine mrcp的配置文件client-profiles/unimrcp.xml里面配置的mrcp-profile
mrcp 配置
unimrcpclient.xml
主要设置本机IP和本机外网IP
xml
<properties>
<!--
If the attribute "type" is set to "auto", IP address is determined implicitly by the hostname.
This is the default setting.
-->
<ip type="auto"/>
<!--
If the attribute "type" is set to "iface", IP address is determined by the specified name of
network interface/adapter.
-->
<!-- <ip type="iface">eth0</ip>-->
<!--
IP address can also be specified explicitly.
-->
<ip>改成本机IP</ip>
<!--
<ext-ip>如果mrcpserver是外网取消这个注释,这里设置本机外网IP </ext-ip>
-->
<!--
Server IP address should be specified explicitly, unless the client and the server are located on
the same host. The server IP address can also be specified per <sip-settings> and <rtsp-settings>.
-->
<!-- <server-ip>a.b.c.d</server-ip> -->
</properties>
client-profiles/unimrcp.xml
主要配置mrcpv2 服务器IP和端口,如果mrcpv1配置V1对应的。
xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- UniMRCP client document -->
<unimrcpclient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../unimrcpclient.xsd"
version="1.0">
<settings>
<!-- SIP MRCPv2 settings -->
<sip-settings id="UniMRCP-SIP-Settings">
<!--
Server IP address can explicitly be specified per "sip-settings". Otherwise, the server IP
address defaults to "server-ip" set in the properties, which in turn defaults to "ip".
-->
<server-ip>mrcpv2 ASR 服务器外网Ip</server-ip>
<server-port>mrcpv2 ASR 服务器外网端口</server-port>
<force-destination>true</force-destination>
<!-- <feature-tags>speechrecog.engine="SR-1";speechsynth.engine="SS-1"</feature-tags> -->
</sip-settings>
<sip-settings id="TTS-UniMRCP-SIP-Settings">
<!--
Server IP address can explicitly be specified per "sip-settings". Otherwise, the server IP
address defaults to "server-ip" set in the properties, which in turn defaults to "ip".
-->
<server-ip>mrcpv2 TTS 服务器外网Ip</server-ip>
<server-port>mrcpv2 TTS 服务器外网端口</server-port>
<!-- <force-destination>true</force-destination> -->
<!-- <feature-tags>speechrecog.engine="SR-1";speechsynth.engine="SS-1"</feature-tags> -->
</sip-settings>
<!-- RTSP MRCPv1 settings -->
<rtsp-settings id="UniMRCP-RTSP-Settings">
<!--
Server IP address can explicitly be specified per "rtsp-settings". Otherwise, the server IP
address defaults to "server-ip" set in the properties, which in turn defaults to "ip".
-->
<!-- <server-ip>10.10.0.1</server-ip> -->
<server-port>1554</server-port>
<!-- <force-destination>true</force-destination> -->
<resource-location>media</resource-location>
<resource-map>
<param name="speechsynth" value="speechsynthesizer"/>
<param name="speechrecog" value="speechrecognizer"/>
</resource-map>
</rtsp-settings>
</settings>
<profiles>
<!-- UniMRCP MRCPv2 profile -->
<mrcpv2-profile id="uni2">
<sip-uac>SIP-Agent-1</sip-uac>
<mrcpv2-uac>MRCPv2-Agent-1</mrcpv2-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<sip-settings>UniMRCP-SIP-Settings</sip-settings>
<rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv2-profile>
<mrcpv2-profile id="uni2-tts">
<sip-uac>SIP-Agent-1</sip-uac>
<mrcpv2-uac>MRCPv2-Agent-1</mrcpv2-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<sip-settings>TTS-UniMRCP-SIP-Settings</sip-settings>
<rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv2-profile>
<!-- UniMRCP MRCPv1 profile -->
<mrcpv1-profile id="uni1">
<rtsp-uac>RTSP-Agent-1</rtsp-uac>
<media-engine>Media-Engine-1</media-engine>
<rtp-factory>RTP-Factory-1</rtp-factory>
<rtsp-settings>UniMRCP-RTSP-Settings</rtsp-settings>
<rtp-settings>RTP-Settings-1</rtp-settings>
</mrcpv1-profile>
<!-- More profiles may follow. -->
</profiles>
</unimrcpclient>