SIP authentication and context name

Hello everyone

Let’s say I have a peer configured in sip.conf:

[peer1] secret=blah
Right now I configure the sip client with username peer1 and password blah to register with my asterisk. Is it possible to use different username for registration then a context name? I mean could I use something like:

[peer1] username_for_authentication=MySipClient secret=blah
and then specify MySipClient/blah as username/password pair in sip client config.

Thanks in advance

There is no context name here!

There is an address of record and an authentication user. Most people do not have a distinct authentication user.

The address of record normally matches the section name, although there is a configuration option to make it match the phone’s authentication user.

Address of record is a concept for register. If you uses type=peer, which is best practice, in most cases, the section name is only used for register, otherwise it is matched against From, or is it contact, on invites. If you use static addresses, and type=peer, no matching is done at all.

The address of record should not be easily guessable (the common GUIs are very bad in this respect), and, as such, shouldn’t be a security issue.

If you use a separate authentication user, the sip.conf option to specify it should be fairly obvious from the sample configuration, as should be the option to match by that, rather than the address of record.

Thanks a lot for your reply. I didn’t understand this part. The only “obvious” config option I could find was “username” but as far as I understand it is used for other things.


You may be right that there is no way of setting both the address of record and an authentication user