Hi,<div><br></div><div>I was facing the very same issue and created a ticket...</div><div><br></div><div><a href="https://issues.asterisk.org/jira/browse/ASTERISK-20221">https://issues.asterisk.org/jira/browse/ASTERISK-20221</a> </div>
<div><br></div><div>best regards,</div><div>Sven<br><br><div class="gmail_quote">2012/8/13 James Mortensen <span dir="ltr"><<a href="mailto:james.mortensen@a-cti.com" target="_blank">james.mortensen@a-cti.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Andrew Latham <lathama <at> <a href="http://gmail.com" target="_blank">gmail.com</a>> writes:<br>
<br>
><br>
> On Mon, Aug 13, 2012 at 2:58 PM, James Mortensen<br>
</div><div><div class="h5">> <james.mortensen <at> <a href="http://a-cti.com" target="_blank">a-cti.com</a>> wrote:<br>
> > Hello,<br>
> ><br>
> > I'm trying to register a user using sipml5 on Asterisk 11. I followed the<br>
> > instructions here:<br>
> > <a href="http://thr3ads.net/asterisk-users/2012/08/1972342-Asterisk-Websockets" target="_blank">http://thr3ads.net/asterisk-users/2012/08/1972342-Asterisk-Websockets</a><br>
> ><br>
> > I added transport=ws to my sip.conf file:<br>
> ><br>
> > [3002]<br>
> > username=3002<br>
> > secret=XXXXXXXXX<br>
> > host=dynamic<br>
> > type=friend<br>
> > context=test<br>
> > disallow=all<br>
> > allow=g729<br>
> > ;allow=all ; Allow codecs in order of preference<br>
> > allow=ilbc<br>
> > allow=silk8<br>
> > allow=gsm<br>
> > transport=ws<br>
> ><br>
> ><br>
> > I also modified the sipml5 library so that the URL looks like this:<br>
> > ws://<a href="http://example.org:8088/ws" target="_blank">example.org:8088/ws</a> with the /ws at the end, as instructed.<br>
> ><br>
> > Now, where I get confused is here:<br>
> ><br>
> > "You will need to change sipml5 to use http://<hostname or IP address of<br>
> ><br>
> > Asterisk>:8088/ws as the URL. WebSocket is only available on the /ws path."<br>
> ><br>
> ><br>
> > Did Joshua mean to say ws:// instead of http://? Because I'm not aware of<br>
> > WebSockets working with http protocols, only ws protocols. Is there<br>
> > something I'm missing here?<br>
> ><br>
> ><br>
> ><br>
> > The error that I'm getting in the sipml5 client is: "Disconnected: Failed<br>
> > to connet to the server" And that typo is not mine.<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > On the server, here is what I see from a tcpdump. The port appears to be<br>
> > open, but I'm not convinced that Asterisk is actually listening for<br>
> > WebSocket traffic:<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > tcpdump -v port 8088<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > 18:57:<a href="tel:03.051712" value="+493051712">03.051712</a> IP (tos 0x0, ttl 243, id 21320, offset 0, flags [DF], proto<br>
> > TCP (6), length 60)<br>
> > static-50-43-101-83.bvtn.or.frontiernet.net.63036 ><br>
> > ip-10-168-151-65.us-west-1.compute.internal.omniorb: Flags [S], cksum 0x4f7a<br>
> > (correct), seq 4055598050, win 14600, options [mss<br>
> > 1380,sackOK,nop,nop,nop,nop,nop,nop,nop,nop,nop,nop,nop,nop,nop,nop], length<br>
> > 0<br>
> > 18:57:03.051758 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP<br>
> > (6), length 40)<br>
> > ip-10-168-151-65.us-west-1.compute.internal.omniorb ><br>
> > static-50-43-101-83.bvtn.or.frontiernet.net.63036: Flags [R.], cksum 0xeaf4<br>
> > (correct), seq 0, ack 4055598051, win 0, length 0<br>
> ><br>
> ><br>
> ><br>
> > Is there something else I'm missing? Please let me know what additional<br>
> > information you need from me.<br>
> ><br>
> > Thank you!<br>
> ><br>
> > --<br>
> > James Mortensen<br>
> ><br>
><br>
> Look to see if the /ws is showing in an "http show status"<br>
><br>
> '''<br>
> *CLI> http show status<br>
> HTTP Server Status:<br>
> Prefix:<br>
> Server Enabled and Bound to <a href="http://0.0.0.0:8088" target="_blank">0.0.0.0:8088</a><br>
><br>
> Enabled URI's:<br>
> /httpstatus => Asterisk HTTP General Status<br>
> /phoneprov/... => Asterisk HTTP Phone Provisioning Tool<br>
> /amanager => HTML Manager Event Interface w/Digest authentication<br>
> /uploads => HTTP POST mapping<br>
> /arawman => Raw HTTP Manager Event Interface w/Digest authentication<br>
> /manager => HTML Manager Event Interface<br>
> /rawman => Raw HTTP Manager Event Interface<br>
> /static/... => Asterisk HTTP Static Delivery<br>
> /amxml => XML Manager Event Interface w/Digest authentication<br>
> /mxml => XML Manager Event Interface<br>
> /ws => Asterisk HTTP WebSocket<br>
><br>
> Enabled Redirects:<br>
> / => /static/admin.html<br>
> *CLI><br>
> '''<br>
><br>
<br>
</div></div>Hi Andrew,<br>
<br>
I uncommented enabled=yes in http.conf and now see the /ws => Asterisk HTTP<br>
WebSocket. I also modified bindaddr=0.0.0.0 as it was previously 127.0.0.1. I<br>
can connect and I do see the following output in my Chrome NET tab:<br>
<br>
Request URL:ws://<a href="http://example.org:8088/ws" target="_blank">example.org:8088/ws</a><br>
Request Method:GET<br>
Status Code:101 Switching Protocols<br>
Request Headersview source<br>
Connection:Upgrade<br>
Host:<a href="http://example.org:8088" target="_blank">example.org:8088</a><br>
Origin:<a href="http://local:8888" target="_blank">http://local:8888</a><br>
Sec-WebSocket-Extensions:x-webkit-deflate-frame<br>
Sec-WebSocket-Key:fazgtURy132RAFXGRiT9TA==<br>
Sec-WebSocket-Protocol:sip<br>
Sec-WebSocket-Version:13<br>
Upgrade:websocket<br>
(Key3):00:00:00:00:00:00:00:00<br>
Response Headersview source<br>
Connection:Upgrade<br>
Sec-WebSocket-Accept:fQA1LFnbYFSxFYAr7Ls1Keh54KY=<br>
Sec-WebSocket-Protocol:sip<br>
Upgrade:websocket<br>
(Challenge Response):00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00<br>
<br>
<br>
However, the Asterisk server dies afterwards and must be restarted. The<br>
/var/log/messages file has no helpful information; I was tailing it as I made<br>
one of my connect attempts.<br>
<br>
If it helps, I have a local Asterisk 11 setup in verbose mode, and I did see the<br>
following warning message when trying to connect to it instead:<br>
<br>
*CLI> [Aug 13 13:17:39] WARNING[567]: res_http_websocket.c:533<br>
websocket_callback: WebSocket connection from '<a href="http://127.0.0.1:53845" target="_blank">127.0.0.1:53845</a>' could not be<br>
accepted - no protocols out of 'sip' supported<br>
<br>
<br>
Also, here is what I see in the Chrome NET tab: (I hope this doesn't confuse<br>
the problem. Keep in mind that these are 2 separate Asterisk 11 instances, one<br>
at <a href="http://example.org" target="_blank">example.org</a> and one at 127.0.0.1):<br>
<br>
Request URL:ws://<a href="http://127.0.0.1:8088/ws" target="_blank">127.0.0.1:8088/ws</a><br>
Request Headersview source<br>
Connection:Upgrade<br>
Cookie:__utma=96992031.124949559.1343691697.1343691697.1343691697.1;<br>
__utmz=96992031.1343691697.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)<br>
Host:<a href="http://127.0.0.1:8088" target="_blank">127.0.0.1:8088</a><br>
Origin:<a href="http://local:8888" target="_blank">http://local:8888</a><br>
Sec-WebSocket-Extensions:x-webkit-deflate-frame<br>
Sec-WebSocket-Key:UnhnlavzW/Gk6mwJMdLU/w==<br>
Sec-WebSocket-Protocol:sip<br>
Sec-WebSocket-Version:13<br>
Upgrade:websocket<br>
(Key3):00:00:00:00:00:00:00:00<br>
<br>
<br>
Let me know if there is any other information you need. Thanks again for your<br>
help!<br>
<span class="HOEnZb"><font color="#888888"><br>
James<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
<br>
--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
<a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br></div>