# MikoPBX and FreePBX (IAX)

## MikoPBX Configuration

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

<figure><img src="/files/dyL1VmwGxXpltp7iMLJm" alt=""><figcaption><p>"Telephony providers" section</p></figcaption></figure>

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

<figure><img src="/files/doBMGQZ8p4hT277IDiMQ" 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="/files/D4wbF8IQTWKTVsnPIVpT" 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="/files/vOnkN4sNXGfGCsxkyufT" 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="/files/7HjW9wG0GiDnTxImYhJO" 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="/files/3eVQFDmzYfRfwXLqjXQ1" alt=""><figcaption><p>"Trunk Name" field</p></figcaption></figure>

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

<figure><img src="/files/E4vo6ynv88vTstrQE0G6" 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="/files/46h5GU4UE3IZF9tKvkyR" 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="/files/K6DZadIg5GSYBQQhJAmb" 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\_FREE\_PBX”**:

<figure><img src="/files/lDGIWv2MBxc0EXS6qiYV" alt=""><figcaption><p>"Register String" field</p></figcaption></figure>

## Routing Setup

### MikoPBX

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

<figure><img src="/files/RRT3BNxrRRu7WanqpqiG" 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="/files/G05NxUgNcx0WpZ1X5VKW" 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="/files/lP9pX0wnGoPIqRFAnN56" alt=""><figcaption><p>Outbound routing MikoPBX</p></figcaption></figure>

### FreePBX

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

<figure><img src="/files/j3Ki8H8ki3v1tTxAmudh" alt=""><figcaption><p>Inbound routing FreePBX</p></figcaption></figure>

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

<figure><img src="/files/fRtbpydhN3Em2uJq7p8g" alt=""><figcaption><p>Outbound routing FreePBX</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

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

The question should be specific, self-contained, and written in natural language.
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.
