JSSIP 401 error


#1

Hello I am tring to connect to the WSS and getting 401 error And i dont know what i am doing wrong.

LOG:

Hello I am tring to connect to the WSS and getting 401 error And i dont know what i am doing wrong.

LOG:
JsSIP:UA configuration parameters after validation: +0ms
jssip.min.js:15 JsSIP:UA - via_host: "itqe1humptff.invalid" +7ms
jssip.min.js:15 JsSIP:UA - password: NOT SHOWN +1ms
jssip.min.js:15 JsSIP:UA - realm: "pbxserver" +1ms
jssip.min.js:15 JsSIP:UA - ha1: NOT SHOWN +0ms
jssip.min.js:15 JsSIP:UA - register_expires: 600 +0ms
jssip.min.js:15 JsSIP:UA - register: true +1ms
jssip.min.js:15 JsSIP:UA - registrar_server: sip:pbxserver +1ms
jssip.min.js:15 JsSIP:UA - ws_server_max_reconnection: 3 +0ms
jssip.min.js:15 JsSIP:UA - ws_server_reconnection_timeout: 4 +0ms
jssip.min.js:15 JsSIP:UA - connection_recovery_min_interval: 2 +1ms
jssip.min.js:15 JsSIP:UA - connection_recovery_max_interval: 30 +0ms
jssip.min.js:15 JsSIP:UA - use_preloaded_route: true +1ms
jssip.min.js:15 JsSIP:UA - no_answer_timeout: 60000 +1ms
jssip.min.js:15 JsSIP:UA - session_timers: false +1ms
jssip.min.js:15 JsSIP:UA - hack_via_tcp: false +0ms
jssip.min.js:15 JsSIP:UA - hack_via_ws: false +0ms
jssip.min.js:15 JsSIP:UA - hack_ip_in_contact: false +0ms
jssip.min.js:15 JsSIP:UA - node_websocket_options: {} +1ms
jssip.min.js:15 JsSIP:UA - uri: sip:3000@pbxserver +2ms
jssip.min.js:15 JsSIP:UA - ws_servers: [{"ws_uri":"wss://pbxserver:8089/ws","sip_uri":"<sip:pbxserver:8089;transport=ws;lr>","weight":0,"status":0,"scheme":"WSS"}] +1ms
jssip.min.js:15 JsSIP:UA - display_name: "Roman Moratov" +0ms
jssip.min.js:15 JsSIP:UA - instance_id: "2f6d7cf9-960e-40e2-a60e-afa0593b2a80" +0ms
jssip.min.js:15 JsSIP:UA - jssip_id: "fur09" +0ms
jssip.min.js:15 JsSIP:UA - hostport_params: "pbxserver" +0ms
jssip.min.js:15 JsSIP:UA - authorization_user: "3000" +1ms
jssip.min.js:15 JsSIP:UA start() +1ms
jssip.min.js:15 JsSIP:Transport connecting to WebSocket wss://pbxserver:8089/ws +1ms
(index):342 false
jssip.min.js:15 JsSIP:Transport WebSocket wss://pbxserver:8089/ws connected +3s
jssip.min.js:15 JsSIP:UA register() +1ms
jssip.min.js:15 JsSIP:Transport sending WebSocket message:REGISTER sip:pbxserver SIP/2.0
Route: <sip:pbxserver:8089;transport=ws;lr>
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK5901874
Max-Forwards: 69
To: <sip:3000@pbxserver>
From: "Roman Moratov" <sip:3000@pbxserver>;tag=jui7jkp8od
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 1 REGISTER
Contact: <sip:jkh73unh@itqe1humptff.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:2f6d7cf9-960e-40e2-a60e-afa0593b2a80>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 0.7.23
Content-Length: 0

 +5ms
jssip.min.js:15 JsSIP:Transport sending WebSocket message:REGISTER sip:pbxserver SIP/2.0
Route: <sip:pbxserver:8089;transport=ws;lr>
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK6688997
Max-Forwards: 69
To: <sip:3000@pbxserver>
From: "Roman Moratov" <sip:3000@pbxserver>;tag=2haepc0262
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 2 REGISTER
Contact: <sip:jkh73unh@itqe1humptff.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:2f6d7cf9-960e-40e2-a60e-afa0593b2a80>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 0.7.23
Content-Length: 0

 +2ms
