@gibme/asterisk-manager-interface
    Preparing search index...

    Class AsteriskManagerInterface

    Hierarchy

    • EventEmitter
      • AsteriskManagerInterface
    Index

    Constructors

    Accessors

    • get authenticated(): boolean

      Returns if the connection is authenticated

      Returns boolean

    Methods

    • Attempts to return a list of the current channels

      Returns Promise<Channel[]>

    • Closes the connection to the server

      Returns Promise<void>

    • Deletes a Database entry

      Parameters

      • family: string
      • key: string

      Returns Promise<boolean>

    • Deletes the Database tree

      Parameters

      • family: string
      • key: string

      Returns Promise<boolean>

    • Gets a Database entry

      Parameters

      • family: string
      • key: string

      Returns Promise<undefined | { key: string; value: string }>

    • Gets Database entries, optionally at a particular family/key

      Parameters

      • Optionalfamily: string
      • Optionalkey: string

      Returns Promise<{ key: string; value: string }[]>

    • Puts a Database entry

      Parameters

      • family: string
      • key: string
      • value: string

      Returns Promise<boolean>

    • Returns if the chan_iax2 module is available

      Returns Promise<boolean>

    • Returns if the chan_pjsip module is available

      Returns Promise<boolean>

    • Returns if the chan_sip module is available

      Returns Promise<boolean>

    • Attempts to log into the server over the AMI connection

      Parameters

      • user: string = ...
      • password: string = ...

      Returns Promise<boolean>

    • Checks if the specified module is loaded on the server

      Parameters

      • module: string

      Returns Promise<boolean>

    • 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

      Parameters

      • event: "close"
      • listener: (hadError?: boolean) => void

        The callback function

      Returns this

      v0.1.101

    • Parameters

      • event: "error"
      • listener: (error: Error) => void

      Returns this

    • Parameters

      • event: "connect"
      • listener: () => void

      Returns this

    • Type Parameters

      • T = any

      Parameters

      • event: "response"
      • listener: (payload: T) => void

      Returns this

    • 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

      Type Parameters

      • T = any

      Parameters

      • event: "response"
      • listener: (payload: T) => void

        The callback function

      Returns this

      v0.3.0

    • Pings the AMI connection (keepalive)

      Returns Promise<boolean>

    • Attempts to return a list of the PJSIP contacts

      Returns Promise<Contact[]>

    • Attempts to return a list of the PJSIP endpoints

      Returns Promise<Endpoint[]>