[asterisk-users] Websockets on Asterisk 11 and SipML5

James Mortensen james.mortensen at a-cti.com
Wed Aug 15 13:01:21 CDT 2012


James Mortensen <james.mortensen <at> a-cti.com> writes:

> 
> James Mortensen <james.mortensen <at> a-cti.com> writes:
> 
> > 
> > 
> > mailsvb <mailsvb <at> gmail.com> writes:
> > 
> > > 
> > > 
> > > Hi James,
> > > after applying the patch, I got the 400 bad request message as well...
> > > This seems to be related to the sipml5 client (same issue with sip-js) 
> > generating a wrong request. Take a look at the contact header in the 
REGISTER 
> > message.
> > > 
> > > I was not able to fix the js code to generate the correct request... In 
fact 
> > it should look like this (sip:user <at> local-ip:local-port)
> > > 
> > > regards,
> > > Sven
> 
> > 
> > Hi Sven,
> > 
> > I know this doesn't fix the sipML5 problem, but I changed line 145 of 
> > tsip_transport.js in the sipML5 library from
> > 
> > return "df7jal23ls0d.invalid";
> > 
> > to
> > 
> > return "10.x.x.x";
> > 
> > where 10.x.x.x is the local IP where I'm trying to register from.  I am 
> getting 
> > a 200 OK from the Asterisk server and am able to connect to it, but I can't 
> make 
> > any calls yet.
> > 
> > I'll continue looking at the sipML5 code and will post an update if I get 
> > anywhere. 
> > 
> > Thanks again!
> > James
> > 
> > --
> > _____________________________________________________________________
> 
> Hi Sven,
> 
> According to the developer of sipML5, the problem is that Asterisk 11 doesn't 
> fully support SIP over WebSockets, which means that the problem is not 
> necessarily in the sipML5 codebase.
> 
> See the Doubango thread here, as well as the spec Mamadou cites:
> https://groups.google.com/forum/?fromgroups#!topic/doubango/jNA0dj5zpKM%5B1-
> 25%5D
> 
> He cited the spec, which indicates that the client is supposed to send 
> "df7jal23ls0d.invalid" as the domain name, since the client side doesn't 
really 
> know what to send.
> 
> The main difference I see between the SIP messages in the spec and my SIP 
> messages is this line:
> 
> I have:
> 
>     Supported: path
> 
> Whereas the spec has:
> 
>     Supported: path, outbound, gruu
> 
> Anyone know what these do exactly and whether or not sipML5 needs to send 
> outbound and gruu?  
> 
> Thank you,
> James
> 
> --
> _____________________________________________________________________


Hello, 

Here is the error that I'm seeing when trying to register my SIP user from 
sipML5 to Asterisk 11:

<------------->
--- (13 headers 0 lines) ---
[Aug 15 17:12:09] ERROR[19510]: netsock2.c:269 ast_sockaddr_resolve: 
getaddrinfo("df7jal23ls0d.invalid", "(null)", ...): Name or service not known

[Aug 15 17:12:09] WARNING[19510]: chan_sip.c:15314 parse_register_contact: 
Invalid hostport 'df7jal23ls0d.invalid'
[Aug 15 17:12:09] WARNING[19510]: chan_sip.c:16208 register_verify: Failed to 
parse contact info


I also added outbound, gruu to the path header in the SIP message, and this 
doesn't seem to make a difference.

It looks to me like the WebSocket portion of Asterisk is trying to use random 
ports.  Shouldn't it be using the default 8088?  The WebSockets spec seems to 
indicate that WebSockets can use the same port used by the HTTP server, which in 
this case is 8088.

Here is the full output with "sip set debug on":


  == WebSocket connection from '50.43.101.83:28096' for protocol 'sip' accepted 
using version '13'

