On 17 September 2013 14:02, Olle E. Johansson <oej@edvina.net> wrote:

Because the REGISTER has expires=0 on the contact, so this is a DEREGISTRATION,
and that's why you do not see any contacts in the 200 OK.
You need to check that you have contact headers before saving based on the 200 OK. Or possibly
read the response code from save().


I do understand that its a deregistration.  I want my Kamailio to remove the local registration, but it is not.

The registrar module save() documentation says that "The function processes a REGISTER message. It can add, remove or modify usrloc records depending on Contact and Expires HFs in the REGISTER message.".  So it seems it would do the right thing if it could see the actual REGISTER message.  But since I'm in the in reply_route looks like it is working off the reply.  In which case it can't "see" the Contact and especially not the ;expires=0.  Is that right?

So is there a way to get at the original REGISTER request in onreply_route?  Otherwise I guess I must use an avp to remember the request or something like that?  Since in the 200 OK there isn't really enough information to tell that its a de-registration.  Unless I can imply that from the missing Contact header?  But I think not since if there were multiple registrations the returned OK IIRC will still report the remaining registrations?

If I can figure out that the returned 200 OK is in response to a deregistration I guess I can use unregister() to remove my local registration.
 
Steve