Skip to content

Instantly share code, notes, and snippets.

@radicaldrew
Last active July 1, 2019 06:19
Show Gist options
  • Save radicaldrew/eab9449e00d5eda59ed81289b83b2e94 to your computer and use it in GitHub Desktop.
Save radicaldrew/eab9449e00d5eda59ed81289b83b2e94 to your computer and use it in GitHub Desktop.
const callControl = require('node-kamailio-callcontrol')({socket: "/opt/callcontrol/socket", heartbeat: 60000, redis: { server: '127.0.0.1', port: 4289}});
callControl.on('init', (call) => {
console.log('received init', call);
});
callControl.on('start', (call) => {
console.log('received start', call);
call.heartbeat.createEvent(1, function(count, last) {
console.log(`call ${call.callid} ran for 1 minute...`);
call.end();
});
});
callControl.on('stop', (call) => {
console.log('received stop', call);
});
callControl.on('connection', () => {
console.log(`received connection`);
});
callControl.start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment