AMI: Not receive any event but Hangup

Hi,
I want to receive the Dial, Answer, Busy and Hangup event from AMI. But my code is listening Hangup event.

Can you please help me to debug?

const AmiClient = require('asterisk-ami-client');
//const https = require('https');

let client = new AmiClient({
    reconnect: true,
    keepAlive: true,
    emitEventsByTypes: true,
    emitResponsesById: true
});

client.connect('user', 'pass', { host: 'pbx.url', port: 5038 })
    .then(() => {
        client
            .on('Dial', event => console.log(event))
            .on('Hangup', event => console.log(event))
            .on('Hold', event => console.log(event))
            .on('Busy', event => console.log(event))
            .on('Bridge', event => console.log(event))
            .on('internalError', error => console.log(error));
    })
    .catch(error => console.log(error));

The only AMI events that exist out of that list are “Hangup” and “Hold”. The others don’t. You can find the full list on the wiki[1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+AMI+Events

Thanks. I just checked the example on the node module page and not the official documentation, how dumb am I.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.