<div class="gmail_quote">Hello,<div><br></div><div>I have a few questions about the websocket module which I have successfully installed but I wasn&#39;t able to make calls through it:</div><div><br></div><div>1. After setting up the proxy ip:port in the call.htm file (of sipml5) to <b><a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a></b> the client started to work but kamailio script refused to establish my connection because the following condition was not satisfied:        </div>

<div><br></div><div><i>if ($Rp != MY_WS_PORT &amp;&amp; $Rp != MY_WSS_PORT) {</i></div><div><i>                xlog(&quot;L_WARN&quot;, &quot;HTTP request received on $Rp\n&quot;);</i></div><div><i>                xhttp_reply(&quot;403&quot;, &quot;Forbidden&quot;, &quot;&quot;, &quot;&quot;);</i></div>

<div><i>                exit;</i></div><div><i>}</i></div><div><br></div><div><i>MY_WS_PORT</i> and <i>MY_WSS_PORT </i>are set to 80 and 443 respectively, as the default config example of websocket module says so.</div><div>

<br></div><div>Then, I decided to change the ip:port to <b><a href="http://127.0.0.1:80" target="_blank">127.0.0.1:80</a></b>, always in the call.htm file and afterwards the condition was satisfied but sipml5 dies with </div>
<div><br></div>
<div><div style="border-bottom-style:solid;border-bottom-width:1px;font-size:11px;margin-left:24px;font-family:&#39;dejavu sans mono&#39;,monospace;min-height:16px;padding:1px 22px 1px 0px;border-bottom-color:rgb(240,240,240)">

<span style="white-space:pre-wrap"><span>SIP stack start: proxy=&#39;<a href="http://127.0.0.1:80" target="_blank">127.0.0.1:80</a>&#39;, realm=&#39;&lt;sip:127.0.0.1&gt;&#39;, impi=&#39;2000&#39;, impu=&#39;&lt;<a href="mailto:sip%3A2000@127.0.0.1" target="_blank">sip:2000@127.0.0.1</a>&gt;&#39;</span> <a href="http://127.0.0.1/sipml5/src/tinySAK/src/tsk_utils.js?svn=5" title="" style="float:right;margin-left:4px;color:rgb(84,84,84);max-width:100%" target="_blank">tsk_utils.js:97</a></span></div>

<div style="border-bottom-style:solid;border-bottom-width:1px;font-size:11px;margin-left:24px;font-family:&#39;dejavu sans mono&#39;,monospace;min-height:16px;padding:1px 22px 1px 0px;border-bottom-color:rgb(240,240,240)">

<span style="white-space:pre-wrap"><span>Connecting to &#39;ws://<a href="http://127.0.0.1:80" target="_blank">127.0.0.1:80</a>&#39;</span> <a href="http://127.0.0.1/sipml5/src/tinySAK/src/tsk_utils.js?svn=5" title="" style="float:right;margin-left:4px;color:rgb(84,84,84);max-width:100%" target="_blank">tsk_utils.js:97</a></span></div>

<div style="border-bottom-style:solid;border-bottom-width:1px;font-size:11px;margin-left:24px;font-family:&#39;dejavu sans mono&#39;,monospace;min-height:16px;padding:1px 22px 1px 0px;border-bottom-color:rgb(240,240,240)">

<span style="white-space:pre-wrap"><span>Stack starting</span> <a href="http://127.0.0.1/sipml5/src/tinySAK/src/tsk_utils.js?svn=5" title="" style="float:right;margin-left:4px;color:rgb(84,84,84);max-width:100%" target="_blank">tsk_utils.js:97</a></span></div>

<div style="border-bottom-style:solid;border-bottom-width:1px;font-size:11px;margin-left:24px;font-family:&#39;dejavu sans mono&#39;,monospace;min-height:16px;padding:1px 22px 1px 0px;border-bottom-color:rgb(240,240,240)">

<span style="white-space:pre-wrap;color:red!important"><span>Unexpected response code: 200</span> <a href="http://127.0.0.1/" title="http://127.0.0.1" style="float:right;margin-left:4px;color:rgb(84,84,84);max-width:100%" target="_blank">:1</a></span></div>

<div style="border-bottom-style:solid;border-bottom-width:1px;font-size:11px;margin-left:24px;font-family:&#39;dejavu sans mono&#39;,monospace;min-height:16px;padding:1px 22px 1px 0px;border-bottom-color:rgb(240,240,240)">

<span style="white-space:pre-wrap"><span>__tsip_transport_ws_onerror</span> <a href="http://127.0.0.1/sipml5/src/tinySAK/src/tsk_utils.js?svn=5" title="" style="float:right;margin-left:4px;color:rgb(84,84,84);max-width:100%" target="_blank">tsk_utils.js:97</a></span></div>

<div style="border-bottom-style:solid;border-bottom-width:1px;font-size:11px;margin-left:24px;font-family:&#39;dejavu sans mono&#39;,monospace;min-height:16px;padding:1px 22px 1px 0px;border-bottom-color:rgb(240,240,240)">

<span style="white-space:pre-wrap"><span>__tsip_transport_ws_onclose</span> <a href="http://127.0.0.1/sipml5/src/tinySAK/src/tsk_utils.js?svn=5" title="" style="float:right;margin-left:4px;color:rgb(84,84,84);max-width:100%" target="_blank">tsk_utils.js:97</a></span></div>

