<div dir="ltr">Hi,<div><br></div><div>On 20 August 2013 23:37, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br></div><div class="gmail_extra">
<div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><div><div class="h5"><span style="color:rgb(34,34,34)">I would use also the tags - something like:</span><br>
</div></div>
    - save for invite:<br>
    $sht(x=>$ci::$ft) = $sel(contact.uri);<br>
    - save for 200ok of invite<br>
    $sht(x=>$ci::$tt) = $sel(contact.uri);<br>
    <br>
    For bye, if uri==myself, then if $sht(x=>$ci::$tt)!=$null then
    $ru = $sht(x=>$ci::$tt)<br></div></blockquote><div><br></div><div><br></div><div>I've got something that works for my simple test case.</div><div><br></div><div>But could you just explain one thing for me:</div>
<div><br></div><div>When the upstream service sends back the 407 to the initial INVITE, the kamalio.cfg processes that via failure_route[MANAGE_FAILURE].</div><div>That calls route[NATMANAGE].  Its in NATMANAGE where I put my code to save the contact.</div>
<div><br></div><div>But I'm surprised to see that "is_request()" is apparently true at that time:</div><div><br></div><div>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.</div>
<div><br></div><div>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.</div><div><br></div><div>But to improve my understanding, which is is_request true for the 407 which surely is a reply?</div>
<div><br></div><div>Is there documentation I have missed which will help me understand the "architecture" and internal logic flow of Kamailio better?</div><div><br></div><div>Thanks,</div><div>Steve</div><div><br>
</div><div><br></div></div>
</div></div>