If "Registration" is "Receive", the user name used for SIP authentication is the "Trunk Name" in the GUI.

Nice to meet you.
I am Japanese and not fluent in English, so I will use DeepL translation.
I apologize if my meaning is not understood or if there are any rude phrases.

We are currently using FreePBX 16.0.21.18 and Asterisk 18.13.0.
I have a VoIP gateway called VE-AG1 as a trunk, but when I tried to install HT813 as a spare, “401 Authentication Failed” kept coming up when I tried to register it with FreePBX, and I could not register it.

I knew that “Registration” is “Receive” when registering HT813 to FreePBX, but when I checked “Username”, “Auth username” and “Secret”, there was no mistake and I was at a loss.

Finally, I realized that when “Registration” is “Receive”, the username used for SIP authentication is the “Trunk Name” in the GUI.
If “Registration” is “Send”, “Username” or “Auth username” is used.
I set “Trunk Name” in FreePBX to “SIP User ID” in HT813, and was able to register.

I have to preface this question, but is it normal that when “Registration” is set to “Receive”, the username used for SIP authentication is the “Trunk Name” in the GUI?
Or is it a bug?
Also, is this a problem specific to my environment?

It’s normal. It’s how Asterisk works. The type=aor section name (or type=peer/friend one) is used to identify incoming registrations by name.

(chan_sip uses the section name of type=user (and the type=user part of type=friend), to match INVITEs, but registration is only for dynamic host peers, including the peer element of type=friend.)

1 Like

Thanks for the reply.
I am relieved to hear that it is not a bug.
I forgot to add one piece of information.
My environment is working with pjsip.
But I guess it is just Asterisk’s specification, so it works the same whether it is sip or pjsip.

However, I feel that “Username” and “Auth Username” on the GUI are confusing…
In my current VE-AG1, I was able to authenticate using “Username” or “Auth Username” and it was not affected by the trunk name, so I did not think that just changing to “Receive” would change the ID used for registrations…
The Asterisk log also showed “Failed to authenticate”, so I checked only the items related to authentication.

However, if the SIP user ID section used for authentication changes between “Send” and “Receive” according to Asterisk’s specifications, I guess the only way is for the user to understand the behavior correctly…
I learned a lot this time.
Thank you very much.

One thing I noticed.
If “Authentication” is set to “Inbound”, the “Username” and “Auth username” fields will be marked “username is trunk name” and each cannot be entered.

If “Registration” is set to “Receive”, the trunk name is used.
Why not disable the entry in the same way as above?
If I set “Receive”, are the values I set for “Username” and “Auth username” used anywhere?