Hi,

On 20 August 2013 23:37, Daniel-Constantin Mierla <miconda@gmail.com> wrote:
 
I would use also the tags - something like:
- save for invite:
$sht(x=>$ci::$ft) = $sel(contact.uri);
- save for 200ok of invite
$sht(x=>$ci::$tt) = $sel(contact.uri);

For bye, if uri==myself, then if $sht(x=>$ci::$tt)!=$null then $ru = $sht(x=>$ci::$tt)


I've got something that works for my simple test case.

But could you just explain one thing for me:

When the upstream service sends back the 407 to the initial INVITE, the kamalio.cfg processes that via failure_route[MANAGE_FAILURE].
That calls route[NATMANAGE].  Its in NATMANAGE where I put my code to save the contact.

But I'm surprised to see that "is_request()" is apparently true at that time:

My code says "if ( is_request() && ($ft != $null) && ($sel(contact.uri) != $null) ) ...."  - ie its a request, there is a from_tag, and there is a contact: uri.  In that case I save the contact.uri and xlog a message.

I see the message, and the contact is (re-)saved.  Its harmless since the contact in the 407 is the same contact that was in the INVITE.

But to improve my understanding, which is is_request true for the 407 which surely is a reply?

Is there documentation I have missed which will help me understand the "architecture" and internal logic flow of Kamailio better?

Thanks,
Steve