<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body 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 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 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 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 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=[sip:105@MYPUBLICIP] </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 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 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></body></html>