Asterisk AMI Events Stream for NodeJS (ES2015)
This is a transform stream for AMI socket. This stream has a three custom events:
This library is a part of Asterisk's AMI Client library.
amiEvent- fired when event was receive. Handler of this event receives AMI event object.
amiResponse- fired when response was receive. Handler of this event receives AMI response object.
amiAction- fired when action was receive. Handler of this event receives AMI action object.
If response from AMI not has structure like this:
<KEY>: <VALUE>CRLF <KEY>: <VALUE>CRLF ... <KEY>: <VALUE>CRLFx2
In above case, body of this response will be available in
$content property of response object.
$ npm i asterisk-ami-events-stream
const net = ;const amiUtils = ;const AmiEventsStream = ;const eventsStream = ;const amiSocket = net;amiSocket;eventsStream;
For examples, please, see tests
Tests require Mocha.
Test coverage with Istanbul
npm run coverage
Licensed under the MIT License