Once we have our internal telephone network configured (if not, check out our previous guides), it is time to connect our PBX to the external telephone network so that people can get through to us. To achieve this, we need a virtual phone number – either a landline or a mobile number, and a SIP trunk, which is a service that allows our FreePBX system to communicate with the national (or international) telephone network. You can usually get both services (the phone number and the SIP trunk) from a single provider.
What a SIP Trunk gives us
A SIP Trunk is a connection between traditional landline and mobile telephony and a VoIP telephony network. But how exactly does it work? Our SIP Trunk provider will give us a virtual phone number that our customers, who use mobile phones and landlines, can call, and then these calls will be transferred over the Internet to our FreePBX Asterisk server. A SIP Trunk also enables two-way communication, allowing calls from our internal telephone network to the outside world. The main advantages include:
- Hundreds of simultaneous calls – An additional advantage is that even if we only have one virtual phone number, we can receive and make dozens, or even hundreds, of calls simultaneously, all depending on the performance of the computer on which the FreePBX Asterisk server is installed and the capacity of our Internet connection.
- Price – The typically much lower cost is also a significant factor. FreePBX Asterisk is usually a lot cheaper than if we had to order and pay for dozens or hundreds of subscriptions from a traditional operator.
- Recording all calls – FreePBX Asterisk makes it easy to configure the recording of all calls, both inbound and outbound, as well as voicemail for all phones on the internal network. Listening back to previous conversations makes running the business much easier. Note: Don’t forget to notify your customers about call recording, for example during a welcome message. You will learn how to configure a welcome message in FreePBX Asterisk in one of the next parts of our guides.
- Notifications – Another very useful feature is email notifications for missed calls and messages left on voicemails. Notifications can be configured so that voicemail recordings are sent directly in the email message. This is extremely useful if we are away from the office.
- The ability to connect our telephony to a CRM application – Some SIP Trunk providers offer the integration of our telephony with CRM systems. This means that all telephone calls made from our network are automatically linked to our CRM system’s customer database.
- Easy number portability to another location – Thanks to the fact that our number is not assigned to a telephone line, we can easily move our entire telephone infrastructure to another location. All that is needed is a sufficiently fast internet connection in the new location, and we are able to move our entire telephony system within a few hours.
- Choice of any area code – No matter where our PBX is located, we can assign area codes from all over the country to it.
- IVR – Most SIP Trunk providers offer an IVR service, which is an automated assistant. Depending on the day of the week, business hours, or the topic of the call, the digital assistant will allow the customer to connect to the appropriate department, or will redirect the call to a voicemail or a mobile number if it is after business hours. Remember, however, that there is no need to pay a provider for this service, as you can get the same functions for free in FreePBX Asterisk.
- Virtual FAX – FreePBX Asterisk also supports a free virtual FAX. We will explain how to configure it in one of the next parts of our guides.
Choosing a SIP Trunk Provider
- In the UK, there is a good choice of SIP Trunk providers. It would be a good idea if we had the opportunity to test the service for free before signing a contract. Also, make sure that the provider works correctly with FreePBX Asterisk. In addition to the phone number and SIP Trunk, providers can offer you many additional features for an extra fee, such as IVR (Interactive Voice Response), call forwarding, or call recording, but there is no need to spend money on them, as you can implement all these options for free with FreePBX Asterisk. All you need is a phone number and a SIP Trunk. When choosing a landline number, you will usually be able to choose an area code from any part of the country. If your company operates locally, it is worth choosing an area code from your region, as research shows that customers are much more likely to answer calls with a local area code.
What to look out for when choosing a SIP Trunk provider?
- Prices of subscriptions for the SIP Trunk service and for the virtual phone number.
- Call costs to landline, mobile, and international numbers.
- Packages of free calls.
- Customer service quality, working hours, and days.
Check the offer of one of the British providers, comparing the prices of the SIP Trunk subscription, the virtual phone number subscription, and the cost per minute for calls to landline and mobile numbers:
- Actio
- TeleCube
- EasyCall
- Spikon
- IPpfon
- Apifonica
- Zadarma
SIP Trunk Settings in FreePBX Asterisk
Once we have our virtual phone number and a purchased SIP Trunk service, it’s time to configure our FreePBX Asterisk. To do this, click on the Connectivity tab, and then on Trunks.

