SIP registration failure: There were no auth ids available

Questions with this error have been asked before, but all it seems with the opposite problem of the one I’m having.

I have an Asterisk system behind NAT using PJSIP registering twice to a public Asterisk server.
The configuration worked with the public Asterisk on chan_sip but not with chan_pjsip, even though it’s just the endpoints for this server having the issue.

For some reason, I keep getting this warning:
[2022-03-01 20:22:52] ERROR[25303]: res_pjsip_outbound_authenticator_digest.c:450 digest_create_request_with_auth: Host: 'PUBLIC-IP-OF-NAT-SERVER:16555': There were no auth ids available

I’m seeing this on the PUBLIC server. This doesn’t make any sense, because the NAT’ed server is registring to it, not the other way around. Yet, the thing that is registering seems to be rejecting the thing it’s registered to, for some reason.

I only have outbound_auth on the NAT server set, not auth, so the NAT’ed server shouldn’t be asking for any auth.

The funny thing is that according to both servers, the registration appears to be up and active. However, if the NAT’ed server tries placing a call to the public server, it’s rejected because it can’t find a matching endpoint, which makes it seem like the registration isn’t actually working after all:

[2022-03-01 20:26:08] NOTICE[28114]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>' failed for 'PUBLIC-IP-OF-NAT-SERVER:16555' (callid: cc9d2364-6b37-460f-8c06-3e0dcd207aa2) - No matching endpoint found
[2022-03-01 20:26:08] NOTICE[28114]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>' failed for 'PUBLIC-IP-OF-NAT-SERVER:16555' (callid: cc9d2364-6b37-460f-8c06-3e0dcd207aa2) - Failed to authenticate

Any idea as to why this would be? The hints all make it seem like I have the opposite problem. Must be missing something simple, but I can’t seem to figure it out. The configs on the public server aren’t any different from any of the other configs for stuff that registers, and none of those endpoints have issues.

SIP debugs and configs attached.

;;;;;;;;;;;;;;;;;;;;;;;; strange SIP debug:

[2022-03-01 20:20:52] <--- Transmitting SIP request (434 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 20:20:52] OPTIONS sip:autotest1@PUBLIC-IP-OF-NAT-SERVER:16555 SIP/2.0
[2022-03-01 20:20:52] Via: SIP/2.0/UDP PUBLIC-IP-OF-PUBLIC-SERVER:17777;rport;branch=z9hG4bKPjcc9bb460-69ce-4ad4-aa1b-c0efb1e09937
[2022-03-01 20:20:52] From: <sip:autotest1@PUBLIC-IP-OF-PUBLIC-SERVER>;tag=289ee557-c1bd-474d-984c-8f90a39d0252
[2022-03-01 20:20:52] To: <sip:autotest1@PUBLIC-IP-OF-NAT-SERVER>
[2022-03-01 20:20:52] Contact: <sip:autotest1@PUBLIC-IP-OF-PUBLIC-SERVER:17777>
[2022-03-01 20:20:52] Call-ID: 9d1b3b69-886b-40d7-9917-90d931440ede
[2022-03-01 20:20:52] CSeq: 29515 OPTIONS
[2022-03-01 20:20:52] Max-Forwards: 70
[2022-03-01 20:20:52] User-Agent: Asterisk
[2022-03-01 20:20:52] Content-Length:  0
[2022-03-01 20:20:52]
[2022-03-01 20:20:52]
[2022-03-01 20:20:52] <--- Received SIP response (578 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 20:20:52] SIP/2.0 401 Unauthorized
[2022-03-01 20:20:52] Via: SIP/2.0/UDP PUBLIC-IP-OF-PUBLIC-SERVER:17777;rport=17777;received=PUBLIC-IP-OF-PUBLIC-SERVER;branch=z9hG4bKPjcc9bb460-69ce-4ad4-aa1b-c0efb1e09937
[2022-03-01 20:20:52] Call-ID: 9d1b3b69-886b-40d7-9917-90d931440ede
[2022-03-01 20:20:52] From: <sip:autotest1@PUBLIC-IP-OF-PUBLIC-SERVER>;tag=289ee557-c1bd-474d-984c-8f90a39d0252
[2022-03-01 20:20:52] To: <sip:autotest1@PUBLIC-IP-OF-NAT-SERVER>;tag=z9hG4bKPjcc9bb460-69ce-4ad4-aa1b-c0efb1e09937
[2022-03-01 20:20:52] CSeq: 29515 OPTIONS
[2022-03-01 20:20:52] WWW-Authenticate: Digest realm="asterisk",nonce="1646166052/2f3804591fe9f25c7de43bb787359a8b",opaque="1ca55a3839d021fa",algorithm=md5,qop="auth"
[2022-03-01 20:20:52] Server: Asterisk PBX 18.10.0
[2022-03-01 20:20:52] Content-Length:  0

;;;;;;;;;;;;;;;;;;;;;;;;;; public server

[autotest1](template-aor-line)

[autotest1](template-auth-line)
username = autotest1
password = REDACTED

[autotest1](template-endpoint-1)
aors = autotest1
auth = autotest1
callerid = "Auto Test" <2155>

(Ditto for autotest2, essentially)

