unable to get value of RECOG_RESULT via AGI

571 views
Skip to first unread message

Kevin Bernard

unread,
Dec 17, 2013, 5:06:44 PM12/17/13
to uni...@googlegroups.com

I am using Asterisk AGI and using the following line to run speech recognition:
    exec("MRCPRecog", "/usr/local/unimrcp/data/digits.jsgf,builtin:dtmf/number,t=10000&b=1&ct=0.7&spl=en-US");
That works fine and I see the response of what I'm saying (more or less) in the Asterisk CLI, such as...
[Dec 17 15:49:53] NOTICE[19462]: app_mrcprecog.c:488 recog_channel_get_results: (ASR-8) Result:
<?xml version="1.0"?>
<result grammar="grammar-0">
  <interpretation grammar="grammar-0" confidence="99">
    <instance>oh eight two three oh oh oh</instance>
    <input mode="speech">oh eight two three oh oh oh</input>
  </interpretation>
</result>
However, I cannot get this data from the Asterisk channel variable via AGI.  The problem seems to be that the result code is blank for this response.  The method getResultCode() in AgiReplyImpl returns -1 while trying to get that channel variable.  I have no trouble getting the values of RECOGSTATUS and RECOG_COMPLETION_CAUSE.
 
If I try this same thing directly in the Asterisk dialplan, like so...
exten => 1111,n,MRCPRecog(/usr/local/unimrcp/data/digits.jsgf,t=10000&b=1&ct=0.7&spl=en-US)
exten => 1111,n,Verbose(Status is: ${RECOGSTATUS} and result is: ${RECOG_RESULT})
That works fine and I AM able to get the value of RECOG_RESULT.
 
Thanks for any help.
-Kevin
 
 

Arsen Chaloyan

unread,
Dec 17, 2013, 10:49:18 PM12/17/13
to UniMRCP
Try to use the option "uer" with MRCPRecog. It will make the results URI-encoded.

uer: URI-encoded results (1: URI-encode NLMSL results, 0: do not encode)


--
You received this message because you are subscribed to the Google Groups "UniMRCP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unimrcp+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



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

Kevin Bernard

unread,
Dec 19, 2013, 1:40:37 PM12/19/13
to uni...@googlegroups.com
That did the trick, thanks again!

jay...@phonon.in

unread,
Dec 4, 2015, 6:41:12 AM12/4/15
to UniMRCP
Hi Arsen Chaloyan,

I am unable to understand your answer. Please brief.

Regards,
Jayesh

Anuj Kumar

unread,
Jan 9, 2016, 2:23:29 PM1/9/16
to UniMRCP
Hi Kevin,

Can you please suggest how are you handling multiple grammars with AGI 

as if try this

$code=$agi->exec("MRCPRecog","builtin:grammar/number?minlength=10,builtin:dtmf/number?minlength=10,dtt=5000&b=1&ct=0.7&spl=en-IN&f=/home/project/prompt/pension/welcome");

it takes ,builtin:dtmf/number?minlength=10,dtt as an option parameter as it delimites by ',' .

Please suggest.

Jayesh Dhandha

unread,
Jan 10, 2016, 11:26:05 PM1/10/16
to UniMRCP
Hey Kevin,

I am also facing the same issue with AGI. But i am able to use both grammar from dialplan directly.

DialPlan : same = n,MRCPRecog("/etc/lumenvox/Lang/BuiltinGrammars/voice/en-IN/general,/etc/lumenvox/Lang/BuiltinGrammars/dtmf/date",p=default&i=none&f=beep) ----> Working

AGI : $agi->exec('MRCPRecog',"/etc/lumenvox/Lang/BuiltinGrammars/voice/en-IN/general,/etc/lumenvox/Lang/BuiltinGrammars/dtmf/date",p=default&i=none&f=beep); ----> Not working for both. It is taking first grammar as default grammar.

Please suggest us what to do asap.

Regards,
Jayesh Dhandha

Arsen Chaloyan

unread,
Jan 12, 2016, 10:04:14 PM1/12/16
to UniMRCP
Hi Jayesh,

If the option "uer" is set with MRCPRecog, then the received NLSML results are URI-encoded and only then passed to Asterisk.

https://github.com/unispeech/asterisk-unimrcp/blob/master/app-unimrcp/app_mrcprecog.c#L445

https://en.wikipedia.org/wiki/Percent-encoding

--
You received this message because you are subscribed to the Google Groups "UniMRCP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unimrcp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages