var subscription = rcsdk.getSubscription();
subscription.on(subscription.events.notification, function(msg) {
console.log(msg.body.activeCalls[n].from);
// activeCalls is array
console.log(msg.body.activeCalls[n].to);
})
.register({
events: ['/account/~/extension/~/presence?detailedTelephonyState=true'],
})
.then(function(response) {
console.log('Success: Subscription is listening');
}).catch(function(e) {
alert('Subscription Error: ' + e.message);
});
Using This code for that