<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">you can create a hook for this:</div><div class=""><br class=""></div><div class=""><font face="Courier New" class=""><configuration name="v8.conf" description="Google V8 JavaScript Plug-Ins"><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><settings><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><hook event="CUSTOM" subclass="sofia::register" script="event_hook.js"/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><hook event="CUSTOM" subclass="sofia::unregister" script="event_hook.js"/><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></settings><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><modules><br class=""><span class="Apple-tab-span" style="white-space:pre"> </span></modules><br class=""></configuration><br class=""></font><br class="">event_hook.js:</div><div class=""><br class=""></div><div class=""><font face="Courier New" class="">var fromUser = event.getHeader("from-user");<br class="">var fromHost = event.getHeader("from-host");<br class="">var fromUri = event.getHeader("from-user") + "@" + event.getHeader("from-host");<br class="">var addFifo = "add callqueue" + "@" + fromHost + " user/" + fromUri + " 1 20 0";<br class="">var delFifo = "del callqueue" + "@" + fromHost + " user/" + fromUri;<br class="">var rc;<br class="">var regType;<br class=""><br class="">if (event.getHeader("Event-Subclass") == "sofia::register") {<br class=""> regType = "Register";<br class="">} else if (event.getHeader("Event-Subclass") == "sofia::unregister") {<br class=""> regType = "Unregister";<br class="">}<br class=""><br class="">if (fromUser >= 1001 && fromUser <= 1008) {<br class=""> console_log('info', 'USER ' + fromUri + " " + regType);<br class=""> if (regType == "Register") {<br class=""> rc = apiExecute("fifo_member", addFifo);<br class=""> } else if (regType == "Unregister") {<br class=""> rc = apiExecute("fifo_member", delFifo);<br class=""> }<br class=""> console_log(regType + " " + fromUri + " (User Agent: " + event.getHeader("user-agent") + ")");<br class=""> rc = apiExecute("fifo", "count callqueue@" + fromHost);<br class=""> console_log("FIFO status: " + rc);<br class="">}<br class=""></font><br class=""><div>This is based on a JS hook, but it will work with Lua, too.</div><div><br class=""></div><div>My script does a login / logout for FIFO member if a user between 1001 and 1008 does a SIP login or logout. </div><div>You have to adapt the commands for mod_callcenter.</div><div><br class=""></div><div>hth</div><div>Henning</div><div><br class=""></div><div><br class=""></div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class="">Am 03.02.2021 um 12:29 schrieb Nathan Stratton <<a href="mailto:nathan@robotics.net" class="">nathan@robotics.net</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I am playing around with call center, and noticed many times that users will disconnect (stop registering) but be stuck in queue because they did not log out. How hard would it be to have something that runs every minute and log out all agents that are not registered?<br clear="all" class=""><div class=""><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><br class="">><><br class="">nathan stratton</div></div></div></div></div>
_________________________________________________________________________<br class=""><br class="">The FreeSWITCH project is sponsored by SignalWire <a href="https://signalwire.com" class="">https://signalwire.com</a><br class="">Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.<br class="">Build your next product on our scalable cloud platform.<br class=""><br class="">Join our online community to chat in real time <a href="https://signalwire.community" class="">https://signalwire.community</a><br class=""><br class="">Professional FreeSWITCH Services<br class=""><a href="mailto:sales@freeswitch.com" class="">sales@freeswitch.com</a><br class="">https://freeswitch.com<br class=""><br class="">Official FreeSWITCH Sites<br class="">https://freeswitch.com/oss<br class="">https://freeswitch.org/confluence<br class="">https://cluecon.com<br class=""><br class="">FreeSWITCH-users mailing list<br class="">FreeSWITCH-users@lists.freeswitch.org<br class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users<br class="">UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users<br class="">https://freeswitch.com</div></blockquote></div><br class=""></div></body></html>