VoIP.ms is an excellent SIP provider – they’re one of the 3 SIP providers that we recommend to customers. They have excellent reliability and uptime, and offer a metered SIP service that allows you to pay per minute for your usage – excellent for small businesses.
Setting up VoIP.ms SIP trunking with FreePBX using the pjsip protocol can be a bit confusing however, so in this guide we will show you how it’s done!
Before we get started however, if you have not already signed up with VoIP.ms, please consider using our affiliate code – this doesn’t change your price at all, but gets us a few bucks for the recommendation:
Here’s what you’ll need to get started:
- A VoIP.ms account (https://voip.ms/en/code/CROSSTALK)
- FreePBX running pjsip on port 5060
We’re gonna start off by logging into our VoIP.ms account. Click on the ‘Sub Accounts’ tab and choose ‘Create Sub Account.’
Sub accounts are used in VoIP.ms for different destination endpoints – for instance, if you had one VoIP.ms account, but you used it to provide SIP services to multiple PBX’s at different company locations, you would want each company location to have its own sub account. Most people will just have one sub account.
For your sub account settings, you can mostly take the defaults. Here are the fields you should populate:
- Username (will be account number ‘underscore’ username for the sub account)
- Password (make it strong, but best to avoid special characters)
- Device type: Asterisk, IP PBX, Gateway or VoIP Switch
- CallerID Number: I use a system capable of passing its own CallerID
- Allow International calls (leave NO unless you specifically need International dialing)
Scroll to the bottom and click ‘Create account.’
DID Routing – Existing DID’s
Next we need to route a DID to our sub account. If you already have a DID, you can go to DID Numbers → Manage DID’s. If you do NOT already have a DID, skip down to the next section, and we’ll add one.
Click the yellow ‘edit’ button next to one of your DID’s, or check multiple DID’s and then click the ‘Edit selection – all settings at once’ button.
When editing the DID, choose your new sub account for SIP/IAX.
Scroll down to the next section, and choose a server. I’m going to pick USA Seattle 1. Make note of the FQDN – in my case, the Seattle 1 FQDN is ‘seattle1.voip.ms.’
You can leave all remaining settings default. Click the button at the bottom to apply changes.
DID Routing – New DID’s
If you do not already have a DID phone number associated with your VoIP.ms account, click on DID Numbers → Order DID(s).
For our tutorial, we’re going to choose a United States Local Number.
Select the state where you want your DID, and then click ‘View numbers’ next to the city/area where you would like your DID. In my case, I chose Portland, OR.
Find a DID that you want to purchase, check the box next to the DID(s) that you want, and then click the red ‘Proceed to the next step’ button that pops up at the bottom of the page.
The next step is to select a plan – for businesses, the best plan to use is the Per minute plan. The ‘Flat rate’ plan only allows for 2 channels of calling.
For section 3, choose whether you want to enable or disable CallerID lookups (I would say YES to this), and then pick a server (aka DID POP) close to your location. Take note of the FQDN next to your selection – in my case, I’m picking Seattle 1 which has an FQDN of seattle1.voip.ms.
Finally, in the ‘Routing’ section, select your newly created sub-account next to the SIP/IAX option and click ‘Order DID’ at the bottom of the page.
You should now have your DID routed to the sub account that we created. If you ever want to make any changes to your DID, go to DID Numbers → Manage DID(s).
Now it’s time to add the VoIP.ms trunk to FreePBX. In this tutorial, I am using a version 14 FreePBX, but both the previous version 13 and the subsequent version 15 are very similar in terms of setup.
Also, for the purposes of this tutorial, we are going to assume that A) your pjsip protocol is set to port 5060, and B) all appropriate firewall settings are in place. Or in other words, this tutorial doesn’t take into account any potential firewall blocking that may be happening.
To check your pjsip port, you can go to Settings → Asterisk SIP Settings → pjsip settings tab. Scroll down and you should see ‘Port to Listen On’ in the 0.0.0.0 (udp) section. That field should be set to 5060.
Add VoIP.ms trunk
Click Connectivity → Trunks. Click Add Trunk and choose Add SIP (chan_pjsip) Trunk.
Give your trunk a name – this can be anything you want. I am using the name ‘VoIP.ms_1’ as the name in this example. You should also add one of your 10 digit DID’s as the Outbound CallerID.
Next, click on ‘pjsip Settings’ → ‘General’ tab.
Here, add your VoIP.ms username, secret, SIP Server, and SIP Server Port. Make sure Authentication is set to Outbound, and Registration is set to Send.
Next, click on the ‘Advanced’ tab. In the From Domain field, enter in the WAN IP address for your PBX – this is the IP address that VoIP.ms will see your calls coming ‘from.’
Click ‘Submit’ to submit your changes, and then click the red ‘Apply Changes’ button in the upper left corner.
If you want to check to see if your VoIP.ms trunk has successfully registered, you should now be able to click on Reports → Asterisk Info → Chan_PJSip info.
You should be able to see your VoIP.ms trunk status in two places. First, in the ‘Chan_PJSip Registrations’ section, it should show as ‘Registered.’
Second, if you scroll down a bit further, you can find your VoIP.ms trunk in the ‘Chan_PJSip Endpoints’ section, and if all is well, you should see ‘Avail’ status.
Inbound Route Setup
To route calls inbound, you need to set up an inbound route – this can be a default inbound route that routes all calls to a specific location, or an inbound route specifically for your VoIP.ms DID.
In our case, we’re going to create an inbound route specific to our DID, and we’ll route it to a specific extension.
Click on Connectivity → Inbound Routes and then click the Add Inbound Route button.
On the General tab, first give your inbound route a description. This can be anything you want.
In the DID Number field, add your 10 digit VoIP.ms DID. This will route any calls to this DID to the destination set at the bottom of this tab. If you leave this field blank, you will route calls to ANY DID not specifically routed elsewhere to this inbound route.
At the bottom of the General tab, set your destination – in our case, I’m going to send all calls to this DID directly to my extension x200.
Click ‘Submit’ followed by Apply Changes to create your inbound route. If you call your VoIP.ms DID, it should now ring the extension you set.
For complete details for how to configure inbound routes, see our FreePBX v14 series video on the subject: https://www.youtube.com/watch?v=Z2Toi1THvTU
Outbound Route Setup
Next, we’ll create an outbound route for dialing the rest of the world. Click on Connectivity → Outbound Routes and then click the Add Outbound Route button. On the Route Settings tab, first give your route a name – this can be whatever you like, but I’ll call ours VoIP.ms outbound.
For Route CID, enter in your 10 digit VoIP.ms DID – this is the caller ID that will show up as your caller ID when dialing outbound. Next, head down to Trunk Sequence for Matched Routes and choose the VoIP.ms trunk that we set up earlier.
*** NOTE: If you have the Extension Routing our Class of Service (COS) modules installed in your FreePBX, you may have to also authorize your extensions to use this outbound route.
For complete details for how to configure outbound routes, see our FreePBX v14 series video on the subject: https://www.youtube.com/watch?v=sugd5Ngj0F8
And that’s it! The last step is to test outbound dialing, and congratulations! Your VoIP.ms SIP trunk is up and running.