First, we will create the user/phone account in sip.conf:
[phone1] type=friend context=from-internal defaultusername=phone1 secret=password1111 ;; *change this!* host=dynamic qualify=yes ;; keep NAT open canreinvite=no mailbox=20 ;; voicemail boxl
This creates a SIP phone called “phone1”, with the username “phone1”, using the password “password1111”. This also links it to the from-internal context in extensions.conf where I have the rest of my extensions. If you want it to go to a different part of the configuration, change that line here.
Now, edit voicemail.conf and add the new mailbox (The default context is quite a ways down):
[default] ; Note: The rest of the system must reference mailboxes defined here as mailbox@default. 20 => 20,User1,firstname.lastname@example.org
In the Asterisk console, reload:
In the SIP client, the SIP address is now email@example.com. The password is what was set in sip.conf. You should now be able to dial other extensions! In some SIP clients, you may need to turn off/disable sRTP Encryption.
Now, the next thing we could do is make the SIP phone an extension in Asterisk. Edit extensions.conf and add the following to [from-internal] context (or whatever your normal extensions context is):
exten => 300,1,Dial(SIP/phone1,20)
In the Asterisk console, reload the dialplan:
Your SIP phone is now extension 300!
There are a TON of different options for SIP phones, so this is just the beginning.