Speech:Summer 2013 Nicholas C. Sandberg


 * Home
 * Semesters
 * Summer 2013
 * [ Logs: Nicholas Sandberg ]

2013.June.03

 * Task:
 * Update wiki with Summer 2013 term.
 * Login to Caesar
 * Research open source call routers.


 * Results:
 * Wiki
 * Added Summer 2013 section
 * Followed existing pattern and added sections from previous semester
 * Assigned myself to Obelix
 * Setup section for weekly logs


 * Accessed Caeser and Obelix
 * Installed Java 6 on Obelix


 * Call router applications
 * Linux Call Router
 * Linux Based
 * May require expensive hardware
 * Adhearsion
 * Uses Ruby


 * Voip Applications
 * Asterisk
 * Recommended for use with Adhearsion
 * May be a good solution by itself

2013.June.10

 * Task:
 * Decide on a couple of VOIP tools
 * Try to install and setup the tools
 * Document pros and cons of different available VOIP tools


 * Results:
 * Installed and setup Asterisk on local computer
 * Asterisk - Quick Start Guide
 * Asterisk - Definitive Guide


 * Managed to connect to Asterisk using a VOIP phone application
 * SLFPhone Voip Client - SLF Phone


 * Configured Asterisk to accept different extensions and present different greetings to the caller.

2013.June.17

 * Task:
 * Install Asterisk on Obelix server
 * Route Voip port from Caesar to Obelix
 * Try and Connect to call router using Voip Phone


 * Results:
 * Installed Asterisk on Caesar
 * Due to dependency issues, I was unable to install Asterisk on Obelix
 * Issue with Asterisk not starting correctly. Issue with OpenSSL library being necessary to build Asterisk.
 * Unable to dial into asterisk server. May be firewall issue.
 * Used Nmap to verify port 5060 is open internally and externally

2013.June.24

 * Task:
 * Document Asterisk installation process
 * Try and dial from within UNH firewall
 * Find dependencies to install Asterisk on Obelix


 * Results:
 * Asterisk installation instructions
 * Did not find time to dial Caesar from within UNH
 * Still unable to get missing dependencies on Obelix.
 * Tried using an RPM but it threw errors as well.

2013.July.1

 * Task:
 * Document some basic configuration and usage of Asterisk
 * Dial Caesar from within the UNHM building.
 * Try and fix package dependencies with Obelix


 * Results:
 * Found packages of sound files available for Asterisk. Includes numbers, letters, and phonemes in English.
 * Was unable to dial into UNHM while on the UNHM Lan.
 * Found the firewall was enabled on Caesar. Still unable to connect after opening up port 5060.
 * Received new instructions to test tools on local machine versus servers since the servers may be changed.
 * Received new instructions to focus on integrating Sphinx with Asterisk to accept voice commands.

2013.July.8

 * Task:
 * Scope what it will take to integrate Sphinx and Asterisk
 * Setup Sphinx on my dev machine.
 * Try and create a POC of Asterisk directing to voice commands to Sphinx


 * Results:
 * Was able to dial into Caesar using a SIP application on my Android phone on the Local UNHM LAN.
 * Tried to connect from outside the firewall using the same profile but it appears to be blocked.
 * Received new instructions to look into using Speech models with Sphinx to make menu navigation work better.
 * Found a tool Zanzibar which wraps Sphinx4 with an MRCPv2 Server to allow VOIP systems to use the Sphinx toolkit.
 * Zanzibar OpenIVR Project
 * I am not sure how the user can be linked back to Asterisk but this tool may handle the phone directory and menu system as well.

2013.July.15

 * Task:
 * Connect Sphinx to Asterisk


 * Results:
 * Cairo is a MRCPv2 Server which includes Sphinx for decoding audio.
 * Cairo is composed of 3 services, Main Server, Transmitter, and Receiver
 * Zanzibar is a tool which includes Cairo and allows connection to SIP phone services such as Asterisk.
 * Managed to install Zanzibar and connect it to Asterisk
 * Calls seem to route to Zanzibar but the demo messages are not played, the phone just hangs until the 30 second timeout occurs.
 * When the phone picks up, a Hello World message is played to confirm Asterisk is answering, but after the call is routed to Zanzibar, it goes silent.
 * Looking on the forums, people seemed to have the same configuration as the test setup
 * The issue might be between Cairo and Zanzibar, The next attempt will be to use Cairo directly via a SIP phone and try some of the demos.


 * Resources:
 * Cairo
 * Zanzibar

[test_phone_abc123] type=friend host=dynamic secret=def456 context=demo [Zanzibar] type=peer host=127.0.0.1 port=5090 dtmfmode=info canreinvite=no context=demo
 * Asterisk - Sip Configuration:

[demo] exten => 2900,1,Answer same => n,Playback(hello-world) same => n,SIPAddHeader(x-channel:${CHANNEL}) same => n,SIPAddHeader(x-application:beanId|Parrot) ;same => n,SIPAddHeader("x-application:vxml|http://localhost/hello.vxml") same => n,Dial(SIP/Zanzibar) same => n,Hangup
 * Asterisk - Extensions Configuration (Dialer):

   sip:cairogate@speechforge.org  Zanzibar Sip Stack 5090     UDP  sip:cairo@speechforge.org  localhost  5050
 * Zanzibar - pbxconfig.xml

