VoIP Phones - FreePBX - chan sip
- IPv6 Works!
FreePBX is based on Asterisk - you may wish to read this page for more background information.
These instructions were last tested on FreePBX 12.0.76.2 - from the FreePBX Distro installer with Asterisk 11.19.0.
Setting up your A&A trunk
Log into your FreePBX administration interface and go to Connectivity, Trunks - then select Add SIP Trunk.
Fill out the fields as below:
General Settings
- Trunk Name: A descriptive name for the trunk - enter whatever you wish.
- Outbound CallerID: The caller ID you will use for calls made on this trunk. I entered my phone number in the format: 01234567890.
- CID Options: Set this as you prefer. I left it set to "Allow Any CID".
- Maximum Channels: Leave this blank.
- Asterisk Trunk Dial Options: Leave this blank and make sure "Override" isn't ticked.
- Continue if Busy: Set this as you prefer.
- Disable Trunk: Make sure "Disable" is not ticked.
Dialed Number Manipulation Rules
I left this entire section alone.
Outgoing Settings
These are your outgoing call settings - for calls you make from your phone through voiceless. These settings can be found under the "SIP Phone" heading in clueless for your number.
Trunk Name: out-01234567890
PEER Details:
host=voiceless.aa.net.uk type=peer username=+441234567890 remotesecret=YOUR-OUTGOING-PASSWORD-HERE transport=udp disallow=all allow=alaw qualify=yes
Incoming Settings
These are your incoming call settings - for calls you receive from voiceless. These settings can be found under the "To your server via SIP" heading in clueless for your number.
My settings in clueless look like the following:
In FreePBX, I entered the following:
USER Context: in-01234567890
USER Details:
type=user context=from-trunk username=in-01234567890 remotesecret=YOUR-INCOMING-PASSWORD-HERE transport=udp disallow=all allow=alaw trustrpid=yes
Registration
If your FreePBX is behind a NAT you may need to enter a registration string here.
If there is no NAT between your FreePBX and voiceless, you should not use registration if possible.
More details can be found on the VoIP Phones - Asterisk article.
Fixing incoming calls
In order for FreePBX to recognise incoming calls from the voiceless.aa.net.uk platform, we must change a FreePBX setting:
Go to Settings, Asterisk SIP Settings, then click on Chan SIP.
Scroll to the bottom of the page and find the Other SIP Settings entry.
In the first field, enter match_auth_username
, and in the second field enter yes
.
Then click Submit Changes!
Making IPv6 work
You may notice that out of the box your FreePBX install will not talk IPv6. This is because by default it configures Asterisk to only listen on IPv4.
This can be fixed!
- Log into the FreePBX administration UI.
- Go to Settings, Asterisk SIP Settings.
- Scroll down to Advanced General Settings.
- Change Bind Address to an IPv6 Address.
::
can be used for binding to all available IPv6 and IPv4 addresses. - Scroll to the bottom and click Submit Changes.
Setting your audio settings
For best results, your FreePBX install should be set up to use only alaw audio.
To set this up, do the following:
- Log into the FreePBX administration UI.
- Go to Settings, Asterisk SIP Settings.
- Scroll to Audio Codecs.
- In the list of codecs, untick every codec except alaw.
- Scroll to the bottom and click Submit Changes.
Firewall & Security
- You will also want to set up firewall rules, as per the VoIP Firewall page.
- Also see the VoIP Security page for information about securing your VoIP service.