Registration fails with 403 Forbidden with linphone

2,518 views
Skip to first unread message

Andrew

unread,
Dec 3, 2014, 2:59:39 PM12/3/14
to sip...@googlegroups.com
Hello, I have been testing sipjs with some 3rd party sip services, such as linphone, and find myself running into the following registration issue. I do not have the issue using X-Lite.

I then modified sipjs.6.3 and tried different combinations of the following:
- Setting hackViaTcp: true and hackIpInContact: true
- Changing the Via, Contact, Allow to match that of what X-Lite used, although I faked the ip and port in those tests.
I am using ws://edge.sip.onsip.com for wsServers

Might this have something to do with the onsip websocket relay/translation? I dont know how my websocket register is turned into a request for the linphone server. If the 403 was sent by the liphone server then it obviously received the to/from user name correctly but I have no way to know why it is rejecting the request. One thought is because of a blacklisted ip or port.
I verified the sip registration and response using tcpdump and it matches the sipjs trace pasted below.
Any ideas?


....... Using Sip.js(0.6.3) ........

REGISTER sip:sip.linphone.org SIP/2.0
Via: SIP/2.0/TCP 192.0.2.125;branch=z9hG4bK7653063
Max-Forwards: 70
From: "sipjstest1"<sip:sipjs...@sip.linphone.org>;tag=9sk5k95jj6
Call-ID: fkddq2anabtd8roc104hdv
CSeq: 81 REGISTER
Contact: <sip:g0j5...@192.0.2.125;transport=ws>;reg-id=1;+sip.instance="<urn:uuid:3a173fca-9b97-47ff-8e36-431c710ae5>"
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Expires: 3600
Supported: path,gruu,100rel,outbound
User-Agent: SIP.js/0.6.3
Content-Length: 0

Wed Dec 03 2014 19:24:38 GMT+0000 (UTC) | sip.ua | emitting event connected
Wed Dec 03 2014 19:24:38 GMT+0000 (UTC) | sip.transport | received WebSocket text message:

SIP/2.0 403 Forbidden
Via: SIP/2.0/TCP 192.0.2.125;branch=z9hG4bK7653063
To: "sipjstest1"<sip:sipjs...@sip.linphone.org>;tag=1ee758eef3cbb66f4da79e04a0e4dad7.9a05
From: "sipjstest1"<sip:sipjs...@sip.linphone.org>;tag=9sk5k95jj6
Call-ID: fkddq2anabtd8roc104hdv
CSeq: 81 REGISTER
Server: OpenSIPS (1.10.0-notls (x86_64/linux))
Content-Length: 0






...... Using X-Lite, 401 received as expected with digest ......

Session Initiation Protocol (401)
Via: SIP/2.0/UDP 192.168.1.4:16546;branch=z9hG4bK-d8754z-c50d0c3e3bf10f73-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:sipjs...@192.168.1.4:16546;rinstance=23381940ec1f7a53>
From: "sipjstest1"<sip:sipjs...@sip.linphone.org>;tag=19070d13
Call-ID: MDA3OTQ0NDFhZjliMmNjYTQ4MmFmNTA5YTlkMjEwNTg
CSeq: 1 REGISTER
Expires: 3600
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
User-Agent: X-Lite 4.7.1 74247-3759ac27-W6.1
Content-Length: 0

Via: SIP/2.0/UDP 192.168.1.4:16546;branch=z9hG4bK-d8754z-c50d0c3e3bf10f73-1---d8754z-;rport=16546
From: "sipjstest1" <sip:sipjs...@sip.linphone.org>;tag=19070d13
To: "sipjstest1" <sip:sipjs...@sip.linphone.org>;tag=eXHDD93ZD5r2N
Call-ID: MDA3OTQ0NDFhZjliMmNjYTQ4MmFmNTA5YTlkMjEwNTg
CSeq: 1 REGISTER
Server: Flexisip/0.8.0 (sofia-sip-nta/2.0)
WWW-Authenticate: Digest realm="sip.linphone.org", nonce="meMp2AAAAABE3DEjAABdwFmC5mMAAAAA", opaque="+GNywA==", algorithm=MD5, qop="auth"
Content-Length: 0


Thanks,
Andrew

Will Mitchell

unread,
Dec 3, 2014, 3:05:03 PM12/3/14
to sip...@googlegroups.com
Hi Andrew,

