FreePBX
There are two ways to register the FreePBX based on registration and based on IP address.
FreePBX Registration
This guide assumes you have performed a clean installation of FreePBX. First, we will retrieve the Account ID and corresponding password for the VoIP trunk from the portal. This guide is based on registering the trunk. This setup is ideal for internet lines where the external IP address changes.
It is important to have a good router with SIP ALG disabled. Our experiences with various routers are listed in the Router Compatibility List. Firewall settings can be found on the General Firewall Settings page. More information on a successful VoIP implementation can be found on the following page.
Configuration
Portal
- Log in to the portal.
- Go to "VoIP Trunk" under "Management" and click the 'edit' icon next to the VoIP trunk.
- In the overview, you will see the "Account ID" and corresponding "Password." Note these down.
General Trunk Settings
- Log in to your FreePBX server and click "Trunks" under the "Connectivity" section.
- Next, click "+ Add Trunk" and select "+ Add SIP (chan_pjsip) Trunk."
- Enter the following information under "General":
- 'Trunk Name': SIP Trunk
- 'Outbound CallerID': <Phone number in +31 format>
- Click on the "pjsip Settings" tab:
- Enter the 'Account ID' in the 'Trunk Name' field.
- Enter the corresponding password for the 'Account ID' in the 'Secret' field.
- Enter 'ha.voys.nl' in the 'SIP Server' field.
- Enter '5060' or '6060' in the 'SIP Server Port' field. Both ports are active on our side, so if 5060 doesn’t work, you can use 6060.
Leave the remaining settings that have not been addressed as they are.

Click on the "Dialed Manipulation Rules" tab:
- Enter 'X.' in the 'Match Pattern' field.
Click on the "Advanced" tab under "pjsip Settings":
- Select 'RFC 4733' for 'DTMF'.
- Select 'Yes' for 'Trust RPID/PAI'.
- Select 'Send P-AssertedIdentity header' for 'Send RPID/PAI'.
Leave the remaining settings that have not been addressed as they are.

- Click on "Submit".
Setting Up Incoming Numbers
- Go to "Connectivity" and then "Inbound Routes".
- Click on '+ Add Inbound Route'.
- Enter the following:
- Description: <Name of incoming route>
- DID Number: <Number in +31 format>
- To test the connection, set "Set Destination" to "Terminate Call" and "Put caller on hold forever".
- Click "Submit", then click "Apply Config" at the top.
When you now dial the number, you will hear hold music.

Adding an Account
To add a phone account, click on "Applications" and then "Extensions".
Next, click "+ Add Extension" and select, for example, "Add New PJSIP Extension".
- In "User Extension", enter the internal number of the phone, e.g., 201.
- In "Display Name", enter the name of the user, e.g., Jan Jansen.
- Under "Outbound CID", enter the number that the user should display when making outbound calls.
- Click "Submit" and then "Apply Config".
You can now register the account on a phone. The username is the "User Extension," and the password is what is listed under "Secret." The server to connect to is the IP address of your PBX.
Making Outbound Calls
To make outbound calls, you need an "Outbound Route." In the "Outbound Route," you set the number to dial and the trunk you wish to use.
- Go to "Connectivity" and then "Outbound Routes."
- Click "+ Add Outbound Route."
- Enter "default" for "Route Name."
- Under "Trunk Sequence for Matched Routes," select "SIP Trunk."
Under the "Dial Patterns" section, enter "X." (X followed by a dot) in the "Match Pattern" field. This ensures that all outbound calls will go through this trunk.

- Click "Submit" and then click "Apply Changes" at the top.
You can now make outbound calls with your VoIP phone. To receive calls, update the "Inbound Route" to your extension.
Encrypted Calling
It is possible to encrypt both incoming and outgoing calls.
To enable this, you need to make some changes in both the portal and FreePBX.
Portal
- Log in to the portal.
- Go to "VoIP Trunk" under "Management" and click the 'edit' icon next to the VoIP trunk.
- Click on "Advanced (SIP) Settings" on the left.
- Check "Force Encryption" under the "Advanced (SIP) Settings".
- A pop-up will appear, and in the pop-up, click "Continue".
- At the bottom of the page, click "Save".

