From: steveayre@gmail.com
Date: Wed, 12 Dec 2012 19:47:07 +0000
To: freeswitch-users@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
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org