Created
May 22, 2017 03:25
-
-
Save zengfenfei/63f7a6d3c69cd4b27233fc7cae62134f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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