jssip.min.js:15 JsSIP:Transport received WebSocket text message:SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK5901874;received=5.29.212.238
From: "Roman Moratov" <sip:3000@pbxserver>;tag=jui7jkp8od
To: <sip:3000@pbxserver>;tag=as7561a75c
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 1 REGISTER
Server: FPBX-14.0.5.25(13.19.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="24a22928"
Content-Length: 0

 +94ms
jssip.min.js:15 JsSIP:DigestAuthentication authenticate() | response generated +13ms
jssip.min.js:15 JsSIP:Transport sending WebSocket message:REGISTER sip:pbxserver SIP/2.0
Route: <sip:pbxserver:8089;transport=ws;lr>
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK902203
Max-Forwards: 69
To: <sip:3000@pbxserver>
From: "Roman Moratov" <sip:3000@pbxserver>;tag=jui7jkp8od
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 3 REGISTER
Authorization: Digest algorithm=MD5, username="3000", realm="asterisk", nonce="24a22928", uri="sip:pbxserver", response="477d50bd2f34075c8d2e87c2d230eb00"
Contact: <sip:jkh73unh@itqe1humptff.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:2f6d7cf9-960e-40e2-a60e-afa0593b2a80>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 0.7.23
Content-Length: 0

 +1ms
jssip.min.js:15 JsSIP:Transport received WebSocket text message:SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK6688997;received=5.29.212.238
From: "Roman Moratov" <sip:3000@pbxserver>;tag=2haepc0262
To: <sip:3000@pbxserver>;tag=as7561a75c
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 2 REGISTER
Server: FPBX-14.0.5.25(13.19.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="46ebf27e"
Content-Length: 0

 +1ms
jssip.min.js:15 JsSIP:DigestAuthentication authenticate() | response generated +2ms
jssip.min.js:15 JsSIP:Transport sending WebSocket message:REGISTER sip:pbxserver SIP/2.0
Route: <sip:pbxserver:8089;transport=ws;lr>
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK3131127
Max-Forwards: 69
To: <sip:3000@pbxserver>
From: "Roman Moratov" <sip:3000@pbxserver>;tag=2haepc0262
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 4 REGISTER
Authorization: Digest algorithm=MD5, username="3000", realm="asterisk", nonce="46ebf27e", uri="sip:pbxserver", response="1daa3dc87482355556ae329382949a42"
Contact: <sip:jkh73unh@itqe1humptff.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:2f6d7cf9-960e-40e2-a60e-afa0593b2a80>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 0.7.23
Content-Length: 0

 +1ms
jssip.min.js:15 JsSIP:Transport received WebSocket text message:SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK902203;received=5.29.212.238
From: "Roman Moratov" <sip:3000@pbxserver>;tag=jui7jkp8od
To: <sip:3000@pbxserver>;tag=as7561a75c
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 3 REGISTER
Server: FPBX-14.0.5.25(13.19.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="46ebf27e", stale=true
Content-Length: 0

 +93ms
jssip.min.js:15 JsSIP:DigestAuthentication authenticate() | response generated +2ms
jssip.min.js:15 JsSIP:Transport sending WebSocket message:REGISTER sip:pbxserver SIP/2.0
Route: <sip:pbxserver:8089;transport=ws;lr>
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK9186409
Max-Forwards: 69
To: <sip:3000@pbxserver>
From: "Roman Moratov" <sip:3000@pbxserver>;tag=jui7jkp8od
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 5 REGISTER
Authorization: Digest algorithm=MD5, username="3000", realm="asterisk", nonce="46ebf27e", uri="sip:pbxserver", response="1daa3dc87482355556ae329382949a42"
Contact: <sip:jkh73unh@itqe1humptff.invalid;transport=ws>;+sip.ice;reg-id=1;+sip.instance="<urn:uuid:2f6d7cf9-960e-40e2-a60e-afa0593b2a80>";expires=600
Expires: 600
Allow: INVITE,ACK,CANCEL,BYE,UPDATE,MESSAGE,OPTIONS,REFER,INFO
Supported: path,gruu,outbound
User-Agent: JsSIP 0.7.23
Content-Length: 0

 +1ms
jssip.min.js:15 JsSIP:Transport received WebSocket text message:SIP/2.0 200 OK
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK3131127;received=5.29.212.238
From: "Roman Moratov" <sip:3000@pbxserver>;tag=2haepc0262
To: <sip:3000@pbxserver>;tag=as7561a75c
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 4 REGISTER
Server: FPBX-14.0.5.25(13.19.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 600
Contact: <sip:jkh73unh@itqe1humptff.invalid;transport=ws>;expires=600
Date: Wed, 16 Jan 2019 17:13:48 GMT
Content-Length: 0

 +0ms
jssip.min.js:15 JsSIP:Transport received WebSocket text message:SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS itqe1humptff.invalid;branch=z9hG4bK9186409;received=5.29.212.238
From: "Roman Moratov" <sip:3000@pbxserver>;tag=jui7jkp8od
To: <sip:3000@pbxserver>;tag=as7561a75c
Call-ID: 5dadcj2u5ini9dic5so8ds
CSeq: 5 REGISTER
Server: FPBX-14.0.5.25(13.19.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="07264403", stale=true
Content-Length: 0

 +98ms
(index):287 {response: i, cause: "Authentication Error"}



#2

401 is not an error. It is a request for you to provide your password.


#3

401 is provisional response


#4

401 is a final response, in SIP terms, but, as I said above, it is not, in itself, an indication of an error…