How to Connect FreePBX to Yeastar TE Gateway

1. Introduction

The guide provides step-by-step configuration instructions of how to connect TE gateway and FreePBX. The E1 trunk on TE gateway will be extended on FreePBX phone system. With the connection you can achieve:

  1. Make outbound calls from FreePBX via the E1 trunks of TE gateway directly.
  2. Receive calls through E1 trunks of TE gateway at FreePBX.


Integration Modes

FreePBX and TE gateway use the Service provider mode to connect with each other.

Firmware version:

In the guide, we tested TE200 and FreePBX.


FreePBX: 10.13.66


IP address of FreePBX:

IP address of TE200:

E1 main line number: 5503300

Figure 1 FreePBX and TE200 connect with SPS trunk



2. Connect FreePBX to Yeastar TE200

2.1 Create a VoIP Trunk on TE200

Path: Gateway> VoIP Settings> VoIP trunk> Add VoIP Trunk.

Choose “Service Provider” mode, and fill in FreePBX IP address.

Figure 2 Add SIP Trunking in TE200

Provider Name: To_FreePBX

Hostname/IP: The IP of the FreePBX,


After creating SIP Trunking, we can check the status of this trunk, it should be OK(green).

Path: Status> System Status> Trunk Status

Figure 3 Trunks Status on TE200


2.2 Create a VoIP Trunk on FreePBX to TE200

Path: Connectivity> Trunks> Add Trunks> Add SIP (chan_pjsip) Trunk

Figure 4 Add VOIP Provider on FreePBX

Figure 5 VoIP trunk on FreePBX

Trunk name: TE_200

SIP Server: the IP of the TE200,

SIP Server Port: the default port 5060. For example, if you change to 5068, other device should use 5068 to register FreePBX

From Domain: the IP of the TE200,


Click “save” and “Apply change”, please check the status of the trunk, it shows “Avail” and “Not in use”

Path: Admin> Asterisk CLI> execute command “pjsip show endpoints”

Figure 6 The status of the SIP trunk on FreePBX


2.3 Create an extension in FreePBX

Path: Applications> Extensions> Add Extension> Add New Chan_PJSIP Extension


Figure 7 the PJSIP extension on FreePBX


Click “save” and “Apply change”, please check the status of the extension and it will shows OK.

Path: Admin> Asterisk CLI> execute command “pjsip show endpoints”

Figure 8 Extension status on FreePBX


3. Incoming Calls from E1 to FreePBX

In this section, we will configure incoming call to FreePBX.

Figure 9 E1 to IP


Step1. Create a route from TE200 to FreePBX

Path: Gateway> Route Settings > Route List


Figure 10 Create Route from TE200 to FreePBX

Simple Mode: Yes

Route Name: You can name the route whatever you want, TE_to_FreePBX

Call comes in From: Trunk--E1Trunk1. You can select E1Trunk1 or E1Trunk2.

Send Call Through: ServiceProvider--FreePBX. All the calls from E1Trunk1 will be sent to FreePBX via this trunk


Step 2. Configure inbound route on FreePBX.

Path: Connectivity> Inbound Routes> Add Inbound Route

Figure 11 Create inbound route on FreePBX

Description: From_TE200

DID Number: 5503300

Set Destination: Extensions-101 Sharon


Step 3. Test a call.

Now the external user can use his cell phone to FreePBX system by dialing number 5503300. 5503300 is the line number of the E1 trunk on TE200 which is the same as DID number in the FreePBX inbound route. The call will reach the extension 101


4. Outbound Calls from FreePBX extension via E1

In this section, we will configure outbound call for FreePBX extensions.

Figure 12 IP to BRI

Step1. Configure Outbound route on FreePBX.

Path: Connectivity> Outbound routes> Add Outbound Route

Figure 13 Create Outbound Route on FreePBX

Route Name: To_TE200

Prefix: 9, if it is configured which means you need to dial the prefix ahead of your number, in the settings you have to call 9+external number

Match pattern: X.

Trunk Sequence for Matched Routes: TE200


Step2. Configure route on TE200

Path: Gateway->Route Settings->Route List


Figure 14 Create Route from FreePBX to TE200

Simple Mode: Yes

Route name: Freebpbx_to_TE

Call Comes in From: ServiceProvider-FreePBX

Send Call Through: Trunk-E1Trunk1


Step3. Set DOD for FreePBX extension

For example, extension 101 will use DOD 5503301 to make outside calls via E1 Trunk


Figure 14 Configure DOD for FreePBX extension

Step4. Test the call

Now, all the calls from FreePBX will be routed to TE200. We can use extension on FreePBX to call the external user directly. For example dial 913805044321. 9 is the prefix on FreePBX outbound route.


Have more questions? Submit a request


Please sign in to leave a comment.