rx-ami
v1.0.55
Published
## What is Asterisk AMI?
Downloads
18
Readme
Reactive Asterisk Manager Interface (AMI)
What is Asterisk AMI?
Asterisk Manager Interface (AMI) is a powerful programmatic interface for Asterisk, allowing for communications between Asterisk and external applications. AMI is asynchronous in nature, allowing for fast and efficient communication from Asterisk to an external application. AMI is a TCP protocol based on JSON (JavaScript Object Notation), and is heavily documented in the Asterisk source tree in the form of an XML schema.
What is Reactive Asterisk Manager Interface (AMI) ?
This is a library to connect to Asterisk AMI and listen to events. It uses RxJs to handle stream of events. It will emit all events as Observable.
How to use it ?
Install
npm install rx-ami --save
Import
import { AmiClient } from 'rx-ami';
// specify connection options
const options: AMIConnectionOptions = {
host: 'localhost',
port: 5038,
username: 'username',
password: 'password',
connectionTimeout: 20000,
};
// create client
const amiClient = new AmiClient(options);
// connect to AMI
const result = await amiClient.connect();
// send action to AMI and get response
const queueEvents = await amiClient.sendAction(new QueueSummaryAction());
Libraries
NodeJs
This library is build on NodeJs TCP Socket.
RxJs
NodeJs socket is stream based. RxJs is used for packet parsing and stream handling.
Typescript
This library is build on Typescript and can be used in any NodeJs project.
uuid
This library is used to generate unique id for each packet.