401 Failed to authenticate on reg - No matching endpoint

Hi all -

Been banging my head against the wall on this for weeks. Nothing I’ve found online has guided me to a solution. Even tried ChatGPT…

I’ve got asterisk set up on an internal network. Just extension to extension dialing. I’ve got no problem with UDP connections including softphones and hardphones. Calls can be made back and forth. I’ve got several clients working. My problem is with TLS / WSS based clients (Windows using sip.js). I’ve gotten all the certificate issues worked out as you’ll see in the logs. The issue is failing to get the client and server to love each other via username and password.

This is where things inevitably end up that you’ll see at the end of the browser logs and asterisk:

Browser says…

sip-0.21.2.js:9587 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.user-agent-client | 401 apparently in authentication loop, cannot authenticate
sip-0.21.2.js:9587 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | Failed to register, status code 401

Asterisk says…

[2023-04-17 00:21:22] NOTICE[10657]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:anonymous.3c5i34{at}anonymous.invalid>' failed for '192.168.x.xx:57049' (callid: gkboktclpj0pee8drgj0) - No matching endpoint found

A few things about the set up. Hosted on RPI4. I’m using nginx to serve static web content. So only use webserver here to assist with connections. I’ve tried different username and password key names. I tried adding an identify section. I know this is going to turn out to be simple…

Below are:

  • PJSIP and HTTP conf files
  • snippet of javascript code trying to set up the useragent
  • The console debug logs out of the browser (that’s most of the text here)
  • The asterisk debug output {At very bottom of this}

Thanks in advance for any help.

Charlie

pjsip.conf

[global]
max_forwards=70
user_agent=asteriskS1_user
default_realm=asteriskS1
keep_alive_interval=3

; == Transports

[udp_transport]
type=transport
protocol=udp
bind=0.0.0.0
tos=af42
cos=3

[wss_transport]
type=transport
protocol=wss
bind=0.0.0.0:443

[tcp_transport]
type=transport
protocol=tcp
bind=0.0.0.0

[tls_transport]
type=transport
protocol=tls
bind=0.0.0.0:5061
cert_file=/etc/main_answer/asteriskS1.crt
priv_key_file=/etc/main_answer/asteriskS1.key
cipher=ADH-AES256-SHA,ADH-AES128-SHA
method=tlsv1


; == ACL

[acl] ; 
type=acl
deny=0.0.0.0/0.0.0.0
permit=10.0.0.0/255.0.0.0
permit=172.16.0.0/255.240.0.0
permit=192.168.0.0/255.255.0.0

; == Templates

[single_aor](!)
max_contacts=1
qualify_frequency=120
remove_existing=yes

[userpass_auth](!)
auth_type=userpass


[basic_endpoint](!)
moh_suggest=default
context=from-extensions
inband_progress=no
rtp_timeout=120
message_context=textmessages
allow_subscribe=yes
subscribe_context=subscriptions
direct_media=no
dtmf_mode=rfc4733
device_state_busy_at=1
disallow=all

[phone_endpoint](!)
allow=law,alaw,g722,gsm,vp9,vp8,h264

[webrtc_endpoint](!)
transport=tls_transport  ;was wss_transport
allow=opus,ulaw,vp9,vp8,h264
; webrtc=yes
use_avpf=yes
media_encryption=dtls
dtls_verify=fingerprint
dtls_setup=actpass
ice_support=yes
media_use_received_transport=yes
rtcp_mux=yes
dtls_cert_file=/etc/main_answer/asteriskS1.crt
dtls_private_key=/etc/main_answer/asteriskS1.key
dtls_ca_file=/etc/main_answer/ast-Root-CA.crt

; == Users

[U1](basic_endpoint,webrtc_endpoint)
type=endpoint
callerid="U1" <1>
auth=U1
aors=U1@asteriskS1
[U1](single_aor)
type=aor
mailboxes=U1@default
[U1](userpass_auth)
type=auth
username=U1
password=1234

http.conf

[general]
enabled=no ; HTTP
tlsenable=yes ; HTTPS
tlsbindaddr=0.0.0.0:443
tlscertfile=/etc/main_answer/asteriskS1.crt
tlsprivatekey=/etc/main_answer/asteriskS1.key
enablestatic=no
sessionlimit=1000
redirect=/ /static/index.html

JS code

const server = 'wss://asteriskS1:443/ws';

