
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@revall/asterisk-ami-connector
Advanced tools
This library is a part of Asterisk's AMI Client library.
$ npm i asterisk-ami-connector
support >=4.0.0
Base example with promises.
const connector = require('asterisk-ami-connector')({reconnect: true});
connector.connect('login', 'password', {host: '127.0.0.1', port: 5038})
.then(amiConnection => {
amiConnection
.on('event', event => {
console.log(event);
amiConnection.close();
})
.on('response', response => console.log(response))
.on('close', () => console.log('closed'))
.on('error', error => console.log(error));
})
.catch(error => console.log(error));
or using co
for synchronous code style
const connector = require('asterisk-ami-connector')({reconnect: true});
const co = require('co');
co(function*(){
let amiConnection = yield connector.connect('login', 'password', {host: '127.0.0.1', port: 5038});
amiConnection
.on('event', event => {
console.log(event);
amiConnection.close();
})
.on('response', response => console.log(response))
.on('close', () => console.log('closed'))
.on('error', error => console.log(error));
})
.catch(error => console.log(error));
or with co
like synchronous style
false
. Reconnection during connection setup.null
(infinity). Max count of attempts of reconnection.connect
It takes the following parameters:
net.connect
method.It always returns promise. That promise will be resolved with instance of AmiConnection, or will be reject with AmiAuthError.
AmiConnection
It is a class-wrapper for Asterisk's AMI socket, which was inherit from EventEmitter.
Available methods:
Available props:
true
when connection to Asterisk AMI established;Available events:
AmiAuthError
It class of Asterisk AMI auth-errors, which was inherit from Error.
Use env-variable DEBUG=*
for print to console of steps of connection establishment.
For examples, please, see ./examples/*
or tests ./test/*
.
Tests require Mocha.
mocha ./tests
or with npm
npm test
Test coverage with Istanbul
npm run coverage
Licensed under the MIT License
FAQs
Asterisk AMI Connector for NodeJS (ES2015)
The npm package @revall/asterisk-ami-connector receives a total of 0 weekly downloads. As such, @revall/asterisk-ami-connector popularity was classified as not popular.
We found that @revall/asterisk-ami-connector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.