Sei sulla pagina 1di 10

ACAPELA-GROUP

Acapelas UNIMRCP
Integration Documentation
TTS for Asterisk
Julien Boy
18/02/2014

Documentation to install an Acapela-Groups TTS Server dealing with Asterisk and with any other
UNIMRCP client.

I.

Contents

I.

Contents ................................................................................................................................................ 1

II.

Document revisions ............................................................................................................................... 2

III.

Architecture and Installation ............................................................................................................. 3


1.

Server................................................................................................................................................. 3

2.

Client .................................................................................................................................................. 3

IV.

Configuring and testing the components .......................................................................................... 5


1.

Acapela Telecom Server .................................................................................................................... 5

2.

Acapela MRCP V2 Server ................................................................................................................... 5

3.

UniMRCP client .................................................................................................................................. 6

Acapela-Group

II.

Document revisions

Date
18/02/14
21/02/14

Author
Julien Boy
Julien Boy

Description
First version
Acapelas configuration
files added.

Version
1.0
1.1

Acapela-Group

III.

Architecture and Installation

The following documentation is provided for an Unix environment and was tested on a CentOS 6.5 64bits
edition. Except for some specific points such as dependencies resolution, the manual still provides useful
informations for any environment.

1. Server
The Acapela Telecom application must be installed on the server as well as the Acapela MRCP V2 Server
application. These steps will not be explained in this documentation. Please refer to the official Acapelas
documentation of these products for more information.
To have a straightforward installation, its recommended to install the en-US Ryan and the fr-FR
Bruno voices.

2. Client
Asterisk will be used as the uniMRCP client. To do so, the Unix environment should be ready for the
compilation of Asterisk and its dependencies:
yum install gcc-c++.x86_64 glibc-devel.x86_64 ncurses-devel.x86_64 libxml2-devel.x86_64 sqlitedevel.x86_64;
Once the generic dependencies are installed, simply download and install the specific ones as follow:
cd /usr/local/src/;
wget https://unimrcp.googlecode.com/files/unimrcp-deps-1.2.0.tar.gz;
tar -xf unimrcp-deps-1.2.0.tar.gz;
cd unimrcp-deps-1.2.0;
./build-dep-libs.sh;
Acapela-Group

Follow the instructions and answer yes to all questions. Please make sure that you do NOT have other
versions of APR, APR-util or Sofia-SIP libraries already installed. As mentioned, those dependencies are
specifically patched for the compilation of Asterisk. Otherwise, make sure that during the configuration
steps of Asterisk, the correct path is used to compile with the patched libraries.
The next step is about downloading, compiling and installing Asterisk:
cd /usr/local/src/;
wget https://unimrcp.googlecode.com/files/uni-ast-package-1.1.0.tar.gz;
tar -xf uni-ast-package-1.1.0.tar.gz;
cd uni-ast-package-1.1.0;
There are 3 shell scripts to help you with the installation of Asterisk. However, the manual compilation
will be preferred as it may be useful to see debug informations in case of problem (such as missing
dependencies). During the writing of this documentation, the shell scripts were not displaying errors
while the installation was incomplete.
cd asterisk;
./configure;
make;
make install;
cd /usr/local/src/unimrcp;
./configure;
make;
make install;
cd /usr/local/src/modules;
./configure;
make;
make install;

Acapela-Group

IV.

Configuring and testing the components

Before configuring the client and the server to deal with MRCP, some preliminary tests should be
performed.

1. Acapela Telecom Server


Launch the Acapela TTS server:
/opt/Acapela/TTS-Server/bin/acatel_srv;
Compile the code sample and run it:
cd /opt/Acapela/TTS-Server/sample/;
make ;
./ttssample;

2. Acapela MRCP V2 Server


Some configurations files must be modified. Open /opt/Acapela/MRCP-2/conf/acapelatts.xml
<connection>
<param name="command-port" value="6666"/>
<param name="data-port" value="6665"/>
<!-- Enter your Acapela Telecom server IP here. Do NOT put localhost or 127.0.0.1 -->
<param name="ip-address" value="192.168.40.135"/>
</connection>

<trace>

<!-- plugin trace level -->


<param name="trace-level" value="ON"/>
</trace>
Take a look at the languages section if you didnt have installed the Ryan nor Bruno voices. Please
refer to the official documentation of the Acapela MRCP V2 Server application for more information
about how to parameterize this section.
Open /opt/Acapela/MRCP-2/conf/unimrcpserver.xml
Acapela-Group

<properties>
<!-- <ip type="auto"/> -->
<!-- Enter your Acapela MRCP V2 server IP here. Do NOT put localhost or 127.0.0.1. Be aware, here the
ip is the same than the Acapela TTS server as this tutorial was performed on a unique VM. -->
<ip>192.168.40.135</ip>
<!-- <ext-ip>a.b.c.d</ext-ip> -->
</properties>
To finish, make sure that the sip-port is set to 8060.
The uniMRCP server may be launched (make sure that the TTS server is also running):
cd /opt/Acapela/MRCP-2/bin/;
./unimrcpserver;
You should see a message like:

2014-02-18 08:09:02:024992 |INFO | Open TTS engine {08B78C18}