const options = {
  userAgentString: 'asteriskS1_user',
  transportOptions: {
    wsServers: [server],
    traceSip: true
  },
  username: 'U1',
  password: '1234',
  displayName: 'U1',
  registerExpires: 600,
  uri: 'sip:U1@asteriskS1',
  sessionDescriptionHandlerFactoryOptions: {
    constraints: {
      audio: true,
      video: false
    },
    peerConnectionOptions: {
      rtcConfiguration: {
        iceServers: [] // Add any STUN/TURN servers if needed
      }
    }
  }
};

  // Return a Promise object
  return new Promise((resolve, reject) => {
    // Initialize the Simple User

    napa_Phone = new SIP.Web.SimpleUser(server,options);

Browser Console Log

napa_phone.js:383 document.ready.
napa_phone.js:273 In getUserProfile
(index):103 sending offer
(index):87 new track video
(index):78 peer connection state: checking
(index):78 peer connection state: connected
napa_phone.js:286 Data returned  {UserID: 'U438', asteriskID: 'U1', id: 1, ip_address: '192.168.x.xx', pwd: '1234'}
napa_phone.js:398 Registration server return code 200
napa_phone.js:399 getProfilepromise resolved.
napa_phone.js:294 CreateUser.
napa_phone.js:352 server object:  "wss://asteriskS1:443/ws"
napa_phone.js:353 options object:  {
  "userAgentString": "asteriskS1_user",
  "transportOptions": {
    "wsServers": [
      "wss://asteriskS1:443/ws"
    ],
    "traceSip": true
  },
  "username": "U1",
  "password": "1234",
  "displayName": "U1",
  "registerExpires": 600,
  "uri": "sip:U1@asteriskS1",
  "sessionDescriptionHandlerFactoryOptions": {
    "constraints": {
      "audio": true,
      "video": false
    },
    "peerConnectionOptions": {
      "rtcConfiguration": {
        "iceServers": []
      }
    }
  }
}
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | Configuration:
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · allowLegacyNotifications: false
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · authorizationHa1: ""
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · authorizationPassword: NOT SHOWN
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · authorizationUsername: ""
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · delegate: {}
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · contactName: ""
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · contactParams: {"transport":"ws"}
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · displayName: ""
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · forceRport: false
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · gracefulShutdown: true
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · hackAllowUnregisteredOptionTags: false
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · hackIpInContact: false
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · hackViaTcp: false
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · instanceId: ""
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · instanceIdAlwaysAdded: false
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · logBuiltinEnabled: true
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · logConfiguration: true
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · logConnector: undefined
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · logLevel: "log"
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · noAnswerTimeout: 60
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · preloadedRouteSet: []
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · reconnectionAttempts: 0
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · reconnectionDelay: 4
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · sendInitialProvisionalResponse: true
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · sessionDescriptionHandlerFactory: (session, options) => {
        // provide a default media stream factory if need be
        if (mediaStreamFactory === undefined) {
            mediaStreamFactory = (0,_media_stream_factory_default_js__WEBPACK_IMPORTED_MODULE_0__.defaultMediaStreamFactory)();
        }
        // make sure we allow `0` to be passed in so timeout can be disabled
        const iceGatheringTimeout = (options === null || options === void 0 ? void 0 : options.iceGatheringTimeout) !== undefined ? options === null || options === void 0 ? void 0 : options.iceGatheringTimeout : 5000;
        // merge passed factory options into default session description configuration
        const sessionDescriptionHandlerConfiguration = {
            iceGatheringTimeout,
            peerConnectionConfiguration: Object.assign(Object.assign({}, (0,_peer_connection_configuration_default_js__WEBPACK_IMPORTED_MODULE_1__.defaultPeerConnectionConfiguration)()), options === null || options === void 0 ? void 0 : options.peerConnectionConfiguration)
        };
        const logger = session.userAgent.getLogger("sip.SessionDescriptionHandler");
        return new _session_description_handler_js__WEBPACK_IMPORTED_MODULE_2__.SessionDescriptionHandler(logger, mediaStreamFactory, sessionDescriptionHandlerConfiguration);
    }
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · sessionDescriptionHandlerFactoryOptions: {}
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · sipExtension100rel: "Unsupported"
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · sipExtensionReplaces: "Unsupported"
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · sipExtensionExtraSupported: []
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · sipjsId: "n9n1a"
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · transportConstructor: Transport
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · transportOptions: {"server":"wss://asteriskS1:443/ws"}
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · uri: sip:anonymous.rpvb1m{at}anonymous.invalid
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · userAgentString: "SIP.js/0.21.2"
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | · viaHost: "up3mc47ktrma.invalid"
napa_phone.js:406 cometPhone is defined
napa_phone.js:410 createUserPromise resolved.
napa_phone.js:411 Creating listeners.
napa_phone.js:414 createListeners completed. Now registering user.
napa_phone.js:367 register user.
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.SimpleUser | [Anonymous] Registering UserAgent...
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.SessionManager | Registering UserAgent...
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | Configuration:
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | · expires: 600
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | · extraContactHeaderParams: []
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | · extraHeaders: []
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | · logConfiguration: true
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | · instanceId: ""
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | · params: {}
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | · regId: 0
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | · registrar: sip:anonymous.invalid
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | · refreshFrequency: 99
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.SessionManager | Registration attempt without delay
napa_phone.js:369 past register
napa_phone.js:419 registerPromise resolved. Now connecting.
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.SimpleUser | [Anonymous] Connecting UserAgent...
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.SessionManager | Connecting UserAgent...
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | Starting sip:anonymous.rpvb1m{at}anonymous.invalid
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.UserAgent | Transitioned from Stopped to Started
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Transport | Connecting wss://asteriskS1:443/ws
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Transport | Transitioned from Disconnected to Connecting
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.SessionManager | User agent not connected
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Transport | WebSocket opened wss://asteriskS1:443/ws
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Transport | Transitioned from Connecting to Connected
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.SessionManager | Connected
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.SessionManager | Registering UserAgent...
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.SessionManager | Registration attempt without delay
napa_phone.js:424 Connected. All promises resolved.
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | Waiting toggled to true
sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Transport | Sending WebSocket message:

REGISTER sip:anonymous.invalid SIP/2.0
Via: SIP/2.0/WSS up3mc47ktrma.invalid;branch=z9hG4bK2568630
To: <sip:anonymous.rpvb1m{at}anonymous.invalid>
From: <sip:anonymous.rpvb1m{at}anonymous.invalid>;tag=tg8m5gqt4n
CSeq: 2 REGISTER
Call-ID: n9n1aoktbiqj9693lpu6
Max-Forwards: 70
Contact: <sip:2mjgdice{at}up3mc47ktrma.invalid;transport=ws>;expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound, path, gruu
User-Agent: SIP.js/0.21.2
Content-Length: 0



sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Transport | Received WebSocket text message:

SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS up3mc47ktrma.invalid;rport=55537;received=192.168.x.xx;branch=z9hG4bK2568630
Call-ID: n9n1aoktbiqj9693lpu6
From: <sip:anonymous.rpvb1m{at}anonymous.invalid>;tag=tg8m5gqt4n
To: <sip:anonymous.rpvb1m{at}anonymous.invalid>;tag=z9hG4bK2568630
CSeq: 2 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1681714834/8db142cef2fb47b3f00baff0e5db1f8b",opaque="00c11ba662d40890",algorithm=MD5,qop="auth"
Server: Asterisk PBX 16.30.0
Content-Length:  0



sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Transport | Sending WebSocket message:

REGISTER sip:anonymous.invalid SIP/2.0
Via: SIP/2.0/WSS up3mc47ktrma.invalid;branch=z9hG4bK5382649
To: <sip:anonymous.rpvb1m{at}anonymous.invalid>
From: <sip:anonymous.rpvb1m{at}anonymous.invalid>;tag=tg8m5gqt4n
CSeq: 3 REGISTER
Call-ID: n9n1aoktbiqj9693lpu6
Max-Forwards: 70
Authorization: Digest algorithm=MD5, username="anonymous.rpvb1m", realm="asterisk", nonce="1681714834/8db142cef2fb47b3f00baff0e5db1f8b", uri="sip:anonymous.invalid", response="9d23f196818847bfd7df8963489c8457", opaque="00c11ba662d40890", qop=auth, cnonce="0uklj929nhlp", nc=00000001
Contact: <sip:2mjgdice{at}up3mc47ktrma.invalid;transport=ws>;expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound, path, gruu
User-Agent: SIP.js/0.21.2
Content-Length: 0



sip-0.21.2.js:9591 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Transport | Received WebSocket text message:

SIP/2.0 401 Unauthorized
Via: SIP/2.0/WSS up3mc47ktrma.invalid;rport=55537;received=192.168.x.xx;branch=z9hG4bK5382649
Call-ID: n9n1aoktbiqj9693lpu6
From: <sip:anonymous.rpvb1m{at}anonymous.invalid>;tag=tg8m5gqt4n
To: <sip:anonymous.rpvb1m{at}anonymous.invalid>;tag=z9hG4bK5382649
CSeq: 3 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1681714834/8db142cef2fb47b3f00baff0e5db1f8b",opaque="1aa0b31717223562",algorithm=MD5,qop="auth"
Server: Asterisk PBX 16.30.0
Content-Length:  0



sip-0.21.2.js:9587 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.user-agent-client | 401 apparently in authentication loop, cannot authenticate
sip-0.21.2.js:9587 Mon Apr 17 2023 00:00:35 GMT-0700 (Pacific Daylight Time) | sip.Registerer | Failed to register, status code 401

Asterisk Debug logs

[2023-04-17 00:21:22] NOTICE[10657]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:anonymous.3c5i34{at}anonymous.invalid>' failed for '192.168.x.xx:57049' (callid: gkboktclpj0pee8drgj0) - No matching endpoint found
[2023-04-17 00:21:22] NOTICE[10657]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:anonymous.3c5i34{at}anonymous.invalid>' failed for '192.168.x.xx:57049' (callid: gkboktclpj0pee8drgj0) - No matching endpoint found
[2023-04-17 00:21:22] NOTICE[10657]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:anonymous.3c5i34{at}anonymous.invalid>' failed for '192.168.x.xx:57049' (callid: gkboktclpj0pee8drgj0) - Failed to authenticate
[2023-04-17 00:21:28] NOTICE[10657]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:anonymous.3c5i34{at}anonymous.invalid>' failed for '192.168.x.xx:57049' (callid: gkboktclpj0pee8drgj0) - No matching endpoint found
[2023-04-17 00:21:28] NOTICE[10657]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:anonymous.3c5i34{at}anonymous.invalid>' failed for '192.168.x.xx:57049' (callid: gkboktclpj0pee8drgj0) - Failed to authenticate
[2023-04-17 00:21:28] NOTICE[10657]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:anonymous.3c5i34{at}anonymous.invalid>' failed for '192.168.x.xx:57049' (callid: gkboktclpj0pee8drgj0) - No matching endpoint found
[2023-04-17 00:21:28] NOTICE[10657]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:anonymous.3c5i34{at}anonymous.invalid>' failed for '192.168.x.xx:57049' (callid: gkboktclpj0pee8drgj0) - Failed to authenticate

Please edit the original posting to mark up all logs and configuration files as pre-formatted text.

1 Like

I can’t see anything in your configuration (endpoint section name for example) that would match anonymous.rpvb1m. How are you expecting to identify the endpoint?

You failed to mark up as pre-formatted text, as per my previous remark.

Hi David,

[I think I’ve now preformatted here and original]

Thanks for the reply.

I’ve been assuming (and using) extension number (username) as identity. In my very simple use case, there’s no messaging, no voice mail and if an endpoint is offline, it’s simply unreachable.

For my UDP clients (soft and hard) this has worked fine and I can call from extension to extension.
For example, here’s the config for extension 12 and the subsequent logged response from asterisk.
I can call extension to extension with this.

[12](basic_endpoint,webrtc_endpoint)
type=endpoint
callerid="12" <12>
auth=12
aors=12
[12](single_aor)
type=aor
[12](userpass_auth)
type=auth
username=12
password=1234

[2023-04-17 07:54:27] DEBUG[13553]: res_pjsip_endpoint_identifier_user.c:148 username_identify: Attempting identify by From username '12' domain '192.168.y.yy'
[2023-04-17 07:54:27] DEBUG[13553]: res_pjsip_endpoint_identifier_user.c:160 username_identify: Identified by From username '12' domain '192.168.y.yy'

But above does not work for my TLS/WSS clients.

I expect you are guiding me towards using “identify” which I’ve tried and not succeeded with.
Interestingly when I’ve added that to a TLS client, the UDP clients stop working.

If you are nudging me towards identify, could you please suggest specific config for U1 (original post)
and for this user (UDP)?

Thanks again,
Charlie

It doesn’t work because the TLS/WSS client is putting “anonymous.3c5i34” in the From user field, instead of the actual username.

I’ll spend some time double checking this to make sure I have my facts right but I believe that the sip.js logger anonymizes the output display of sensitive values (which apparently can’t be turned off). These anonymized values actually change every session so I’m not sure how it could ever work if it really did send these anonymized values instead of the actual usernames and passwords. But if you know this to be wrong, please say so.

Charlie

I only have experience with JsSIP which works perfectly fine. I vaguely recall hearing other people use sip.js, but don’t know for sure.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.