<div dir="auto">Glad I could help, those were only some examples used by me. Just adapt them to fit your needs.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 18, 2019, 7:08 PM mario_fs <<a href="mailto:mario_fs@mgtech.com">mario_fs@mgtech.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div dir="auto" style="word-wrap:break-word;line-break:after-white-space">Thanks Adridan this worked great! My only issue was I needed the agent but it’s not available for custom, so I used contact which has the IP address of the push server when needed. Thanks also to David but I don’t know anything about ESL and the wiki was of little help. I know already had a LUA script.<div><br></div><div>I don’t know what the last “if” block does, I don’t think it applies to me, not much on the wiki, it seems to work fine with it commented out.<br><div><br></div><div><div>local username = event:getHeader("username");</div><div>local from_user = event:getHeader("from-user");</div><div>--local agent = event:getHeader("variable_sip_user_agent");</div><div>local contact = event:getHeader("contact");</div><div>freeswitch.consoleLog("INFO","LUA logout_callcenter.lua username: " .. (username or "") .." from-user: " .. (from_user or "") .."\n");</div><div>freeswitch.consoleLog("INFO"," contact: " .. (contact or "") .."\n");</div><div>--freeswitch.consoleLog("INFO","agent: " .. (agent or "") .."\n");</div><div><br></div><div>--if (username ~= nil) then</div><div>-- api = freeswitch.API();</div><div>-- result = api:execute("callcenter_config", "agent set status "..username.." 'Logged Out'");</div><div>-- freeswitch.consoleLog("INFO", "Execute on unregister: ".. result .. "\n")</div><div>--end</div><div><br><blockquote type="cite"><div>On Mar 12, 2019, at 4:30 PM, David Villasmil <<a href="mailto:david.villasmil.work@gmail.com" target="_blank" rel="noreferrer">david.villasmil.work@gmail.com</a>> wrote:</div><br class="m_-3891314299194242910Apple-interchange-newline"><div><div dir="ltr">Hello,<div><br></div><div>You can use ESL to log that, just connect to localhost:8021 and log everything you see coming in:</div><div><br></div><div>checkout <a href="https://freeswitch.org/confluence/display/FREESWITCH/Python+ESL" target="_blank" rel="noreferrer">https://freeswitch.org/confluence/display/FREESWITCH/Python+ESL</a></div><div>and just log.</div><div><br></div><div>hope this helps.</div><div><br></div><div><br></div><div><br clear="all"><div><div dir="ltr" class="m_-3891314299194242910gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank" rel="noreferrer">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 12, 2019 at 10:21 PM mario_fs <<a href="mailto:mario_fs@mgtech.com" target="_blank" rel="noreferrer">mario_fs@mgtech.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Thanks! I know enough LUA to already have a LUA script in FreeSwitch so will give this a try. This should drastically help with debugging Bria PUSH staying registered issues! I found sofia::unregister on the wiki and check the lua.conf.xml file. Thanks a LOT!<div>Mario G<br><div><br><blockquote type="cite"><div>On Mar 12, 2019, at 11:46 AM, Adridan Tudor <<a href="mailto:tudor.gabriell@gmail.com" target="_blank" rel="noreferrer">tudor.gabriell@gmail.com</a>> wrote:</div><br class="m_-3891314299194242910gmail-m_-2843184031320206500Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">You can use an event hook from mod_lua to execute a lua script on unregister event. <br></div><div dir="ltr">Add "<hook event="custom" subclass="sofia::unregister" script="logout_callcenter.lua" />" in lua.conf.xml</div><div dir="ltr"><br></div><div>In the script you can do whatever you want, for example logout from callcenter.<br></div>>>freeswitch.consoleLog("INFO","Executing logout_callcenter.lua\n");<br>>>local username = event:getHeader("username");<br>>>local from_user = event:getHeader("from-user");<br>>>freeswitch.consoleLog("INFO","username: " .. (username or "") .."\n");<br>>>freeswitch.consoleLog("INFO","from-user: " .. (from_user or "") .."\n");<br>>><br>>>if (username ~= nil) then<br>>> api = freeswitch.API();<br>>> result = api:execute("callcenter_config", "agent set status "..username.." 'Logged Out'");<br>>> freeswitch.consoleLog("INFO", "Execute on unregister: ".. result .. "\n")<br>>>end</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 12, 2019 at 8:26 PM mario_fs <<a href="mailto:mario_fs@mgtech.com" target="_blank" rel="noreferrer">mario_fs@mgtech.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>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,<div>Mario G<br><div><br><blockquote type="cite"><div>On Feb 20, 2019, at 9:16 AM, mario_fs <<a href="mailto:mario_fs@mgtech.com" target="_blank" rel="noreferrer">mario_fs@mgtech.com</a>> wrote:</div><br class="m_-3891314299194242910gmail-m_-2843184031320206500gmail-m_2857438639847486835Apple-interchange-newline"><div><div>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?<div>Mario G<br><div><br><blockquote type="cite"><div>On Feb 15, 2019, at 9:46 AM, mario_fs <<a href="mailto:mario_fs@mgtech.com" target="_blank" rel="noreferrer">mario_fs@mgtech.com</a>> wrote:</div><br class="m_-3891314299194242910gmail-m_-2843184031320206500gmail-m_2857438639847486835Apple-interchange-newline"><div><div>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.<div>Mario G<br><div><br><blockquote type="cite"><div>On Feb 15, 2019, at 12:05 AM, Avi Marcus <<a href="mailto:avi@avimarcus.net" target="_blank" rel="noreferrer">avi@avimarcus.net</a>> wrote:</div><br class="m_-3891314299194242910gmail-m_-2843184031320206500gmail-m_2857438639847486835Apple-interchange-newline"><div><div dir="ltr"><div dir="ltr">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.<div><br></div><div><a href="https://gist.github.com/avimar/9645dd3134476d458e68cca077f4ed16" target="_blank" rel="noreferrer">https://gist.github.com/avimar/9645dd3134476d458e68cca077f4ed16</a></div><div><br></div><div><br clear="all"><div><div dir="ltr" class="m_-3891314299194242910gmail-m_-2843184031320206500gmail-m_2857438639847486835m_-6791474544660118792gmail_signature"><div dir="ltr"><div><div dir="ltr">-Avi Marcus<br>BestFone</div></div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 15, 2019 at 12:13 AM mario_fs <<a href="mailto:mario_fs@mgtech.com" target="_blank" rel="noreferrer">mario_fs@mgtech.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Does anyone know if there is something I can do to log device registrations, and more importantly when devices lose registration, <i>without having a ton of other log data</i>. 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.<div><br></div><div>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!</div><div>Mario G</div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com/" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com/" rel="noreferrer noreferrer" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com/" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div>
_________________________________________________________________________<br>Professional FreeSWITCH Services<br><a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br><a href="https://freeswitch.com/" target="_blank" rel="noreferrer">https://freeswitch.com</a><br><br>Official FreeSWITCH Sites<br><a href="https://freeswitch.com/oss" target="_blank" rel="noreferrer">https://freeswitch.com/oss</a><br><a href="https://freeswitch.org/confluence" target="_blank" rel="noreferrer">https://freeswitch.org/confluence</a><br><a href="https://cluecon.com/" target="_blank" rel="noreferrer">https://cluecon.com</a><br><br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="https://freeswitch.com/" target="_blank" rel="noreferrer">https://freeswitch.com</a></div></blockquote></div><br></div></div>_________________________________________________________________________<br>Professional FreeSWITCH Services<br><a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br><a href="https://freeswitch.com/" target="_blank" rel="noreferrer">https://freeswitch.com</a><br><br>Official FreeSWITCH Sites<br><a href="https://freeswitch.com/oss" target="_blank" rel="noreferrer">https://freeswitch.com/oss</a><br><a href="https://freeswitch.org/confluence" target="_blank" rel="noreferrer">https://freeswitch.org/confluence</a><br><a href="https://cluecon.com/" target="_blank" rel="noreferrer">https://cluecon.com</a><br><br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="https://freeswitch.com/" target="_blank" rel="noreferrer">https://freeswitch.com</a></div></blockquote></div><br></div></div>_________________________________________________________________________<br>Professional FreeSWITCH Services<br><a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br><a href="https://freeswitch.com/" target="_blank" rel="noreferrer">https://freeswitch.com</a><br><br>Official FreeSWITCH Sites<br><a href="https://freeswitch.com/oss" target="_blank" rel="noreferrer">https://freeswitch.com/oss</a><br><a href="https://freeswitch.org/confluence" target="_blank" rel="noreferrer">https://freeswitch.org/confluence</a><br><a href="https://cluecon.com/" target="_blank" rel="noreferrer">https://cluecon.com</a><br><br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="https://freeswitch.com/" target="_blank" rel="noreferrer">https://freeswitch.com</a></div></blockquote></div><br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com/" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com/" rel="noreferrer noreferrer" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com/" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div>
_________________________________________________________________________<br>Professional FreeSWITCH Services<br><a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br><a href="https://freeswitch.com/" target="_blank" rel="noreferrer">https://freeswitch.com</a><br><br>Official FreeSWITCH Sites<br><a href="https://freeswitch.com/oss" target="_blank" rel="noreferrer">https://freeswitch.com/oss</a><br><a href="https://freeswitch.org/confluence" target="_blank" rel="noreferrer">https://freeswitch.org/confluence</a><br><a href="https://cluecon.com/" target="_blank" rel="noreferrer">https://cluecon.com</a><br><br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="https://freeswitch.com/" target="_blank" rel="noreferrer">https://freeswitch.com</a></div></blockquote></div><br></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com/" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com/" rel="noreferrer noreferrer" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com/" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div>
_________________________________________________________________________<br>Professional FreeSWITCH Services<br><a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br><a href="https://freeswitch.com" target="_blank" rel="noreferrer">https://freeswitch.com</a><br><br>Official FreeSWITCH Sites<br><a href="https://freeswitch.com/oss" target="_blank" rel="noreferrer">https://freeswitch.com/oss</a><br><a href="https://freeswitch.org/confluence" target="_blank" rel="noreferrer">https://freeswitch.org/confluence</a><br><a href="https://cluecon.com" target="_blank" rel="noreferrer">https://cluecon.com</a><br><br>FreeSWITCH-users mailing list<br><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank" rel="noreferrer">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br><a href="https://freeswitch.com" target="_blank" rel="noreferrer">https://freeswitch.com</a></div></blockquote></div><br></div></div></div></div>_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank" rel="noreferrer">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer noreferrer" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank" rel="noreferrer">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div>