2013.July.22

 * Task:
 * Configure Zanzibar to route voice calls from Asterisk to Sphinx
 * Install Zanzibar on a Fedora system to work out any dependency problems


 * Results:
 * Still had issues trying to get the Cairo server to pick up the phone calls.
 * Found a more up to date Call server package called UniMRCP
 * UniMRCP
 * Tried to install UniMRCP but ran into some similar dependency issues as with Zanzibar
 * Tried to install Fedora in a Virtualbox VM but it just seemed to hang the emulator. Possibly due to the fact that the host machine is Debian.

2013.July.29

 * Task:
 * Install Debian or Fedora on a different machine.
 * Install UniMRCP or Zanzibar on the new machine to rule out any local system dependency problems.


 * Results:


 * Installed Debian in a Virtualbox VM
 * Username: mercury
 * Password: unhm
 * Root Password: same as Caesar and others


 * UniMRCP Install Guide


 * Downloaded Asterisk/UniMrcp package
 * Uni-Ast-Package-1.1.0
 * Followed install guide in INSTALL file within tar ball
 * Install Asterisk
 * asterisk-install.sh
 * Install UniMRCP
 * unimrcp-install.sh
 * Install UniMRCP Modules for Asterisk
 * modules-install.sh


 * Packages required to install UniMRCP on debian
 * apt-get install sofia-sip-bin
 * apt-get install autoconf
 * apt-get install automake
 * apt-get install libtool
 * apt-get install gcc
 * apt-get install pkg-config
 * apt-get install g++
 * apt-get install libncurses5-dev
 * apt-get install libxml2-dev
 * apt-get install libsqlite3-dev


 * The following library is needed for Asterisk to have sip capabilities (chan_sip.so)
 * apt-get install libssl-dev


 * Installed Asterisk in the Debian VM
 * Installed UniMRCP in the Debian VM
 * Installed UniMRCP Asterisk Modules


 * Unable to get Asterisk to work with the UniMRCP modules. Asterisk crashes with a segmentation fault at startup.
 * When the SIP module is disabled, it starts with the UniMRCP module and with the UniMRCP module disabled, it starts with the SIP module. We need both.

2013.August.5

 * Task:


 * Try and get Asterisk and UniMRCP working together.
 * Search for alternative MRCP type applications
 * Look for another way to receive calls into Sphinx.


 * Results:


 * Found out the order of the modules loaded in Asterisk effects how UniMRCP will work with it.
 * Managed to get the SIP and UniMRCP modules working together by loading the SIP module first, then the UniMRCP.

Modules Loaded load => chan_sip.so load => res_rtp_asterisk.so load => res_agi.so load => res_adsi.so load => pbx_config.so load => app_echo.so load => app_playback.so load => codec_gsm.so load => format_gsm.so load => app_unimrcp.so load => res_speech_unimrcp.so

Error loading module 'res_speech_unimrcp.so': /usr/lib/asterisk/modules/res_speech_unimrcp.so: undefined symbol: ast_speech_change_state
 * The res_speech_unimrcp.so module is not loading due to the following error.


 * This seems to have something to due with the sources not matching the version of Asterisk.

[demo] exten => 2900,1,Answer same => n,MRCPSynth(Hello World!,p=default) same => n,Verbose(1, ${SYNTHSTATUS}) same => n,Hangup
 * This is the call extension used to connect to UniMRCP from Asterisk

tport_udp_error: icmp(6) message was truncated (at 832) tport_udp_error: Connection refused (111) [icmp6 type=1 code=4] reported by [::1]:0 tport_udp_error: Connection refused (111) [icmp type=3 code=3] reported by [127.0.0.1]:0 nta: INVITE (896053925): Connection refused (111) with udp/[127.0.0.1]:5061 [Jul 30 19:28:22] NOTICE[29126]: app_unimrcp.c:122 unimrcp_log: SIP Call State TTS-0 [terminated] [Jul 30 19:28:22] ERROR[29122]: app_mrcpsynth.c:218 speech_on_channel_add: (TTS-0) Channel error! [Jul 30 19:28:22] NOTICE[29122]: app_unimrcp.c:122 unimrcp_log: Destroy MRCP Handle TTS-0 [Jul 30 19:28:22] NOTICE[29129][C-00000000]: app_mrcpsynth.c:525 mrcpsynth_exit: MRCPSynth exiting status: ERROR on SIP/unhm-00000000
 * When a call comes in, The following error is logged
 * This may or may not be related to the previous module no loading correctly.
 * A configuration change may fix this issue.
 * Here is the configuration of the UniMRCP file. /etc/asterisk/mrcp.conf

[general] default-asr-profile = speech-nuance5-mrcp2 default-tts-profile = speech-nuance5-mrcp2 ; 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 offer-new-connection = 1 ; rx-buffer-size = 1024 ; tx-buffer-size = 1024 ; request-timeout = 60

