> For the complete documentation index, see [llms.txt](https://docs.mikopbx.com/mikopbx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mikopbx.com/mikopbx/english/faq/interconnections/mikopbx-and-freepbx-iax.md).

# MikoPBX and FreePBX (IAX)

Instructions for connecting multiple PBX systems

## MikoPBX Configuration

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

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FVYiyVJv2nPxA6RmMSve3%2FTelephonyProvidersSection.jpg?alt=media&amp;token=17a501df-c2ec-4e8d-bb51-799659b21774" alt=""><figcaption><p>"Telephony providers" section</p></figcaption></figure>

2. Create a new **IAX** provider:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FIqLpbxS0NrEgRTqq2D6b%2FconnectIAXBtn.jpg?alt=media&amp;token=18113b91-17d6-450c-8287-861215bd8f6f" alt=""><figcaption><p>"Connect IAX" button</p></figcaption></figure>

3. Fill in the parameters:

* **Provider Name** – any name
* **Host or IP Address** – the IP address of FreePBX
* **Username** – “tmp”
* **Password** – any (secure) password

Save the parameters.

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F0aD7JKAqf2kYkJpYR6EM%2FproviderParameters.jpg?alt=media&amp;token=db9c9bd2-e500-47fa-9ce8-3473efbfe671" alt=""><figcaption><p>Provider Parameters 1</p></figcaption></figure>

4. After saving, you’ll see the **provider ID** in the browser’s address bar. Copy it into the **Username** field:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2F29A0j5X8s4SQT1JW0c73%2FproviderParameters2.jpg?alt=media&amp;token=ea2a3340-49e2-4224-995e-89a3ed4956ac" alt=""><figcaption><p>Provider Parameters 2</p></figcaption></figure>

## FreePBX Configuration

1. In FreePBX, go to **"Connectivity" → "Trunks"** and add a new **IAX2** trunk:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FOgaxn9HFM2PWaocgw7XQ%2FnewIAXTrunkFreePBX.jpg?alt=media&amp;token=0e8cf82f-dacd-4020-9bd7-20c945ed1f0c" alt=""><figcaption><p>New IAX2 Trunk</p></figcaption></figure>

2. Under the **"General"** tab, set **Trunk Name** to the login used in MikoPBX (seen in the browser address bar, e.g., “**IAX-TRUNK-1E8B1CFE**”):

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FcyvQyGsInJOwyYfRcTQG%2FTrunkNameFreePBX.jpg?alt=media&amp;token=cf427493-ac17-4061-bb1b-7e1fcccdfea6" alt=""><figcaption><p>"Trunk Name" field</p></figcaption></figure>

3. Under **"Dialed Number Manipulation Rules,"** define a pattern for outgoing calls:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FWWOmhEQiVFt7voAIN6sy%2FDNMRFreePBX.jpg?alt=media&amp;token=34f985c8-3ed9-4244-8b61-f44f5d575cea" alt=""><figcaption><p>Dialed Number Manipulation Rules</p></figcaption></figure>

4. Go to **"pjsip Settings"** → **"iax2 Settings."** Under **Trunk Name**, use the same login from MikoPBX (e.g., “IAX-TRUNK-1E8B1CFE”):

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2Fbq76gg7xL0l5CYuCO45g%2Fiax2TrunkName.jpg?alt=media&amp;token=7583ab13-2d23-435d-b78b-c34c2995ba77" alt=""><figcaption><p>"Trunk Name" field (iax2 Settings)</p></figcaption></figure>

Fill in **PEER Details**:

```
type=friend
auth=plaintext
language=ru-ru
qualify=2000
transfer=mediaonly
disallow=all
;username=mikopbx
host=dynamic
trunk=yes
secret=123
allow=alaw&ulaw
```

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FZwWCznLGtzAIoZqOQECf%2FPEERDetailsParameters.jpg?alt=media&amp;token=a1bc9214-48ab-4153-aac1-169b03841433" alt=""><figcaption><p>"PEER Details" field</p></figcaption></figure>

5. In the **"Incoming"** tab, fill in the **Register String** field in the format **“LOGIN:PASSWORD\@IP\_MIKO\_PBX”**:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FnDijzCOfC2Zo1d7kCk9r%2FregisterStringFieldFreePBX.jpg?alt=media&amp;token=c1509a14-b896-453e-a4e3-50724120872e" alt=""><figcaption><p>"Register String" field</p></figcaption></figure>

## Routing Setup

### MikoPBX

1. Define an **incoming route** ([see “Incoming Routes” guide](https://docs.mikopbx.com/mikopbx/english/manual/routing/incoming-routing.md)). In this example, all calls are routed to extension **202**:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FSb9W5dEXRhEUmYqMBS2w%2FinboundMikoPBX.jpg?alt=media&amp;token=a9252154-f911-4190-ac2a-82c0e3ca9519" alt=""><figcaption><p>Inbound routing rule MikoPBX</p></figcaption></figure>

If needed, define a separate route for each DID with its own destination:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FCv4VpLd07PCd2hPy0dc5%2FinboundMikoPBXindividualDID.jpg?alt=media&amp;token=bbf12e2c-b674-4637-a595-21ba62b24182" alt=""><figcaption><p>Inbound routing rule MikoPBX (Individual DID)</p></figcaption></figure>

2. Define an **outgoing route** ([see “Outbound Routes” guide](https://chatgpt.com/manual/routing/outbound-routing.md)):

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FSFpFevvtr12kKibx0IJ8%2FoutboundRulesMikoPBX(USA).jpg?alt=media&amp;token=c9bdf807-f071-424d-abe5-d821677314c9" alt=""><figcaption><p>Outbound routing MikoPBX</p></figcaption></figure>

### FreePBX

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

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FcoAMrpJ6kBhn55iILi9X%2FinboundRouteFreePBX.jpg?alt=media&amp;token=1b9799ae-1050-41ad-8a38-9078a31f4846" alt=""><figcaption><p>Inbound routing FreePBX</p></figcaption></figure>

2. Go to **"Connectivity" → "Outbound Routes"** and define an outbound route:

<figure><img src="https://835495363-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsZ8acWnNlSalIHQjMFu1%2Fuploads%2FyPcV8k2q4OOKUQWW6x7B%2FoutboundRoutingFreePBX.jpg?alt=media&amp;token=cdfafd83-609e-466d-8a50-9d7c919f3bed" alt=""><figcaption><p>Outbound routing FreePBX</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mikopbx.com/mikopbx/english/faq/interconnections/mikopbx-and-freepbx-iax.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
