# Integration guide for MirtaPBX

> Configure MirtaPBX extensions for WebRTC and optionally let WebRTC Client authenticate users via the MirtaPBX API, so SIP credentials are never stored.

URL: https://webrtcclient.com/guides/mirtapbx/

![MirtaPBX logo](https://webrtcclient.com/img/logos/mirtapbx-large.png)

Before you start, first follow the [Asterisk guide](https://webrtcclient.com/guides/asterisk/) to set up the websocket on the MirtaPBX server. Then continue below.

## Configure the extensions

For each extension, set the following in the **Security** section:

- WebRTC Support: **Yes**
- RTP Encryption (SRTP): **Yes**

![MirtaPBX extension security settings with WebRTC support and SRTP enabled](https://webrtcclient.com/img/guides/mirtapbx-extension-webrtc.png "MirtaPBX extension: enable WebRTC support and SRTP.")

Users can now log in to WebRTC Client.

## Optional: login via the MirtaPBX API

WebRTC Client can also talk to the MirtaPBX API. This saves time and removes the need to share or store SIP credentials in the WebRTC Client platform. When a user logs in, the `GETWEBRTCAUTH` API request retrieves the SIP username and password, and WebRTC Client uses them to set up the websocket connection to the PBX.

**Important:**
With API login, the *forgot password* feature of WebRTC Client does not work, because the password is managed in MirtaPBX.

### In MirtaPBX

1. Create an extension and enable **WebRTC support** and **SRTP** (see above).
2. Enter a **Web User** (an e-mail address) and **password**. These become the user's login credentials for WebRTC Client.

![MirtaPBX web user with e-mail address and password](https://webrtcclient.com/img/guides/mirtapbx-web-user.png "The MirtaPBX Web User (e-mail) and password are used to log in.")

### In the WebRTC Client management portal

1. Open the customer and go to the **PBX server settings**.
2. Select **Authenticate users using the API**.
3. Enter the MirtaPBX API details (API URL and credentials) and save.

The newly created user can now log in to WebRTC Client with the MirtaPBX web-user credentials.
