npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ast-monitor

v0.0.9

Published

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

Downloads

23

Readme

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);
});