;;;;;;;;;;;;;;;;;;;;;;;;;;; private (NAT'ed) server

root@pbxdev:~# head -72 /etc/asterisk/pjsip.conf
[global]
endpoint_identifier_order = auth_username,username,ip,anonymous

[endpoint](!)
type = endpoint
rtp_symmetric = yes
force_rport = yes
rewrite_contact = yes
direct_media = no
tos_audio = ef
disallow = all
allow = ulaw
language = en

[hosted-endpoint](!,endpoint)
type = endpoint
dtmf_mode = auto_info

[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0:16555
tos = cs3

[reg_autotest1]
type = registration
contact_user = autotest1
transport = transport-udp
outbound_auth = autotest1
client_uri = sip:autotest1@PUBLIC-SERVER:PUBLIC-PORT
server_uri = sip:PUBLIC-SERVER:PUBLIC-PORT

[autotest1]
type = auth
username = autotest1
password = REDACTED

[autotest1]
type = aor
contact = sip:autotest1@PUBLIC-SERVER:PUBLIC-PORT

[autotest1](hosted-endpoint)
from_domain = PUBLIC-SERVER
outbound_auth = autotest1
aors = autotest1
context = from-autotest
identify_by = auth_username

[reg_autotest2]
type = registration
contact_user = autotest2
transport = transport-udp
outbound_auth = autotest2
client_uri = sip:autotest2@PUBLIC-SERVER:PUBLIC-PORT
server_uri = sip:PUBLIC-SERVER:PUBLIC-PORT

[autotest2]
type = auth
username = autotest2
password = REDACTED

[autotest2]
type = aor
contact = sip:autotest2@PUBLIC-SERVER:PUBLIC-PORT

[autotest2](hosted-endpoint)
from_domain = PUBLIC-SERVER
outbound_auth = autotest2
aors = autotest2
context = from-autotest
identify_by = auth_username

The only thing that is strange about the debug is that there is no registration attempt.

Yes, hence why it’s odd that the public server is even trying to do anything with with that peer.
Again, according to “pjsip show endpoints” it is “Not in use”, as opposed to “Unavailable”.

Even if there were a reg. attempt, why would this outbound reg code be firing for an inbound registration? That seems wrong in this case.

Registration is only about communicating ones address, so there is no reason why outbound traffic, including options would be blocked.

You’ve got multiple things going on here and confusion.

The message about “There were no auth ids available” is because the OPTIONS request was challenged, and there are no authentication credentials configured.

You’ve got “autotest1” and “autotest2” configured so they can only be identified using authentication username, which you don’t have configured to do so inbound traffic would never get matched to them thus “PUBLIC server” would never match them regardless.

You don’t have a defined mechanism for how the traffic from “PUBLIC server” should be matched on “NAT server”. You can either do IP based matching, or use line[1], or set the “from_user” option on “PUBLIC server” so it matches on From username on “NAT server”.

[1] The PJSIP Outbound Registration 'line' Option ⋆ Asterisk

I had actually added line=yes and endpoint last week in playing around with trying to get it to work, but then it turned out I could get it to work without that - but this was when the public server was using chan_sip. Now that it’s back to chan_pjsip, I guess it may behave differently.

Adding the line stuff did seem to fix some stuff, but the public server still doesn’t seem to associate incoming requests with that endpoint.

I’m essentially registering the NAT server to extensions on the public server. As such, IP matching on the public server would be inappropriate as even though the IP in this case is known, in theory it may not be known and that needs to not be referenced anywhere. If anything, it would seem the config on the NAT server is faulty since the configs on the public server work for ATAs and softphones just fine. Also worked with chan_sip just fine, strangely.

Here is debug showing the change after adding the line option:

[2022-03-01 22:24:34] <--- Received SIP request (464 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:34] REGISTER sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:34] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPj5c44631a-332b-4870-b96a-0db383aaf3f8
[2022-03-01 22:24:34] From: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=ffc632ba-6e8d-445a-962e-7ca5c6524d81
[2022-03-01 22:24:34] To: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:34] Call-ID: f5e42e6d-3ee7-44c8-8ab4-2b225ef51e3a
[2022-03-01 22:24:34] CSeq: 59234 REGISTER
[2022-03-01 22:24:34] Contact: <sip:autotest2@10.55.1.158:16555>
[2022-03-01 22:24:34] Expires: 0
[2022-03-01 22:24:34] Max-Forwards: 70
[2022-03-01 22:24:34] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:34] Content-Length:  0
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]
[2022-03-01 22:24:34] <--- Received SIP request (464 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:34] REGISTER sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:34] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPjf863e8da-1067-4ea7-81ec-7bc05732f206
[2022-03-01 22:24:34] From: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=bb996cce-2693-4ff3-ae6f-0271125d247a
[2022-03-01 22:24:34] To: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:34] Call-ID: 62bee395-f34c-40bd-82cb-f3cd76aa5c0e
[2022-03-01 22:24:34] CSeq: 36126 REGISTER
[2022-03-01 22:24:34] Contact: <sip:autotest1@10.55.1.158:16555>
[2022-03-01 22:24:34] Expires: 0
[2022-03-01 22:24:34] Max-Forwards: 70
[2022-03-01 22:24:34] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:34] Content-Length:  0
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]
[2022-03-01 22:24:34] <--- Transmitting SIP response (578 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:34] SIP/2.0 401 Unauthorized
[2022-03-01 22:24:34] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPj5c44631a-332b-4870-b96a-0db383aaf3f8
[2022-03-01 22:24:34] Call-ID: f5e42e6d-3ee7-44c8-8ab4-2b225ef51e3a
[2022-03-01 22:24:34] From: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=ffc632ba-6e8d-445a-962e-7ca5c6524d81
[2022-03-01 22:24:34] To: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPj5c44631a-332b-4870-b96a-0db383aaf3f8
[2022-03-01 22:24:34] CSeq: 59234 REGISTER
[2022-03-01 22:24:34] WWW-Authenticate: Digest realm="asterisk",nonce="1646173474/58599c5e05324007bffde54cf1e8f930",opaque="75bdbbad2c149a4c",algorithm=md5,qop="auth"
[2022-03-01 22:24:34] Server: Asterisk
[2022-03-01 22:24:34] Content-Length:  0
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]
[2022-03-01 22:24:34] <--- Transmitting SIP response (578 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:34] SIP/2.0 401 Unauthorized
[2022-03-01 22:24:34] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPjf863e8da-1067-4ea7-81ec-7bc05732f206
[2022-03-01 22:24:34] Call-ID: 62bee395-f34c-40bd-82cb-f3cd76aa5c0e
[2022-03-01 22:24:34] From: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=bb996cce-2693-4ff3-ae6f-0271125d247a
[2022-03-01 22:24:34] To: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPjf863e8da-1067-4ea7-81ec-7bc05732f206
[2022-03-01 22:24:34] CSeq: 36126 REGISTER
[2022-03-01 22:24:34] WWW-Authenticate: Digest realm="asterisk",nonce="1646173474/58599c5e05324007bffde54cf1e8f930",opaque="1e60e4e61d2a5a66",algorithm=md5,qop="auth"
[2022-03-01 22:24:34] Server: Asterisk
[2022-03-01 22:24:34] Content-Length:  0
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]
[2022-03-01 22:24:34] <--- Received SIP request (768 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:34] REGISTER sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:34] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPj99ea9500-84ff-4558-87c7-355da8fc1912
[2022-03-01 22:24:34] From: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=ffc632ba-6e8d-445a-962e-7ca5c6524d81
[2022-03-01 22:24:34] To: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:34] Call-ID: f5e42e6d-3ee7-44c8-8ab4-2b225ef51e3a
[2022-03-01 22:24:34] CSeq: 59235 REGISTER
[2022-03-01 22:24:34] Contact: <sip:autotest2@10.55.1.158:16555>
[2022-03-01 22:24:34] Expires: 0
[2022-03-01 22:24:34] Max-Forwards: 70
[2022-03-01 22:24:34] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:34] Authorization: Digest username="autotest2", realm="asterisk", nonce="1646173474/58599c5e05324007bffde54cf1e8f930", uri="sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777", response="bdd728f8c3d76a1982e5cd22519898bb", algorithm=md5, cnonce="b71b9fe79def48d8a78739644c188ee0", opaque="75bdbbad2c149a4c", qop=auth, nc=00000001
[2022-03-01 22:24:34] Content-Length:  0
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]
[2022-03-01 22:24:34] <--- Received SIP request (768 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:34] REGISTER sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:34] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPjf7ec5dc8-b8a3-48c7-a2c4-7198f09f9c41
[2022-03-01 22:24:34] From: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=bb996cce-2693-4ff3-ae6f-0271125d247a
[2022-03-01 22:24:34] To: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:34] Call-ID: 62bee395-f34c-40bd-82cb-f3cd76aa5c0e
[2022-03-01 22:24:34] CSeq: 36127 REGISTER
[2022-03-01 22:24:34] Contact: <sip:autotest1@10.55.1.158:16555>
[2022-03-01 22:24:34] Expires: 0
[2022-03-01 22:24:34] Max-Forwards: 70
[2022-03-01 22:24:34] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:34] Authorization: Digest username="autotest1", realm="asterisk", nonce="1646173474/58599c5e05324007bffde54cf1e8f930", uri="sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777", response="b6e78d61df9cbb810f31c5c4fcffcbe1", algorithm=md5, cnonce="3df7227bb74842f688525ef9c280f03e", opaque="1e60e4e61d2a5a66", qop=auth, nc=00000001
[2022-03-01 22:24:34] Content-Length:  0
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]     -- Removed contact 'sip:autotest2@PUBLIC-IP-OF-NAT-SERVER:16555;x-ast-orig-host=10.55.1.158:16555' from AOR 'autotest2' due to request
[2022-03-01 22:24:34] <--- Transmitting SIP response (471 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:34] SIP/2.0 200 OK
[2022-03-01 22:24:34] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPj99ea9500-84ff-4558-87c7-355da8fc1912
[2022-03-01 22:24:34] Call-ID: f5e42e6d-3ee7-44c8-8ab4-2b225ef51e3a
[2022-03-01 22:24:34] From: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=ffc632ba-6e8d-445a-962e-7ca5c6524d81
[2022-03-01 22:24:34] To: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPj99ea9500-84ff-4558-87c7-355da8fc1912
[2022-03-01 22:24:34] CSeq: 59235 REGISTER
[2022-03-01 22:24:34] Date: Tue, 01 Mar 2022 22:24:34 GMT
[2022-03-01 22:24:34] Expires: 0
[2022-03-01 22:24:34] Server: Asterisk
[2022-03-01 22:24:34] Content-Length:  0
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]     -- Removed contact 'sip:autotest1@PUBLIC-IP-OF-NAT-SERVER:16555;x-ast-orig-host=10.55.1.158:16555' from AOR 'autotest1' due to request
[2022-03-01 22:24:34] <--- Transmitting SIP response (471 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:34] SIP/2.0 200 OK
[2022-03-01 22:24:34] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPjf7ec5dc8-b8a3-48c7-a2c4-7198f09f9c41
[2022-03-01 22:24:34] Call-ID: 62bee395-f34c-40bd-82cb-f3cd76aa5c0e
[2022-03-01 22:24:34] From: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=bb996cce-2693-4ff3-ae6f-0271125d247a
[2022-03-01 22:24:34] To: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPjf7ec5dc8-b8a3-48c7-a2c4-7198f09f9c41
[2022-03-01 22:24:34] CSeq: 36127 REGISTER
[2022-03-01 22:24:34] Date: Tue, 01 Mar 2022 22:24:34 GMT
[2022-03-01 22:24:34] Expires: 0
[2022-03-01 22:24:34] Server: Asterisk
[2022-03-01 22:24:34] Content-Length:  0
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]
[2022-03-01 22:24:34]   == Contact autotest2/sip:autotest2@PUBLIC-IP-OF-NAT-SERVER:16555;x-ast-orig-host=10.55.1.158:16555 has been deleted
[2022-03-01 22:24:34]   == Endpoint autotest2 is now Unreachable
[2022-03-01 22:24:34]   == Contact autotest1/sip:autotest1@PUBLIC-IP-OF-NAT-SERVER:16555;x-ast-orig-host=10.55.1.158:16555 has been deleted
[2022-03-01 22:24:34]   == Endpoint autotest1 is now Unreachable
[2022-03-01 22:24:38] <--- Received SIP request (591 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:38] REGISTER sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:38] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPjc820afff-6894-4fe3-9c03-e4b799195b66
[2022-03-01 22:24:38] From: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=b53fbdba-22d9-46e3-9131-0c1b5200ee54
[2022-03-01 22:24:38] To: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:38] Call-ID: 33376d45-d9c3-4a32-b103-f9904ecabf1f
[2022-03-01 22:24:38] CSeq: 56577 REGISTER
[2022-03-01 22:24:38] Contact: <sip:autotest2@10.55.1.158:16555;line=rjqfnpn>
[2022-03-01 22:24:38] Expires: 3600
[2022-03-01 22:24:38] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
[2022-03-01 22:24:38] Max-Forwards: 70
[2022-03-01 22:24:38] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:38] Content-Length:  0
[2022-03-01 22:24:38]
[2022-03-01 22:24:38]
[2022-03-01 22:24:38] <--- Transmitting SIP response (578 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:38] SIP/2.0 401 Unauthorized
[2022-03-01 22:24:38] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPjc820afff-6894-4fe3-9c03-e4b799195b66
[2022-03-01 22:24:38] Call-ID: 33376d45-d9c3-4a32-b103-f9904ecabf1f
[2022-03-01 22:24:38] From: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=b53fbdba-22d9-46e3-9131-0c1b5200ee54
[2022-03-01 22:24:38] To: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPjc820afff-6894-4fe3-9c03-e4b799195b66
[2022-03-01 22:24:38] CSeq: 56577 REGISTER
[2022-03-01 22:24:38] WWW-Authenticate: Digest realm="asterisk",nonce="1646173478/a7ab46dfa73e839b246c0b5eacbf72e7",opaque="28a87d804550cae5",algorithm=md5,qop="auth"
[2022-03-01 22:24:38] Server: Asterisk
[2022-03-01 22:24:38] Content-Length:  0
[2022-03-01 22:24:38]
[2022-03-01 22:24:38]
[2022-03-01 22:24:38] <--- Received SIP request (895 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:38] REGISTER sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:38] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPjc271691e-c305-4486-932d-9678507d1735
[2022-03-01 22:24:38] From: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=b53fbdba-22d9-46e3-9131-0c1b5200ee54
[2022-03-01 22:24:38] To: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:38] Call-ID: 33376d45-d9c3-4a32-b103-f9904ecabf1f
[2022-03-01 22:24:38] CSeq: 56578 REGISTER
[2022-03-01 22:24:38] Contact: <sip:autotest2@10.55.1.158:16555;line=rjqfnpn>
[2022-03-01 22:24:38] Expires: 3600
[2022-03-01 22:24:38] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
[2022-03-01 22:24:38] Max-Forwards: 70
[2022-03-01 22:24:38] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:38] Authorization: Digest username="autotest2", realm="asterisk", nonce="1646173478/a7ab46dfa73e839b246c0b5eacbf72e7", uri="sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777", response="359699b4ed955e230e00ce1ecb437666", algorithm=md5, cnonce="e771ab6e9e2d4f9cb71623b292f2dcd4", opaque="28a87d804550cae5", qop=auth, nc=00000001
[2022-03-01 22:24:38] Content-Length:  0
[2022-03-01 22:24:38]
[2022-03-01 22:24:38]
[2022-03-01 22:24:38]     -- Added contact 'sip:autotest2@PUBLIC-IP-OF-NAT-SERVER:16555;line=rjqfnpn;x-ast-orig-host=10.55.1.158:16555' to AOR 'autotest2' with expiration of 3600 seconds
[2022-03-01 22:24:38] <--- Transmitting SIP response (544 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:38] SIP/2.0 200 OK
[2022-03-01 22:24:38] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPjc271691e-c305-4486-932d-9678507d1735
[2022-03-01 22:24:38] Call-ID: 33376d45-d9c3-4a32-b103-f9904ecabf1f
[2022-03-01 22:24:38] From: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=b53fbdba-22d9-46e3-9131-0c1b5200ee54
[2022-03-01 22:24:38] To: <sip:autotest2@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPjc271691e-c305-4486-932d-9678507d1735
[2022-03-01 22:24:38] CSeq: 56578 REGISTER
[2022-03-01 22:24:38] Date: Tue, 01 Mar 2022 22:24:38 GMT
[2022-03-01 22:24:38] Contact: <sip:autotest2@10.55.1.158:16555;line=rjqfnpn>;expires=3599
[2022-03-01 22:24:38] Expires: 3600
[2022-03-01 22:24:38] Server: Asterisk
[2022-03-01 22:24:38] Content-Length:  0
[2022-03-01 22:24:38]
[2022-03-01 22:24:38]
[2022-03-01 22:24:38] <--- Transmitting SIP request (460 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:38] OPTIONS sip:autotest2@PUBLIC-IP-OF-NAT-SERVER:16555;line=rjqfnpn SIP/2.0
[2022-03-01 22:24:38] Via: SIP/2.0/UDP PUBLIC-IP-OF-PUBLIC-SERVER:17777;rport;branch=z9hG4bKPjbedd14ad-759a-42a5-a8cf-5a5bb79071ee
[2022-03-01 22:24:38] From: <sip:autotest2@PUBLIC-IP-OF-PUBLIC-SERVER>;tag=fb44299d-6835-4c88-a9ad-97eb7c78f3a0
[2022-03-01 22:24:38] To: <sip:autotest2@PUBLIC-IP-OF-NAT-SERVER;line=rjqfnpn>
[2022-03-01 22:24:38] Contact: <sip:autotest2@PUBLIC-IP-OF-PUBLIC-SERVER:17777>
[2022-03-01 22:24:38] Call-ID: 4cee156b-b6e0-47d0-b56c-64d5354abc8f
[2022-03-01 22:24:38] CSeq: 54078 OPTIONS
[2022-03-01 22:24:38] Max-Forwards: 70
[2022-03-01 22:24:38] User-Agent: Asterisk
[2022-03-01 22:24:38] Content-Length:  0
[2022-03-01 22:24:38]
[2022-03-01 22:24:38]
[2022-03-01 22:24:38] <--- Received SIP response (920 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:38] SIP/2.0 200 OK
[2022-03-01 22:24:38] Via: SIP/2.0/UDP PUBLIC-IP-OF-PUBLIC-SERVER:17777;rport=17777;received=PUBLIC-IP-OF-PUBLIC-SERVER;branch=z9hG4bKPjbedd14ad-759a-42a5-a8cf-5a5bb79071ee
[2022-03-01 22:24:38] Call-ID: 4cee156b-b6e0-47d0-b56c-64d5354abc8f
[2022-03-01 22:24:38] From: <sip:autotest2@PUBLIC-IP-OF-PUBLIC-SERVER>;tag=fb44299d-6835-4c88-a9ad-97eb7c78f3a0
[2022-03-01 22:24:38] To: <sip:autotest2@PUBLIC-IP-OF-NAT-SERVER;line=rjqfnpn>;tag=z9hG4bKPjbedd14ad-759a-42a5-a8cf-5a5bb79071ee
[2022-03-01 22:24:38] CSeq: 54078 OPTIONS
[2022-03-01 22:24:38] Accept: application/dialog-info+xml, application/xpidf+xml, application/cpim-pidf+xml, application/simple-message-summary, application/pidf+xml, application/pidf+xml, application/dialog-info+xml, application/simple-message-summary, application/sdp, message/sipfrag;version=2.0
[2022-03-01 22:24:38] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
[2022-03-01 22:24:38] Supported: 100rel, timer, replaces, norefersub
[2022-03-01 22:24:38] Accept-Encoding: identity
[2022-03-01 22:24:38] Accept-Language: en
[2022-03-01 22:24:38] Server: Asterisk PBX 18.10.0
[2022-03-01 22:24:38] Content-Length:  0
[2022-03-01 22:24:38]
[2022-03-01 22:24:38]
[2022-03-01 22:24:38]   == Endpoint autotest2 is now Reachable
[2022-03-01 22:24:38]     -- Contact autotest2/sip:autotest2@PUBLIC-IP-OF-NAT-SERVER:16555;line=rjqfnpn;x-ast-orig-host=10.55.1.158:16555 is now Reachable.  RTT: 12.696 msec
[2022-03-01 22:24:43] <--- Received SIP request (591 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:43] REGISTER sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:43] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPj39473a2d-779c-485b-9d90-e9e9828cd1fd
[2022-03-01 22:24:43] From: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=60f121e4-5c71-4f18-948a-d197ecb0381a
[2022-03-01 22:24:43] To: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:43] Call-ID: 4af2f771-9a30-406e-8c8a-b9f14139c995
[2022-03-01 22:24:43] CSeq: 32515 REGISTER
[2022-03-01 22:24:43] Contact: <sip:autotest1@10.55.1.158:16555;line=njvqmtu>
[2022-03-01 22:24:43] Expires: 3600
[2022-03-01 22:24:43] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
[2022-03-01 22:24:43] Max-Forwards: 70
[2022-03-01 22:24:43] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:43] Content-Length:  0
[2022-03-01 22:24:43]
[2022-03-01 22:24:43]
[2022-03-01 22:24:43] <--- Transmitting SIP response (578 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:43] SIP/2.0 401 Unauthorized
[2022-03-01 22:24:43] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPj39473a2d-779c-485b-9d90-e9e9828cd1fd
[2022-03-01 22:24:43] Call-ID: 4af2f771-9a30-406e-8c8a-b9f14139c995
[2022-03-01 22:24:43] From: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=60f121e4-5c71-4f18-948a-d197ecb0381a
[2022-03-01 22:24:43] To: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPj39473a2d-779c-485b-9d90-e9e9828cd1fd
[2022-03-01 22:24:43] CSeq: 32515 REGISTER
[2022-03-01 22:24:43] WWW-Authenticate: Digest realm="asterisk",nonce="1646173483/840f6893bdaf5f44ebd7b02cfea4457c",opaque="7a91b22f429d39f8",algorithm=md5,qop="auth"
[2022-03-01 22:24:43] Server: Asterisk
[2022-03-01 22:24:43] Content-Length:  0
[2022-03-01 22:24:43]
[2022-03-01 22:24:43]
[2022-03-01 22:24:43] <--- Received SIP request (895 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:43] REGISTER sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:43] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPje45e4d0e-d49c-4f8a-8a80-fadf42033221
[2022-03-01 22:24:43] From: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=60f121e4-5c71-4f18-948a-d197ecb0381a
[2022-03-01 22:24:43] To: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:43] Call-ID: 4af2f771-9a30-406e-8c8a-b9f14139c995
[2022-03-01 22:24:43] CSeq: 32516 REGISTER
[2022-03-01 22:24:43] Contact: <sip:autotest1@10.55.1.158:16555;line=njvqmtu>
[2022-03-01 22:24:43] Expires: 3600
[2022-03-01 22:24:43] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
[2022-03-01 22:24:43] Max-Forwards: 70
[2022-03-01 22:24:43] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:43] Authorization: Digest username="autotest1", realm="asterisk", nonce="1646173483/840f6893bdaf5f44ebd7b02cfea4457c", uri="sip:PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777", response="f4ec9425bfb44946f82efece211057fe", algorithm=md5, cnonce="9e322afc96e14b3a8e6847af3867f6cc", opaque="7a91b22f429d39f8", qop=auth, nc=00000001
[2022-03-01 22:24:43] Content-Length:  0
[2022-03-01 22:24:43]
[2022-03-01 22:24:43]
[2022-03-01 22:24:43]     -- Added contact 'sip:autotest1@PUBLIC-IP-OF-NAT-SERVER:16555;line=njvqmtu;x-ast-orig-host=10.55.1.158:16555' to AOR 'autotest1' with expiration of 3600 seconds
[2022-03-01 22:24:43] <--- Transmitting SIP response (544 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:43] SIP/2.0 200 OK
[2022-03-01 22:24:43] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPje45e4d0e-d49c-4f8a-8a80-fadf42033221
[2022-03-01 22:24:43] Call-ID: 4af2f771-9a30-406e-8c8a-b9f14139c995
[2022-03-01 22:24:43] From: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=60f121e4-5c71-4f18-948a-d197ecb0381a
[2022-03-01 22:24:43] To: <sip:autotest1@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPje45e4d0e-d49c-4f8a-8a80-fadf42033221
[2022-03-01 22:24:43] CSeq: 32516 REGISTER
[2022-03-01 22:24:43] Date: Tue, 01 Mar 2022 22:24:43 GMT
[2022-03-01 22:24:43] Contact: <sip:autotest1@10.55.1.158:16555;line=njvqmtu>;expires=3599
[2022-03-01 22:24:43] Expires: 3600
[2022-03-01 22:24:43] Server: Asterisk
[2022-03-01 22:24:43] Content-Length:  0
[2022-03-01 22:24:43]
[2022-03-01 22:24:43]
[2022-03-01 22:24:43] <--- Transmitting SIP request (460 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:43] OPTIONS sip:autotest1@PUBLIC-IP-OF-NAT-SERVER:16555;line=njvqmtu SIP/2.0
[2022-03-01 22:24:43] Via: SIP/2.0/UDP PUBLIC-IP-OF-PUBLIC-SERVER:17777;rport;branch=z9hG4bKPjf7cc16bb-043e-464c-b752-da6f99050056
[2022-03-01 22:24:43] From: <sip:autotest1@PUBLIC-IP-OF-PUBLIC-SERVER>;tag=9ab5da30-c7c3-4d45-ba62-81ff246e29fc
[2022-03-01 22:24:43] To: <sip:autotest1@PUBLIC-IP-OF-NAT-SERVER;line=njvqmtu>
[2022-03-01 22:24:43] Contact: <sip:autotest1@PUBLIC-IP-OF-PUBLIC-SERVER:17777>
[2022-03-01 22:24:43] Call-ID: 89f63548-c2c7-422b-93ba-163a2d72357e
[2022-03-01 22:24:43] CSeq: 63425 OPTIONS
[2022-03-01 22:24:43] Max-Forwards: 70
[2022-03-01 22:24:43] User-Agent: Asterisk
[2022-03-01 22:24:43] Content-Length:  0
[2022-03-01 22:24:43]
[2022-03-01 22:24:43]
[2022-03-01 22:24:43] <--- Received SIP response (920 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:43] SIP/2.0 200 OK
[2022-03-01 22:24:43] Via: SIP/2.0/UDP PUBLIC-IP-OF-PUBLIC-SERVER:17777;rport=17777;received=PUBLIC-IP-OF-PUBLIC-SERVER;branch=z9hG4bKPjf7cc16bb-043e-464c-b752-da6f99050056
[2022-03-01 22:24:43] Call-ID: 89f63548-c2c7-422b-93ba-163a2d72357e
[2022-03-01 22:24:43] From: <sip:autotest1@PUBLIC-IP-OF-PUBLIC-SERVER>;tag=9ab5da30-c7c3-4d45-ba62-81ff246e29fc
[2022-03-01 22:24:43] To: <sip:autotest1@PUBLIC-IP-OF-NAT-SERVER;line=njvqmtu>;tag=z9hG4bKPjf7cc16bb-043e-464c-b752-da6f99050056
[2022-03-01 22:24:43] CSeq: 63425 OPTIONS
[2022-03-01 22:24:43] Accept: application/dialog-info+xml, application/xpidf+xml, application/cpim-pidf+xml, application/simple-message-summary, application/pidf+xml, application/pidf+xml, application/dialog-info+xml, application/simple-message-summary, application/sdp, message/sipfrag;version=2.0
[2022-03-01 22:24:43] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
[2022-03-01 22:24:43] Supported: 100rel, timer, replaces, norefersub
[2022-03-01 22:24:43] Accept-Encoding: identity
[2022-03-01 22:24:43] Accept-Language: en
[2022-03-01 22:24:43] Server: Asterisk PBX 18.10.0
[2022-03-01 22:24:43] Content-Length:  0
[2022-03-01 22:24:43]
[2022-03-01 22:24:43]
[2022-03-01 22:24:43]   == Endpoint autotest1 is now Reachable
[2022-03-01 22:24:43]     -- Contact autotest1/sip:autotest1@PUBLIC-IP-OF-NAT-SERVER:16555;line=njvqmtu;x-ast-orig-host=10.55.1.158:16555 is now Reachable.  RTT: 11.020 msec
[2022-03-01 22:24:46] <--- Received SIP request (926 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:46] INVITE sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:46] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPj0703842e-24de-42f1-bbff-107a1f8d9ce6
[2022-03-01 22:24:46] From: "Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=e50cbdb6-6a2e-4e35-8dab-66c38fadbee0
[2022-03-01 22:24:46] To: <sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:46] Contact: <sip:asterisk@10.55.1.158:16555>
[2022-03-01 22:24:46] Call-ID: c6058d9a-fd79-4a9f-a24c-99a05831f9cf
[2022-03-01 22:24:46] CSeq: 30268 INVITE
[2022-03-01 22:24:46] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
[2022-03-01 22:24:46] Supported: 100rel, timer, replaces, norefersub, histinfo
[2022-03-01 22:24:46] Session-Expires: 1800
[2022-03-01 22:24:46] Min-SE: 90
[2022-03-01 22:24:46] Max-Forwards: 70
[2022-03-01 22:24:46] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:46] Content-Type: application/sdp
[2022-03-01 22:24:46] Content-Length:   233
[2022-03-01 22:24:46]
[2022-03-01 22:24:46] v=0
[2022-03-01 22:24:46] o=- 453420192 453420192 IN IP4 10.55.1.158
[2022-03-01 22:24:46] s=Asterisk
[2022-03-01 22:24:46] c=IN IP4 10.55.1.158
[2022-03-01 22:24:46] t=0 0
[2022-03-01 22:24:46] m=audio 16336 RTP/AVP 0 101
[2022-03-01 22:24:46] a=rtpmap:0 PCMU/8000
[2022-03-01 22:24:46] a=rtpmap:101 telephone-event/8000
[2022-03-01 22:24:46] a=fmtp:101 0-16
[2022-03-01 22:24:46] a=ptime:20
[2022-03-01 22:24:46] a=maxptime:150
[2022-03-01 22:24:46] a=sendrecv
[2022-03-01 22:24:46]
[2022-03-01 22:24:46] NOTICE[9452]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>' failed for 'PUBLIC-IP-OF-NAT-SERVER:16555' (callid: c6058d9a-fd79-4a9f-a24c-99a05831f9cf) - No matching endpoint found
[2022-03-01 22:24:46] <--- Transmitting SIP response (581 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:46] SIP/2.0 401 Unauthorized
[2022-03-01 22:24:46] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPj0703842e-24de-42f1-bbff-107a1f8d9ce6
[2022-03-01 22:24:46] Call-ID: c6058d9a-fd79-4a9f-a24c-99a05831f9cf
[2022-03-01 22:24:46] From: "Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=e50cbdb6-6a2e-4e35-8dab-66c38fadbee0
[2022-03-01 22:24:46] To: <sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPj0703842e-24de-42f1-bbff-107a1f8d9ce6
[2022-03-01 22:24:46] CSeq: 30268 INVITE
[2022-03-01 22:24:46] WWW-Authenticate: Digest realm="asterisk",nonce="1646173486/dc5347f441a430d987f9930b967d7ad5",opaque="25a03e0043bcaa00",algorithm=md5,qop="auth"
[2022-03-01 22:24:46] Server: Asterisk
[2022-03-01 22:24:46] Content-Length:  0
[2022-03-01 22:24:46]
[2022-03-01 22:24:46]
[2022-03-01 22:24:46] <--- Received SIP request (456 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:46] ACK sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:46] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPj0703842e-24de-42f1-bbff-107a1f8d9ce6
[2022-03-01 22:24:46] From: "Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=e50cbdb6-6a2e-4e35-8dab-66c38fadbee0
[2022-03-01 22:24:46] To: <sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPj0703842e-24de-42f1-bbff-107a1f8d9ce6
[2022-03-01 22:24:46] Call-ID: c6058d9a-fd79-4a9f-a24c-99a05831f9cf
[2022-03-01 22:24:46] CSeq: 30268 ACK
[2022-03-01 22:24:46] Max-Forwards: 70
[2022-03-01 22:24:46] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:46] Content-Length:  0
[2022-03-01 22:24:46]
[2022-03-01 22:24:46]
[2022-03-01 22:24:46] <--- Received SIP request (1233 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:46] INVITE sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:46] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPj8c0a3ea5-3963-4d38-8362-13d9b0782c11
[2022-03-01 22:24:46] From: "Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=e50cbdb6-6a2e-4e35-8dab-66c38fadbee0
[2022-03-01 22:24:46] To: <sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>
[2022-03-01 22:24:46] Contact: <sip:asterisk@10.55.1.158:16555>
[2022-03-01 22:24:46] Call-ID: c6058d9a-fd79-4a9f-a24c-99a05831f9cf
[2022-03-01 22:24:46] CSeq: 30269 INVITE
[2022-03-01 22:24:46] Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
[2022-03-01 22:24:46] Supported: 100rel, timer, replaces, norefersub, histinfo
[2022-03-01 22:24:46] Session-Expires: 1800
[2022-03-01 22:24:46] Min-SE: 90
[2022-03-01 22:24:46] Max-Forwards: 70
[2022-03-01 22:24:46] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:46] Authorization: Digest username="autotest1", realm="asterisk", nonce="1646173486/dc5347f441a430d987f9930b967d7ad5", uri="sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777", response="0c4caa11ba84f24957b42ccdbc5c026f", algorithm=md5, cnonce="e18dc3d1cd8b47abb2244554e0720b72", opaque="25a03e0043bcaa00", qop=auth, nc=00000001
[2022-03-01 22:24:46] Content-Type: application/sdp
[2022-03-01 22:24:46] Content-Length:   233
[2022-03-01 22:24:46]
[2022-03-01 22:24:46] v=0
[2022-03-01 22:24:46] o=- 453420192 453420192 IN IP4 10.55.1.158
[2022-03-01 22:24:46] s=Asterisk
[2022-03-01 22:24:46] c=IN IP4 10.55.1.158
[2022-03-01 22:24:46] t=0 0
[2022-03-01 22:24:46] m=audio 16336 RTP/AVP 0 101
[2022-03-01 22:24:46] a=rtpmap:0 PCMU/8000
[2022-03-01 22:24:46] a=rtpmap:101 telephone-event/8000
[2022-03-01 22:24:46] a=fmtp:101 0-16
[2022-03-01 22:24:46] a=ptime:20
[2022-03-01 22:24:46] a=maxptime:150
[2022-03-01 22:24:46] a=sendrecv
[2022-03-01 22:24:46]
[2022-03-01 22:24:46] NOTICE[25303]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>' failed for 'PUBLIC-IP-OF-NAT-SERVER:16555' (callid: c6058d9a-fd79-4a9f-a24c-99a05831f9cf) - No matching endpoint found
[2022-03-01 22:24:46] NOTICE[25303]: res_pjsip/pjsip_distributor.c:676 log_failed_request: Request 'INVITE' from '"Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>' failed for 'PUBLIC-IP-OF-NAT-SERVER:16555' (callid: c6058d9a-fd79-4a9f-a24c-99a05831f9cf) - Failed to authenticate
[2022-03-01 22:24:46] <--- Transmitting SIP response (581 bytes) to UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:46] SIP/2.0 401 Unauthorized
[2022-03-01 22:24:46] Via: SIP/2.0/UDP 10.55.1.158:16555;rport=16555;received=PUBLIC-IP-OF-NAT-SERVER;branch=z9hG4bKPj8c0a3ea5-3963-4d38-8362-13d9b0782c11
[2022-03-01 22:24:46] Call-ID: c6058d9a-fd79-4a9f-a24c-99a05831f9cf
[2022-03-01 22:24:46] From: "Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=e50cbdb6-6a2e-4e35-8dab-66c38fadbee0
[2022-03-01 22:24:46] To: <sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPj8c0a3ea5-3963-4d38-8362-13d9b0782c11
[2022-03-01 22:24:46] CSeq: 30269 INVITE
[2022-03-01 22:24:46] WWW-Authenticate: Digest realm="asterisk",nonce="1646173486/dc5347f441a430d987f9930b967d7ad5",opaque="42cd268577b8b0a5",algorithm=md5,qop="auth"
[2022-03-01 22:24:46] Server: Asterisk
[2022-03-01 22:24:46] Content-Length:  0
[2022-03-01 22:24:46]
[2022-03-01 22:24:46]
[2022-03-01 22:24:46] <--- Received SIP request (456 bytes) from UDP:PUBLIC-IP-OF-NAT-SERVER:16555 --->
[2022-03-01 22:24:46] ACK sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER:17777 SIP/2.0
[2022-03-01 22:24:46] Via: SIP/2.0/UDP 10.55.1.158:16555;rport;branch=z9hG4bKPj8c0a3ea5-3963-4d38-8362-13d9b0782c11
[2022-03-01 22:24:46] From: "Anonymous" <sip:anonymous@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=e50cbdb6-6a2e-4e35-8dab-66c38fadbee0
[2022-03-01 22:24:46] To: <sip:01@PUBLIC-HOSTNAME-OF-PUBLIC-SERVER>;tag=z9hG4bKPj8c0a3ea5-3963-4d38-8362-13d9b0782c11
[2022-03-01 22:24:46] Call-ID: c6058d9a-fd79-4a9f-a24c-99a05831f9cf
[2022-03-01 22:24:46] CSeq: 30269 ACK
[2022-03-01 22:24:46] Max-Forwards: 70
[2022-03-01 22:24:46] User-Agent: Asterisk PBX 18.10.0
[2022-03-01 22:24:46] Content-Length:  0

