Returns if the connection is authenticated
Attempts to return a list of the current channels
Closes the connection to the server
Deletes a Database entry
Deletes the Database tree
Gets a Database entry
Gets Database entries, optionally at a particular family/key
Optional
family: stringOptional
key: stringPuts a Database entry
Returns if the chan_iax2 module is available
Returns if the chan_pjsip module is available
Returns if the chan_sip module is available
Attempts to return a list of the IAX2 peers
Attempts to log into the server over the AMI connection
Checks if the specified module is loaded on the server
Adds the listener
function to the end of the listeners array for the event
named eventName
. No checks are made to see if the listener
has already
been added. Multiple calls passing the same combination of eventName
and
listener
will result in the listener
being added, and called, multiple times.
server.on('connection', (stream) => {
console.log('someone connected!');
});
Returns a reference to the EventEmitter
, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The emitter.prependListener()
method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.on('foo', () => console.log('a'));
myEE.prependListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a
The callback function
Adds a one-time listener
function for the event named eventName
. The
next time eventName
is triggered, this listener is removed and then invoked.
server.once('connection', (stream) => {
console.log('Ah, we have our first user!');
});
Returns a reference to the EventEmitter
, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The emitter.prependOnceListener()
method can be used as an alternative to add the
event listener to the beginning of the listeners array.
import { EventEmitter } from 'node:events';
const myEE = new EventEmitter();
myEE.once('foo', () => console.log('a'));
myEE.prependOnceListener('foo', () => console.log('b'));
myEE.emit('foo');
// Prints:
// b
// a
The callback function
Pings the AMI connection (keepalive)
Attempts to return a list of the PJSIP contacts
Attempts to return a list of the PJSIP endpoints
Sends the AMI payload and awaits the response form the server
Attempts to return a list of the SIP peers
Constructs a new instance of AMI connection