VoIP Phones - FreePBX - chan sip

Back up to the VoIP Configuring page
From AAISP Support Site
Revision as of 00:24, 18 August 2018 by Reedy (talk | contribs) (→‎top: clean up)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Freepbx logo.png

2016-11 The information below is for an older version of FreePBX - newer versions use 'pjsip' rather than 'chan_sip', see: VoIP Phones - FreePBX

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:

Clueless to your server settings.png

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.

Freepbx other sip settings.png

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!

  1. Log into the FreePBX administration UI.
  2. Go to Settings, Asterisk SIP Settings.
  3. Scroll down to Advanced General Settings.
  4. Change Bind Address to an IPv6 Address. :: can be used for binding to all available IPv6 and IPv4 addresses.
  5. 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:

  1. Log into the FreePBX administration UI.
  2. Go to Settings, Asterisk SIP Settings.
  3. Scroll to Audio Codecs.
  4. In the list of codecs, untick every codec except alaw.
  5. 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.