Peer id vs username

Let’s say we have this peer definition:

[some_peer_id] host = some.address.com 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 = some.address.com 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: 1.8.5.0 and 1.8.10.0 (from packages.asterisk.org/deb).

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
issues.asterisk.org/jira/browse/ASTERISK-18266
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: