
Combining 3CX Phone System with Asterisk (FreePBX)
- Tutorial
In this article, we will show you how to combine 3CX Phone System v14 and Asterisk FreePBX v13 systems. We will assume that both systems are on the same local network. If you have any questions or suggestions for improving integration, you can ask them in a special section of our forum .
In the 3CX Management Console, add the new 3CX trunk in the Bridges - Add Bridge section .

Other parameters: Allow tunneled connection , Publish information , Receive information , Supports Re-Invite , Support Replaces , PBX Delivers Audio leave the default.
After clicking Next, the interface for creating an outgoing rule on Asterisk will appear. Setting outgoing rules is described in detail here .
In the Asterisk system, create an outgoing trunk with the following parameters:

Outgoing - Trunk name : 3CX Bridge Outgoing Outgoing
- PEER Details:
host = [3CX IP]
port = [3CX SIP Port]
username = [3CX Bridge ID]
fromuser = [3CX Bridge ID]
secret = [3CX Bridge Password]
sendrpid = yes
qualify = yes
type = peer
And incoming trunk:

Incoming - USER Details:
host = [3CX IP]
port = [3CX SIP Port]
type = peer
trustrpid = yes
context = from-trunk
Incoming - Register String:
[3CX Bridge ID]: [3CX Bridge Password] @ [3CX IP]: [3CX SIP Port] / [3CX Bridge ID]
In the Asterisk system, you must also create an incoming and outgoing route that determines the routing of calls from / to the 3CX Phone System. To do this, refer to the FreePBX documentation .
If the trunks are configured correctly, the 3CX trunk on Asterisk should have the Registered status in the management console under System Status - Ports / Trunks .

If you make traffic capture with the Wireshark utility, the INVITE SIP request should look something like this.

Configure 3CX Phone System
In the 3CX Management Console, add the new 3CX trunk in the Bridges - Add Bridge section .

3CX trunk options
- Virtual extension number - leave the value assigned by the system, or specify another 5-digit Bridge ID number . Lock the Bridge ID and do not change it, as it is used later.
- Name of Bridge - name the trunk as you like. Usually the name displays the direction of calls, for example, To-Asterisk .
- Type of 3CX Bridge - set the trunk type to Master .
- Outbound rule prefix to reach remote 3CX PBX - if you want to use the prefix for calls going to the Asterisk system, specify it. However, we recommend that you pre-define the numbering plan so that users do direct dialing, i.e. without prefixes. In this case, you do not need to specify (and type) a prefix.
- Authentication Password - the system automatically generates a complex 8-character Bridge Password . Lock Bridge Password and do not change it, as it is used later.
- Assigned Codecs are the voice codecs used for this trunk. By default, the GSM-FR codec is installed, however you can add other codecs and determine their priority. Please note that the codecs you add must be supported by Asterisk. We recommend that you use the G722 Broadband Codec and give it the highest priority so that the system tries to use it before others.
Other parameters: Allow tunneled connection , Publish information , Receive information , Supports Re-Invite , Support Replaces , PBX Delivers Audio leave the default.
After clicking Next, the interface for creating an outgoing rule on Asterisk will appear. Setting outgoing rules is described in detail here .
Configure Asterisk
In the Asterisk system, create an outgoing trunk with the following parameters:

Outgoing - Trunk name : 3CX Bridge Outgoing Outgoing
- PEER Details:
host = [3CX IP]
port = [3CX SIP Port]
username = [3CX Bridge ID]
fromuser = [3CX Bridge ID]
secret = [3CX Bridge Password]
sendrpid = yes
qualify = yes
type = peer
And incoming trunk:

Incoming - USER Details:
host = [3CX IP]
port = [3CX SIP Port]
type = peer
trustrpid = yes
context = from-trunk
Incoming - Register String:
[3CX Bridge ID]: [3CX Bridge Password] @ [3CX IP]: [3CX SIP Port] / [3CX Bridge ID]
Trunk options
- 3CX Bridge ID - The virtual extension that was set when the 3CX trunk was created.
- 3CX Bridge Password - The virtual extension password that was set when the 3CX trunk was created.
- 3CX IP - The IP address or FQDN of the 3CX server to which the Asterisk server connects.
- 3CX SIP Port - SIP port of the 3CX server. If you have a normal (ie non-cloud) 3CX installation, the default SIP port is 5060. You can change the SIP port in the 3CX management interface in the Settings - Network - Ports section .
In the Asterisk system, you must also create an incoming and outgoing route that determines the routing of calls from / to the 3CX Phone System. To do this, refer to the FreePBX documentation .
Integration Testing
If the trunks are configured correctly, the 3CX trunk on Asterisk should have the Registered status in the management console under System Status - Ports / Trunks .

If you make traffic capture with the Wireshark utility, the INVITE SIP request should look something like this.

Request Parameters
- 101 - dialed from Asterisk to 3CX number
- 10003 - virtual trunk extension
- John Smith and 100 - Display Name and Caller Asterisk User ID
- 10.172.1.25:5061 - IP address and SIP port of Asterisk
- 192.168.9.206:5060 - IP address and SIP port of 3CX Phone System