Function is not executed

I use the Asterisk-Manager package for NodeJs

and Phoner

for testing purposes. I want to test the call functionality using this code

const asterisk = require('asterisk-manager');
const { port, host, user, password, events } = require('../config.json').phone;
const ami = new asterisk(port, host, user, password, events);

module.exports = () => {
    if (!ami.isConnected()) {
        console.log(`Phone is not connected, trying to connect`);


        if (!ami.isConnected()) {
            throw Error(`Failed to connect`);
        } else {
            console.log(`Connected successfully`);

        action: 'originate',
        channel: 'SIP/phonerUser',
        context: 'internal',
        exten: 1337,
        priority: 1
    }, (err, res) => {


but the originate action is not executed. The code does not hit the callback function so I can’t even log an error. When I try to log


before calling the action I get a true. Am I missing something?

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