Hey Timo <br><br>Thanks for your email.<br>I apologise i never copied the config properly. I missed a  } to close the if statement.<br>You can see that the route(WITHINDLG); is called for all requests from this config.<br>
<br><br><br>       # MANAGE ALL DIALOGS<br>       #===================================================<br>        if (is_method(&quot;INVITE&quot;))<br> {<br>        if(is_method(&quot;INVITE&quot;) &amp;&amp; !has_totag())<br>
       {<br>           $dlg_ctx(timeout_route) = 12;<br>           $dlg_ctx(timeout_bye) = 1;<br>       }<br><br>          dlg_manage();<br><br> }<br><br> <br>         if(is_method(&quot;BYE|CANCEL&quot;))<br><br>      {<br>
        <br>         dlg_manage();<br><br><br>      }<br>       <br>        <br><br>        # per request initial checks<br>        route(REQINIT);<br><br>        # NAT detection<br>        route(NAT);<br><br>        # handle requests within SIP dialogs<br>
        route(WITHINDLG);<br><br>        ### only initial requests (no To tag)<br><br>        # CANCEL processing<br>        if (is_method(&quot;CANCEL&quot;))<br>        {<br>                if (t_check_trans())<br>                        t_relay();<br>
                exit;<br>        }<br><br>        t_check_trans();<br><br>        # authentication<br>        route(AUTH);<br><br>        # record routing for dialog forming requests (in case they are routed)<br>        # - remove preloaded route headers<br>
        remove_hf(&quot;Route&quot;);<br>        if (is_method(&quot;INVITE|SUBSCRIBE&quot;))<br>                record_route(); <br><br><br><br>Thanks again for your help.<br><br>Phillip<br><br><div class="gmail_quote">On Tue, Sep 20, 2011 at 3:06 PM, Timo Reimann <span dir="ltr">&lt;<a href="mailto:timo.reimann@1und1.de">timo.reimann@1und1.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hey Phillip,<br>
<div class="im"><br>
<br>
On 20.09.2011 13:48, Phillman25 Kyriacou wrote:<br>
&gt; Thanks for your email.<br>
&gt;<br>
&gt; Yes dlg_manage(); has to now be called on INVITE and BYE/CANCEL messages.<br>
&gt; Where would i have to call loose_route()? Only on INVITE?<br>
<br>
</div>On *all* in-dialog requests, i.e., all requests which contain a To tag.<br>
This may include Re-INVITEs too (but not initial INVITEs).<br>
<div class="im"><br>
<br>
&gt; My configuration did not change between 3.1.2 and 3.1.5.<br>
&gt;<br>
&gt; Call flow example:<br>
&gt; ==============<br>
&gt;<br>
&gt; Cisco PGW ===&gt; Kamailio 3.1.5 ===&gt; VOIP PROVIDER or ASTERISK PABX<br>
&gt;<br>
&gt;<br>
&gt; The below is my configuration.<br>
<br>
</div>Let&#39;s take a look at it:<br>
<br>
<br>
&gt; #!KAMAILIO<br>
&gt; #<br>
<br>
[...]<br>
<div class="im"><br>
&gt;          if(is_method(&quot;BYE|CANCEL&quot;))<br>
&gt;<br>
&gt;       {<br>
&gt;<br>
&gt;          dlg_manage();<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;         # per request initial checks<br>
&gt;         route(REQINIT);<br>
&gt;<br>
&gt;         # NAT detection<br>
&gt;         route(NAT);<br>
&gt;<br>
&gt;         # handle requests within SIP dialogs<br>
&gt;         route(WITHINDLG);<br>
<br>
</div>[...]<br>
<div class="im"><br>
&gt; # Handle requests within SIP dialogs<br>
&gt; route[WITHINDLG] {<br>
&gt;         if (has_totag()) {<br>
&gt;                 # sequential request withing a dialog should<br>
&gt;                 # take the path determined by record-routing<br>
&gt;                 if (loose_route()) {<br>
<br>
</div>[...]<br>
<br>
<br>
So route[WITHINDLG] contains the logic to track in-dialog requests.<br>
However, you seem to call that route only from BYE and CANCEL requests,<br>
missing out ACKs, which is likely the reason why things go wrong. So<br>
make sure you run all in-dialog requests through that route, and you<br>
should be fine (hopefully).<br>
<br>
<br>
Cheers,<br>
<font color="#888888"><br>
--Timo<br>
</font></blockquote></div><br>