The guide shows how to connect FreePBX phone system to TA FXO gateway via SIP trunk. With the connection of TA FXO gateway and asterisk FreePBX software, physical trunk PSTN will be extended on the open source PBX phone system.
Features to be achieved after configuration:
- Make outbound calls from FreePBX via the PSTN trunks of TA FXO gateway.
- Receive calls from PSTN trunks of TA FXO gateway at FreePBX.
Basic Information Used in This Guide
Integration Mode:
FreePBX and TA FXO gateway are connected with Service provider mode (SPS trunk)
Firmware version:
In the guide, we tested TA410 and FreePBX phone system
TA410: 41.19.0.23
FreePBX: 10.13.66
Description:
IP address of FreePBX: 192.168.9.91
IP address of TA410: 192.168.9.90
A PSTN line from the provider is connected to TA410’s FXO port1
PSTN number: 05925503301
Figure 1 Connect FreePBX Phone System and TA FXO gateway
2. Preparation
All the TA FXO gateway attempts to contact a DHCP server in your network to obtain valid network settings (e.g., the IP address, subnet mask, default gateway address and DNS address) by default except TA410 and TA810.
Steps to set static IP for TA FXO gateway:
- Download a DeviceFound tool from Yeastar website: FindTA.rar
- Run the DeviceFound.exe software.
- The detected TA devices in the local network will appear in the window.
- Find the TA device’s IP address by the device’s MAC address or the SN.
- Log in TAO gateway and go to System> Network Preferences> LAN Settings, disable DHCP and configure the LAN network, save and apply the changes, reboot TAO gateway to take effect.
* In TA410 and TA810, the IP is 192.168.5.150 in the factory default. In the guide, you could just go to System> LAN Settings and configure your own IP.
Figure 2 Configure LAN Settings on TA FXO gateway
3. Connect FreePBX Phone System to TA410 FXO Gateway
3.1 Create a SIP Trunk on FreePBX
Step 1: Add a SIP (chan_pjsip) Trunk to TA410. Fill in the IP of TA410 in the “SIP Server” and “From Domain” field.
Path: Connectivity> Trunks> Add Trunk> Add SIP (chan_pjsip) Trunk
- Trunk name: TA410
- SIP Server: the IP of the TA410, 192.168.9.90
- SIP Server Port: the default port 5060, if you want to change the port, it means the FreePBX provide the port for other devices to register to it.
- From Domain: the IP of the TA410, 192.168.9.90
Figure 3 Configure SIP trunk on FreePBX
Step 2. Click “save” and “Apply change”, please check the status of the trunk, it shows “Avail” and “Not in use”
Path: Admin> Asterisk CLI> CLI command> execute “pjsip show endpoints”
Figure 4 Check the status of the SIP trunk to TA410 on FreePBX
3.2 Configuration on TA410 TA FXO Gateway
Step 1. Set a VoIP Server Template on TA410
Path: Gateway> VoIP Settings> VoIP Trunk> Add New Trunk
- Trunk Type: Service Provider
- Type: SIP
- Provider Name: FreePBX
- Hostname/IP: fill in FreePBX IP address, 192.168.9.91
- Domain: fill in FreePBX IP address, 192.168.9.91
Figure 5 create a service provider trunk on TA410
Step2. After we create the trunk we can check the status of the trunk, it shows OK.
Path: Status> Port/Trunk Status
Figure 6 check the status of the SPS trunk to FreePBX on TA410
4. IP to Port
In this section, we introduce how to achieve making outbound calls from FreePBX through PSTN line on TA410.
Figure 7 IP to Port
Step 1. Create one outbound route on FreePBX.
Path: Connectivity> Outbound Routes> Add Outbound Route
- Route Name: Name of the outbound route
- Trunk Sequence for Matched Routes: choose the trunk you want to use in the outbound route, TA410
- Dial Patterns: if you configure the prefix, it means that you should dial the number after the prefix. Match patterns means the number you dial should match it. For example, if the prefix is "9", the match pattern is "X.", and the number you want to dial is "5503300", then to dial the number via the route successfully, you need to dial "95503300".
Figure 8 Configure an outbound route on FreePBX
Step 2. Configure “IP to Port” Route on TA410.
Path: Gateway> Routes Settings> IP->Port> Add IP->Port Route
Leave all the default settings on this page or you can change the Simple Mode to “NO” to configure the DID number if you to manage the call. And choose the source as SPS trunk with FreePBX and the destination is the PSTN line.
- Route Name: from_FreePBX
- Call Source: choose the source of the call. For example, FreePBX.
- Call Destination: choose which PSTN trunk been chosen to dial out. For example, FXO1.
Figure 9 Configure IP to port on TA410
Step 3. Test a call from FreePBX
Now, you can use FreePBX phone system’s extension to make external calls through the PSTN 1 on TA410. Do not forget to add digit 9 before the called number, as the dial prefix is set to 9 on FreePBX outbound route. For example, if you want to call "15880270600", you need to dial "915880270600".
5. Port to IP
In this section, we introduce how to achieve making incoming calls to FreePBX through PSTN trunk on TA410.
Figure 10 Port to IP
Step 1. Create an inbound route on FreePBX.
Path: Connectivity> Inbound Routes> Add Inbound Route
- Description: the name of the inbound route, from_TA410
- DID Number: if the trunk want to pass the DID on the incoming calls, please configure 888
- Set Destination: choose the destination of the inbound route. Extension 300
Figure 11 Inbound Route on FreePBX Phone System
Step 2. Configure “Port to IP” Route on TA410
Path: Gateway> Routes Settings> Port->IP> Add Port->IP/Port Route
Choose Simple Mode to “No” and set Hotline to 888, which is the same number with the DID number set on FreePBX Inbound route.
- Route Name: to_FreePBX
- Call Source: choose the source of the call. For example, Port-FXO1.
- Call Destination: choose which PSTN trunk been chosen to dial out. For example, FreePBX.
- Hotline: the hotline number should be the same as the DID number configured in the inbound route of FreePBX side
Figure 12 Port to IP on TA410
Step 3. Test a call.
Dial the PSTN trunk number 05925503301 on your cell phone, the call will be routed to FreePBX extension 300.
1 Comments