UniMRCP-Asterisk and Activating Multiple Grammars

259 views
Skip to first unread message

Stephen Keller

unread,
Nov 1, 2012, 2:03:29 PM11/1/12
to uni...@googlegroups.com
Having a bit of a problem getting two grammars active at the same time with Asterisk.

I'm attempting to use the Asterisk interface with res_speech_unimrcp.so and my dialplan looks like:

exten => s,n,SpeechLoadGrammar(grammar1,/etc/asterisk/grammar1)
exten => s,n,SpeechLoadGrammar(grammar2,/etc/asterisk/grammar2)
exten => s,n,SpeechActivateGrammar(grammar1)
exten => s,n,SpeechActivateGrammar(grammar2)
exten => s,n,SpeechBackground(beep)

If I look at the MRCP traffic, I see something like this:

MRCP/2.0 3630 DEFINE-GRAMMAR 2
Channel-Identifier: 05ed7ced-31b9-4cea-8@speechrecog
Content-Type: application/srgs+xml
Content-Id: grammar1
Content-Length: 3467

grammar

And my MRCP server returns a 200 OK, and then I get the second DEFINE-GRAMMAR with the Content-Id set to grammar2. Perfect so far.

But then:

MRCP/2.0 192 RECOGNIZE 4
Channel-Identifier: 05ed7ced-31b9-4cea-8@speechrecog
Content-Type: text/uri-list
Cancel-If-Queue: false
Start-Input-Timers: true
Content-Length: 11

session:grammar2

And obviously I'm missing a reference to session:grammar1 in the RECOGNIZE. It seems to always send just the last grammar I loaded/activated. Is there anyway to have multiple grammars active as part of the same RECOGNIZE request with UniMRCP-Asterisk?

Arsen Chaloyan

unread,
Nov 27, 2012, 9:43:28 PM11/27/12
to uni...@googlegroups.com
Actually, it should be possible to load and activate multiple grammars
with Asterisk the way you attempted. I've just tried the same sequence
of dialplan commands, and everything works as expected. In the
RECOGNIZE, both grammars are referenced as follows:

MRCP/2.0 195 RECOGNIZE 4
Channel-Identifier: 5@speechrecog
Content-Type: text/uri-list
Cancel-If-Queue: false
Start-Input-Timers: true
Content-Length: 33

session:grammar1
session:grammar2

First, make sure both grammars are successfully loaded and activated.
If the problem persists, I'd suggest to check the source code and add
debug statements, if needed.

http://code.google.com/p/unimrcp/source/browse/solutions/asterisk-unimrcp/res-speech-unimrcp/res_speech_unimrcp.c#574

Follow uni_speech->active_grammars
> --
> You received this message because you are subscribed to the Google Groups
> "UniMRCP" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/unimrcp/-/W0zC04DKa3IJ.
> To post to this group, send email to uni...@googlegroups.com.
> To unsubscribe from this group, send email to
> unimrcp+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/unimrcp?hl=en.



--
Arsen Chaloyan
Author of UniMRCP
http://www.unimrcp.org

Stephen Keller

unread,
Nov 28, 2012, 6:48:33 PM11/28/12
to uni...@googlegroups.com
Hi Arsen,

I am not getting that behavior at all. My RECOGNIZE contains only a single grammar reference.

Which version of Asterisk/unimrcp did you test against?

Arsen Chaloyan

unread,
Nov 28, 2012, 9:22:03 PM11/28/12
to uni...@googlegroups.com
Hi Stephen,

I was testing it against UniMRCP r1848 and Asterisk 1.8.2.3.

Now, looking back at the change log of res_speech_unimrcp.c,

http://code.google.com/p/unimrcp/source/list?path=/solutions/asterisk-unimrcp/res-speech-unimrcp/res_speech_unimrcp.c&start=1807

I've noticed the relevant modification

http://code.google.com/p/unimrcp/source/detail?r=1796&path=/solutions/asterisk-unimrcp/res-speech-unimrcp/res_speech_unimrcp.c

which is not included into the released UniMRCP/Asterisk package.

So, make sure you're using r1796 or above.
> https://groups.google.com/d/msg/unimrcp/-/hMTiC-F2SNQJ.
Reply all
Reply to author
Forward
0 new messages