Either set the “from_user” field on the endpoint on “NAT server” to the name of the endpoint on “PUBLIC server” to match, or set “identify_by” to “auth_username” on “PUBLIC server” for the respective endpoint.

All right, so it appears it works if both line = yes and from_user are set on the NAT server. I guess from_user is necessary when registering to an Asterisk server that uses PJSIP, but not if registering to an Asterisk server that uses SIP.

As far as auth_username goes, this is what I had been using on the public side hitherto:

type = global
user_agent = Asterisk
endpoint_identifier_order = username,ip,anonymous

My usernames and auth IDs for endpoints are always the same, so wouldn’t this capture essentially the same thing? Your comments here make it sound like you need one or the other: PJSIP trunk to another Asterisk 13 server unable to authenticate unless I set from_user = username - #20 by jcolp
I always want to match on username for any endpoint, not IP, because otherwise multiple registrations/endpoints from the same IP address can get mixed up.

Either setting from_user or using identify_by with auth_username will work. They just work differently on how to match an endpoint.

username = Uses the username in the From header
auth_username = Uses the authentication username in the authentication header

1 Like

Got it, thanks file! It looks like I actually had identify_by = username in my template. I thought that was the correct setting to force it to use username as opposed to the IP address.

I guess I was only halfway right - seems like I really care about the auth ID, not the username, so I’ve changed that as well in the template for all endpoints. I presume this will be the most resilient method, and correctly handle any endpoint registrations no matter what variation may be in play, e.g.:

