Skip to content

Instantly share code, notes, and snippets.

@zengfenfei
Created May 22, 2017 03:25
Show Gist options
  • Save zengfenfei/63f7a6d3c69cd4b27233fc7cae62134f to your computer and use it in GitHub Desktop.
Save zengfenfei/63f7a6d3c69cd4b27233fc7cae62134f to your computer and use it in GitHub Desktop.
let subscription = rc.createSubscription();
subscription.onMessage(msg => {
let presenceEvt = msg.body;
console.log('>> telephonyStatus', presenceEvt.telephonyStatus);
console.log('>> activeCalls', presenceEvt.activeCalls);
console.log('@@ presence event', presenceEvt);
});
subscription.subscribe(['/account/~/extension/~/presence?detailedTelephonyState=true'])
.then(subscription => {
console.log('Subscription created', subscription);
}, e => {
console.error('Fail to subscribe', e);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment