You'll need to manage your expectations here.<div><br><div>SIP registrations start when the client sends a REGISTER, with an expiry time. They then periodically send additional REGISTERs to remain registered. They can be spread quite a long way apart - several minutes.</div>
<div><br></div><div>A client explicitly unregisters by sending a REGISTER with a 0 expiry time, ie the registration expires immediately.</div><div><br></div><div>If the client has gone offline because of reboot, network problem etc it won't send that final REGISTER. You won't see the client unregister until the end of the expiry time when the client hasn't renewed its registration.</div>
<div><br></div><div>Since that's several minutes later, there's no way to see that they have unregistered <i>immediately</i>. You may be able to reduce the expiry time to detect they're offline quicker, but that will increase bandwidth and load.</div>
<div><br></div><div><br></div><div><br></div><div>As for actually how to detect the unregistration... I suspect the 2 events you want to listen for are sofia::unregister and sofia::expire. The names suggest the 1st will be for an explicit unregister and the 2nd for when the client fails to reregister within the expiry time. That means the 2nd'll be the one you'd see if the client goes unexpectedly offline.</div>
<div><br></div><div><br></div><div>-Steve</div><div><br></div><div><br></div><div><br></div><div><br><div class="gmail_quote">On 12 December 2012 17:52, 王理 <span dir="ltr"><<a href="mailto:itispip-qq@hotmail.com" target="_blank">itispip-qq@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">
Hi Freeswtich Master,<div><br></div><div>I'm in a situation where I need to proactively moniter whether some device/extension is on in my local network; If for some reason the devices are offline, I need to be noticed immediately so that I can restart the device;</div>
<div><br></div><div>Previously I use xlite client to suscribe to the presence notification of the devices, but recently added some devices which not supporting presence notification, so I want FreeSwitch to send an email notification when some user/extention are getting unregistered;</div>
<div><br></div><div>How can I capture a Feeswtich user unregister event & launch a LUA script then?</div><div><br></div><div>Happy days!</div><div><br></div><div>/Brgds, Alex</div>                                            </div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>