Powered by Universal Speech Solutions LLC

 MRCP

Client Configuration Manual

Developer Guide

 

Revision: 51

Last updated: March 19, 2017

Created by: Arsen Chaloyan


 

Table of Contents

1  Overview.. 4

1.1         Applicable Versions. 4

2  Configuration Format 5

2.1         Document 5

2.2         Properties. 6

<ip>. 6

<ext-ip>. 7

<server-ip>. 7

2.3         Components. 7

<resource-factory>. 7

<sip-uac>. 8

<rtsp-uac>. 9

<mrcpv2-uac>. 10

<media-engine>. 11

<rtp-factory>. 11

2.4         Settings. 12

<sip-settings>. 13

<rtsp-setting>. 13

<rtp-setting>. 14

2.5         Profiles. 15

<mrcpv2-profile>. 16

<mrcpv1-profile>. 16

3  Configuration Steps. 18

3.1         Using the Default Configuration. 18

3.2         Specifying the IP addresses. 18

3.3         Specifying the client port numbers. 18

3.4         Specifying the server port numbers. 19

3.5         Specifying the codecs. 19

4  Configuration Examples. 20

4.1         The MRCPv2 Setup. 20

Description. 20

Topology. 20

Parameters. 20

Sample Configuration. 20

Sample Network Captures. 20

4.2         The MRCPv1 Setup. 21

Description. 21

Topology. 21

Parameters. 21

Sample Configuration. 21

Sample Network Captures. 21

4.3         The MRCPv2 Setup behind NAT. 22

Description. 22

Topology. 22

Parameters. 22

Sample Configuration. 22

Sample Network Captures. 22

4.4         The MRCPv1 Setup behind NAT. 22

Description. 22

Topology. 23

Parameters. 23

Sample Configuration. 23

Sample Network Captures. 23

 

 

1       Overview

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.

1.1      Applicable Versions

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.

 

2       Configuration Format

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.

2.1      Document

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.

Attributes

 

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.

 

Parent

None.

Children

 

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.

 

Example

 

<unimrcpclient xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

               xsi:noNamespaceSchemaLocation="unimrcpclient.xsd"

               version="1.0"

               subfolder="client-profiles">

</unimrcpclient>

 

2.2      Properties

This element is a container of properties. The properties are common parameter encompassing the whole document.

Attributes

            None.

Parent

<unimrcpclient>

Children

 

Name

Description

<ip>

Specifies the local IP address.

<ext-ip>

Specifies the external (NAT) IP address.

<server-ip>

Specifies the server IP address.

 

<ip>

Specifies the local IP address.

Attributes

 

Name

Description

type

Defines the type of the IP address to one of auto or iface.

 

Parent

<properties>

Children

None.

Example

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>

 

<ext-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.

<server-ip>

Specifies the server IP address. The details and usage are the same as for the <ip> element.

2.3      Components

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.

Attributes

            None.

Parent

<unimrcpclient>

Children

 

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.

<resource-factory>

Specifies the factory of MRCP resources used by the client stack.

Attributes

None.

Parent

<components>

Children

 

Name

Description

<resource >

Specifies the MRCP resource to load.

Example

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>

 

<sip-uac>

Specifies the SIP user agent client which is used for MRCPv2 only.

Attributes

 

Name

Description

id

Defines a unique name of the agent to be referenced in the profiles.

type

Defines the SIP uac type.

 

Parent

<components>

Children

 

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.

Example

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>

<rtsp-uac>

Specifies the RTSP user agent client which is used for MRCPv1 only.

Attributes

 

Name

Description

id

Defines a unique name of the agent to be referenced in the profiles.

type

Defines the RTSP uac type.

 

Parent

<components>

Children

 

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.

Example

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>

 

<mrcpv2-uac>

Specifies the MRCPv2 transport agent.

Attributes

 

Name

Description

id

Defines a unique name of the agent to be referenced in the profiles.

 

Parent

<components>

Children

 

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.

Example

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>

 

<media-engine>

Specifies the media processing engine.

