1. Introduction
The guide shows how to connect FreePBX phone system to TA FXS gateway via SIP trunk. With the connection of TA FXS gateway and FreePBX phone system, the analog phones connected to the FXS ports will be treated as FreePBX Phone system's extensions. The following features can be achieved:
- Make calls between the analog phone and SIP extension on FreePBX phone system;
- Receive incoming calls on the analog phones;
- Make external calls from the analog phones using trunks on FreePBX phone system.
Integration Mode:
There are three modes for TA FXS gateway to connect FreePBX.
On TA FXS gateway, the register modes are as below:
Port Register
Service Provider
Template Register
*You can choose one of the modes to do the integration due to different scenarios. But in the following guide, we only choose port register mode and service provider mode for integration.
Port register mode is the most popular feature in TAS gateway. With the connection of FreePBX we often use port register mode.
Service provider mode is used in the integration scenario, for example two TAS gateway connection.
Template Register is often used in the scenario that the analog phone in the TAS gateway work as the ring group. Or all other devices connect to the TAS gateway use one SIP account.
Firmware version:
In the guide, we tested TA1600 and FreePBX.
TA1600: 41.19.0.32
FreePBX: 10.13.66
Description:
IP address of FreePBX: 192.168.9.91
IP address of Yeastar TA1600: 192.168.9.73
Figure 1. Connect FreePBX Phone System and Yeastar TA1600
2. Preparation
Yeastar TA1600 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.
Before connecting Yeastar TA1600 to FreePBX phone system, you need to set a static IP address from the same LAN with the FreePBX phone system.
Steps to set static IP for Yeastar TA1600:
- Connect one analog phone in one of the FXS ports on Yeastar TA1600;
- Dial "***" to enter the voice menu;
- Press "1" to check the IP address;
- Open the browser and type in the TA1600's IP address to access TA1600;
- Log in TA1600 and go to System> Network Preferences> LAN Settings, disable DHCP and configure the LAN network, save and apply the changes, reboot Yeastar TA1600 to take effect.
Figure 2. Configure LAN Settings on Yeastar TA1600
3. Port Register Mode
If you choose port register mode, the FXS ports will be registered as the FreePBX's SIP extensions, whose functions are the same with other SIP extensions on FreePBX
Figure 3. Connect TA1600 and FreePBX Phone System via VoIP Mode
Step 1. Create a SIP extension on FreePBX
Path: Applications> Extensions> Add Extensions
Create an extension on FreePBX for the FXS port on the TA1600 which has connected an analog phone. Here we take extension 400 for example
Figure 4. Create Extension 400 on FreePBX Phone System
User Extension: 400
Display Name: Lim
Secret: password of the extension
Step 2. Configure one VoIP server on Yeastar TA1600
Path: Gateway> VoIP Settings> VoIP Server Settings
Figure 5. Configure Register Mode as port register on TA1600
Server Name: FreePBX
Type: SIP
Transport: UDP
Hostname/IP: the IP of FreePBX, 192.168.9.91
Domain: the IP of the FreePBX, 192.168.9.91
Register Mode: the way of the voip server. Port register
Step 3. Edit the Dial Pattern Template
Path: Gateway> VoIP Settings> Dial Pattern Template
The default dial pattern is set as ".", which allows you to dial any number out. In this guide, we will remain the default setting. You can change it according to your environment.
Figure 6. Edit Dial Pattern Template
Step 4. Edit the FXS port
Path: Gateway> Port List> Port List
Figure 7. Edit FXS Port on TA1600
Caller ID Name: name the port whatever you want.
Caller ID Number: the extension number which is created on the FreePBX
VoIP Server: choose “FreePBX(4)”, the VoIP server template configured in Step 2
User Name: the extension “user extension” on FreePBX phone system, 400
Authentication Name: the same as the “User Name” on T1600, 400
Password: the “secret” of the extension on FreePBX phone system
From user: same as the “User Name” on TA1600,400
Dial Pattern Template: choose the Dial Pattern Template DialPatternTemplate1(1).
DID Number: the called number which is the same as the “User Name” on TA1600
Save and apply the changes, and you will see the port status is “OK”on "Port Status" page.
Path: Status> System Status> FXS Port Status
Figure 8. Check the status of the port on TA1600
Step 5. Create the outbound route and inbound route on FreePBX
On FreePBX, it should create the outbound route and inbound route and selected extension 400 to call out and received the call. Then you are able to use the analog phone which is connected to Yeastar TA's FXS port 1 to make calls and receive calls.
Note: All outgoing calls to FreePBX extensions and to external numbers through trunks on FreePBX should match the dial pattern of FreePBX, or calls will be failed.
4. Service Provider Mode
If you choose this mode to connect Yeastar TA1600 and FreePBX, the FXS port will be registered as a Service Provider SIP/IAX (SPS/SPX) trunk to the FreePBX phone system. One SPS/SPX trunk to Yeastar TA also should be created on FreePBX phone system. In this guide, we use SIP protocol, configure one VoIP server template as Service Provider mode on Yeastar TA1600 and create one Service Provider SIP trunk on FreePBX phone system.
Figure 9. Connect TA1600 and FreePBX Phone System via SPS Mode
Step 1. Create a Service Provider SIP Trunk on FreePBX phone system.
Path: Connectivity> Trunks> Add Trunk> Add SIP (chan_pjsip) Trunk
Figure 10. Create a SIP trunk on FreePBX connected to TA1600
Trunk name: TA1600
SIP Server: the IP of the TA1600, 192.168.9.73
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 TA1600, 192.168.9.73
Click “save” and “Apply change”, please check the status of the trunk, it shows “Avail” and “Not in use”
Path: Admin> Asterisk CLI> CLI commend> execute “pjsip show endpoints
Figure 11. Check the status of the SIP trunk on FreePBX
Step 2. Set a VoIP Server Template on TA1600
Path: Gateway> VoIP Settings> VoIP Server Settings
Figure 12. Configure the VoIP Server Template as SPS Mode
Server Name: FreePBX
Type: SIP
Transport: UDP
Hostname/IP: The IP of the FrePBX, 192.168.9.91
Domain: The IP of the FrePBX, 192.168.9.91
Register Mode: the way of the voip server, Service Provider
Step 3. Edit the Dial Pattern Template
Path: Gateway> VoIP Settings> Dial Pattern Template
The default dial pattern is set as ".", which allows you to dial any number out. In this guide, we will remain the default setting. You can change it according to your environment.
Figure 13. Edit the Dial Pattern Template
Step 4. Edit the FXS port
Path: Gateway> Port List> Port List
Figure 14. Edit the FXS Port
Caller ID Name: Name the port whatever you want, 100.
Caller ID Number: Give a number to the port whatever you want. The number should be different from the extension numbers on FreePBX. Here we set number 100 for FXS port 2
VoIP Server: choose FreePBX(4), the VoIP server template configured on Step 2
Dial Pattern Template: choose the Dial Pattern Template, DialPatternTemplate1(1)
DID number: Same as the caller ID Number, 100
After saving and applying the changes, you will see the trunk is “OK” in “Port Status”
Path: Status> System Status> FXS Port Status
Figure 15. Check the status of the FXS port on TA1600
Step 5. Configure the inbound route on FreePBX phone system.
Path: Connectivity> Inbound Routes> Add Inbound Routes
Figure 16. Create an inbound route on FreePBX
Description: the name of the inbound route, from_TA1600
DID Number: the number should be called when the call go to the inbound route,777
Set Destination: choose the destination of the inbound route. For example, destination IVR
Now you can make calls from the phone which is connected to TA1600 FXS port1 to FreePBX by dialing 777 to go to the IVR on FreePBX
Step 6. Create an outbound route on FreePBX phone system.
Path: Connectivity> Outbound Routes> Add Outbound Routes
Figure 17. Add Outbound Route on FreePBX
Route Name: to_TA1600
Trunk Sequence for Matched Routes: the trunk will be used in the outbound route, TA1600.
Now extensions on FreePBX are allowed to make calls to the phone which is connected to Yeastar TA1600 FXS port 1. Dial 7100 and the analog phone on FXS port 2 will ring. 7 is the prefix on the outbound route on FreePBX.
0 Comments