I want to receive events from Asterisk via ARI in my nodejs app (ari-client). As prerequisite i may not change the dialplan. Is there a way to receive all events like incoming sip calls etc. without Stasis apps in dialplan?
So far i’m able to request all known endpoint like shown below and i also did the test example to receive dtmf events, but unfortunately only with a Stasis app in the dialplan.
var ariClient = require('ari-client');
ariClient.connect('http://192.168.1.49:8088', 'USER', 'PASSWORD',
function (err, ari) {
if (err) {
console.log('Error: %s', JSON.parse(err));
throw err; // program will crash if it fails to connect
}
console.log('Requesting endpoints..');
ari.endpoints.list(
function (err, endpoints) {
var names = endpoints.map(function(item) {
return 'Client ' + item['resource'] + ' with ' + item['technology'] + ' is [' + item['state'] + ']';
});
socket.emit("event",'Requested endpoints: ' + names);
console.log('Endpoints: %s', names);
}
);
}
);