How to Connect MyPBX to Elastix

This application note shows how to connect Elastix to MyPBX using SIP P2P(Peer to Peer) mode. This will be working fine for:
1. Intercommunication between Elastix and MyPBX
2. Make calls using Elastix’s extension through the GSM/PSTN/BRI trunks of MyPBX.
3. Receive calls from GSM/PSTN/BRI trunks of MyPBX at Elastix.

Description
IP address of MyPBX: 192.168.5.146
IP address of Elastix: 192.168.5.203

1. Intercommunication between Elastix and MyPBX

Description
All the extensions under MyPBX are in the format 5XX.
All the extensions under MyPBX are in the format 3XX.

Note: For SIP P2P mode connection, you don’t need to set up inbound routes for any side.

MyPBX Configuration

Step 1: Set up SIP P2P mode in MyPBX, connect to Elastix.
Path: PBX--Trunks--VoIP trunk--Add Service Provider

                                       Figure 1 Create a SIP P2P mode in MyPBX

After creating SIP P2P mode, we can check the status of this trunk; it should be OK (green).
Path: Status--Trunk Status

                                                 Figure 2 Trunk Status in MyPBX

Step 2: Set up Outbound Route in MyPBX.

Dial pattern: 3XX, which means all 3-digit calls starting with 3 will be sent to Elastix via this SIP P2P mode.
Path: PBX--Outbound Call Control--Outbound Routes--Add Outbound Route

                                    Figure 3  Outbound route for SIP P2P mode in MyPBX

Elastix Configuration

Step1: Set up SIP P2P mode in Elastix, connect to MyPBX
Path: PBX --Trunks--Add SIP Trunk

                                                  Figure 4

                                                 Figure 5 Add SIP P2P mode

1)Enter the info of trunk for PEER Details :
host=192.168.4.146
type=peer
qualify=yes
disallow=all
allow=ulaw,alaw,gsm

                                        Figure 6 Enter PEER Details

2)After creating SIP P2P mode, we can check the status of this trunk, it should be “OK”.
Path: PBX--Option--Unembedded freePBX

                                             Figure 7

Path: Admin--Tools--Asterisk CLI--Enter the command “sip show peers” and click “Execute”.


                                     Figure 8 The status of SIP P2P mode in Elastix

Step2: Set up outbound routes in Elastix.

Dial pattern: 3XX, which means all 3-digit calls starting with 5 will be sent to MyPBX via the SIP P2P mode.
Path: PBX--Admin--Set up--Outbound Routes.

                                    Figure 9 Outbound route for SIP P2P mode in Elastix

Click “Submit Changes” and “Apply Configuration Changes Here”.

Step 3: Test call
Register an IP phone to MyPBX with extension 500.
Register an IP phone to Elastix with extension 300.
Use 500 to dial 300. You can see 300 is ringing and you can answer the calls
Use 300 to dial 500. You can see 500 is ringing and you can answer the calls


2. Make calls using Elastix’s extension via SIP P2P mode
The SIP P2P mode connection is finished in the last step, so we can start to configure rule to make calls via PSTN/GSM/BRI trunks of MyPBX using Elastix’s extension.

Description
PSTN trunk of MyPBX: 5503301
GSM trunk of MyPBX: 15060748304
BRI trunk of MyPBX: 5503300

MyPBX Configuration

Step1: Check the status of GSM/PSTN/BRI trunk.
Path: Status--Trunk Status

                                                Figure 10 Trunk status

Step2: Set up Outbound Route for GSM/PSTN/BRI trunk to make calls in MyPBX.
Path:PBX--Outbound Call Control--Outbound Routes--Add Outbound Route.

1) Create an outbound route for GSM/PSTN/BRI trunk. In this example, all calls starting with 9 will be sent out via the GSM/PSTN/BRI trunk of MyPBX.


                             Figure 11 Outbound route for SIP P2P mode in MyPBX

Step3: Set up Inbound Route for SIP P2P mode in MyPBX, and choose the outbound route we just created as the “Destination”, so that the calls via this SIP P2P mode will be sent out through GSM/PSTN trunk.

Note: We must configure DID number of this inbound route to match the dial pattern of outbound routes which are used to make call to GSM/PSTN trunk of MyPBX in Elastix, however, this dial pattern must match the dial pattern of the outbound route for GSM/PSTN trunk in MyPBX. So, we should set the DID number to “9.”.
Please place this route at the top.

                            Figure 12 Set up Inbound Route for the SIP P2P mode

Elastix Configuration

Step1: Set up outbound routes in Elastix.

Path:PBX--Outbound Routes--Add Route.
Note: This dial pattern must match the dial pattern of the outbound route for GSM/PSTN trunk in MyPBX.

                                   Figure 13 Outbound route for SIP P2P mode in Elastix

Step2: Test Call

Use Elastix’s extension to dial 913800000000, then mobile phone 13800000000 will ringing and you can answer the calls.

3. Receive calls from GSM/PSTN/BRI trunks of MyPBX at Elastix
The SIP P2P mode connection is finished in the previous step, so we can start to configure a rule to route the incoming calls to Elastix side.

MyPBX Configuration

Step1: Set up an outbound route for this SIP P2P mode to Elastix.

Note: In this example, we set up the dial pattern is “X.”. We can dial any number via this SIP P2P mode. And place this route at the bottom.

                                  Figure 14 Outbound route for SIP P2P mode in MyPBX

The order of outbound routes: (Path: Basic--Outbound routes)

                                                 Figure 15 Order

Step2: Create an inbound route for GSM/PSTN/BRI trunk, and choose the outbound route we created in previous step as destination, so that the incoming calls from GSM/PSTN/BRI trunk will be sent to Elastix via the SIP P2P mode.

Note: Since GSM/PSTN trunks have no DID number, we need to set up a DID number for them.

1) Create an inbound route for GSM trunk.
    DID number: 15060748304

                           Figure 16 Inbound route for GSM trunk

2) Create an inbound route for PSTN trunk.
    DID number: 5503301

                                                Figure 17 Inbound route for PSTN trunk

3) Create an inbound route for BRI trunk.

                                     Figure 18 Inbound route for BRI trunk

Elastix Configuration

In Elastix side, we need to create inbound route for the SIP P2P mode so that we can dial in, in this example, we choose IVR as the destination (generally).
PBX Admin Set up Inbound Routes

1) Create an inbound route for GSM trunk of MyPBX. Then DID Number must match that of MyPBX, so we set DID Number of this route to 15060748304.

                        Figure 19 Inbound route for GSM in Elastix

2) Create an inbound route for PSTN trunk of MyPBX. Then DID Number must match that of MyPBX, so we set DID Number of this route to 5503301.

                             Figure 20 Inbound route for PSTN in Elastix

3) Create an inbound route for BRI trunk of MyPBX. Then DID Number must match that of MyPBX, so we set DID Number of this route to 5503300.

                              Figure 21 Inbound route for BRI in Elastix

4) Test call
Use mobile phone dial the GSM trunk’s number 15060748304/the PSTN trunk’s number 5503301/the BRI trunk’s number 5503300, then it will reach the IVR of Elastix.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.