Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.