Introduction to Asterisk-ARI


Asterisk RESTful Interface (ARI) was created to address the limitations of Asterisk Gateway Interface (AGI) and the Asterisk Manager Interface (AMI). Both AMI and AGI were created early in the Asterisk project, and are products of their time.

The  drawbacks to using AMI and AGI are the following.

  1. AGI is synchronous and blocks the thread servicing the AGI, when an Asterisk action is taken on the channel. It is difficult to do respond to changes in the channel like the DTMF received, or to monitor the channel state, etc with AGI by itself and you would require to coordinate with AMI events which can be challenging.
  2. The dialplan ( extensions.conf ) can be limiting, even with AMI and AGI, your fundamental operations are limited to what can be executed on a channel.  Bridges, endpoints, device state, message waiting indications, and the actual media on the channels themselves are not available through AGI & AMI, and it can be difficult to control them and can often involve complex dialplan manipulation to achieve.

ARI is an asynchronous API that allows developers to build communications applications by exposing the raw primitive objects in Asterisk – channels, bridges, endpoints, media, etc. – through an intuitive REST interface.

JSON events over a Web-socket are used to control the state of the object.

I shall cover the basics of interacting to Asterisk through ARI, using Python. Please follow the blog categories Here

Watch video on Building your First ARI Application