<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    should be fixed in 4.2 -- the issue was introduced when changed the
    build of refer to contain a contact header, as it was reported some
    UA don't like it without the header.<br>
    <br>
    Let me know if all works ok now.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 24/10/14 14:56, Daniel-Constantin
      Mierla wrote:<br>
    </div>
    <blockquote cite="mid:544A4C96.6000806@gmail.com" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      I don't recall any change to this part for 4.2 and I am using
      dlg_bridge with 4.1 (no time to upgrade that box yet) -- but
      apparently there is a bug building the REFER. There were few
      changes on how From/To are built locally, but they are ok.<br>
      <br>
      I am traveling at Astricon, but with first occasion I will check
      it.<br>
      <br>
      Cheers,<br>
      Daniel<br>
      <br>
      <div class="moz-cite-prefix">On 24/10/14 12:07, Paul Smith wrote:<br>
      </div>
      <blockquote
        cite="mid:14EC42D0-5C60-41E0-975D-6260436E2946@claritytele.com"
        type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=windows-1252">
        <div>I added a log line to the top of kamailio.cfg request_route
          block to grab the message buffer of the REFER.  I also put a
          condition around the sanity_check to skip it for method=REFER
          … </div>
        <div apple-content-edited="true">
          <div><br>
          </div>
          <div>I got the following output for $mb at the start of
            request_route for the REFER packet (I have substituted
            MYPUBLICIP for my ip address)</div>
          <div><br>
          </div>
          <div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45); position: static;
              z-index: auto;">2(341) INFO: <script>:  --- SCRIPT
              Got a REFER packet from MYPUBLICIP to <a
                moz-do-not-send="true"
                href="sip:105@MYPUBLICIP:1095;transport=tcp;line=5twzz1pj">sip:105@MYPUBLICIP:1095;transport=tcp;line=5twzz1pj</a>
              with message buffer REFER <a moz-do-not-send="true"
                href="sip:105@192.168.1.15:1095;transport=tcp;line=5twzz1pj">sip:105@192.168.1.15:1095;transport=tcp;line=5twzz1pj</a>
              SIP/2.0</div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">Via: SIP/2.0/UDP
              MYPUBLICIP;branch=z9hG4bKcfed.c87adfb2000000000000000000000000.0</div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">To: <<a
                moz-do-not-send="true" href="sip:105@MYPUBLICIP">sip:105@MYPUBLICIP</a>>;tag=q42s05ts0b</div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">From: <<a
                moz-do-not-send="true"
                href="sip:controller@kamailio.org">sip:controller@kamailio.org</a>>;tag=48329130e552128b3c54a5eeb8c86eea-03b0</div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">CSeq: 11 REFER</div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">Call-ID:
              1a37a04a3bd8d656-347@MYPUBLICIP</div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">Route: <<a
                moz-do-not-send="true"
                href="sip:MYPUBLICIP;r2=on;lr;did=cd7.3482;nat=yes">sip:MYPUBLICIP;r2=on;lr;did=cd7.3482;nat=yes</a>>,

              <<a moz-do-not-send="true"
                href="sip:MYPUBLICIP;transport=tcp;r2=on;lr;did=cd7.3482;nat=yes">sip:MYPUBLICIP;transport=tcp;r2=on;lr;did=cd7.3482;nat=yes</a>></div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">Max-Forwards: 70</div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">Content-Length: 0</div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">User-Agent: kamailio
              (4.2.0 (x86_64/linux))</div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">Referred-By: <a
                moz-do-not-send="true"
                href="sip:controller@kamailio.org">sip:controller@kamailio.org</a></div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);">Refer-To: <a
                moz-do-not-send="true" href="sip:106@MYPUBLICIP">sip:106@MYPUBLICIP</a></div>
            <div style="margin: 0px; font-size: 11px; font-family:
              'Espresso Mono'; color: rgb(245, 245, 245);
              background-color: rgb(32, 36, 45);"><a
                moz-do-not-send="true"
                href="sip:controller@kamailio.org">sip:controller@kamailio.org</a></div>
          </div>
          <br class="Apple-interchange-newline">
        </div>
        <div apple-content-edited="true">The last line does not look
          right to me … why is there a sip uri at the end of the message
          buffer with no field name.</div>
        <div apple-content-edited="true"><br>
        </div>
        <div apple-content-edited="true">later on in the output I see:</div>
        <div apple-content-edited="true">
          <div style="margin: 0px; font-size: 11px; font-family:
            'Espresso Mono'; color: rgb(245, 245, 245);
            background-color: rgb(32, 36, 45);">Oct 24 10:50:27
            KamTesting002 kamailio[402]: DEBUG: tm [t_lookup.c:1373]:
            t_newtran(): DEBUG: t_newtran: msg id=2 , global msg id=1 ,
            T on entrance=0xffffffffffffffff</div>
          <div style="margin: 0px; font-size: 11px; font-family:
            'Espresso Mono'; color: rgb(245, 245, 245);
            background-color: rgb(32, 36, 45);">Oct 24 10:50:27
            KamTesting002 kamailio[402]: ERROR: tm [t_lookup.c:1403]:
            t_newtran(): ERROR: t_newtran: EoH not parsed</div>
        </div>
        <div apple-content-edited="true"><br>
        </div>
        <br>
        <div>
          <div>On 24 Oct 2014, at 10:09, Paul Smith <<a
              moz-do-not-send="true"
              href="mailto:paul.smith@claritytele.com">paul.smith@claritytele.com</a>>

            wrote:</div>
          <br class="Apple-interchange-newline">
          <blockquote type="cite">
            <meta http-equiv="Content-Type" content="text/html;
              charset=windows-1252">
            <div style="word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space;">Thank you for the
              reply Daniel.  I have enabled debug=3 and put in a few
              more xlog lines.  I can see the REFER coming in on local
              interface 127.0.0.1.  I am now trying to narrow down the
              issue in the kamailio.cfg.
              <div><br>
              </div>
              <div>My conclusions so far are:</div>
              <div>1) The REFER packet has a problem which causes it to
                fail sanity_check()</div>
              <div>2) sanity_check returns 0=exit rather than -1 =
                error.</div>
              <div><br>
                <div><br>
                </div>
                <div>I have 2 snom phones registered to the kamailio
                  server over NAT and can make calls between them.</div>
                <div><br>
                </div>
                <div>The REFER is failing in the REQINIT route block.
                  The script stops there.  </div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div>Kamailio.cfg : I started again with default 4.2 and
                  kamailio.cfg as shipped enabled MYSQL, USRLOCDB,
                  inserted dialog module, replaced rtpproxy with
                  rtpengine.</div>
                <div><br>
                </div>
                <div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">#!define
                    WITH_MYSQL</div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">#!define
                    WITH_AUTH</div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">#!define
                    WITH_USRLOCDB</div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">#!define
                    WITH_NAT</div>
                </div>
                <div><br>
                </div>
                <div>amended REQINIT as follows.  I see log lines for
                  “going to sanity check” but neither “Malformed” or
                  “returning” line are reached.</div>
                <div>...</div>
                <div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">        if
                    (is_method("REFER")) {xlog("L_INFO","REFER going to
                    sanity check\n");}</div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45); min-height:
                    14px;"><br>
                  </div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">       
                    if(!sanity_check("1511", "7")) {</div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">               
                    xlog("L_INFO","Malformed SIP message from
                    $si:$sp\n");</div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">               
                    exit;</div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">        }</div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45); min-height:
                    14px;"><br>
                  </div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45);">        if
                    (is_method("REFER")) {xlog("L_INFO","REFER returning
                    OK from sanity check");}</div>
                  <div style="margin: 0px; font-size: 11px; font-family:
                    'Espresso Mono'; color: rgb(245, 245, 245);
                    background-color: rgb(32, 36, 45); min-height:
                    14px;"><br>
                  </div>
                </div>
                <div>...</div>
                <div><br>
                </div>
                <div><br>
                </div>
                <div>Then run from the command line:</div>
                <div> <span style="background-color: rgb(32, 36, 45);
                    color: rgb(245, 245, 245); font-family: 'Espresso
                    Mono'; font-size: 11px;">kamcmd dlg.bridge_dlg <a
                      moz-do-not-send="true" href="sip:105@">sip:105@</a></span>MYPUBLICIP<span
                    style="background-color: rgb(32, 36, 45); color:
                    rgb(245, 245, 245); font-family: 'Espresso Mono';
                    font-size: 11px;"> <a moz-do-not-send="true"
                      href="sip:106@">sip:106@</a></span>MYPUBLICIP<span
                    style="background-color: rgb(32, 36, 45); color:
                    rgb(245, 245, 245); font-family: 'Espresso Mono';
                    font-size: 11px;"> sip:</span>MYPUBLICIP<span
                    style="background-color: rgb(32, 36, 45); color:
                    rgb(245, 245, 245); font-family: 'Espresso Mono';
                    font-size: 11px;">:5060</span></div>
                <div><br>
                </div>
                <div>Kamailio Output:</div>
                <div><br>
                </div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);">2(32566) DEBUG:
                  <core> [parser/msg_parser.c:623]: parse_msg():
                  SIP Request:</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/msg_parser.c:625]: parse_msg(): 
                  method:  <REFER></div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/msg_parser.c:627]: parse_msg(): 
                  uri:     <<a moz-do-not-send="true"
                    href="sip:105@192.168.1.15:1082;transport=tcp;line=5twzz1pj">sip:105@192.168.1.15:1082;transport=tcp;line=5twzz1pj</a>></div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/msg_parser.c:629]: parse_msg(): 
                  version: <SIP/2.0></div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/parse_via.c:1284]:
                  parse_via_param(): Found param type 232,
                  <branch> =
                  <z9hG4bKf666.1955cd53000000000000000000000000.0>;
                  state=16</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/parse_via.c:2672]: parse_via():
                  end of header reached, state=5</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/msg_parser.c:513]:
                  parse_headers(): parse_headers: Via found, flags=2</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/msg_parser.c:515]:
                  parse_headers(): parse_headers: this is the first via</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [receive.c:154]: receive_msg(): After
                  parse_msg...</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [receive.c:197]: receive_msg(): preparing
                  to run routing scripts...</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) INFO:
                  <script>:  --- SCRIPT Got a REFER packet from
                  MYPUBLICIP to <a moz-do-not-send="true"
                    href="sip:105@192.168.1.15:1082;transport=tcp;line=5twzz1pj">sip:105@192.168.1.15:1082;transport=tcp;line=5twzz1pj</a>
                  -- </div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/parse_addr_spec.c:176]:
                  parse_to_param(): DEBUG: add_param: tag=wg03aczruz</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/parse_addr_spec.c:898]:
                  parse_addr_spec(): end of header reached, state=29</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/msg_parser.c:190]:
                  get_hdr_field(): DEBUG: get_hdr_field: <To>
                  [41]; uri=[<a moz-do-not-send="true"
                    class="moz-txt-link-freetext"
                    href="sip:105@MYPUBLICIP">sip:105@MYPUBLICIP</a>] </div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/msg_parser.c:192]:
                  get_hdr_field(): DEBUG: to body [<<a
                    moz-do-not-send="true" href="sip:105@MYPUBLICIP">sip:105@MYPUBLICIP</a>>]</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/msg_parser.c:170]:
                  get_hdr_field(): get_hdr_field: cseq <CSeq>:
                  <11> <REFER></div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  maxfwd [mf_funcs.c:85]: is_maxfwd_present(): value =
                  70 </div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) INFO:
                  <script>: REFER going to sanity check</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  <core> [parser/msg_parser.c:204]:
                  get_hdr_field(): DEBUG: get_hdr_body :
                  content_length=0</div>
                <div style="margin: 0px; font-size: 11px; font-family:
                  'Espresso Mono'; color: rgb(245, 245, 245);
                  background-color: rgb(32, 36, 45);"> 2(32566) DEBUG:
                  sanity [mod_sanity.c:255]: w_sanity_check(): sanity
                  checks result: 0</div>
                <div>   <br>
                  <div apple-content-edited="true">
                    <div><br>
                    </div>
                    <br class="Apple-interchange-newline">
                  </div>
                  <br>
                  <div>
                    <div>On 23 Oct 2014, at 15:39, Daniel-Constantin
                      Mierla <<a moz-do-not-send="true"
                        href="mailto:miconda@gmail.com">miconda@gmail.com</a>>

                      wrote:</div>
                    <br class="Apple-interchange-newline">
                    <blockquote type="cite">
                      <meta content="text/html; charset=windows-1252"
                        http-equiv="Content-Type">
                      <div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
                        <br>
                        what should be happen, is the following:<br>
                        <br>
                        - invite from controller to first parameter
                        (caller of desired call)<br>
                        - after 200ok comes from 'caller', kamailio
                        sends REFER to it pointing to the second
                        parameter (callee of desired call) and then BYE,
                        getting out of the initial call<br>
                        - after getting the REFER, caller should send a
                        new INVITE to callee<br>
                        <br>
                        You can run with debug=3 to see what happens. In
                        kamailio config is nothing special needed, just
                        allow traffic from kamailio to go back to
                        kamailio.<br>
                        <br>
                        Cheers,<br>
                        Daniel<br>
                        <br>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
            _______________________________________________<br>
            SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
            mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
            <a moz-do-not-send="true" class="moz-txt-link-freetext"
              href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
          </blockquote>
        </div>
        <br>
      </blockquote>
      <br>
      <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://twitter.com/#%21/miconda">http://twitter.com/#!/miconda</a> - <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>