EVENT ASTERISK MANAGER


npm install asterisk-manager

/home/node_modules/asterisk-manager/lib/test.js

test.js

var ami = new require(‘asterisk-manager’)(‘5038′,’192.168.0.105′,’username’,’password’, true);

// Listen for any/all AMI events.
ami.on(‘managerevent’, function(evt) {
console.log(‘EVENT ::’, evt);

});

// Listen for specific AMI events. A list of event names can be found at
// https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+AMI+Events
ami.on(‘hangup’, function(evt) {
console.log(‘HANGUP ::’, evt);
});
ami.on(‘confbridgejoin’, function(evt) {
console.log(‘CONFBRIDGEJOIN ::’, evt);
});

ami.on(‘close’, function(e) {
console.log(‘CLOSE ::’, e);
});
ami.on(‘disconnect’, function(e) {
console.log(‘DISCONNECT ::’, e);
});
ami.on(‘connect’, function(e) {
console.log(‘CONNECT ::’, e);
});

ami.action({
‘action’:’originate’,
‘channel’:’SIP/4001′,
‘context’:’default’,
‘exten’:1234,
‘priority’:1,
‘variables’:{
‘name1′:’value1’,
‘name2′:’value2’
}
}, function(err, res) {});

Leave a comment

shisdew

Listens until think alike

moses.spaceku@yahoo.com / voip ipbx

Hosted PBX, IP-PBX SOHO/ CALL CENTER, VOICE GATEWAY, VOICE CARD, COST EFECTIVE SOLUTIONS (LCR), GSM/CDMA GATEWAY