On Mon, Jan 10, 2011 at 7:55 AM, Mikael <mikael....@lingsoft.fi> wrote:
>
> Hi Arsen,
>
> Just to be sure, ASR plugin framework implements a queue for recognize
> requests? When new recognize request comes in when there is an active
> request, the new request gets response PENDING and is inserted into
> queue?
That's right.
>
> I am not sure but it seems that cancel-if-queue is not working. If
> it's set true in a recognize request, it is not cancelled if a new
> request comes in.
I'd say "cancel-if-queue" is not implemented or not handled in the
state machine of the recognizer resource. So, please submit this to
the issue tracker first.
It'd be great if you could implement this and come up with the patch.
Below are a few directions which may help
1. Test the "Cancel-If-Queue" header field for the recognition request
being in-progress in recog_request_recognize()
http://code.google.com/p/unimrcp/source/browse/trunk/libs/mrcp-engine/src/mrcp_recog_state_machine.c#148
2. If it's not allowed to cancel the request, then, well, everything
should work as before; otherwise, we need to terminate the current
request and start a new one.
At this stage, I'd suggest to create and send an internal STOP request
to the plugin/engine. In the meantime, the new recognition request can
be stored in the ordinary pending queue.
3. The response to the internal STOP response should be caught, an
actual RECOGNITION-COMPLETE event with the completion cause set to
canceled should be sent to the server.
See recog_response_stop()
http://code.google.com/p/unimrcp/source/browse/trunk/libs/mrcp-engine/src/mrcp_recog_state_machine.c#297
4. Then the pending recognize request should be processed as usual.
That's basically it, nothing will be changed in the plugin/engine
interface and it'll remain simple enough.
>
> Br,
> Mikael
>
Br,
> --
> You received this message because you are subscribed to the Google Groups "UniMRCP" group.
> 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
The author of UniMRCP
http://www.unimrcp.org