Peer id vs username

Let’s say we have this peer definition:

[some_peer_id] host = username = provider secret = **** context = from-provider

username is ONLY used to authenticate outgoing calls to the peer. It has no meaning when the peer registers to our server, and no meaning when authenticating incoming calls from the peer. In both cases peer identifier (some_peer_id) is matched instead.

My provider gave me a user name like “&#$%KDS&^%”. Now (when I want incoming calls to be authenticated) I need to have this peer definition:

[*&#$%KDS&*^%] host = username = *&#$%KDS&*^% secret = **** context = from-provider
and use this application to make calls:

Is it possible to change this behavior? To authenticate calls based on some parameter not peer ID?

Version: and (from

Best current practice for Asterisk would lead to a section name somewhat like this, anyway.

Best current practice is a wishful thinking as most people using asterisk use FreePBX.
FreePBX does not allow non-numeric section names.
This is not only convenience, but also a serious security issue. I tried to open a bug
but it did not go anywhere.
I find it strange asterisk devs decided to overload the section name and use it as authentication credentials,
instead of having a separate option for auth name.
This is a bad design and also confusing to lots of newcomers.
I’d love to be the fly on the wall when this decision was discussed :wink: