<!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 text="#000000" bgcolor="#ffffff">
    <div class="moz-text-flowed" style="font-family: -moz-fixed;
      font-size: 12px;" lang="x-western">Hi,
      <br>
      <br>
      I have Kamailio set up to act as a proxy and load balancer.  Most
      things are working correctly but for some reason I can't get
      Kamailio to proxy an ACK to a 486 Busy.
      <br>
      I assume that it is something wrong that I have done in the
      kamailio.cfg file but I am not seeing it.
      <br>
      <br>
      Does the t_check_trans() return false because the call state is
      Busy?
      <br>
      <br>
      Please let me know if you need other logs or information.
      <br>
      <br>
      Thanks in advance,
      <br>
      Carl
      <br>
      <br>
      <br>
      <br>
      ================== Call flow:  (from ngrep) 
      ======================
      <br>
      <br>
      Asterisk     Kamailio     Provider
      <br>
       INVITE---------&gt;
      <br>
                         INVITE---------&gt;
      <br>
      &lt;----------100 Trying
      <br>
      &lt;---------100 Trying
      <br>
      &lt;----------486 Busy
      <br>
      &lt;---------486 Busy
      <br>
      ACK-------------&gt;
      <br>
      ====== Kamailio does not proxy the ACK here =======
      <br>
      &lt;----------486 Busy
      <br>
      &lt;---------486 Busy
      <br>
      ACK-------------&gt;
      <br>
      &lt;----------486 Busy
      <br>
      &lt;---------486 Busy
      <br>
      <br>
      <br>
      === kamailio.cfg snippet
      <br>
      ...
      <br>
      route
      <br>
      {
      <br>
         route(REQINIT);  # remove malformed messages
      <br>
      <br>
         # handle requests within SIP dialogs
      <br>
         route(WITHINDLG);
      <br>
        ...
      <br>
      }
      <br>
      <br>
###################################################################
      <br>
      # Handle requests within SIP dialogs (request has a TO: Tag)
      <br>
      route[WITHINDLG]
      <br>
      {
      <br>
         if (has_totag())
      <br>
         {
      <br>
      xlog("L_INFO", "  WITHINDLG: SIP Request: [$rm] ruri=[$ru]  (from
      [$fu] to [$tu], Call-ID=[$ci], CSeq=[$cs])\n");
      <br>
            if (loose_route())
      <br>
            {
      <br>
               ...
      <br>
            }
      <br>
            else  # not loose_route
      <br>
            {
      <br>
               if ( is_method("ACK") )
      <br>
               {
      <br>
                  if ( t_check_trans() )  # see if a message is related
      to a transaction
      <br>
                  {
      <br>
                     ...
      <br>
                  }
      <br>
                  else
      <br>
                  {
      <br>
                     # ACK without matching transaction ... ignore and
      discard
      <br>
      xlog("L_INFO", "  WITHINDLG: has TO: tag AND loose_route is NOT
      true and is_method = ACK and t_check_trans=FALSE\n");
      <br>
      <br>
      # not forwarded here!!!   Tried both t_relay and forward.
      <br>
                     # $var(a) = t_relay();
      <br>
                     $var(a) = forward();
      <br>
                     xlog ("L_INFO", "  WITHINDLG: (ReturnCode =
      [$var(a)] exiting)\n");
      <br>
      <br>
                     exit;
      <br>
                  }
      <br>
               }
      <br>
               sl_send_reply("404","Not here");
      <br>
            }
      <br>
            exit;
      <br>
         }
      <br>
      }
      <br>
      <br>
      ============= End of kamailio.cfg ================
      <br>
      <br>
      <br>
      ============= /var/log/messages - snippit of the message
      ==========
      <br>
      <br>
      May 18 11:21:05 kam0 /usr/sbin/kamailio[21282]: INFO:
      &lt;script&gt;: ======== processing new message
      <br>
      May 18 11:21:05 kam0 /usr/sbin/kamailio[21282]: INFO:
      &lt;script&gt;: MAIN: SIP Request: [ACK] ruri=[<a
        class="moz-txt-link-abbreviated"
        href="mailto:sip:+13031112222@2.3.4.5">sip:+13031112222@2.3.4.5</a>] 
      (from [<a class="moz-txt-link-abbreviated"
        href="mailto:sip:+13031112222@3.4.5.6">sip:+13031112222@3.4.5.6</a>]
      to [<a class="moz-txt-link-abbreviated"
        href="mailto:sip:+13031112222@2.3.4.5">sip:+13031112222@2.3.4.5</a>],
      Call-ID=[<a class="moz-txt-link-abbreviated"
        href="mailto:21a30b9168e0a8c963d47ca1361cef77@3.4.5.6">21a30b9168e0a8c963d47ca1361cef77@3.4.5.6</a>])
      CSeq=[102]
      <br>
      May 18 11:21:05 kam0 /usr/sbin/kamailio[21282]: INFO:
      &lt;script&gt;:   WITHINDLG: SIP Request: [ACK] ruri=[<a
        class="moz-txt-link-abbreviated"
        href="mailto:sip:+13031112222@2.3.4.5">sip:+13031112222@2.3.4.5</a>] 
      (from [<a class="moz-txt-link-abbreviated"
        href="mailto:sip:+13031112222@3.4.5.6">sip:+13031112222@3.4.5.6</a>]
      to [<a class="moz-txt-link-abbreviated"
        href="mailto:sip:+13031112222@2.3.4.5">sip:+13031112222@2.3.4.5</a>],
      Call-ID=[<a class="moz-txt-link-abbreviated"
        href="mailto:21a30b9168e0a8c963d47ca1361cef77@3.4.5.6">21a30b9168e0a8c963d47ca1361cef77@3.4.5.6</a>],
      CSeq=[102])
      <br>
      May 18 11:21:05 kam0 /usr/sbin/kamailio[21282]: INFO:
      &lt;script&gt;:   WITHINDLG: has TO: tag
      <br>
      May 18 11:21:05 kam0 /usr/sbin/kamailio[21282]: INFO:
      &lt;script&gt;:   WITHINDLG: has TO: tag AND loose_route is NOT
      true and is_method = ACK and t_check_trans=FALSE
      <br>
      May 18 11:21:05 kam0 /usr/sbin/kamailio[21282]: INFO:
      &lt;script&gt;:   WITHINDLG:    the ACK to a 486 was not being
      processed so I am adding t_relay here
      <br>
      May 18 11:21:05 kam0 /usr/sbin/kamailio[21282]: INFO:
      &lt;script&gt;:   WITHINDLG: (ReturnCode = [1] exiting)
      <br>
      <br>
      <br>
      <br>
    </div>
  </body>
</html>