Hi Ashok,
I you can use this workaround solution to detect missed call for any extension under an account. The sample code is in Node JS, but you can implement similar way in other programming languages.
var RC = require('ringcentral') require('dotenv').load() var rcsdk = new RC({ server: process.env.SERVER, appKey: process.env.APP_KEY, appSecret: process.env.APP_SECRET }) var users = [] var platform = rcsdk.platform() login() function login(){ platform.login({ username: process.env.USERNAME, password: process.env.PASSWORD }) .then(function(resp){ removeRegisteredSubscription() subscribeForNotification() }) .catch(function(e){ console.log(e) throw e }) } var subcription = rcsdk.createSubscription() function subscribeForNotification(){ var eventFilter = [] eventFilter.push('/restapi/v1.0/account/~/presence') subcription.setEventFilters(eventFilter) .register() .then(function(resp){ console.log('ready to get account presense') }) .catch(function(e){ throw e }) } subcription.on(subcription.events.notification, function(msg){ var user = {} user['extensionId'] = msg.body.extensionId user['telephonyStatus'] = msg.body.telephonyStatus checkMissedCall(user) }) function checkMissedCall(user){ var newUser = true for (var i=0; i<users.length; i++){ if (users[i].extensionId == user.extensionId){ newUser = false if (users[i].telephonyStatus == "Ringing" && user.telephonyStatus == "CallConnected"){ users[i].telephonyStatus = user.telephonyStatus console.log("this extensionId " + users[i].extensionId + " has a accepted a call") break } if (user.telephonyStatus == "NoCall" && users[i].telephonyStatus == "Ringing"){ users[i].telephonyStatus = user.telephonyStatus console.log("this extensionId " + users[i].extensionId + " has a missed call") break } users[i].telephonyStatus = user.telephonyStatus } } if (newUser){ users.push(user) } } function removeRegisteredSubscription() {
platform.get('/subscription') .then(function (response) { var data = response.json(); if (data.records.length > 0){ for(var record of data.records) { // delete old subscription before creating a new one platform.delete('/subscription/' + record.id) .then(function (response) { console.log("deleted: " + record.id) }) .catch(function(e) { console.error(e); throw e; }); } } }) .catch(function(e) { console.error(e); throw e; }); }
Hope this helps!
+ Phong