Click on Add Trunk and select its type. Most often it will be Add SIP (chan_pjsip) Trunk, or Add SIP (chan_sip) Trunk in the case of older versions of FreePBX Asterisk. If you are not sure which one to choose, ask your SIP Trunk provider. The settings for these two versions of Trunk are slightly different. We will discuss the differences below.

General Tab

- Trunk Name – any name. For example, the name of your SIP Trunk provider.
- Hide CallerID – turn on this option if you want to hide your phone number.
- Outbound CallerID – ask your SIP Trunk provider about this.
- CID Options – We set which CallerIDs are allowed to use our PBX. We most often set Allow Any CID.
- Maximum channels – here we set the maximum number of simultaneous outbound calls. If we leave this field empty, the number of outbound calls will be unlimited.
- Leave the other options unchanged.
pjsip Settings – General Tab
This tab applies only to the pjsip Trunk version. If you are configuring the sip Trunk version, see the paragraph below. You should receive all the settings you need in this tab from your SIP Trunk provider.
sip Settings Tab


The sip Trunk settings differ from pjsip. In the Outgoing and Incoming tabs, enter the settings received from your SIP Trunk provider. After entering all the settings, save them by clicking Submit, and then Apply Config.
Checking the correct operation of the SIP Trunk
To check if the entered SIP Trunk has connected correctly with our provider, you can do it in two ways:
Check via SSH
Log in to your FreePBX server using SSH and enter the following commands:
asterisk -rvvv
pjsip show endpoints
If a correct connection has been made with the provider, you should see the message “Endpoint Available” and the connection’s IP address.
Check via the browser
Go to Reports – Asterisk Info. In the PJSIP, or CHANSIP window (depending on which version of SIP Trunk you are using), you should see the connection’s IP addresses, and the channel for that SIP Trunk should be highlighted in green.


If our SIP Trunk is correctly connected to the provider, we can proceed to the next step and set up Inbound Routes to tell FreePBX Asterisk to use our SIP Trunk for inbound calls.
Inbound Routes – Inbound Calls
Go to Connectivity and Inbound Routes. Add a new Inbound Route by clicking on Add Inbound Route.

- Description – Enter any description.
- DID Number – Enter the DID number received from your SIP Trunk provider.
Leave the other fields apart from Set Destination unchanged. The Set Destination option contains a number of options and allows us to choose where inbound calls should be directed. This option gives us enormous possibilities. We can direct callers to different places depending on whether our company is currently open or not. We can redirect the caller to an IVR so they can select the appropriate department, or give them the option to send a fax to us. We will cover this option in more detail in one of the next articles. For a start, we will simply set all inbound calls to be directed to the Extension number we created in part 5 of our guides. So, select Extensions from the options and you should be able to select the previously created Extension.

Save the settings by clicking Submit, and then Apply Config. Inbound calls should now work, and you should be able to call your landline number received from the provider from your mobile. We will now configure outbound calls.
Outbound Routes – Outbound Calls
Go to Connectivity and then Outbound Routes. Add new outbound calls by clicking on Add Outbound Route.

- Route Name – provide any name.
- Route CID – provide your virtual phone number received from the provider.
- Trunk Sequence for Matched Routes – select your SIP Trunk from the list.
If you want all outbound calls to be recorded, go to the Additional Setting tab and select Yes, or Force in the Call Recording field.
Dial Patterns
We will not go into the details of the Dial Patterns settings in this article. For a start, simply enter X. in the first box (Capital letter X and a dot). This means that the first digit can be from 0 to 9 and the number can have any number of digits. This will allow you to call any phone numbers without restrictions.

Save the settings by clicking Submit, and then Apply Config.
Summary
Congratulations! You have successfully configured inbound and outbound calls. We invite you to our next parts of the guides on FreePBX Asterisk.
Leave a Reply