Skip to content
Phone Guides

Choose AGI, AMI or ARI for an Asterisk integration

Choose the interface after describing what the application must do during a call. A screen showing call events, a dialplan lookup and a custom communications application can need different interfaces even when all three use the same customer records.

Source-reviewed, 18 October 2026. Prepared from the cited documentation. Integration designs have not been independently tested by Phone Guides. Scope: Asterisk 22 interface concepts; individual actions, events and resources require matching version references.

Compare the control model

Interface Common role Question to settle first
AGI / FastAGI Let an external program participate in dialplan execution How long may the call wait for that program?
AMI Receive management/events and request supported actions Which actions and event data does the account actually need?
ARI Build an application around channels, bridges and media resources Which channels enter the application's Stasis control and how are events handled?

These are starting points, not mutually exclusive product labels. An application can use more than one interface, but each additional connection adds identity, failure and lifecycle work.

AGI: a program in a dialplan path

AGI connects dialplan execution with an external program through a command/response interface. FastAGI moves that interaction across a network service. Design timeouts and a fallback destination before adding an external lookup to a caller's path.

Use the official AGI documentation to choose the execution model. Do not assume that a successful HTTP request in an unrelated application proves the AGI protocol, channel lifetime or hangup handling is correct. Keep program diagnostics out of the protocol response stream.

AMI: events and supported management actions

AMI suits applications that consume Asterisk events and issue defined actions, such as an application requesting call origination. Restrict its account permissions and network access to the actual job. A read-only status application should not receive configuration-changing authority simply because an example uses a broad account.

The AMI documentation leads to protocol and versioned action/event references. Check each required action and event; the interface name alone does not establish that an application has all the control it needs. Correlate responses and events rather than assuming a request acknowledgement means the called party answered.

ARI: an application owns a defined call lifecycle

ARI exposes communications resources to an application, using resource requests and asynchronous events. The dialplan's Stasis() application is the handover point for channels under that application's control. The application must manage resource lifetime, call termination and dependency failures.

The upstream ARI overview explains this model and advises placing production access behind your own application server. Browser code should not hold PBX service credentials. Continue with ARI and Stasis for the setup boundaries.

Write the integration contract

Record the trigger, allowed operations, required data, call stage, expected response time and fallback. Identify which side initiates each connection, how credentials are stored, and which component owns retries. Define behaviour when the caller hangs up before a slow external request completes.

For event consumers, plan reconnect and state reconciliation. For actions that can create calls or records, distinguish a safe retry from a duplicate operation. For every path, redact numbers and authentication material from ordinary application logs.

Choose maintained client code only after checking the current library, its supported Asterisk/API versions and its own source. An upstream list of libraries is a research starting point, not a blanket maintenance guarantee.

Related: phone system integrations, security baseline and architecture. Return to Asterisk documentation.