Configuration Guide: Unimrcp On Asterisk

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

July 2020 

Configuration Guide 
UniMRCP on Asterisk 
 
 
 
 
 
 
 
 
 
 
 
 
version 2.0.0 
 

Summary 
 
Summary 1 

1. Introduction 2 
1.1 What is UniMrcp? 2 
1.2 What subjects are covered in this guide? 2 
1.3 What subjects are not covered in this guide? 2 
1.4 Legal notice 2 

2. Environment preparation 3 

3. UniMRCP for Asterisk 4 


3.1 Configuring MRCP for Asterisk 4 
3.2 Testing Configuration 6 

4. Troubleshooting 7 
4.1 I can’t listen anything 7 
4.2 Error loading libsofia library 7 

5. Useful links 8 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 
 
 
 

1. Introduction 

1.1 What is UniMrcp? 


 
UniMRCP  is  an  open-source  software  client  MRCP  that  implements  all 
features  of  the  MRCP  protocol  established  in  the  RFC  4463  and  RFC  6787. 
UniMRCP  can  be  installed  stand-alone  or  together  with  Asterisk  –  that’s  the 
scenario  that  will  be  covered  in  this  guide.  It  can  be  utilized  to  make  MRCP 
requisitions  for  the  MRCP  Verbio  server  in  order  to  obtain  ASR  and  TTS 
resources. 

1.2 What subjects are covered in this guide? 


This guide covers the configuration of UniMRCP with Verbio MRCP Server. 

1.3 What subjects are not covered in this guide? 


This guide does not cover: 
● Installation of Verbio Voxserver and Verbio MRCP. 
● Installation of Asterisk. 
● Installation of UniMRCP 
● Installation of UniMRCP plugin for Asterisk 

1.4 Legal notice 


UniMRCP  is  a  third-party  software,  independent  of  Verbio  and  does  not have 
any  relation  with  Verbio  products  or  the  company  Verbio  Technologies  S.L. 
and its affiliates. This guide has the only purpose of provide instructions about 
the use of UniMRCP with Verbio MRCP server 
 
 
 
 


 
 

2. Environment preparation 
This  guide  covers  how  to  configure  the  UniMRCP  module  for  Asterisk  with 
Verbio  MRCP  Server.  But  in  order  to  continue  with  the  configuration  your 
environment must be prepared. Check whether next steps are met: 
 
1. Install  and  configure  Verbio  Voxserver  ​(follow  ​installing  ​and 
configuring verbio​ from​ ​Verbio’s installation guide​) 
2. Install and configure Verbio MRCP (​ same as point 1) 
3. Install Asterisk (​ ​Asterisk installation - wiki​) 
4. Install UniMRCP Components ​(​UniMRCP components​) 
a. UniMRCP Dependencies 
b. UniMRCP 
c. UniMRCP for Asterisk 
 
 
 

   


 
 

3. UniMRCP for Asterisk  


 
Before  continuing  with  the  MRCP  Configuration  for  Asterisk you must assure 
all the requirements are met. 
 
✓V
​ erbio Voxserver (verbiod) is running 
✓V​ erbio MRCP server is running and connected to Verbio Voxserver 
✓A ​ sterisk is running 

3.1 Configuring MRCP for Asterisk 


In  order  to  connect  Asterisk  with  Verbio’s  MRCP  server,  new  profiles 
verbio-mrcpv1  and  ​verbio-mrcpv2  must  be  created  in  ​/etc/asterisk/mrcp.conf  ​and  set  as 
default-asr-profile​ and ​default-tts-profile​ . 
 
[general] 
; Default ASR and TTS profiles change them accordingly to the version (profile) suits you 
default-asr-profile = v ​ erbio-mrcpv2 
default-tts-profile = v​ erbio-mrcpv2 
; UniMRCP logging level to appear in Asterisk logs. Options are: 
; EMERGENCY|ALERT|CRITICAL|ERROR|WARNING|NOTICE|INFO|DEBUG --> 
log-level = DEBUG 
max-connection-count = 100 
max-shared-count = 100 
offer-new-connection = 1 
 
; Profile for Verbio’s MRCP Server version 1 
[verbio-mrcpv1] 
; MRCP version 
version = 1 
 