<div style="border-bottom-style:solid;border-bottom-width:1px;font-size:11px;margin-left:24px;font-family:&#39;dejavu sans mono&#39;,monospace;min-height:16px;padding:1px 22px 1px 0px;border-bottom-color:rgb(240,240,240)">

<span style="white-space:pre-wrap"><span>Failed to connet to the server</span> </span></div></div><div><br></div>Finally, I ended up commenting the condition block and restored the original values of ip:port to <b><a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a></b> .<div>

<br></div><div>Having done that, I tried again and another error was thrown but this time, in the next condition block: <b> if ($hdr(Host) == $null || !is_myself($hdr(Host))) </b></div><div><br></div><div>&lt;script&gt;: WebSocket</div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;script&gt;:  Host: <a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a></div><div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;script&gt;:  Origin: <a href="http://127.0.0.1" target="_blank">http://127.0.0.1</a></div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;core&gt; [socket_info.c:589]: grep_sock_info - checking if host==us: 14==9 &amp;&amp; [<a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a>] == [127.0.0.1]</div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;core&gt; [socket_info.c:589]: grep_sock_info - checking if host==us: 14==9 &amp;&amp; [<a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a>] == [127.0.0.2]</div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;core&gt; [socket_info.c:589]: grep_sock_info - checking if host==us: 14==13 &amp;&amp; [<a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a>] == [192.168.10.95]</div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;core&gt; [socket_info.c:589]: grep_sock_info - checking if host==us: 14==13 &amp;&amp; [<a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a>] == [192.168.10.55]</div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;core&gt; [socket_info.c:589]: grep_sock_info - checking if host==us: 14==9 &amp;&amp; [<a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a>] == [127.0.0.1]</div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;core&gt; [socket_info.c:589]: grep_sock_info - checking if host==us: 14==9 &amp;&amp; [<a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a>] == [127.0.0.2]</div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;core&gt; [socket_info.c:589]: grep_sock_info - checking if host==us: 14==13 &amp;&amp; [<a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a>] == [192.168.10.95]</div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;core&gt; [socket_info.c:589]: grep_sock_info - checking if host==us: 14==13 &amp;&amp; [<a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a>] == [192.168.10.55]</div>

<div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: DEBUG: &lt;core&gt; [forward.c:462]: <b>check_self: host != me</b></div><div>Aug  8 11:30:53 carlosrdcnx-laptop kamailio[16238]: WARNING: &lt;script&gt;: Bad host <a href="http://127.0.0.1:5060" target="_blank">127.0.0.1:5060</a></div>

<div><br></div><div>I commented the block too and only then sipml5 was able to register itself.</div><div><br></div><div>What am I doing wrong here?</div><div><br></div><div>2. I registered a legacy softphone (twinkle) to attempt to initiate a call in both ways, but the was something wrong with the signaling, probably some frame decoding garbage in the buffer of the SIP message. Perhaps these bytes are part of the frame control header but since I haven&#39;t read the RFC (yet) I am mentioning it anyway.</div>

<div><br></div><div><div>tcp_send: buf=<b>#012�~#003�</b>INVITE sip:2000@df7jal23ls0d.invalid;transport=ws SIP/2.0#015#012Record-Route: &lt;sip:127.0.0.1;transport=ws;r2=on;lr=on&gt;#015#012Record-Route: &lt;sip:127.0.0.1;r2=on;lr=on&gt;#015#012Via: SIP/2.0/WS  127.0.0.1;branch=z9hG4bK90a8.b1a7035e13ed19880dd12a1f4c86adbb.0#015#012Via: SIP/2.0/UDP 127.0.0.1:5062;rport=5062;branch=z9hG4bKimixlbyp#015#012Max-Forwards: 69#015#012To: &lt;<a href="mailto:sip%3A2000@127.0.0.1" target="_blank">sip:2000@127.0.0.1</a>&gt;#015#012From: &quot;1000&quot; &lt;<a href="mailto:sip%3A1000@127.0.0.1" target="_blank">sip:1000@127.0.0.1</a>&gt;;tag=lrtfz#015#012Call-ID: gxsqobolphfchfq@carlosrdcnx-laptop.site#015#012CSeq: 654 INVITE#015#012Contact: &lt;<a href="http://sip:1000@127.0.0.1:5062" target="_blank">sip:1000@127.0.0.1:5062</a>&gt;#015#012Content-Type: application/sdp#015#012Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,REFER,NOTIFY,SUBSCRIBE,INFO,MESSAGE#015#012Supported: replaces,norefersub,100rel#015#012User-Agent: Twinkle/1.4.2#015#012Content-Length: 302#015#012#015#012v=0#015#012o=twinkle 391470222 1383232165 IN IP4 127.0.0.1#015#012s=-#015#012c=IN IP4 127.0.0.1#015#012t=0 0#015#012m=audio 8008 RTP/AVP 98 97 8 0 3 101#015#012a=rtpmap:98 speex/16000#015#012a=rtpmap:97 speex/8000#015#012a=rtpmap:8 PCMA/8000#015#012a=rtpmap:0 PCMU/8000#015#012a=rtpmap:3 GSM/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-15#015#012a=ptime:20#015#012</div>
</div><div><br></div><div>3. Does Twinkle support the minimum media requirements for testing? If not, what (Linux) softphone is suitable for this purpose?</div>
<div><br></div><div>Thanks and sorry for the long email.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Carlos.</div><div><br></div><div><br></div><div><br></div><div> </div>
</font></span></div><br>