Nothing received from Asterisk after registration

102 views
Skip to first unread message

Jan Kaláb

unread,
Oct 24, 2014, 6:27:29 AM10/24/14
to sip...@googlegroups.com
Hi,
I'm trying to use SIP.js (0.6.3) with our Asterisk PBX. The initial registration works, but I don't see any incoming packets from Asterisk after that. Especially OPTIONS.

Registration:
new SIP.UA({
    uri: data.device + '@' + location.hostname,
    password: data.pass,
    wsServers: ['wss://' + location.hostname + ':8089/ws'],
    register: true,
    hackIpInContact: true,
    hackViaTcp: false,
    log: {
        builtinEnabled: false
    }
});

Which result's in following packet:
REGISTER sip:xxxxx.xxxxx.xxx SIP/2.0
Via: SIP/2.0/WSS 192.0.2.24;branch=z9hG4bK8268194
Max-Forwards: 70
To: <sip:web_103_54...@xxxxx.xxxxx.xxx>
From: <sip:web_103_54...@xxxxx.xxxxx.xxx>;tag=nf6lfg11f4
Call-ID: eccflapfiouvmsvtrqip0i
CSeq: 94 REGISTER
Authorization: Digest algorithm=MD5, username="web_103_543d42cd67433", realm="pbx", nonce="7950a459", uri="sip:xxxxx.xxxxx.xxx", response="1670cea38fff046564b9eb62285c5812"
Contact: <sip:kv2q...@192.0.2.24;transport=ws>;reg-id=1;+sip.instance="<urn:uuid:bd248ba4-1e31-45d1-8cfe-a74fbf8ca716>";expires=600
Allow: ACK,CANCEL,BYE,OPTIONS,INFO,NOTIFY,INVITE
Supported: path,gruu,outbound
User-Agent: SIP.js/0.6.3
Content-Length: 0

And I get this response:
SIP/2.0 200 OK
Via: SIP/2.0/WSS 192.0.2.24;branch=z9hG4bK8268194;received=xxx.xxx.xxx.xxx;rport=55361
From: <sip:web_103_54...@xxxxx.xxxxx.xxx>;tag=nf6lfg11f4
To: <sip:web_103_54...@xxxxx.xxxxx.xxx>;tag=as1f9da8c0
Call-ID: eccflapfiouvmsvtrqip0i
CSeq: 94 REGISTER
Server: ipbx 3.0.14
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 600
Contact: <sip:kv2q...@192.0.2.24;transport=ws>;expires=600
Date: Fri, 24 Oct 2014 10:13:43 GMT
Content-Length: 0

And silence after that.

I tried all combinations of hackIpInContact and hackViaTcp, but none works. It works with SIPML5 demo phone, so It's not problem in Asterisk.

Jan Kaláb

unread,
Oct 24, 2014, 6:45:19 AM10/24/14
to sip...@googlegroups.com
In other words, this is what we need to work: http://www.voip-info.org/wiki/view/Asterisk+sip+qualify

Jan Kaláb

unread,
Oct 24, 2014, 7:48:30 AM10/24/14
to sip...@googlegroups.com
Ok, it's this bug in Asterisk. As workaround, find transport:"ws" in sip.min.js and change it to wss.

Dne pátek, 24. října 2014 12:27:29 UTC+2 Jan Kaláb napsal(a):
Hi,
I'm trying to use SIP.js (0.6.3) with our Asterisk PBX. The initial registration works, but I don't see any incoming packets from Asterisk after that. Especially OPTIONS.

Registration:
new SIP.UA({
    uri: data.device + '@' + location.hostname,
    password: data.pass,
    wsServers: ['wss://' + location.hostname + ':8089/ws'],
    register: true,
    hackIpInContact: true,
    hackViaTcp: false,
    log: {
        builtinEnabled: false
    }
});

Which result's in following packet:
REGISTER sip:xxxxx.xxxxx.xxx SIP/2.0
Via: SIP/2.0/WSS 192.0.2.24;branch=z9hG4bK8268194
Max-Forwards: 70
To: <sip:web_103_543d42cd67433@xxxxx.xxxxx.xxx>
From: <sip:web_103_543d42cd67433@xxxxx.xxxxx.xxx>;tag=nf6lfg11f4
Call-ID: eccflapfiouvmsvtrqip0i
CSeq: 94 REGISTER
Authorization: Digest algorithm=MD5, username="web_103_543d42cd67433", realm="pbx", nonce="7950a459", uri="sip:xxxxx.xxxxx.xxx", response="1670cea38fff046564b9eb62285c5812"
Contact: <sip:kv2q...@192.0.2.24;transport=ws>;reg-id=1;+sip.instance="<urn:uuid:bd248ba4-1e31-45d1-8cfe-a74fbf8ca716>";expires=600
Allow: ACK,CANCEL,BYE,OPTIONS,INFO,NOTIFY,INVITE
Supported: path,gruu,outbound
User-Agent: SIP.js/0.6.3
Content-Length: 0

And I get this response:
SIP/2.0 200 OK
Via: SIP/2.0/WSS 192.0.2.24;branch=z9hG4bK8268194;received=xxx.xxx.xxx.xxx;rport=55361
From: <sip:web_103_543d42cd67433@xxxxx.xxxxx.xxx>;tag=nf6lfg11f4
To: <sip:web_103_543d42cd67433@xxxxx.xxxxx.xxx>;tag=as1f9da8c0
Call-ID: eccflapfiouvmsvtrqip0i
CSeq: 94 REGISTER
Server: ipbx 3.0.14
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 600
Contact: <sip:kv2q...@192.0.2.24;transport=ws>;expires=600
Date: Fri, 24 Oct 2014 10:13:43 GMT
Content-Length: 0

And silence after that.

Eric Green

unread,
Oct 24, 2014, 3:25:42 PM10/24/14
to sip...@googlegroups.com
Hi Jan,

I pushed a fix to the SIP.js master branch that allows you to set via a UA configuration parameter. Let me know if that works for you.

-Eric Green
Reply all
Reply to author
Forward
0 new messages