Pjsip configure issues with linphone app

Hi!
I was following the guide at
https://wiki.asterisk.org/wiki/display/AST/res_pjsip+Configuration+Examples

to setup a softphone (linphone)
My Asterisk pjsip.conf is as follows:

; This file is overwritten by Ansible

; TRANSPORT
 
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0

; ENDPOINT TEMPLATES
 
[endpoint-basic](!)
type = endpoint
context = from-internal
force_rport = no
disallow = all
allow = g722
allow = ulaw
allow = alaw
 
[userpass-basic](!)
type = auth
auth_type = userpass
 
[single-reg-basic](!)
type = aor
max_contacts = 1

; Phones

; Extension === 101 ===
[101](endpoint-basic)
auth = auth101
aors = aor101
; trust_id_outbound = yes
callerid = Daddy <101>
dtmf_mode = rfc4733

[auth101](userpass-basic)
username=acwn-phone-101
password=<securepassword>

[aor101](single-reg-basic)
max_contacts = 1

I get the following error:

[Mar 20 13:40:15] DEBUG[27001] res_pjsip_endpoint_identifier_user.c: Attempting identify by From username 'acwn-phone-101' domain 'server01.acwn.de'
[Mar 20 13:40:15] DEBUG[27001] res_pjsip_endpoint_identifier_user.c: Endpoint not found for From username 'acwn-phone-101' domain 'server01.acwn.de'
[Mar 20 13:40:15] DEBUG[27001] res_pjsip_endpoint_identifier_user.c: Attempting identify by Authorization username 'acwn-phone-101' realm 'asterisk'
[Mar 20 13:40:15] DEBUG[27001] res_pjsip_endpoint_identifier_user.c: Endpoint not found for Authentication username 'acwn-phone-101' realm 'asterisk'
[Mar 20 13:40:15] NOTICE[27001] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Daddy" <sip:acwn-phone-101@server01.acwn.de>' failed for '109.40.64.68:3468' (callid: Ut5dyzRa8F) - No matching endpoint found
[Mar 20 13:40:15] DEBUG[27001] res_pjsip_authenticator_digest.c: Calculated nonce 1553085615/01286b0424c87202343b559f86c87ab4. Actual nonce is 1553085615/01286b0424c87202343b559f86c87ab4
[Mar 20 13:40:15] NOTICE[27001] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"Daddy" <sip:acwn-phone-101@server01.acwn.de>' failed for '109.40.64.68:3468' (callid: Ut5dyzRa8F) - Failed to authenticate

As far as I understand the error message, there is no matching endpoint and so the authentication fails. So my question is what is missing here? Any ideas are much appreciated.

Thanks in advance
Alexander

Your softphone appears to be configured for a username of “acwn-phone-101” and not “101”. I’d suggest using the same username everywhere, as some endpoints don’t like things being different - and we can’t find things appropriately.

Thanks for your answer.
But in the section [auth101] I have the username acwn-phone-101
That should work that credentials.
I don’t think that the extension 101 and the username in auth101 must be the same.

I wouldn’t expect it to look that deeply. I’d expect it to match against the information in an endpoint section and only then worry about authentication.

David is correct in his analysis.

The From username or the authentication username is used to find the endpoint, so it has to match the name of the endpoint.

I see. Then I think I have to add “from_user” and “from_domain” options to the endpoint config?

No, those are not necessary. Those configure the From username and From domain which are placed in outgoing messages. This may be necessary for ITSPs, but is not for endpoints.

You need to change the contents of the square brackets naming the section.

I got it now !! :smiley:

I had to change the name of the aor as well.
Why does the aor entry has to be the same name like the endpoint?

Thank you very much for your help to both of you!

Here is the config that works.

; Extension === 101 ===
[acwn-phone-101](endpoint-basic)
auth = auth101
aors = acwn-phone-101
callerid = Daddy <101>

[auth101](userpass-basic)
username=acwn-phone-101
password=<supersecure>

[acwn-phone-101](single-reg-basic)
max_contacts = 1

Some endpoints simplify things quite a lot - and have an assumption that the username, auth username, and AOR will all be the same. That can then impose the requirement on Asterisk.