You can only use the OnSIP WebSocket server to register with OnSIP.  To send register requests to other third party services, you will need to connect either directly to a websocket server that service provides, or run your own which can proxy the request over UDP or TCP.  It is expected behavior that OnSIP will respond with a 403 Forbidden for REGISTER requests on domains it does not manage registrations for.

Thanks,

Will


On Wednesday, December 3, 2014 2:59:39 PM UTC-5, Andrew wrote:
Hello, I have been testing sipjs with some 3rd party sip services, such as linphone, and find myself running into the following registration issue. I do not have the issue using X-Lite.

I then modified sipjs.6.3 and tried different combinations of the following:
- Setting hackViaTcp: true and hackIpInContact: true
- Changing the Via, Contact, Allow to match that of what X-Lite used, although I faked the ip and port in those tests.
I am using ws://edge.sip.onsip.com for wsServers

Might this have something to do with the onsip websocket relay/translation? I dont know how my websocket register is turned into a request for the linphone server. If the 403 was sent by the liphone server then it obviously received the to/from user name correctly but I have no way to know why it is rejecting the request. One thought is because of a blacklisted ip or port.
I verified the sip registration and response using tcpdump and it matches the sipjs trace pasted below.
Any ideas?


....... Using Sip.js(0.6.3) ........

REGISTER sip:sip.linphone.org SIP/2.0
Via: SIP/2.0/TCP 192.0.2.125;branch=z9hG4bK7653063
Max-Forwards: 70
From: "sipjstest1"<sip:sipjstest1@sip.linphone.org>;tag=9sk5k95jj6
Call-ID: fkddq2anabtd8roc104hdv
CSeq: 81 REGISTER
Contact: <sip:g0j5...@192.0.2.125;transport=ws>;reg-id=1;+sip.instance="<urn:uuid:3a173fca-9b97-47ff-8e36-431c710ae5>"
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Expires: 3600
Supported: path,gruu,100rel,outbound
User-Agent: SIP.js/0.6.3
Content-Length: 0

Wed Dec 03 2014 19:24:38 GMT+0000 (UTC) | sip.ua | emitting event connected
Wed Dec 03 2014 19:24:38 GMT+0000 (UTC) | sip.transport | received WebSocket text message:

SIP/2.0 403 Forbidden
Via: SIP/2.0/TCP 192.0.2.125;branch=z9hG4bK7653063
To: "sipjstest1"<sip:sipjstest1@sip.linphone.org>;tag=1ee758eef3cbb66f4da79e04a0e4dad7.9a05
From: "sipjstest1"<sip:sipjstest1@sip.linphone.org>;tag=9sk5k95jj6
Call-ID: fkddq2anabtd8roc104hdv
CSeq: 81 REGISTER
Server: OpenSIPS (1.10.0-notls (x86_64/linux))
Content-Length: 0






...... Using X-Lite, 401 received as expected with digest ......

Session Initiation Protocol (401)
Via: SIP/2.0/UDP 192.168.1.4:16546;branch=z9hG4bK-d8754z-c50d0c3e3bf10f73-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:sipjs...@192.168.1.4:16546;rinstance=23381940ec1f7a53>
From: "sipjstest1"<sip:sipjstest1@sip.linphone.org>;tag=19070d13

Andrew Pappas

unread,
Dec 3, 2014, 3:09:07 PM12/3/14
to Will Mitchell, sip...@googlegroups.com
Well that certainly explains it :) Any recommendation on a proxy?
Thanks,
Andrew

--
You received this message because you are subscribed to a topic in the Google Groups "SIP.js" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sip_js/UwIkHNcM3pM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sip_js+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Will Mitchell

unread,
Dec 3, 2014, 3:10:59 PM12/3/14
to sip...@googlegroups.com, wi...@onsip.com
We use OverSIP internally.  Kamailio also supports WebSocket connections, although I have not tried it myself.  A softswitch like Asterisk or FreeSWITCH could be used, although the proxy options are likely going to be easier to set up.

-Will
To unsubscribe from this group and all its topics, send an email to sip_js+unsubscribe@googlegroups.com.

Andrew Pappas

unread,
Dec 3, 2014, 3:13:27 PM12/3/14
to Will Mitchell, sip...@googlegroups.com
Thanks again. I also just came across webrtc2sip which looks promising.

To unsubscribe from this group and all its topics, send an email to sip_js+un...@googlegroups.com.

Andrew Pappas

unread,
Dec 3, 2014, 3:47:01 PM12/3/14
to Will Mitchell, sip...@googlegroups.com
Registering fine now using overSIP. The default configuration worked.
Andrew
Reply all
Reply to author
Forward
0 new messages