Asterisk cmd MRCPSpeech



MRCP integraton for Asterisk - based on unimrcp (Supports Barge In)



To enable this command you will need to install an additional module as part of asterisk. New version released (Read below)

This solution has been deployed in a couple of Live installations handling large call volumes.

News & Tested Platforms

Please use unimrcp 0.6 and above.

Supports multiple File playback.Use file1-file2-file3.... in file parameter (Monday, June 21 2009)
Supports DTMF Grammars (Tuesday, June 09 2009)
Now supports Asterisk 1.6
Nuance is now supported, both MRCP v1 and v2

1.Telispeech (Telisma)


3.Sphinx with unimrcp server
We should be able to integrate with any platform supported by Unimrcp. We have tested against MRCP v1 servers, though it should also work against MRCP v2 servers. If anyone has any experience in getting this to work with an MRCP v2 server can please add a comment. If you need any help with integration we would be more than glad to help.
Coming soon.......

1.Configuration of recognition timeout and other parameters from the command itself.

2.Easier installation process.


MRCPSpeech(url of grammar|profile|playback_file)


  • grammar type - two types supported file and url
  • url - can be http or absolute path to grammar xml
  • profile - The unimrcp profile to use
  • playback_file -The playback_file to play while listening for speech.
Future versions will contain other configurable parameters like language etc.



When this application starts, it starts playing the sound file specified as the last option (/tmp/location) and waits for the user to speak and when the user speaks, the asterisk audio data is sent to the MRCP server directly which will provide the data to the ASR which will perform the recognition based on the grammar file specified and send back the result in xml format. The result xml has to be parsed separately in agi or in some other way. This is necessary as there is no way we can predict the xml response of all MRCP servers. A default agi file will be provided which can be modified to suit the needs.The result xml can be accessed from the asterisk variable RECOGNITION_RESULT.

The new version contains barge-in facility. Recognition can interrupt the playback file and start recognizing. We can also specify the profile to use in unimrcp.


Must have a MRCP v1 or v2 compliant server.


The product is still in beta and the price has not yet been decided excatly. Interested parties can mail to .

__Single simultaneous call use for evaluation purpose is free.

Dialplan example

exten => 889,1,Answer
;Call MRCPSpeech and specify the grammar
exten => 889,2,MRCPSpeech(url-|MRCPv1-Default|/tmp/location)
;Parse the xml returned by the MRCP server
exten => 889,3,agi,|${RECOGNITION_RESULT}
;check the confidence
exten => 889,4,GotoIf($["${RECOGCONFIDENCE}" >= "40"]?RecLoc)
;play wrong result if less confidence
exten => 889,5,Playback('/tmp/invalid')
exten => 889,6,Goto(incoming,888,2)
;playback thanks if high confidence
exten => 889,7(RecLoc),AGI(|Thank you . The list of A T Ms in ${RECOGDATA} will be sent your mobile.)
;sms the result to the user
exten => 889,8,agi,|${CALLERID(num)}|${RECOGDATA}|ATM
exten => 889,9,AGI(|Thank you . The list of A T Ms is ${RESULTLIST})
exten => 889,10,Hangup.


(Use is for evaluation purpose only. If you want to use for commercial purpose please contact at the email address given below.)

1.Install unimrcp . Install it to /usr/local/unimrcp .

2.Download library from

3.Make asterisk aware of the library location. In most cases. execute this command.
ln -s /usr/local/unimrcp/lib/ /usr/lib/

4.Setup the mrcp server details in unimrcpclient.xml file in the /usr/local/unimrcpclient/conf directory.

And in asterisk you need to load the module and then you can use the mrcpspeech library as shown in the Dial plan above.
The packaged library can be used for only one call at a time. Use is free only for evaluation. If you want to use it in your applications please contact
at the address given below.


New version features

1.Barge in

2.Profile specification

3.Enable/disable barge in

4.Bug fixes

For questions or feed back email me: atul.sharma at ozonetel dot com

Related software

Asterisk cmd MRCPTalk

Created by: nutanc, Last modification: Fri 05 of Nov, 2010 (23:46 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+