thank you a lot Henning, your explanation makes perfect sense.
> Date: Wed, 12 Nov 2008 09:09:05 +0100
> Subject: RE: [Kamailio-Users] question about register
> From: henning.westerholt@1und1.de
> To: fborot@hotmail.com
> CC: henning.westerholt@1und1.de; users@lists.kamailio.org
>
> On Tue, November 11, 2008 8:19 pm, Fabian Borot wrote:
> >
> > txs Henning, the search() works, that block only matches REGISTERs, but my
> > point was whether the lookup() function makes sense or not for handling
> > REGISTERs [ I see it in some tutorials, I am a beginner to kamailio by the
> > way]
> >
> > as far as handling UN-REGISTRATIONs, would save() fit there as well?
> > should I do something special to handle the UN-REGISTRATION or kamailio
> > should know that should remove the AOR automaticall when it sees the
> > "expires=0" in the Contact HF?
> >
> >
> > also, I see the loop but do not understand why it happens.
>
> Hi Fabian,
>
> using the lookup function makes no sense for REGISTERs. An incoming INVITE
> is targeted to some user@sip.domain, so you need to do the lookup() to be
> able deliver the INVITE to your user. But the REGISTER is targeted to
> sip.domain, e.g. your servers, which should just handle them.
>
> The save() does all the work for you, it also handles unregistrations,
> error handling related to REGISTERs and so on.You don't need to handle it
> specially.
>
> The loop happens as the unregistration is not handled by your save() path
> in the config (probably because of the wrong check), so the server try to
> forward it. The destination was not changed, so it will end up on your
> server again, and again..
>
> I'll later take a look to the docs of the save() function, perhaps this
> should be explained a little bit better.
>
> Henning
>
Color coding for safety: Windows Live Hotmail alerts you to suspicious email. Sign up today.