Accuracy at properly handling inbound registrations / endpoints:
auth ID > username > IP address (default).

Okay, scratch what I just said:

Changing identify_by = username to auth_username globally causes 95% of endpoints to start erroring out with this: No matching endpoint found

Changing this back immediately stops that. So I guess this isn’t really a viable solution.

Sure, I could set it per endpoint, but Asterisk shouldn’t need to know or care that another Asterisk is registering to it as opposed to an ATA. Since this is a configurable option I guess somehow chan_sip automagically handled all cases just fine implicitly.

So the right way seems to be from_user on whatever’s doing the registering, and I guess non-Asterisk does this implicitly/automatically since I’ve never encountered this issue before.

Almost every endpoint sets the From username to the username to use. It’s also required to be set when Asterisk is communicating to many ITSPs.

I won’t exert any mental thought on anything chan_sip as to explaining how or why it could work.

Almost every endpoint sets the From username to the username to use. It’s also required to be set when Asterisk is communicating to many ITSPs.

So then why does PJSIP not do this by default? It seems like from_user should default to being the username, as opposed to whatever it is currently by default. Would it be appropriate to make this the default? I can’t think what the use case of not having it this way would be.

Additionally, from_user is not a global setting, so it means we need an extra line for every outbound registration, which will bulk up configs, presuming there is nothing like “default_from_user = username” to do that automatically.

By default it is the caller ID. If you defaulted from_user to a constant, and didn’t provide an alternative means of signalling caller ID, all your phones would show that constant as the caller ID!

No, we’re not changing or making it the default. It’s not necessary when contacting phones for example. It’s only usually needed when contacting an ITSP really, or another Asterisk. The vast majority of endpoints aren’t those, and for normal endpoints it can carry Caller ID information.

No, there is no default_from_user option or anything like that. Adding it would also be problematic because then you’d need the ability to disable it on a per endpoint basis for the vast majority of endpoints on a normal system most likely, which you can’t do by setting “from_user” to empty.

Please don’t touch that stuff.

One thing I would note is that you were getting the headline failure message when you weren’t registered. At that point, without a match on from_user, you would be treated as a hacker and given a dummy 401 to avoid revealing information about what was actually allowed.

Whilst I think that documentation on matching is rather weak, my suspicion is that registrations are matched against type=aor, and create an, invisible, identify by IP rule. That would seem the most sensible thing, but I don’t really know.

Incidentally, register requests should be matched against to_user (which is set as part of client URI, not separately), although from_user should be used for authentication purposes, if checking the user name.

Registrations in chan_pjsip don’t cause any IP based matching, unlike chan_sip.

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