# Asterisk Manager Interface (AMI) Overview

The Asterisk Manager Interface (AMI) is a monitoring and management channel built into Asterisk. Cloud Voice exposes AMI so that an external client can connect to your phone system and interact with it programmatically.

## What AMI does

AMI follows a client/server model that runs over TCP. A client program opens a connection to the server and then exchanges data across the TCP/IP stream: it can send commands and read a stream of events as they happen. Through this interface you can drive your phone system (its PBX, short for Private Branch Exchange) in a number of ways, including:

- Placing (originating) calls
- Checking voicemail (mailbox) status
- Monitoring extensions
- Managing other aspects of the PBX

## Connect a client to Cloud Voice over AMI

Connecting involves two parts: turning on AMI in the management portal and defining who may reach it, then pointing your client at the details Cloud Voice generates.

### Step 1: Enable AMI

1. Sign in to the management portal and go to **Integrations > AMI**.
2. Turn on **AMI**.
3. Under the **AMI** section, set the credentials a third party will use to authenticate:
   - **Username**: the account name the external client presents to reach AMI.
   - **Password**: the secret that pairs with the username.

   :::caution
   AMI can control your phone system: it can place calls, read mailbox and extension status, and manage the PBX. Anyone who knows these credentials and can reach the AMI port effectively controls your system, which is a toll-fraud risk. Use a long, unique username and password, and keep the **Permitted IP** list (Step 4) as narrow as possible.
   :::
4. Under the **Permitted IP** section, restrict which clients are allowed to connect:
   1. In the **IP Address** field, click **Add**.
   2. Enter a single address or a range that should have access, using the format `XXX.XXX.XXX.XXX`.

      For example, IP address `216.207.245.47` with subnet mask `255.255.255.255` permits only the host at `216.207.245.47` to reach the phone system through AMI.

      :::note
      You can define up to 4 permitted IP addresses.
      :::
5. Click **Save**, then **Apply**.

   Cloud Voice now shows the **Server Address** and **Port** on the page. These values are assigned by the system and cannot be changed.

   
   ![Cloud Voice, the AMI settings page showing the read-only server address and port after AMI is enabled](/images/pbx/ami-port-and-pbx-ip-ce.png)

### Step 2: Configure the AMI client

Enter the username, password, server address, and port from the previous step into your AMI client, then connect it to the phone system.