FreePBX
Activating TLS
- Click on "Settings" and then select "Asterisk SIP Settings."
- Next, select the "SIP Settings [chan_pjsip]" tab.
- Change the "Certificate Manager" to 'default'.
- Change the "SSL Method" to 'tlsv1_2'.
- Set "Verify Server" to 'No'.
- Set "tls - 0.0.0.0 - All" to 'Yes'.
- Click "Submit", and then click "Apply Changes" at the top.

- Under the "Connectivity" section, click on "Trunks."
- Click the 'edit' icon next to the VoIP trunk.
- Click on the "pjsip Settings" tab.
- Change 'SIP Server' to 'sip.encryptedsip.com'.
- Change 'SIP Server Port' to '5061'.
- Select '0.0.0.0-tls' for 'Transport'. (If you don't see this option, TLS is not properly activated; please repeat the TLS activation steps.)
- Click "Submit", and then click "Apply Changes" at the top.

In version 16.0.40.7, TLS doesn't work immediately. You need to restart the server to activate it. To do this, go to 'Admin' -> 'System Admin', then click on 'Power Options' on the right and select 'Reboot'.
More Information
More information and documentation can be found on the FreePBX wiki.
FreePBX IP Address
This guide assumes that you have performed a clean installation of FreePBX. In the online management interface, you will find the Account ID and your password. The Custom Proposition only allows you to create a trunk, whereas this option is not available with the Complete Proposition due to the FUP (Fair Use Policy). This guide assumes that the platform delivers calls to a specific IP address and port. If your PBX is behind a router, it is necessary to create a port forward for port 5060. Ensure that you only accept traffic from the network 195.35.114.0/23 and 2a06:2a80::/29 (IPv6).
If you have a dynamic WAN address, it is better to use registration, see FreePBX (Registration). However, a trunk based on IP is preferred due to Asterisk's fail-over method.
It is important to have a good router with SIP ALG disabled. Our experiences with various routers are listed in the Router Compatibility List. Firewall settings can be found on the General Firewall Settings page. More information about a successful VoIP implementation can be found on the following page.
Configuration
Step 1 - General Trunk Settings
This guide assumes that you have performed a clean installation of FreePBX. First, we will retrieve the Account ID and password for the VoIP trunk from the portal, and set a static IP in the VoIP trunk settings.
Note: A static IP address is required for this configuration.
Portal
- Log in to the portal.
- Go to "VoIP Trunk" under "Management" and click the 'edit' icon next to the VoIP trunk.
- In the overview, you will find the "Account ID" and the corresponding "Password". Note these down.
- Then, click on "Advanced (SIP) Settings" on the left.
- Enter your IP address in the "Static Hostname" field.
- Enter the appropriate port in the "Static Port" field, typically '5060'.
- Set the "Caller ID Header" to "P-Asserted-Identity SIP Header".
- Click "Save" at the bottom of the page.
General Trunk Settings
- Log in to your FreePBX server and click on "Trunks" under the "Connectivity" section.
- Click "+ Add Trunk" and select "+ Add SIP (chan_pjsip) Trunk."
- Enter the following information under General:
- 'Trunk Name': SIP Trunk
- 'Outbound CallerID': <Phone number in +31 format>

- Click on the "pjsip Settings" tab:
- Enter the 'Account ID' in the 'Username' field.
- Enter the password for the corresponding Account ID in the 'Secret' field.
- Set 'Registration' to 'None'.
- Enter 'ha.voys.nl' in the 'SIP Server' field.
- Enter 5060 or 6060 in the 'SIP Server Port' field. Both ports are active on our side, so if 5060 doesn’t work, you can use 6060.
Leave the remaining settings that have not been addressed as they are.

Click on the "Dialed Manipulation Rules" tab:
- Enter 'X.' in the 'Match Pattern' field.
- Click on the "Advanced" tab under "pjsip Settings":
- Select 'RFC 4733' for 'DTMF'.
- Enter the 'Account_ID' in the 'Contact User' field.
- Set 'Trust RPID/PAI' to 'Yes'.
- Select 'Send P-Asserted-Identity header' for 'Send RPID/PAI'.
- Click "Submit".
Leave the remaining settings that have not been addressed as they are.

Setting Up Incoming Numbers
- Go to "Connectivity" and then "Inbound Routes."
- Click 'Add Inbound Route.'
- Enter the following:
- Description: <Name of the incoming route>
- DID Number: <Number in +31 format>
- To test the connection, set "Set Destination" to "Terminate Call" and "Put caller on hold forever."
- Click "Submit", and then click "Apply Config" at the top.
When you now dial the number, you will hear hold music.

Adding an Account
To add a phone account, click on "Applications" and then "Extensions."
Next, click "+ Add Extension" and select "Add New SIP [chan_pjsip] Extension."
- In "User Extension", enter the internal number of the phone, e.g., 201.
- In "Display Name", enter the name of the user, e.g., Jan Jansen.
- Under "Outbound CID", enter the number that the user should display when making outbound calls.
- Click "Submit" and then "Apply Config."
You can now register the account on a phone. The username is the "User Extension" and the password is what is listed under "Secret." The server to connect to is the IP address of your PBX.
Making Outbound Calls
To make outbound calls, you need an "Outbound Route." In the "Outbound Route," you define the number to dial and the trunk you want to use.
- Go to "Connectivity" and then "Outbound Routes."
- Click "+ Add Outbound Route."
- Enter "default" for "Route Name."
- Under "Trunk Sequence for Matched Routes," select "SIP Trunk."

Under the "Dial Patterns" section, enter "X." (X followed by a dot) in the "Match Pattern" field. This ensures that all outbound calls will go through this trunk.

- Click "Submit", and then click "Apply Changes" at the top.
You can now make outbound calls with your VoIP phone. To receive calls, update the "Inbound Route" to your extension.
Encrypted Calling
It is possible to encrypt both incoming and outgoing calls.
To enable this, you need to make some changes in both the portal and FreePBX.
Portal
- Log in to the portal.
- Go to "VoIP Trunk" under "Management" and click the 'edit' icon next to the VoIP trunk.
- Click on "Advanced (SIP) Settings" on the left.
- Check "Force Encryption" under the "Advanced (SIP) Settings".
- A pop-up will appear, and in the pop-up, click "Continue."
- You will now see that the "Transport Protocol" is set to TLS.
- Click "Save" at the bottom of the page.

FreePBX
Activating TLS
- Click on "Settings" and then select "Asterisk SIP Settings."
- Next, select the "SIP Settings [chan_pjsip]" tab.
- Change the "Certificate Manager" to 'default'.
- Change the "SSL Method" to 'tlsv1_2'.
- Set "Verify Server" to 'No'.
- Set "tls - 0.0.0.0 - All" to 'Yes'.
- Click "Submit", and then click "Apply Changes" at the top.
- Under the "Connectivity" section, click on "Trunks."
- Click the 'edit' icon next to the VoIP trunk.
- Click on the "pjsip Settings" tab.
- Change 'SIP Server' to 'sip.encryptedsip.com'.
- Change the 'SIP Server Port' to '5061'.
- Select '0.0.0.0-tls' for 'Transport'. (If this option is not available, TLS has not been correctly activated; please repeat the TLS activation steps.)
- Click "Submit", and then click "Apply Changes" at the top.
In version 16.0.40.7, TLS does not work immediately. You need to restart the server to activate it. To do this, go to 'Admin' -> 'System Admin', then click on 'Power Options' on the right and click 'Reboot'.
More Information
More information and documentation can be found on the FreePBX wiki.