[Freeswitch-users] Option to log registrations/deregistrations?

Adridan Tudor tudor.gabriell at gmail.com
Tue Mar 12 18:46:11 UTC 2019


You can use an event hook from mod_lua to execute a lua script on
unregister event.
Add "<hook event="custom" subclass="sofia::unregister"
script="logout_callcenter.lua" />" in lua.conf.xml

In the script you can do whatever you want, for example logout from
callcenter.
>>freeswitch.consoleLog("INFO","Executing logout_callcenter.lua\n");
>>local username = event:getHeader("username");
>>local from_user = event:getHeader("from-user");
>>freeswitch.consoleLog("INFO","username: " .. (username or "") .."\n");
>>freeswitch.consoleLog("INFO","from-user: " .. (from_user or "") .."\n");
>>
>>if (username ~= nil) then
>>    api = freeswitch.API();
>>    result = api:execute("callcenter_config", "agent set status
"..username.." 'Logged Out'");
>>    freeswitch.consoleLog("INFO", "Execute on unregister: ".. result ..
"\n")
>>end

On Tue, Mar 12, 2019 at 8:26 PM mario_fs <mario_fs at mgtech.com> wrote:

> Still no luck on this and I really need to know date/time when a
> particular extension is unregistering. Anyone else have an idea that does
> not involve programming? Thanks,
> Mario G
>
> On Feb 20, 2019, at 9:16 AM, mario_fs <mario_fs at mgtech.com> wrote:
>
> I have been searching the wiki and web and still nothing simple to log
> de-registrations. I find it hard to believe there is not a simple way to do
> this, anyone have a good idea?
> Mario G
>
> On Feb 15, 2019, at 9:46 AM, mario_fs <mario_fs at mgtech.com> wrote:
>
> Hmmmm…. Logging de-registrations would be a useful enhancement to
> FreeSwitch for debugging issues like this. I know a SIP trace does it but
> that’s a LOT of data when we're talking days. Thanks.
> Mario G
>
> On Feb 15, 2019, at 12:05 AM, Avi Marcus <avi at avimarcus.net> wrote:
>
> Here's some old nodejs code relying on `esl` lib to monitor for
> de-registrations and send me an email. I haven't used it in ages.
>
> https://gist.github.com/avimar/9645dd3134476d458e68cca077f4ed16
>
>
> -Avi Marcus
> BestFone
>
>
> On Fri, Feb 15, 2019 at 12:13 AM mario_fs <mario_fs at mgtech.com> wrote:
>
>> Does anyone know if there is something I can do to log device
>> registrations, and more importantly when devices lose registration, *without
>> having a ton of other log data*. I know I can turn on a higher level of
>> diagnostics, but it may be several days before I find what I need and don’t
>> want to flood the log.
>>
>> I am working with Counterpath on Bria Push service and need to find when
>> their push server stops registering. Since they don’t send a notification
>> for that and it’s not in the normal FS log, I may not know for days when
>> this happens. It would be nice to be able to scan the log for lost
>> registrations. Thanks!
>> Mario G
>> _________________________________________________________________________
>> Professional FreeSWITCH Services
>> sales at freeswitch.com
>> https://freeswitch.com
>>
>> Official FreeSWITCH Sites
>> https://freeswitch.com/oss
>> https://freeswitch.org/confluence
>> https://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
>> https://freeswitch.com
>
> _________________________________________________________________________
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://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
> https://freeswitch.com
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://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
> https://freeswitch.com
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://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
> https://freeswitch.com
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Services
> sales at freeswitch.com
> https://freeswitch.com
>
> Official FreeSWITCH Sites
> https://freeswitch.com/oss
> https://freeswitch.org/confluence
> https://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
> https://freeswitch.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20190312/788ea7e0/attachment.html>


More information about the FreeSWITCH-users mailing list