Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ast-monitor

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ast-monitor

A simple Asterisk events Monitor through Asterisk Manager Interface. You can monitor Peers Status, T1/E1 boards status, Congestion or Fail Calls and more.

  • 0.0.9
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by900%
Maintainers
1
Weekly downloads
 
Created
Source

ast-monitor

Ast-Monitor is a module to monitor events on Asterisk Manager Interface.

It simplify the task to get certain events link a call and its parts (called and caller channels) and join, clean and re-emit the event with a new object.

Use

const mon = require('ast-monitor')(AMI_PORT, AMI_HOST, AMI_USER, AMI_PASS, ARRAY_ITEMS_TO_MONITOR);
  • AMI_PORT: is the Asterisk Manager Interface port. Usually is 5038
  • AMI_HOST: the IP Address of your Asterisk
  • AMI_USER: the Asterisk Manager User defined on your /etc/asterisk/manager.conf
  • AMI_PASS: the Asterisk Manager User Password
  • ARRAY_ITEMS_TO_MONITOR: this is an array with the items you want monitor. It can be: trunks or peers
    • the array content can be a string with the item like peers, that means Monitor all peers, or an object with an array list of peer you want monitor like {'peers': ['8020','8021']} that means Monitor the peers 8020 and 8021
const mon = require('ast-monitor')('5038','192.168.10.252','snep','sneppass',[{'peers':['8029','8014']}]);

mon.events.on('online', function(data){
	console.log('Online: %s', JSON.stringify(data));
});

mon.events.on('offline', function(data){
	console.log('Offline: %s', JSON.stringify(data));
});

mon.events.on('oncall', function(data){
	console.log('OnCall: %s', JSON.stringify(data));
});

mon.events.on('hangup', function(data){
	console.log('Hangup: %s', JSON.stringify(data));
});

mon.events.on('state', function(data){
	console.log('State: %s', JSON.stringify(data));
});
mon.events.on('connected', function(data){
	console.log('Connected:');
	console.log(data);
});

mon.events.on('error', function(data){
	console.log('error:');
	console.log(data);
});

FAQs

Package last updated on 25 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc