MRCP
Client Configuration Manual
Developer Guide
Last updated: March 19, 2017
Created by: Arsen Chaloyan
Table of Contents
3.1 Using the Default Configuration
3.2 Specifying the IP addresses
3.3 Specifying the client port numbers
3.4 Specifying the server port numbers
4.3 The MRCPv2 Setup behind NAT
4.4 The MRCPv1 Setup behind NAT
This guide describes configuration format of the UniMRCP client. Major configuration steps and examples of typical client setups are also provided in this guide.
The document is intended for developers and system administrators. A basic knowledge of the Extended Markup Language (XML) is required.
Unless explicitly stated, instructions provided in this guide are applicable to the following versions.
UniMRCP 1.0.0 and above |
Note that an instance of the UniMRCP client stack can be either loaded from a configuration file or initialized by means of function calls of the client API. This guide explains only the case, when an instance is loaded from an XML configuration file defined by UniMRCP. Other configuration formats may exist but are not covered in this document.
The UniMRCP client uses an XML based configuration format described by the XML Schema.
The client configuration can be entirely stored in one document or be logically split into several parts spanning multiple documents.
The root element of the XML document must be <unimrcpclient>. A document may include other documents located in a subfolder. The subfolder can be specified by the corresponding attribute of the root <unimrcpclient> element.
Name |
Description |
xmlns:xsi |
Defines the XML namespace. |
xsi:noNamespaceSchemaLocation |
References the XML Schema document. |
version |
Specifies the version number of the UniMRCP client document. |
subfolder |
Specifies the subfolder containing supplementary documents. |
None.
Name |
Description |
<properties> |
Specifies the common properties encompassing the whole document. |
<components> |
Specifies the core entities of the client stack. |
<settings> |
Specifies the supplementary settings of the client stack. |
<profiles> |
Specifies the profiles. |
<unimrcpclient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="unimrcpclient.xsd" version="1.0" subfolder="client-profiles"> </unimrcpclient> |
This element is a container of properties. The properties are common parameter encompassing the whole document.
None.
<unimrcpclient>
Name |
Description |
<ip> |
Specifies the local IP address. |
<ext-ip> |
Specifies the external (NAT) IP address. |
<server-ip> |
Specifies the server IP address. |
Specifies the local IP address.
Name |
Description |
type |
Defines the type of the IP address to one of auto or iface. |
<properties>
None.
The IP address can be explicitly specified in the numeric format. For example:
<ip>10.10.0.1</ip> |
If the type attribute is set to auto, then the IP address is implicitly determined by the hostname.
<ip type=”auto”/> |
Alternatively, if the type attribute is set to iface, the IP address is determined by the specified name of the network interface. For example:
<ip type=”iface”>eth0</ip> |
Specifies the external IP address to be used in case the client is allocated behind NAT. The details and usage are the same as for the <ip> element.
Specifies the server IP address. The details and usage are the same as for the <ip> element.
This element is a container of components. The components are core entities of the UniMRCP client stack such as the resource factory, the user agent, the media engine, etc.
None.
<unimrcpclient>
Name |
Description |
<resource-factory> |
Specifies the factory of MRCP resources. |
<sip-uac> |
Specifies the SIP user agent client (MRCPv2 only). |
<rtsp-uac> |
Specifies the RTSP user agent client (MRCPv1 only). |
<mrcpv2-uac> |
Specifies the MRCPv2 transport agent (MRCPv2 only). |
<media-engine> |
Specifies the media processing engine. |
<rtp-factory> |
Specifies the factory of RTP media terminations. |
Specifies the factory of MRCP resources used by the client stack.
None.
<components>
Name |
Description |
<resource > |
Specifies the MRCP resource to load. |
The example below defines a resource factory which has the speech synthesizer and recognizer resources enabled and the recorder and verification resources disabled.
<resource-factory> <resource id="speechsynth" enable="true"/> <resource id="speechrecog" enable="true"/> <resource id="recorder" enable="false"/> <resource id="speakverify" enable="false"/> </resource-factory> |
Specifies the SIP user agent client which is used for MRCPv2 only.
Name |
Description |
id |
Defines a unique name of the agent to be referenced in the profiles. |
type |
Defines the SIP uac type. |
<components>
Name |
Description |
<sip-ip> |
Specifies the local IP address to bind the SIP user agent to. If not specified, the <ip> property is used. |
<sip-ext-ip> |
Specifies the external (NAT) IP address to be used for the SIP user agent. If not specified, the <ext-ip> property is used. |
<sip-port> |
Specifies the local port to bind the SIP user agent to. |
<sip-transport> |
Specifies the SIP transport either UDP or TCP. |
<sip-t1x64> |
Specifies the timeout for outgoing SIP INVITE requests. |
<ua-name> |
Specifies the user agent name included in the SIP messages. |
<sdp-origin> |
Specifies the SDP origin field. |
The example below defines a SIP user agent bound to 10.10.0.1:8062 which uses UDP for SIP message transport.
<sip-uac id="SIP-Agent-1" type="SofiaSIP"> <sip-ip>10.10.0.1</sip-ip> <sip-port>8062</sip-port> <sip-transport>udp</sip-transport> <ua-name>UniMRCP SofiaSIP</ua-name> <sdp-origin>UniMRCPClient</sdp-origin> </sip-uac> |
Specifies the RTSP user agent client which is used for MRCPv1 only.
Name |
Description |
id |
Defines a unique name of the agent to be referenced in the profiles. |
type |
Defines the RTSP uac type. |
<components>
Name |
Description |
<max-connection-count> |
Specifies the maximum number of TCP/RTSP connections per agent. |
<request-timeout> |
Specifies the timeout for outgoing RTSP SETUP requests. |
<sdp-origin> |
Specifies the SDP origin field. |
The example below defines an RTSP user agent which has the max connection count set to 300 and the request timeout to 5s.
<rtsp-uac id="RTSP-Agent-1" type="UniRTSP"> <max-connection-count>300</max-connection-count> <request-timeout>5000</request-timeout> <sdp-origin>UniMRCPClient</sdp-origin> </rtsp-uac> |
Specifies the MRCPv2 transport agent.
Name |
Description |
id |
Defines a unique name of the agent to be referenced in the profiles. |
<components>
Name |
Description |
<max-connection-count> |
Specifies the maximum number of TCP/MRCPv2 connections per agent. |
<request-timeout> |
Specifies the timeout for outgoing MRCPv2 requests. |
<offer-new-connection> |
Specifies whether to offer the server to establish a new connection or re-use the existing one. |
The example below defines an MRCPv2 transport agent which has the max connection count set to 300 and the request timeout to 5s.
<mrcpv2-uac id="MRCPv2-Agent-1"> <max-connection-count>300</max-connection-count> <offer-new-connection>false</offer-new-connection> <request-timeout>5000</request-timeout> </mrcpv2-uac> |
Specifies the media processing engine.
Name |
Description |
id |
Defines a unique name of the media engine to be referenced in the profiles. |
<components>
Name |
Description |
<realtime-rate> |
Specifies the real-time rate of the engine, which must be set to 1 for the most of the cases. |
The example below defines a media engine with the real-time rate set to 1.
<media-engine id="Media-Engine-1"> <realtime-rate>1</realtime-rate> </media-engine> |
Specifies the factory of RTP media terminations.
Name |
Description |
id |
Defines a unique name of the RTP factory to be referenced in the profiles. |
<components>
Name |
Description |
<rtp-ip> |
Specifies the local IP address to be used for RTP streaming. If not specified, the <ip> property is used. |
<rtp-ext-ip> |
Specifies the external (NAT) IP address to be used for RTP streaming. If not specified, the <ext-ip> property is used. |
The example below defines a factory of RTP media terminations with the port range set to [4000-5000) and the IP address set to 10.10.0.1.
<rtp-factory id="RTP-Factory-1"> <rtp-ip>10.10.0.1</rtp-ip> <rtp-port-min>4000</rtp-port-min> <rtp-port-max>5000</rtp-port-max> </rtp-factory> |
This element is a container of the SIP, RTSP and RTP settings. The settings are used in conjunction with the corresponding components. Associations between the settings and the components are defined in the profiles. For example, one instance of the SIP user agent can be used to access two different MRCPv2 servers, where the server parameters are defined in the corresponding SIP settings, one per server.
None.
<unimrcpclient>
Name |
Description |
<sip-settings> |
Specifies the SIP settings which are used to connect to a particular MRCPv2 server. |
<rtsp-settings> |
Specifies the RTSP settings which are used to connect to a particular MRCPv1 server. |
<rtp-settings> |
Specifies the RTP settings. |
Specifies the SIP settings which identify a particular MRCPv2 server.
Name |
Description |
id |
Defines a unique name of the SIP settings to be referenced in the profiles. |
<settings>
Name |
Description |
<server-ip> |
Specifies the server IP address. If not specified, the <server-ip> property is used. |
<server-port> |
Specifies the server SIP port number. |
The example below defines SIP settings which identify an MRCPv2 server located at 10.10.0.2:8060.
<sip-settings id="SIP-Settings-1"> <server-ip>10.10.0.2</server-ip> <server-port>8060</server-port> </sip-settings> |
Specifies the RTSP settings which identify a particular MRCPv1 server.
Name |
Description |
id |
Defines a unique name of the RTSP settings to be referenced in the profiles. |
<settings>
Name |
Description |
<server-ip> |
Specifies the server IP address. If not specified, the <server-ip> property is used. |
<server-port> |
Specifies the server RTSP port number. |
<resource-location> |
Specifies the MRCP resource location on the server. |
<resource-map> |
Allows defining a custom map of MRCP resources for a particular server. |
The example below defines RTSP settings which identify an MRCPv1 server located at 10.10.0.3:1554.
<rtsp-settings id="RTSP-Settings-1"> <server-ip>10.10.0.3</server-ip> <server-port>1554</server-port> <resource-location>media</resource-location> <resource-map> <param name="speechsynth" value="speechsynthesizer"/> <param name="speechrecog" value="speechrecognizer"/> </resource-map> </rtsp-settings> |
Specifies the settings used for RTP/RTCP streaming.
Name |
Description |
id |
Defines a unique name of the RTP settings to be referenced in the profiles. |
<settings>
Name |
Description |
<jitter-buffer> |
Specifies the jitter buffer settings. |
<ptime> |
Specifies the packetization time. |
<codecs> |
Specifies the supported codecs. |
<rtcp> |
Specifies the RTCP settings. |
The example below defines typical RTP settings.
<rtp-settings id="RTP-Settings-1"> <jitter-buffer> <adaptive>1</adaptive> <playout-delay>50</playout-delay> <max-playout-delay>600</max-playout-delay> <time-skew-detection>1</time-skew-detection> </jitter-buffer> <ptime>20</ptime> <codecs>PCMU PCMA L16/96/8000 telephone-event/101/8000</codecs> <rtcp enable="false"/> </rtp-settings> |
This element is a container of the MRCPv2 and MRCPv1 profiles. The profiles define associations between certain components and settings. The profile must be assigned a unique identifier to be used by a user client application. There can be multiple profiles defined. The application specifies the name of one of existing profiles upon creation of a new MRCP session.
None.
<unimrcpclient>
Name |
Description |
<mrcpv2-profile> |
Specifies the MRCPv2 profile. |
<mrcpv1-profile> |
Specifies the MRCPv1 profile. |
Specifies the MRCPv2 profile as a collection of SIP user and MRCPv2 transport agents, media engines, RTP factories, SIP and RTP settings.
Name |
Description |
id |
Defines a unique name of the profile to be used by a user client application. |
<profiles>
Name |
Description |
<sip-uac> |
References one or more SIP user agents. |
<mrcpv2-uac> |
References one or more MRCPv2 transport agents. |
<media-engine> |
References one or more media engines. |
<rtp-factory> |
References an RTP factory. |
<sip-settings> |
References SIP settings. |
<rtp-settings> |
References RTP settings. |
The example below defines a typical 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>SIP-Settings-1</sip-settings> <rtp-settings>RTP-Settings-1</rtp-settings> </mrcpv2-profile> |
Specifies the MRCPv1 profile as a collection of RTSP user agents, media engines, RTP factories, RTSP and RTP settings.
Name |
Description |
id |
Defines a unique name of the profile to be used by a user client application. |
<profiles>
Name |
Description |
<rtsp-uac> |
References one or more RTSP user agents. |
<media-engine> |
References one or more media engines. |
<rtp-factory> |
References an RTP factory. |
<rtsp-settings> |
References RTSP settings. |
<rtp-settings> |
References RTP settings. |
The example below defines a typical 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>RTSP-Settings-1</rtsp-settings> <rtp-settings>RTP-Settings-1</rtp-settings> </mrcpv1-profile> |
This section outlines major configuration steps.
The default configuration files are located in the conf directory of the source tree and are being copied to the output directory upon installation. The default client configuration is logically split into the main unimrcpclient.xml document and vendor-specific supplementary documents located in the client-profiles subfolder.
Specify the IP addresses of the client and the server in the common <properties> element.
Note that if the client and the server are located on the same host, the default configuration can be used as is, without any modification.
Set the client IP address. For example:
<ip>10.10.0.1</ip> |
Set the server IP address. For example:
<server-ip>10.10.0.2</server-ip> |
Specify the port number of the SIP user agent and the RTP port range for the client. Note that the default settings should be sufficient for most of the cases.
Set the port number of SIP user agent client in the corresponding <sip-uac> element. For example:
<sip-port>8062</sip-port> |
Set the RTP port range for the client in the corresponding <rtp-factory> element. For example:
<rtp-port-min>4000</rtp-port-min> <rtp-port-max>5000</rtp-port-max> |
Specify the server SIP and RTSP port numbers. In the default configuration, these settings are defined in vendor-specific documents and may differ for each particular server.
Set the server SIP port number in the corresponding <sip-settings> element. For example:
<server-port>8060</server-port> |
Set the server RTSP port number in the corresponding <rtsp-settings> element. For example:
<server-port>1554</server-port> |
Specify the supported or offered codecs for the client. In the default configuration, only the codecs with 8 kHz sampling rate are enabled. The list of supported codecs can be expanded to include also the codecs with 16 kHz sampling rate or, vice versa, be restricted to offer a particular codec.
Set the list of supported codecs in the corresponding <rtp-settings> element. For example:
<codecs>PCMU PCMA L16/96/8000 telephone-event/101/8000</codecs> |
This section provides configuration examples for typical client setups.
The UniMRCP client uses an MRCPv2 server located on the same network.
· client IP address: 192.168.1.10 · server IP address: 192.168.1.7 · client SIP port: 8062 · server SIP port: 8060 · client RTP port range: [4000, 5000) · client codecs: PCMU, PCMA, L16, telephone-event |
The UniMRCP client uses an MRCPv1 server located on the same network.
· client IP address: 192.168.1.10 · server IP address: 192.168.1.7 · server RTSP port: 1554 · client RTP port range: [4000, 5000) · client codecs: PCMU, PCMA, L16, telephone-event |
The UniMRCP client is located behind NAT and uses an MRCPv2 server.
· client IP address: 192.168.1.10 · router internal IP address: 192.168.1.1 · router external IP address: 10.10.1.1 · server IP address: 10.10.1.2 · client SIP port: 8062 · server SIP port: 8060 · client RTP port range: [4000, 5000) · client codecs: PCMU, PCMA, L16, telephone-event |
None.
The UniMRCP client is located behind NAT and uses an MRCPv1 server.
· client IP address: 192.168.1.10 · router internal IP address: 192.168.1.1 · router external IP address: 10.10.1.1 · server IP address: 10.10.1.2 · server RTSP port: 1554 · client RTP port range: [4000, 5000) · client codecs: PCMU, PCMA, L16, telephone-event |
None.