Cannot connect with AMI

enabled = yes
;webenabled = yes

port = 5038
;bindaddr =
bindaddr =

read = system,call,log,verbose,agent,user,config,dtmf,reporting,cdr,dialplan, originate,command
write = system,call,agent,user,config,command,reporting,originate,message,log,verbose

this is my manager.conf

const AsteriskAmi = require(“asterisk-manager”);

const amiConfig = {
host: “localhost”, //write_ your_asterisk-server_IP addr.
port: 5038,
username: “Admin”, // add_your_username of ami
password: “admin@123”, // add_your_password of ami

const ami = new AsteriskAmi();

// Connect to Asterisk AMI
ami.connect(amiConfig, (err) => {
if (err) {
console.error(‘Failed to connect to Asterisk AMI:’, err);
console.log(‘Connected to Asterisk AMI’);

// Example: Sending a Ping action
    Action: 'Ping'
}, (pingErr, res) => {
    if (pingErr) {
        console.error('Failed to send Ping command:', pingErr);

    console.log('Ping command sent successfully:', res);

// Example: Disconnecting from Asterisk AMI after a delay (for demonstration purposes)
setTimeout(() => {
console.log(‘Disconnected from Asterisk AMI’);
}, 5000); // Disconnect after 5 seconds (adjust as needed)

// Handle connection close event
ami.on(‘close’, () => {
console.log(‘Connection to Asterisk AMI closed’);

// Handle error event
ami.on(‘error’, (err) => {
console.error(‘Asterisk AMI connection error:’, err);

this is my node js application to connect with Asterisk AMI but i got a error like this ** Connect attempt from ‘’ unable to authenticate ** , please anyone guide me to solve this problem

On Saturday 06 April 2024 at 10:19:21, Suhasini.R via Asterisk Community

this is my manager.cnf

If you mean that literally, this could be your problem - the filename should be


Ich habe gerade ein Bier getrunken.
Jetzt habe ich kein Bock mehr :frowning:

                                               Please reply to the list;
                                                     please *don't* CC me.

sorry, that’s typing mistake, It’s manager.conf only

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