Rss Categories

Installing and Configuring UniMRCP Modules

Reference Number: AA-01129 Views: 12024 0 Rating/ Voters

The preferred method of communicating with the Asterisk PBX is via the use of Asterisk modules provided by the UniMRCP Project. UniMRCP is an open-source implementation of the Media Resource Control Protocol (MRCP) which is fully supported by the LumenVox Media Server. UniMRCP makes available a number of Asterisk modules that allow Asterisk to act as an MRCP client to make automatic speech recognition (ASR) and text-to-speech (TTS) requests to the LumenVox Media Server.

The latest build of UniMRCP for Asterisk can be obtained from the UniMRCP Project.

Note: Prior to LumenVox version 11, the recommend method of integration with Asterisk was via a closed-source "connector bridge" Asterisk module called (owned and maintained by Digium). The help documentation for this module is still available but it is not recommended for users. To clarify - the older "Asterisk Connector Bridge" is no longer supported. All users should adopt the newer and less problematic UniMRCP interface which allows Asterisk to connect to LumenVox ASR and TTS resources using the MRCP protocol.

UniMRCP provides two Asterisk modules: and which work in different ways. We recommend both be built and loaded so you can use either mechanism.

TIP: We have provided a step-by-step guide to installing Asterisk 13 + UniMRCP 1.3.0 + LumenVox 13.1, along with an accompanying video series, which shows all of the steps required to install and configure these components on a fresh operating system, providing a completely functional speech-enabled Asterisk PBX system. See our Configuring Asterisk 13 article for more details.

Installing UniMRCP

NOTE: As of August 2014, there is a known bug in asterisk-unimrcp 1.2.0 that prevents it from functioning properly, resulting in crashes when attempting to invoke MRCPRecog(). We recommend upgrading to asterisk-unimrcp 1.3.0 instead. 

  1. Download the latest UniMRCP-Asterisk package. Unimrcp member may also use subversion to get the latest code from the trunk (be sure and get both UniMRCP and the UniMRCP-Asterisk module from the packages repository).
  2. Make sure you have installed the UniMRCP Dependency package before installing UniMRCP package.
  3. Extract the tarball you downloaded using tar -xzvf filename to an appropriate directory (e.g. /usr/src/). If you used subversion to checkout the code you can skip this step.
  4. Follow the readme included with the source code.
  5. Build and install the base UniMRCP libraries (including the dependencies ARP and sofia-sip).
  6. Build and install the UniMRCP-Asterisk modules.

Configuring UniMRCP

UniMRCP has several configuration files that should have been installed:

  1. The mrcp.conf file in /etc/asterisk/
  2. The res-speech-unimrcp.conf file /etc/asterisk/
  3. A set of XML config files in /usr/local/unimrcp/conf/ and /usr/local/unimrcp/conf/client-profiles

If you do not have all of these files, you have likely missed a step in the installation. Do not continue until you have finished the installation.

Depending on whether you are going to use the functionality in or, you will need to change different configuration files.


The module relies on the /etc/asterisk/mrcp.conf file. Here is a sample version of the file you can use that is already configured to work with LumenVox, with two important changes:


default-asr-profile = speech-lumenvox-mrcp1
default-tts-profile = speech-lumenvox-mrcp1

; UniMRCP logging level to appear in Asterisk logs.  Options are:
log-level = DEBUG
max-connection-count = 100
offer-new-connection = 1
; rx-buffer-size = 1024
; tx-buffer-size = 1024
; request-timeout = 60

; +++ MRCP settings +++
version = 1
; +++ RTSP +++
; === RSTP settings ===
; Set this to the LumenVox Media Server's IP:
server-ip =
server-port = 554
; force-destination = 1
resource-location = media
speechsynth = speechsynthesizer
speechrecog = speechrecognizer
; +++ RTP +++
; === RTP factory ===

; Set this to the local machine's IP:
rtp-ip =
; rtp-ext-ip = auto
rtp-port-min = 4000
rtp-port-max = 5000
; === RTP settings ===
; --- Jitter buffer settings ---
playout-delay = 50
; min-playout-delay = 20
max-playout-delay = 200
; --- RTP settings ---
ptime = 20
codecs = PCMU PCMA L16/96/8000 telephone-event/101/8000
; --- RTCP settings ---
rtcp = 1
rtcp-bye = 2
rtcp-tx-interval = 5000
rtcp-rx-resolution = 1000

The two changes that must be made:

  1. Set the server-ip address to the IP address of the machine running the LumenVox Media Server.
  2. Set the rtp-ip address to the IP address of the machine running Asterisk.

Reload Asterisk after making these changes, and you may move on to testing the installation.


Configuring the module is a little more complex than First, you must edit the /etc/asterisk/res-speech-unimrcp.conf file. Here is a sample to use:


; UniMRCP named profile. Options are:
;unimrcp-profile = uni2      ; UniMRCP MRCPv2 Server
;unimrcp-profile = uni1     ; UniMRCP MRCPv1 Server
;unimrcp-profile = lv2      ; LumenVox MRCPv2 Server
unimrcp-profile = lv1      ; LumenVox MRCPv1 Server (uncomment this line)

; UniMRCP logging level.  Options are:
log-level = DEBUG

; Preloaded grammars
;grammar-name = path-to-grammar-file

