How to catch Freeswitch mrcp events with LUA?

723 views
Skip to first unread message

Evgen Polivoda

unread,
Sep 5, 2019, 4:14:25 AM9/5/19
to UniMRCP
Hi all
I'm using GSR module with Freeswitch.
I have limited amount of channels. And sometimes, when I run out of channels,  I get this in freeswitch 

2019-09-05 08:03:29.811701 [INFO] mrcp_sofiasip_client_agent.c:609 () Receive SIP Event [nua_i_state] Status 0 INVITE sent [gsr]
2019-09-05 08:03:29.811701 [NOTICE] mrcp_sofiasip_client_agent.c:547 (ASR-28450) SIP Call State ASR-28450 [calling]
2019-09-05 08:03:29.831722 [INFO] mrcp_sofiasip_client_agent.c:609 () Receive SIP Event [nua_r_invite] Status 406 Not Acceptable [gsr]
2019-09-05 08:03:29.831722 [INFO] mrcp_sofiasip_client_agent.c:609 () Receive SIP Event [nua_i_state] Status 406 Not Acceptable [gsr]
2019-09-05 08:03:29.831722 [NOTICE] mrcp_sofiasip_client_agent.c:547 (ASR-28450) SIP Call State ASR-28450 [terminated]
2019-09-05 08:03:29.831722 [INFO] mrcp_client_session.c:151 (ASR-28450) Receive Answer ASR-28450 <new> [c:0 a:0 v:0] Status 406
2019-09-05 08:03:29.831722 [INFO] mrcp_client_session.c:455 (ASR-28450) Raise App Response ASR-28450 <new> [2] FAILURE [2]
d78cac7e-a332-44e0-a4c1-53034516730c 2019-09-05 08:03:29.831722 [ERR] mod_unimrcp.c:1920 (ASR-28450) RECOGNIZER channel error!

I want to use simple lua script to catch these events in order  to know when and how often it happens. 

I tried to catch all events.
I put 

<hook event="all" script="event.lua"/>

in lua.conf.xml

 but it seems to me, it doesn't catch this event.

I know I can try to catch sip events with sofia additional settings, but I doubt that sofia in freeswitch has any relation to mrcp module.
 
Please let me how to do that. 
Thank you.


Arsen Chaloyan

unread,
Sep 5, 2019, 6:55:14 PM9/5/19
to UniMRCP
Hi Evgen,

> I know I can try to catch sip events with sofia additional settings, but I doubt that sofia in freeswitch has any relation to mrcp module.

Right, these two entities are completely disconnected. In FreeSWITCH, mod_unimrcp implements abstract ASR and TTS resources of FS. You should rely on any method available for the ASR resource to pass through this information. I doubt such a status can be propagated through the FS core to your script, though. But you should coordinate this with FS devs.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/unimrcp/9ae6252d-066f-418a-8016-a9004abe762a%40googlegroups.com.


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

Sean DiSanti

unread,
Sep 9, 2019, 6:38:03 PM9/9/19
to uni...@googlegroups.com
We use mod_amqp to push error and crit level events to a rabbitmq server. We have a couple of queues set to catch specific errors like these recognizer errors, and then a consumer that actively watches those queues to handle the call via tap commands sent to the freeswitch box. So as soon as that error happens on ASR-28450, a uuid_transfer command is issued to the box to move that uuid to another context.

On Thu, Sep 5, 2019 at 1:14 AM Evgen Polivoda <pol...@gmail.com> wrote:

zheka_13

unread,
Sep 10, 2019, 7:06:28 AM9/10/19
to uni...@googlegroups.com
Nice  solution. 

Sean, can this mod catch 406 Status even? 

2019-09-05 08:03:29.831722 [INFO] mrcp_sofiasip_client_agent.c:609 () Receive SIP Event [nua_r_invite] Status 406 Not Acceptable [gsr]

вт, 10 сент. 2019 г. в 01:38, Sean DiSanti <sdisanti...@gmail.com>:

Sean DiSanti

unread,
Sep 10, 2019, 12:29:26 PM9/10/19
to uni...@googlegroups.com
Yes, with mod_amqp you would just set the log-levels parameter to include 'info', and then set the binding on your rabbitmq queue to grab the correct messages. One thing to consider going that route though is that there are a LOT of info level events that happen, and they're all going to be published to your exchange. We handle that by trapping the ERR level recognizer error that happens shortly after, instead of the info message.

zheka_13

unread,
Sep 11, 2019, 3:40:58 AM9/11/19
to uni...@googlegroups.com
Thank you very much Sean fro this idea !!!! 

вт, 10 сент. 2019 г. в 19:29, Sean DiSanti <sdisanti...@gmail.com>:

Sean DiSanti

unread,
Sep 13, 2019, 2:11:29 PM9/13/19
to uni...@googlegroups.com
no problem, I'm glad I could help

Reply all
Reply to author
Forward
0 new messages