[Freeswitch-users] How to execute lua script on register?
Abdul Hakeem
alhakeem at gmail.com
Tue Dec 30 15:06:11 MSK 2014
Hello guys,
Thanks for the tip below.
Suppose I want to run a Lua daemon or a NodeJS application to interept and
process sofia::register and sofia:unregister subclasses,
what do I need to substitute for the script="catch-event-gateway.lua"/>
parameter in the "autoload_configs/lua.conf.xml'' (in case of Lua) or the
alternation for an ESL application?
Much obliged,
Abdul Hakeem
-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of
poliv78 at yahoo.co.uk
Sent: Tuesday, December 30, 2014 9:49 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] How to execute lua script on register?
Thank you very much and happy new year.
> Hi,
> I use the following line in "autoload_configs/lua.conf.xml" to monitor de
> register state of my gateways:
> <hook event="CUSTOM" subclass="sofia::gateway_state"
> script="catch-event-gateway.lua"/>
> And put in your scripts directory the file catch-event-gateway.lua with
> the following code to see what happens:
> freeswitch.consoleLog("notice","event ==== sofia::gateway_state
> =====\n")
> freeswitch.consoleLog("notice"," event\n" .. event:serialize())
> Also, for internal users register events, you can try the same code with
> the following "subclass" events:
> sofia::register_failure
> sofia::register
> sofia::expire
> sofia::register_attempt
> sofia::unregister
> sofia::pre_register
> Regards
> JCM
> From: Ken Rice <krice at freeswitch.org>
> Reply-To: FreeSWITCH Users Help
> <freeswitch-users at lists.freeswitch.org>
> Date: viernes, 26 de diciembre de 2014, 11:30
> To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
> Subject: Re: [Freeswitch-users] How to execute lua script on register?
> You cant fire a script on register... Your options are ESL to monitor it
> (which you can write in lua) or luarun and have a lua script constantly
> running processing register events... The external script would probably
> On 12/26/14 2:39 AM, "poliv78 at yahoo.co.uk" <poliv78 at yahoo.co.uk> wrote:
> úÄÒÁ×ÓÔ×ÕÊÔÅ, David.
> Yes I know that, thanks.
> But I want to monitor all registrations. Simply put in database
> fail or success.
> I know I can use ESL for that. But lua is more handy here and I
> would like to know if it's possible.
> ÷Ù ÐÉÓÁÌÉ 25 ÄÅËÁÂÒÑ 2014 Ç., 23:33:41:
> You could just look at the log for failed attempts.
> On Dec 25, 2014 1:21 PM, <poliv78 at yahoo.co.uk> wrote:
> Hi all
> Is it possible to execute lua script when gateway try to register
> to know if it successfull or failed?
> The same question as for internal users.
> Thanks.
> --
> ó Õ×ÁÖÅÎÉÅÍ,
> Poliv78 mailto:poliv78 at yahoo.co.uk
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
--
ó Õ×ÁÖÅÎÉÅÍ,
Poliv78 mailto:poliv78 at yahoo.co.uk
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list