[speech-nuance5-mrcp1] ; +++ MRCP settings +++ version = 2 ; ; +++ RTSP +++ ; === RSTP settings === server-ip = localhost server-port = 4900 ; force-destination = 1 resource-location = media speechsynth = speechsynthesizer speechrecog = speechrecognizer ; ; +++ RTP +++ ; === RTP factory === ; rtp-ip = 0.0.0.0 rtp-ip = localhost ; 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 ; ; +++ SIP +++ ; === SIP settings === server-ip = localhost server-port = 5061 ; server-username = test force-destination = 1 ; === SIP agent === ; client-ip = 0.0.0.0 client-ip = localhost ; client-ext-ip = auto client-port = 5063 sip-transport = udp ; ua-name = Asterisk ; sdp-origin = Asterisk ; ; +++ RTP +++ ; === RTP factory === ; rtp-ip = 0.0.0.0 rtp-ip = localhost ; 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


 * Alternative to Asterisk
 * There is a project compatible with UniMRCP called FreeSwith.
 * This application seems pretty on-par with Asterisk. I was able to install and run it without any trouble.
 * I did not get try to connect to the server with a SIP phone but the application didn't show any errors in the log.


 * | Asterisk-Java
 * Using the asterisk module, AGI (Asterisk Gateway Interface), asterisk can be directed to a java application which can perform some tasks and sends commands back to Asterisk.
 * This might work well with Sphinx 4 since it is written in Java.
 * As long as we can send the audio from Asterisk, you could implement a small wrapper to have sphinx process the audio and send back a response on how to redirect the call.


 * Using a simple extension as follows
 * exten => 1300,1,Agi(agi://localhost/hello.agi)
 * I was able to direct to a small servlet and send a command to Asterisk to play a hello-world sound file.

2013.August.12

 * Task:


 * Create Sphinx Asterisk Java module
 * Try and decode audio using sphinx from asterisk


 * Results:


 * Created a Java application which receives the AGI redirection from Asterisk.
 * Can play an audio file back to the sip caller
 * The application can record audio from asterisk and record it to a timestamped audio file.
 * Integrated sphinx into the application
 * Tried to decode the audio file using Sphinx but results were less than acceptable.
 * Issue may stem from 16 khz acoustic models with Sphinx 4 while Asterisk pipes audio at 8 khz.

2013.August.19

 * Task:


 * Receive an 8 Khz Accoustic model from Eric.
 * Create a Language model and dictionary using a phone directory and extension list.
 * Create a script for configuring the phone system from a phone directory and Accoustic model


 * Results:


 * Created a dictionary file with a list of directory names
 * Tested a text2wave call to have the voice system say a person's name after decoding it
 * Managed to get the 8 Khz acoustic model provided with Sphinx to work
 * Decoded both the names Nick and Mike separately in audio files. Saved for automated test verification later.

2013.August.26

 * Task:


 * Get text2wave as a distinct api for generating audio from text
 * Test full circle of an asterisk call to text


 * Results:


 * Added greeting to phone system. When a user calls in, they receive a computer void welcoming them to unhm.
 * Found issue with multiple names being picked up from recordings.
 * Added filter for first name found to be returned.

2013.September.2

 * Task:


 * Demo solution to Dr. Jonas
 * Work on implementation of an extension lookup api. This way when a person's name is decoded, their extension is returned.


 * Results:


 * Worked with Dr. J to refine voice recording.
 * Changed the record method to stop recording if 1 second of silence is detected. This improved the cycle time of the phone call greatly.
 * Added last name to voice recognition. Now first and last name is required.

2013.September.9

 * Task:


 * Demo changes to Dr. Jonas
 * Add number extensions to name list
 * Create properties file for configurable settings such as working folder.


 * Results:


 * Extensions get verbally returned to client when a name is recognized
 * Adding caching check to text2wav api. If the text has been generated before, it will just send back the previously generated one. This will improve time to respond.
 * Uploaded newest changes to Rome server

2013.September.16

 * Task:


 * Create documentation for system.
 * Check code into UNHM git.


 * Results:


 * Could not figure out how to access UNHM Git system. Appears unused.

2013.December.19

 * Task:


 * Document how to setup call router.


 * Results:


 * Quick List


 * NOTE: Be sure to be root when doing these tasks


 * Install Asterisk


 * Add a UNHM connection to the Asterisk SIP configuration
 * nano /etc/asterisk/sip.conf
 * [unhm_callrouter]
 * type=friend
 * host=dynamic
 * secret=password42
 * context=unhm


 * Add an extension for the asterisk java application
 * nano /etc/aterisk/extensions.conf
 * [demo]
 * exten => 1300,1,Agi(agi://localhost/unhmCallrouter.agi)
 * same => n,Hangup


 * Start Asterisk
 * service asterisk start


 * start callrouter java application
 * sh start_callrouter.sh


 * Configure a sip phone
 * username - unhm_callrouter
 * password - password42
 * number - caesar.unh.edu


 * Call into unh
 * Dial 1300