<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi Mihaylov,<br>
    <br>
    If your Asterisk servers add a Record-Route header to the initial
    Invite, for in-dialog requests ( ACK, BYE) you should use <b>loose_route()
    </b>function to do the routing. This will make sure the requests go
    the same path as the initial Invite. It is not a good practice to
    manually route these requests. <br>
    <br>
    Regards,<br>
    Anca <br>
    <br>
    <br>
    On 01/29/2012 11:10 PM, Stoyan Mihaylov wrote:
    <blockquote
cite="mid:CAPScudYwh8DGzEWCtMbqrSj0NypEuEnD1uNwG+47MT4zGdyphA@mail.gmail.com"
      type="cite"><span class="Apple-style-span" style="">My whole
        configuration is:</span>
      <div style="">[Sip clients] &lt; = &gt; Kamailio 3.2 &lt;=&gt;
        Asterisk servers (behind Kamailio)</div>
      <div style="">Asterisk servers have only local IP addresses, and I
        use t_relay instead of forward.</div>
      <div style="">Kamailio runs on same server as rtpproxy.</div>
      <div>Everything is fine if clients connect to Kamailio with its IP
        address - global, or if they are behind Kamailio with local
        address.</div>
      <div>When clients connect to Kamailio using <a
          moz-do-not-send="true" href="http://sip.ourcompany.com">sip.ourcompany.com</a>,
        then call (video also) is OK, but ACK and BYE do not work.</div>
      <div>BYE receives not here (404), and ACK die somewhere.</div>
      <div>I forward BYE and ACK in case when src_ip==$td to Asterisk
        server.</div>
      <div><br>
      </div>
      <div>If one of clients use IP - then calls initiated from it are
        OK (BYE/ACK - are going correctly - to Asterisk and to other
        client also). But calls from other client have problems with BYE
        and ACK.</div>
      <div><br>
      </div>
      <div>To use&nbsp;<a moz-do-not-send="true"
          href="http://sip.ourcompany.com">sip.ourcompany.com</a> - I
        put:</div>
      <div>alias=<a moz-do-not-send="true"
          href="http://sip.ourcompany.com">sip.ourcompany.com</a></div>
      <div><br>
      </div>
      <div><br>
      </div>
      <div>
        <div style="">
          route[ACKBYE] {</div>
        <div style="">#!ifdef WITH_PSTN</div>
        <div style=""><span style="white-space: pre-wrap;"> </span>if
          (is_method("BYE|ACK"))</div>
        <div style=""><span style="white-space: pre-wrap;"> </span>{</div>
        <div style="">
          <span style="white-space: pre-wrap;"> </span>xlog("L_ALERT","AB
          $rm $sht(forw=&gt;$ft) $td");</div>
        <div style=""><span style="white-space: pre-wrap;"> </span>if(src_ip==$td){</div>
        <div style="">#I have to rewrite du - messages loop in Kamailio,
          I store in&nbsp;$sht(forw=&gt;$ft) $du which I use during INVITE.</div>
        <div style=""><span style="white-space: pre-wrap;"> </span>$du=$sht(forw=&gt;$ft);</div>
        <div style=""><span style="white-space: pre-wrap;"> </span>route(RELAY);</div>
        <div style=""><span style="white-space: pre-wrap;"> </span>exit;</div>
        <div style=""><span style="white-space: pre-wrap;"> </span>}</div>
        <div style=""><span style="white-space: pre-wrap;"> </span>xlog("L_ALERT","ACK,Bye
          Not me");</div>
        <div style=""><span style="white-space: pre-wrap;"> </span>}</div>
        <div style="">#!endif</div>
        <div style="">return;</div>
        <div style="">}</div>
      </div>
      <div style=""><br>
      </div>
    </blockquote>
    <br>
  </body>
</html>