All pages
Powered by GitBook
1 of 1

Loading...

MikoPBX and FreePBX (PJSIP)

Instructions for integrating multiple PBX systems

Creating a Provider on MikoPBX

  1. In MikoPBX, go to "Routing" → "Telephony Providers":

"Telephony Providers" section
  1. Add a new SIP provider by clicking "Connect SIP":

"Connect SIP" button
  1. Fill in the following parameters:

  • Provider Name – any name

  • Account Type – Incoming Registration

Copy the "Username" and "Password"; you will need them later.

  1. In the FreePBX interface, go to "Connectivity" → "Trunks":

  1. Add a new trunk of type "chan_pjsip".

  1. Insert the MikoPBX provider’s login into the "Trunk Name" field:

  1. Go to "pjsip Settings" → "Advanced":

  • From User – your MikoPBX provider login

  • Trust RPID/PAI – "yes"

  • Send RPID/PAI – "Send Remote-Party-ID header"

  1. On the "Dialed Number Manipulation Rules" tab, define your dial patterns

Save the changes.

Next, choose one of the two registration methods:

Set a password (complex, arbitrary). It must be the same on both MikoPBX and FreePBX.

In the MikoPBX “advanced settings” of your provider, under "Additional Parameters," include:

Save and apply the changes.

  1. Define an outbound route () in MikoPBX:

  1. Define an inbound route () in MikoPBX:

If necessary, define a separate route for each DID to direct calls to the correct destination (e.g., if a FreePBX user dials 202, route it to extension 202 on MikoPBX):

  1. Go to "Connectivity" → "Inbound Routes" in FreePBX and define an inbound route:

  1. Go to "Connectivity" → "Outbound Routes" in FreePBX and define an outbound route:

Sometimes users on one PBX need to see the statuses of users on the other PBX, for example when using BLF. To configure statuses:

  1. In the "" section, add the following text to the end of "extensions.conf" on the first PBX:

List all internal extensions configured on FreePBX.

  1. For each PBX, in the "System file customization" section, add the following text to the end of "pjsip.conf":

  1. Use the "Config Edit" module to edit files.

  2. In "extensions_custom.conf," add all of MikoPBX’s internal extensions:

  1. In "pjsip_custom.conf," add:

[endpoint]
trust_id_inbound=yes
send_rpid=yes
[internal-hints]
exten => 301,hint,PJSIP/301
exten => 303,hint,PJSIP/303
exten => 302,hint,PJSIP/302
[SIP-TRUNK-41C1B8B4-devicestate]
type=outbound-publish
server_uri=sip:[email protected]:5060
event=asterisk-devicestate

[SIP-TRUNK-41C1B8B4]
type=asterisk-publication
devicestate_publish=SIP-TRUNK-41C1B8B4-devicestate
device_state=yes

[SIP-TRUNK-41C1B8B4]
type=inbound-publication
event_asterisk-devicestate=SIP-TRUNK-41C1B8B4
[mikopbx-hints]
exten => 201,hint,PJSIP/201
exten => 202,hint,PJSIP/202
[SIP-TRUNK-41C1B8B4-devicestate]
type=outbound-publish
server_uri=sip:[email protected]:5060
event=asterisk-devicestate
outbound_auth=SIP-TRUNK-41C1B8B4

[SIP-TRUNK-41C1B8B4]
type=asterisk-publication
devicestate_publish=SIP-TRUNK-41C1B8B4-devicestate
device_state=yes
device_state_filter=^PJSIP/

[SIP-TRUNK-41C1B8B4]
type=inbound-publication
event_asterisk-devicestate=SIP-TRUNK-41C1B8B4

Creating a Trunk on FreePBX

Registration Variants

FreePBX Registers on MikoPBX

MikoPBX Registers on FreePBX

Routing Configuration

Subscriber Statuses

MikoPBX

Replace "SIP-TRUNK-41C1B8B4" with your MikoPBX provider ID and "172.16.156.216" with the FreePBX address as appropriate.

FreePBX

Replace "SIP-TRUNK-41C1B8B4" with your MikoPBX provider ID and "172.16.156.216" with the FreePBX address, as needed.

The outbound_auth=SIP-TRUNK-41C1B8B4 option applies only if FreePBX registers on MikoPBX. Status sharing was tested only under this registration scenario.

“Outbound Routing” article
“Incoming Routing” article
System File Customization
Provider parameters (MikoPBX)
"Trunks" section
Adding a new trunk
"Trunk Name" field
Advanced parameters of the trunk
Dialed Number Manipulation Rules
Registration Sample 1
Registration Sample 2
Advanced Options of provider
Outgoing routing template MikoPBX
Inbound routing template MikoPBX
Inbound routing template (Individual DID configuring)
Inbound routing template FreePBX
Outbound routing template FreePBX