No matching endpoints found - Failed to authenticate

Good morning everyone.

I just upgraded to Asterisk 16 and I’m having troubles while trying to register a phone to Asterisk.
Asterisk can’t find a endpoint for the registration request sent by the phone:

[Sep 10 04:36:18] NOTICE[2091250]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:binding11@192.168.1.5>' failed for '192.168.1.204:5060' (callid: 224316111-5060-10@BJC.BGI.B.CAE) - No matching endpoint found
[Sep 10 04:36:18] NOTICE[2091250]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'REGISTER' from '<sip:binding11@192.168.1.5>' failed for '192.168.1.204:5060' (callid: 224316111-5060-10@BJC.BGI.B.CAE) - Failed to authenticate

I know this question has been asked before, I even tried to use the “line” parameter as suggested in other topics, but with no avail.
This is my pjsip.conf file:

;================================ TRANSPORTS ==
; Our primary transport definition for UDP communication

[transport-udp-nat]
type = transport
protocol = udp
bind = 0.0.0.0
; NAT settings
;local_net = 10.0.0.0/8
;external_media_address = 203.0.113.1
;external_signaling_address = 203.0.113.1

;================================ CONFIG FOR SIP ITSP ==

[BBBELL-trunk]
type = registration
transport = transport-udp-nat
outbound_auth = BBBELL-trunk-auth
server_uri = sip:sip.local.bbbell:5060
client_uri = sip:username@sip.local.bbbell:5060
outbound_proxy = sip:192.168.1.6\;lr
retry_interval = 60
line = yes
endpoint = BBBELL-endpoint

[BBBELL-trunk-auth]
type = auth
auth_type = userpass
username = *<username provided by ISP>*
password = *<password provided by ISP>*
realm = sip.local.bbbell

[BBBELL-endpoint]
type=endpoint
context = incoming
allow = !all,g722,ulaw
outbound_auth = BBBELL-auth
aors = BBBELL-aor
direct_media = no
from_domain = sip.local.bbbell
outbound_proxy = sip:192.168.1.6\;lr

[BBBELL-auth]
type = auth
auth_type = userpass
username = *<username provided by ISP>*
password = *<password provided by ISP>*
realm = sip.local.bbbell

[BBBELL-aor]
type = aor
contact = sip:sip.local.bbbell:5060
outbound_proxy = sip:192.168.1.6\;lr
qualify_frequency = 60

[BBBELL-identify]
type=identify
endpoint = BBBELL-endpoint
match = 192.168.1.6
;================================ ENDPOINT TEMPLATES ==
; Our primary endpoint template for internal desk phones.

[endpoint-internal](!)
type = endpoint
context = internal
;subscribecontext = incoming
;host = dynamic
disallow = all
allow = g722,ulaw
direct_media = no
trust_id_outbound = yes
device_state_busy_at = 1
dtmf_mode = rfc4733

[auth-userpass](!)
type = auth
auth_type = userpass

[aor-single-reg](!)
type = aor
max_contacts = 1

;================================ ENDPOINT DEFINITIONS ==

;Roberta

[11](endpoint-internal)
auth = auth11
aors = 11
callerid = Roberta <11>

[auth11](auth-userpass)
password = sip11
username = binding11

[11](aor-single-reg)
mailboxes = 11@example

And this is the PJSIP trace of the phone trying to register as the identity [11] :

<--- Received SIP request (864 bytes) from UDP:192.168.1.204:5060 --->
REGISTER sip:192.168.1.5 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.204:5060;branch=z9hG4bK1283973834;rport
From: <sip:binding11@192.168.1.5>;tag=1135209030
To: <sip:binding11@192.168.1.5>
Call-ID: 224316111-5060-10@BJC.BGI.B.CAE
CSeq: 10008 REGISTER
Contact: <sip:binding11@192.168.1.204:5060>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-1000-8000-C074AD1524ED>"
Authorization: Digest username="binding11", realm="asterisk", nonce="1599727364/e204643df4eee5cee592d8711ba7a141", uri="sip:192.168.1.5", response="d06f8df065ae55e6cbf72464d1c1d919", algorithm=md5, cnonce="04802424", opaque="30982e975396043c", qop=auth, nc=00000001
X-Grandstream-PBX: true
Max-Forwards: 70
User-Agent: Grandstream GXP1628 1.0.4.138
Supported: path
Expires: 3600
Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE, MESSAGE
Content-Length: 0

<--- Transmitting SIP response (502 bytes) to UDP:192.168.1.204:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.204:5060;rport=5060;received=192.168.1.204;branch=z9hG4bK1283973834
Call-ID: 224316111-5060-10@BJC.BGI.B.CAE
From: <sip:binding11@192.168.1.5>;tag=1135209030
To: <sip:binding11@192.168.1.5>;tag=z9hG4bK1283973834
CSeq: 10008 REGISTER
WWW-Authenticate: Digest realm="asterisk",nonce="1599727364/e204643df4eee5cee592d8711ba7a141",opaque="0fe2cea46fd1ad53",algorithm=md5,qop="auth"
Server: Asterisk PBX certified/16.8-cert3
Content-Length:  0

Can somebody help me out with this issue please ?

The name of the endpoint generally has to match the username of the device. You have the endpoint as “11” currently instead of “binding11”.

1 Like

That was indeed the solution. Couldn’t believe I had overlooked this step. Many thanks - that did the trick.

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