Problem Getting RECOG_INSTANCE() Using MRCPRecog with Asterisk-Java AGI

I am running some operations over Asterisk-Java AGI (Asterisk Gateway Interface) using MRCPRecog. There is a problem I am facing with the results from MRCPRecog.

On the AGI side, I need to get the instance value with channel.getVariable(“RECOG_INSTANCE()”). However, the result returned by MRCPRecog is as follows:

<result xmlns="">
    <interpretation grammar="4791780161253090829" confidence="99">
        <input mode="speech">edirne</input>
        <instance> Edirne;
    </interpretation> </result>

In the same way, I get the following values.

String recogConfidence = channel.getVariable("RECOG_CONFIDENCE()");
String recogInput = channel.getVariable("RECOG_INPUT()");

Here I get the instance value as null on the AGI side. String recogInstance = channel.getVariable("RECOG_INSTANCE()")

When I print the same value with same => n,Verbose(Instance: ${RECOG_INSTANCE()}), i can see as follows:

Instance: Edirne;

I tried the following methods:

String recogInstance = channel.getVariable("RECOG_INSTANCE(1/1)")

String recogInstance = channel.getVariable("RECOG_INSTANCE(0/1)")

In this case, how can I get the instance value on the AGI side? Why does it return null even though I use channel.getVariable(“RECOG_INSTANCE()”)?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.