UniFi VoIP - Asterisk: SIP Configuration


Overview


Readers will learn how to configure a SIP account in Asterisk, and configure SIP settings in the UVP.

NOTES & REQUIREMENTS: 
User will require some experience using linux text based editors like nano or vim. Minimum Asterisk SIP Configuration Requirements:
  • Server
  • User name
  • Password

Table of Contents


  1. Creating an Extension for the UVP on Asterisk
  2. Configuring the UVP with SIP Settings
  3. Related Articles

Creating an Extension for the UVP on Asterisk PBX


Back to Top

Typically, the file containing the extensions resides in /etc/asterisk/sip.conf

NOTE: User will need to use vi or nano here. example vi /etc/asterisk/sip.conf or nano /etc/asterisk/sip.conf

To add extension 100 you would have to add the following text snippet to this file:

[100]
type=friend
host=dynamic
disallow=all
allow=ulaw
qualify=1000
canreinvite=no
nat=force_rport
dtmfmode=rfc2833
context=from-internal
username=100
callerid=Your Name <100>
secret=password
dial=SIP/100 

To be able to call this extension you will need to hook it up to the corresponding dialplan. Normally, the file containing the dialplan resides in /etc/asterisk/extensions.conf. We would need to create the context from-internal which is what we specified as the outbound context for the SIP extension 100. 

[from-internal]
exten => 100,1,Dial(SIP/${EXTEN}|40|Ttr)

Configuring the UVP with SIP Settings


Back to Top

If you have not already followed the Initial Configuration steps in this article Standalone UniFi VoIP Phone Configuration Guide please complete these before continuing.  If you have any questions about the following settings or what they mean please refer to the article above in the SIP Configuration section. 

1. Enter the SIP settings that you configured in Asterisk above.

  • Server: Server IP (or hostname) for Asterisk server
  • User name: SIP Username
  • Password: SIP Password (secret above)

UVPAccount-Asterisk.png

Sample Asterisk log showing the UVP has registered.

    -- Registered SIP '100' at XX.XX.XX.XX:1024
[Jun  3 13:36:06] NOTICE[4093]: chan_sip.c:23522 handle_response_peerpoke: Peer '100' is now Reachable. (139ms / 5000ms)

2. Navigate back to the UVP App home screen. It should be connected and allow you to call if your Asterisk server is set up for outbound calls (SIP, IAX, PRI, etc).

UVPHome-Asterisk.png


We're sorry to hear that!