2014-02-18 08:09:02:025013 |INFO | TTS engine local pool created
2014-02-18 08:09:02:027142 |INFO | Try to connect ATS server : 192.168.40.135 - (1/3 tries)
2014-02-18 08:09:02:027999 |NOTICE| Connected to TTS Server, address : 192.168.40.135
2014-02-18 08:09:02:028009 |INFO | TTS server Watchdog task created
2014-02-18 08:09:02:029738 |INFO | voice : bruno8kmu enumerated
2014-02-18 08:09:02:029741 |INFO | voice : ryan8kmu enumerated
2014-02-18 08:09:02:029790 |INFO | Start Task [SIP-Agent-1]
2014-02-18 08:09:02:029819 |INFO | Start Task [RTSP-Agent-1]
2014-02-18 08:09:02:029842 |INFO | Start Task [MRCPv2-Agent-1]
2014-02-18 08:09:02:029862 |INFO | Start Task [Media-Engine-1]
2014-02-18 08:09:02:034818 |NOTICE| MRCP Server Started
2014-02-18 08:09:02:034872 |INFO | Receive SIP Event [nua_r_set_params] Status 200 OK

3. UniMRCP client
Open /usr/local/unimrcp/conf/unimrcpclient.xml
<properties>
<!-- <ip type="auto"/> -->
<!-- Enter your uniMRCP client IP here. Do NOT put localhost or 127.0.0.1. Be aware, here the ip is the
same than the Acapela TTS server and uniMRCP server. -->
<ip>192.168.40.135</ip>
<!-- <ext-ip>a.b.c.d</ext-ip> -->
</properties>
Acapela-Group

Open /usr/local/unimrcp/conf/client-profiles/ and create a file named acapela.xml where you will insert
this content:
<?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 address should be explicitly specified, it defaults to "ip" address set in the
properties. Enter the Acapela MRCP V2 server ip and its port -->
<server-ip>192.168.40.135</server-ip>
<server-port>8060</server-port>
<!-- <force-destination>true</force-destination> -->
</sip-settings>
</settings>
<profiles>
<!-- Acapela MRCPv2 profile -->
<mrcpv2-profile id="aca2">
<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>
</profiles>
</unimrcpclient>
-> Dont forget to replace with your server ip.
While both of these configuration files are used by the uniMRCP client, Asterisk uses
/etc/asterisk/mrcp.conf for its dialplan applications such as MRCPSynth() and MRCPRelog() while
/etc/asterisk/res-speech-unimrcp.conf is used by the implementation of the Asterisk Speech API via
MRCP.
Open /etc/asterisk/mrcp.conf, replace the value of the field default-tts-profile by speech-acapela-mrcp2.
Then append at the end of the file:
[speech-acapela-mrcp2]
Acapela-Group

; +++ MRCP settings +++


version = 2
;
; +++ SIP +++
; === SIP settings ===
server-ip = 192.168.40.135
server-port = 8060
; server-username = test
force-destination = 1
; === SIP agent ===
; client-ip = 0.0.0.0
client-ip = 192.168.40.135
; client-ext-ip = auto
client-port = 5093
sip-transport = udp
; ua-name = Asterisk
; sdp-origin = Asterisk
;
; +++ RTP +++
; === RTP factory ===
; rtp-ip = 0.0.0.0
rtp-ip = 192.168.40.135
; 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
; --- RTCP settings --rtcp = 1
rtcp-bye = 2
rtcp-tx-interval = 5000
rtcp-rx-resolution = 1000
-> Replace server-ip value with the Acapela MRCP V2 Server ip
-> Replace server-port value with the Acapela MRCP V2 Server port
-> Replace client-ip value as local ip address of the uniMRCP client
-> No need to change client-port
-> Replace rtp-ip value with the asterisk ip address

Acapela-Group

Open /etc/asterisk/res-speech-unimrcp.conf and comment the line unimrcp-profile = uni2 and add
unimrcp-profile = aca2;
You should have something like:
[general]
; UniMRCP named profile. Options are:
unimrcp-profile = aca2 ; Acapela MRCPv2 Server
;unimrcp-profile = uni2 ; UniMRCP MRCPv2 Server
;unimrcp-profile = uni1 ; UniMRCP MRCPv1 Server
Now launch the unimrcp client to perform a quick test:
cd /usr/local/unimrcp/bin;
./unimrcpclient;
Do NOT launch the client from another location e.g. with a command like
/usr/local/unimrcp/bin/unimrcpclient. The configurations files are defined with relative paths from the
current directory
Many lines will appear on the terminal, look for eventual warnings or errors. Notice the lines:
2014-02-19 06:23:29:999748 [NOTICE] Open Config File [../conf/client-profiles/unimrcp.xml]
2014-02-19 06:23:30:000575 [INFO] Create SIP Settings 192.168.40.135:8060
2014-02-19 06:23:30:000581 [INFO] Register Signaling Settings [UniMRCP-SIP-Settings]
2014-02-19 06:23:30:000585 [INFO] Create RTSP Settings 192.168.40.135:1554
2014-02-19 06:23:30:000587 [INFO] Register Signaling Settings [UniMRCP-RTSP-Settings]
2014-02-19 06:23:30:000590 [NOTICE] Create MRCPv2 Profile [uni2]
2014-02-19 06:23:30:000592 [INFO] Register Profile [uni2]
The ip address should match what was defined previously.
From the unimrcpclient command line, type:
run synth uni2
Exit the unimrcpclient command line and open /usr/local/unimrcp/data. A file named like synth-8kHzxxxx.pcm should be present. Play the sound and you should be able to listen Welcome to MRCP.

You should now have a complete client server MRCP installation ready to be used with Asterisk.

Acapela-Group

Potrebbero piacerti anche