Ah thanks Daniel,
So I had a wrong expectation on the behaviour of pua_usrloc.
It does make sense that the PUBLISH already carries its expiry and so the expiration moment is implicit and should/can be handled elsewhere.
I think what confused me were two things: the pua_usrloc documentation and the fact that pua_usrloc does register for EXPIRE callbacks with usrloc.
I’m referring to:
“The pua_usrloc module is the connector between the usrloc and pua modules. It creates the environment to send PUBLISH requests for user location records, on specific events (e.g., when new record is added in usrloc, a PUBLISH with status open (online) is issued; when expires, it sends closed (offline)).”
From: Daniel-Constantin Mierla [mailto:miconda@gmail.com]
Sent: 19 January 2012 10:37
To: SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - Users Mailing List
Cc: Giacomo Vacca
Subject: Re: [SR-Users] pua_usrloc, PUBLISH not send when contact is deleted or expires
Hello,
On 1/19/12 11:22 AM, Giacomo Vacca wrote:Hi Daniel,
Thanks for your feedback. Yes, using mysql and enabling presence made it work for un-registrations too.
Just for the purpose of this scenario I’m sending the PUBLISH back to the same entity, and it’s being handled as a presentity.
I still have a missing piece though (which is in fact the reason for this configuration): having PUBLISH requests triggered by the expiration of a contact.
When a contact expires, pua_usrloc is now logging:
Jan 19 10:12:03 debian6 /usr/sbin/kamailio[4359]: INFO: pua_usrloc [ul_publish.c:211]: should not send ul publish
(please see below for traces and details).
Since I’m marking a registration with pua_set_publish(), why is that flag not seen as true when usrloc fires an EXPIRE callback?
I’ve tried marking every REGISTER request with pua_set_publish(), and not just the first one, before calling save(“location”) but the result was the same.
the PUBLISH for registration expiration does not make sense, as PUBLISH has also an expire interval, so the record in the presence server should expire at the same time. A publish with update state to close will eventually hit the presence server when there is no record for it. Presence server will send notifications when the record in its table expires.
Cheers,
Daniel
-- Daniel-Constantin Mierla -- http://www.asipto.com http://linkedin.com/in/miconda -- http://twitter.com/miconda