An Asterisk REST Interface (ARI) websocket and API client library
An Asterisk REST Interface websocket and API client library for Node.js.
npm install awry
const awry = require('awry');
const api = new awry.API({
baseUrl: 'http://asterisk.local:8088/ari',
username: 'asterisk',
password: 'asterisk'
});
api.applications.list().then(apps => {
console.log(apps);
});
const events = awry.Events.connect({
app: 'someApp',
url: 'http://asterisk.local:8088/ari/events',
username: 'asterisk',
password: 'asterisk'
});
events.on('message', message => {
console.log(message);
});
Documentation is available in the repository. You can compile the documentation
by doing the following:
git clone git@github.com:chadxz/awry.git
cd awry
npm install
npm run docs
The latest documentation can now be found under the docs
directory.
awry uses the debug module to log
debugging output. To enable this output to print to the console, set the
environment variable DEBUG
to one of the following when running your app:
awry:*
- shows all debug output from this library.awry:ARIWebSocket
- shows only the debug output from the ARIWebSocketawry:ReconnectingWebSocket
- shows only the debug output from theFor example: DEBUG=awry:* node myapp.js
See CONTRIBUTING.md.