项目作者: chadxz

项目描述 :
An Asterisk REST Interface (ARI) websocket and API client library
高级语言: JavaScript
项目地址: git://github.com/chadxz/awry.git
创建时间: 2016-08-28T02:35:31Z
项目社区:https://github.com/chadxz/awry

开源协议:MIT License

下载


awry

Build Status
Codecov
Known Vulnerabilities

An Asterisk REST Interface websocket and API client library for Node.js.

installation

npm install awry

usage

  1. const awry = require('awry');
  2. const api = new awry.API({
  3. baseUrl: 'http://asterisk.local:8088/ari',
  4. username: 'asterisk',
  5. password: 'asterisk'
  6. });
  7. api.applications.list().then(apps => {
  8. console.log(apps);
  9. });
  10. const events = awry.Events.connect({
  11. app: 'someApp',
  12. url: 'http://asterisk.local:8088/ari/events',
  13. username: 'asterisk',
  14. password: 'asterisk'
  15. });
  16. events.on('message', message => {
  17. console.log(message);
  18. });

documentation

Documentation is available in the repository. You can compile the documentation
by doing the following:

  1. git clone git@github.com:chadxz/awry.git
  2. cd awry
  3. npm install
  4. npm run docs

The latest documentation can now be found under the docs directory.

debugging

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 ARIWebSocket
    sub-module.
  • awry:ReconnectingWebSocket - shows only the debug output from the
    ReconnectingWebSocket sub-module.

For example: DEBUG=awry:* node myapp.js

contributing

See CONTRIBUTING.md.

license

MIT