; MRCPv2 properties (recognizer and generic header fields)
Recognition-Timeout = 20000
No-Input-Timeout = 15000

; MRCPv1 properties (recognizer and generic header fields)
Recognition-Timeout = 20000
No-Input-Timeout = 15000

You will want to make sure that the only profile not commented out is lv1 so it is ensured of being the default profile.

The settings for lv1 are defined in /usr/local/unimrcp/conf/client-profiles/lumenvox.xml. Again, here is a sample to use:


<?xml version="1.0" encoding="UTF-8"?>
<!-- UniMRCP client document -->
<unimrcpclient xmlns:xsi="" xsi:noNamespaceSchemaLocation="../unimrcpclient.xsd" version="1.0">
    <!-- SIP MRCPv2 settings -->
    <sip-settings id="LumenVox-SIP-Settings">
      <!-- Server address should be explicitly specified, it defaults to "ip" address set in the properties. -->
      <!-- <force-destination>true</force-destination> -->
    <!-- RTSP MRCPv1 settings -->
    <rtsp-settings id="LumenVox-RTSP-Settings">
      <!-- Set to value of the LV Media Server's IP address -->
      <!-- <force-destination>true</force-destination> -->
        <param name="speechrecog" value="recognizer"/>
    <!-- LumenVox MRCPv2 profile -->
    <mrcpv2-profile id="lv2">
    <!-- LumenVox MRCPv1 profile -->
    <mrcpv1-profile id="lv1">


You must change the server-ip value in the RTSP-Settings section to the IP address of the LumenVox Media Server.

Finally, you must make one or two changes to /usr/local/unimrcp/conf/unimrcpclient.xml:


<?xml version="1.0" encoding="UTF-8"?>
<!-- UniMRCP client document -->
<unimrcpclient xmlns:xsi="" xsi:noNamespaceSchemaLocation="unimrcpclient.xsd" version="1.0" subfolder="client-profiles">
    <!-- By default, network interface (IP address) to bind to will be implicitly identified. 
         Alternatively, it can be explicitly set.
    <!-- <ip type="auto"/> -->

    <!-- Set to the actual IP address of this machine. -->

    <!-- <ext-ip>a.b.c.d</ext-ip> -->
    <!-- <server-ip>a.b.c.d</server-ip> -->

    <!-- Factory of MRCP resources -->
      <resource id="speechsynth" enable="true"/>
      <resource id="speechrecog" enable="true"/>
      <resource id="recorder" enable="true"/>
      <resource id="speakverify" enable="true"/>

    <!-- SofiaSIP MRCPv2 signaling agent -->
    <sip-uac id="SIP-Agent-1" type="SofiaSIP">
      <!-- By default, "ip" and "ext-ip" addresses set in the properties will be used. 
           They still can be explicitly specified (overriden) here.
      <!-- <sip-ip></sip-ip> -->
      <!-- <sip-ext-ip>a.b.c.d</sip-ext-ip> -->
      <ua-name>UniMRCP SofiaSIP</ua-name>
      <!-- <sip-t1>500</sip-t1> -->
      <!-- <sip-t2>4000</sip-t2> -->
      <!-- <sip-t4>4000</sip-t4> -->
      <!-- <sip-t1x64>32000</sip-t1x64> -->
      <!-- <sip-message-output>true</sip-message-output> -->
      <!-- <sip-message-dump>/tmp/sofia-sip.log</sip-message-dump> -->

    <!-- UniRTSP MRCPv1 signaling agent -->
    <rtsp-uac id="RTSP-Agent-1" type="UniRTSP">
      <!-- <request-timeout>5000</request-timeout> -->
    <!-- MRCPv2 connection agent -->
    <mrcpv2-uac id="MRCPv2-Agent-1">
      <!-- <request-timeout>5000</request-timeout> -->
    <!-- Media processing engine -->
    <media-engine id="Media-Engine-1">
    <!-- Factory of RTP terminations -->
    <rtp-factory id="RTP-Factory-1">
      <!-- By default, "ip" and "ext-ip" addresses set in the properties will be used. 
           They still can be explicitly specified (overriden) here.
      <!-- <rtp-ip></rtp-ip> -->
      <!-- <rtp-ext-ip>a.b.c.d</rtp-ext-ip> -->
    <!-- common (default) RTP/RTCP settings -->
    <rtp-settings id="RTP-Settings-1">
      <codecs>PCMU PCMA L16/96/8000 telephone-event/101/8000</codecs>
      <!-- <codecs>PCMU PCMA L16/96/8000 PCMU/97/16000 PCMA/98/16000 L16/99/16000</codecs> -->
      <!-- enable/disable RTCP support -->
      <rtcp enable="false">
        <!-- RTCP BYE policies (RTCP must be enabled first)
              0 - disable RTCP BYE
              1 - send RTCP BYE at the end of session
              2 - send RTCP BYE also at the end of each talkspurt (input)
        <!-- rtcp transmission interval in msec (set 0 to disable) -->
        <!-- period (timeout) to check for new rtcp messages in msec (set 0 to disable) -->

It is important that the <ip> value in the first <properties> section be set to the IP address of the machine running Asterisk. Also verify that the <codecs> setting in the RTSP-Settings-1 section is correctly set as shown above.

Reload Asterisk after making these changes, and you may move on to testing the installation.