<--- SIP read from WS:50.43.101.83:28096 --->
REGISTER sip:50.18.243.242 SIP/2.0
Via: SIP/2.0/WS 
df7jal23ls0d.invalid;branch=z9hG4bKxMm2HP4O04PpG6GFaNUt3v5yGGD6k8Fz;rport
From: <sip:3002 at 50.18.243.242>;tag=TmFBiD1z4TwDR8EvxHSM
To: <sip:3002 at 50.18.243.242>
Contact: "3002"
<sip:3002 at df7jal23ls0d.invalid;transport=ws>;expires=200;+g.oma.sip-
im;+audio;language="en,fr"
Call-ID: 1c6c4822-3b14-fb84-c2f8-a1af9b32e2c2
CSeq: 35134 REGISTER
Content-Length: 0
Max-Forwards: 70
User-Agent: IM-client/OMA1.0 sipML5/v0.0.0000.0
Organization: Doubango Telecom
Supported: path, outbound, gruu

<------------->
--- (12 headers 0 lines) ---

<--- Transmitting (no NAT) to 50.43.101.83:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/WS 
df7jal23ls0d.invalid;branch=z9hG4bKxMm2HP4O04PpG6GFaNUt3v5yGGD6k8Fz;rport;receiv
ed=50.43.101.83
From: <sip:3002 at 50.18.243.242>;tag=TmFBiD1z4TwDR8EvxHSM
To: <sip:3002 at 50.18.243.242>;tag=as300bd165
Call-ID: 1c6c4822-3b14-fb84-c2f8-a1af9b32e2c2
CSeq: 35134 REGISTER
Server: Asterisk PBX 11.0.0-beta1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="47868ef3"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '1c6c4822-3b14-fb84-c2f8-a1af9b32e2c2' in 
32000 ms (Method: REGISTER)

<--- SIP read from WS:50.43.101.83:28096 --->
REGISTER sip:50.18.243.242 SIP/2.0
Via: SIP/2.0/WS 
df7jal23ls0d.invalid;branch=z9hG4bKnpSFmTSk3t1owiThIANGo9cV61xGOfZA;rport
From: <sip:3002 at 50.18.243.242>;tag=TmFBiD1z4TwDR8EvxHSM
To: <sip:3002 at 50.18.243.242>
Contact: "3002"
<sip:3002 at df7jal23ls0d.invalid;transport=ws>;expires=200;+g.oma.sip-
im;+audio;language="en,fr"
Call-ID: 1c6c4822-3b14-fb84-c2f8-a1af9b32e2c2
CSeq: 35135 REGISTER
Content-Length: 0
Max-Forwards: 70
Authorization: Digest 
username="3002",realm="asterisk",nonce="47868ef3",uri="sip:50.18.243.242",respon
se="d27f92f71e44daed84f7b579546d381b",algorithm=MD5
User-Agent: IM-client/OMA1.0 sipML5/v0.0.0000.0
Organization: Doubango Telecom
Supported: path, outbound, gruu

<------------->
--- (13 headers 0 lines) ---
[Aug 15 17:43:10] ERROR[19516]: netsock2.c:269 ast_sockaddr_resolve: 
getaddrinfo("df7jal23ls0d.invalid", "(null)", ...): Name or service not known
[Aug 15 17:43:10] WARNING[19516]: chan_sip.c:15314 parse_register_contact: 
Invalid hostport 'df7jal23ls0d.invalid'
[Aug 15 17:43:10] WARNING[19516]: chan_sip.c:16208 register_verify: Failed to 
parse contact info

<--- Transmitting (no NAT) to 50.43.101.83:5060 --->
SIP/2.0 400 Bad Request
Via: SIP/2.0/WS 
df7jal23ls0d.invalid;branch=z9hG4bKnpSFmTSk3t1owiThIANGo9cV61xGOfZA;rport;receiv
ed=50.43.101.83
From: <sip:3002 at 50.18.243.242>;tag=TmFBiD1z4TwDR8EvxHSM
To: <sip:3002 at 50.18.243.242>;tag=as300bd165
Call-ID: 1c6c4822-3b14-fb84-c2f8-a1af9b32e2c2
CSeq: 35135 REGISTER
Server: Asterisk PBX 11.0.0-beta1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Date: Wed, 15 Aug 2012 17:43:10 GMT
Content-Length: 0


<------------>



James




More information about the asterisk-users mailing list