; === RTSP factory === 
; Must be set to the IP address of the Verbio’s MRCP server. 
server-ip = TO-BE-DEFINED 
; RTSP port on Verbio’s MRCP Server (/opt/verbio/config/software-verbio-mrcp default is 554​) 
server-port = 554 
resource-location = media 
speechsynth = speechsynthesizer 
speechrecog = speechrecognizer 
 
; === RTP factory === 
; same IP where Asterisk is running that will be used to connect to MRCP Server 
rtp-ip = TO-BE-DEFINED 
; RTP port range on the MRCP client 
rtp-port-min = 4000 


 
 

rtp-port-max = 5000 
 
; === Jitter buffer settings === 
playout-delay = 50 
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 
 
; Profile for Verbio’s MRCP Server version 1 
[verbio-mrcpv2] 
; MRCP version 
version = 2 
 
; === SIP settings === 
; Must be set to Verbio’s MRCP Server information (/opt/verbio/config/software-verbio-mrcp default 
5060) 
server-ip = TO-BE-DEFINED 
server-port = 5060 
force-destination = 1 
 
; === SIP agent === 
; same IP where Asterisk is running that will be used to connect to MRCP Server 
client-ip = TO-BE-DEFINED 
; SIP port that will be used and type (tcp, upd) 
client-port = 8060 
sip-transport = udp 
 
; === RTP Factory === 
; same IP where Asterisk is running that will be used to connect to MRCP Server 
rtp-ip = TO-BE-DEFINED 
; RTP port range that will be used 
rtp-port-min = 4000 
rtp-port-max = 5000 
 
; === Jitter buffer settings === 
playout-delay = 50 
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 
 
These  definitions  can  be  copied  and  pasted  directly  to    /etc/asterisk/mrcp.conf  but 
check the values of: 
 
✓​ s​ erver-ip 
✓ s​ erver-port 
✓​ r​ tp-ip 
✓​ r​ tp-port-min and rtp-port-max 
✓ c​ lient-ip 
✓ c​ lient-port 
✓ s​ ip-transport 
 
Also  take  into  account  that  ​Asterisk  ​uses  port  ​5060  ​for  SIP  by  default  that 
means  that  if  ​Verbio’s  MRCP  Server  and  ​Asterisk  are  in  the  same  machine 
one should have a different port configured.  

3.2 Testing Configuration 


In  order to test if the configuration is set properly create the following context 
in ​ /etc/asterisk/extensions.conf 
 
[mrcp] 
exten => _X.,1,Answer() 
exten => _X.,n,MRCPSynth(Hello this is a T T S test that uses M R C P,p=​verbio-mrcpv2) 
exten => _X.,n,Verbose(1,${SYNTHSTATUS}) 
exten => _X.,n,Hangup() 
 
Now  create  a  softphone  associated  with  this  context  in  order to test whether 
the  context  is  working  properly.  If  everything  is  ok  after  calling  from  the 
softphone  to  any  number  (of  two  digits  or  more)  you  should  be  able  to  hear 
Hello this is a TTS test that uses MRCP. 
 
 
 


 
 

4. Troubleshooting 

4.1 I can’t listen anything 


If  the  value  of  variable  ​${SYNTHSTATUS}  is  ​OK  and  you  can’t  listen  to  anything, 
check  out  the  configuration  ports  of  RTP  on  your  softphone.  If  the  machine 
where  UniMRCP  is  installed  is  behind  NAT,  it  will  be  necessary  to  configure 
NAT  traversal  on  Asterisk.  Apply the following configuration on section [​ general] 
of  /​ etc/asterisk/sip.conf​,  changing  the  IP  addresses  accordingly  with  your 
environment.  
 
[general]  
localnet=172.31.37.0/255.255.255.0 ​; It’s the internal local IP address.  
externip=54.207.22.29 ​;It’s the external IP address.  
 

4.2 Error loading libsofia library 


If the following or similar error occurs: 
 
error while loading shared libraries: libsofia-sip-ua.so.0: cannot open shared 
object file: No such file or directory 
 
To solve this issue edit​ /etc/ld.so.conf​ and add the line ​include /usr/local/lib/​ to the file. 
 
Example: 
 
include /etc/ld.so.conf.d/*.conf 
include /usr/local/lib/ 
 
Once configured, save and close the file and apply the command ​ldconfig 
After that, try again. The problem should be solved now. 
 
 


 
 

5. Useful links 
1. UniMRCP Plugin Manual for Asterisk 
2. RFC 4663 - MRCP (version 1) 
3. RFC 6787 - MRCPv2  


 

You might also like