VoIP Phones - FreePBX - chan sip: Difference between revisions

Back up to the VoIP Configuring page
From AAISP Support Site
(→‎top: clean up)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<indicator name="VoIPConfiguring">[[File:menu-voip.svg|link=:Category:VoIP Phones|30px|Back up to the VoIP Configuring page]]</indicator>
[[File:Freepbx_logo.png]]
[[File: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]] '''


*[[IPv6]] Works!
*[[IPv6]] Works!
Line 5: Line 8:
FreePBX is based on [[VoIP Phones - Asterisk|Asterisk]] - you may wish to read this page for more background information.
FreePBX is based on [[VoIP Phones - Asterisk|Asterisk]] - you may wish to read this page for more background information.


These instructions were last tested on FreePBX 2.11.0.23.
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=
=Setting up your A&A trunk=
==Configuration in FreePBX Web UI==
Log into your FreePBX administration interface and go to '''Connectivity, Trunks''' - then select '''Add SIP Trunk'''.
Log into your FreePBX administration interface and go to '''Connectivity, Trunks''' - then select '''Add SIP Trunk'''.


Fill out the fields as below:
Fill out the fields as below:


===General Settings===
==General Settings==
* '''Trunk Name:''' A descriptive name for the trunk - enter whatever you wish.
* '''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.
* '''Outbound CallerID:''' The caller ID you will use for calls made on this trunk. I entered my phone number in the format: 01234567890.
Line 22: Line 24:
* '''Disable Trunk:''' Make sure "Disable" is not ticked.
* '''Disable Trunk:''' Make sure "Disable" is not ticked.


===Dialed Number Manipulation Rules===
==Dialed Number Manipulation Rules==
I left this entire section alone.
I left this entire section alone.


===Outgoing Settings===
==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.
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:''' <code>out-01234567890</code><br />
'''Trunk Name:''' <code>out-01234567890</code><br />
'''PEER Details:''' <pre>host=voiceless.aa.net.uk
'''PEER Details:''' <pre>host=voiceless.aa.net.uk
username=+441234567890
secret=YOUR-OUTGOING-PASSWORD-HERE
type=peer
type=peer
username=+441234567890
insecure=invite</pre>
remotesecret=YOUR-OUTGOING-PASSWORD-HERE
transport=udp
disallow=all
allow=alaw
qualify=yes
</pre>


===Incoming Settings===
==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.
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.


Line 45: Line 51:


'''USER Context:''' <code>in-01234567890</code>
'''USER Context:''' <code>in-01234567890</code>
'''USER Details:''' <pre>secret=YOUR-INCOMING-PASSWORD-HERE
'''USER Details:''' <pre>type=user
type=peer
context=from-trunk
context=from-trunk
username=in-01234567890
insecure=invite</pre>
remotesecret=YOUR-INCOMING-PASSWORD-HERE
transport=udp
disallow=all
allow=alaw
trustrpid=yes</pre>


===Registration===
==Registration==
If your FreePBX is behind a NAT you may need to enter a registration string here.
If your FreePBX is behind a NAT you may need to enter a registration string here.


If you FreePBX is not behind a NAT, you should not use registration if possible.
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.
More details can be found on the [[VoIP Phones - Asterisk]] article.


==Fix for incoming calls==
==Fixing incoming calls==
In order for FreePBX to recognise incoming calls from the voiceless.aa.net.uk platform, we must change a FreePBX setting:
After using the above for a while, you may well find that your incoming calls randomly stop working - this is because they are being rejected by Asterisk as it does not recognise the incoming calls properly.


Go to '''Settings, Asterisk SIP Settings''', then click on '''Chan SIP'''.
This can be fixed by manually adding some fixes to <code>/etc/asterisk/sip_custom_post.conf</code>:
<pre>
; IPv4 voiceless addresses for 01234567890
[in-01234567890-a4](in-01234567890)
host=a4.voiceless.aa.net.uk
[in-01234567890-b4](in-01234567890)
host=b4.voiceless.aa.net.uk
[in-01234567890-c4](in-01234567890)
host=c4.voiceless.aa.net.uk
[in-01234567890-d4](in-01234567890)
host=d4.voiceless.aa.net.uk
[in-01234567890-e4](in-01234567890)
host=e4.voiceless.aa.net.uk
[in-01234567890-f4](in-01234567890)
host=f4.voiceless.aa.net.uk
[in-01234567890-g4](in-01234567890)
host=g4.voiceless.aa.net.uk
[in-01234567890-h4](in-01234567890)
host=h4.voiceless.aa.net.uk
[in-01234567890-i4](in-01234567890)
host=i4.voiceless.aa.net.uk
[in-01234567890-j4](in-01234567890)
host=j4.voiceless.aa.net.uk


Scroll to the bottom of the page and find the '''Other SIP Settings''' entry.
; [[IPv6]] voiceless addresses for 01234567890
[in-01234567890-a6](in-01234567890)
host=a6.voiceless.aa.net.uk
[in-01234567890-b6](in-01234567890)
host=b6.voiceless.aa.net.uk
[in-01234567890-c6](in-01234567890)
host=c6.voiceless.aa.net.uk
[in-01234567890-d6](in-01234567890)
host=d6.voiceless.aa.net.uk
[in-01234567890-e6](in-01234567890)
host=e6.voiceless.aa.net.uk
[in-01234567890-f6](in-01234567890)
host=f6.voiceless.aa.net.uk
[in-01234567890-g6](in-01234567890)
host=g6.voiceless.aa.net.uk
[in-01234567890-h6](in-01234567890)
host=h6.voiceless.aa.net.uk
[in-01234567890-i6](in-01234567890)
host=i6.voiceless.aa.net.uk
[in-01234567890-j6](in-01234567890)
host=j6.voiceless.aa.net.uk
</pre>


In the first field, enter <code>match_auth_username</code>, and in the second field enter <code>yes</code>.
This seems to keep incoming calls working OK.


[[File:Freepbx_other_sip_settings.png]]
You will need to force Asterisk to reload the configuration files for this to take effect - this can be done by restarting Asterisk or by running <code>asterisk -rx 'reload'</code>.


Then click '''Submit Changes'''!
If you are using the test voiceless server for any reason, you will also need to add those addresses to your <code>/etc/asterisk/sip_custom_post.conf</code>:
<pre>
; voiceless test server addresses for 01234567890
[in-01234567890-z4](in-01234567890)
host=z4.voiceless.aa.net.uk
[in-01234567890-z6](in-01234567890)
host=z6.voiceless.aa.net.uk
</pre>


=Making IPv6 work=
=Making IPv6 work=
Line 144: Line 104:
*Also see the [[VoIP Security]] page for information about securing your VoIP service.
*Also see the [[VoIP Security]] page for information about securing your VoIP service.



[[Category:VoIP]]
[[Category:VoIP Phones]]
[[Category:VoIP Phones|FreePBX]]
[[Category:VoIP IPv6]]

Latest revision as of 00:24, 18 August 2018

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.