[Freeswitch-users] Email notification when user unregistered?

王理 itispip-qq at hotmail.com
Thu Dec 13 07:17:02 MSK 2012


Thanks Steve, I think  sofia::expire is what I want. 30s refresh frequency is fair enough.
/brgds, Alex

From: steveayre at gmail.com
Date: Wed, 12 Dec 2012 19:47:07 +0000
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] Email notification when user unregistered?

You'll need to manage your expectations here.
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.


A client explicitly unregisters by sending a REGISTER with a 0 expiry time, ie the registration expires immediately.
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.


Since that's several minutes later, there's no way to see that they have unregistered immediately. You may be able to reduce the expiry time to detect they're offline quicker, but that will increase bandwidth and load.




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.



-Steve



On 12 December 2012 17:52, 王理 <itispip-qq at hotmail.com> wrote:






Hi Freeswtich Master,
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;


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;


How can I capture a Feeswtich user unregister event & launch a LUA script then?
Happy days!
/Brgds, Alex 		 	   		  

_________________________________________________________________________

Professional FreeSWITCH Consulting Services:

consulting at freeswitch.org

http://www.freeswitchsolutions.com









Official FreeSWITCH Sites

http://www.freeswitch.org

http://wiki.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





_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.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 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20121213/9b4a1472/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list