Attributes

 

Name

Description

id

Defines a unique name of the media engine to be referenced in the profiles.

 

Parent

<components>

Children

 

Name

Description

<realtime-rate>

Specifies the real-time rate of the engine, which must be set to 1 for the most of the cases.

Example

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>

 

<rtp-factory>

Specifies the factory of RTP media terminations.

Attributes

 

Name

Description

id

Defines a unique name of the RTP factory to be referenced in the profiles.

 

Parent

<components>

Children

 

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.

Example

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>

 

2.4      Settings

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.

Attributes

            None.

Parent

<unimrcpclient>

Children

 

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.

 

<sip-settings>

Specifies the SIP settings which identify a particular MRCPv2 server.

Attributes

 

Name

Description

id

Defines a unique name of the SIP settings to be referenced in the profiles.

 

Parent

<settings>

Children

 

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.

Example

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>

 

<rtsp-setting>

Specifies the RTSP settings which identify a particular MRCPv1 server.

Attributes

 

Name

Description

id

Defines a unique name of the RTSP settings to be referenced in the profiles.

 

Parent

<settings>

Children

 

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.

Example

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>

 

<rtp-setting>

Specifies the settings used for RTP/RTCP streaming.

Attributes

 

Name

Description

id

Defines a unique name of the RTP settings to be referenced in the profiles.

 

Parent

<settings>

Children

 

Name

Description

<jitter-buffer>

Specifies the jitter buffer settings.

<ptime>

Specifies the packetization time.

<codecs>

Specifies the supported codecs.

<rtcp>

Specifies the RTCP settings.

Example

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>

 

2.5      Profiles

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.

Attributes

            None.

Parent

<unimrcpclient>

Children

 

Name

Description

<mrcpv2-profile>

Specifies the MRCPv2 profile.

<mrcpv1-profile>

Specifies the MRCPv1 profile.

<mrcpv2-profile>

Specifies the MRCPv2 profile as a collection of SIP user and MRCPv2 transport agents, media engines, RTP factories, SIP and RTP settings.

Attributes

 

Name

Description

id

Defines a unique name of the profile to be used by a user client application.

 

Parent

<profiles>

Children

 

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.

Example

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>

<mrcpv1-profile>

Specifies the MRCPv1 profile as a collection of RTSP user agents, media engines, RTP factories, RTSP and RTP settings.

Attributes

 

Name

Description

id

Defines a unique name of the profile to be used by a user client application.

 

Parent

<profiles>

Children

 

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.

Example

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>

 

3       Configuration Steps

This section outlines major configuration steps.

3.1      Using the Default Configuration

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.

3.2      Specifying the IP addresses

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>

 

3.3      Specifying the client port numbers

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>

 

3.4      Specifying the server port numbers

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>

3.5      Specifying the codecs

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>

 

4       Configuration Examples

This section provides configuration examples for typical client setups.

4.1      The MRCPv2 Setup

Description

The UniMRCP client uses an MRCPv2 server located on the same network.

Topology

MRCPv2.png

Parameters

·         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

Sample Configuration

unimrcpclient.xml

Sample Network Captures

§  Speech Synthesis Resource

§  Speech Recognition Resource

 

4.2      The MRCPv1 Setup

Description

The UniMRCP client uses an MRCPv1 server located on the same network.

Topology

MRCPv2.png

Parameters

·         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

Sample Configuration

unimrcpclient.xml

Sample Network Captures

§  Speech Synthesis Resource

§  Speech Recognition Resource

 

4.3      The MRCPv2 Setup behind NAT

Description

The UniMRCP client is located behind NAT and uses an MRCPv2 server.

Topology

MRCPv2.png

Parameters

·         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

Sample Configuration

unimrcpclient.xml

Sample Network Captures

None.

4.4      The MRCPv1 Setup behind NAT

Description

The UniMRCP client is located behind NAT and uses an MRCPv1 server.

Topology

MRCPv2.png

Parameters

·         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

Sample Configuration

unimrcpclient.xml

Sample Network Captures

None.