Not allowed subscribe for missed calls of another extension
Apr 25, 2018 at 4:36am • 2 replies • 0 likes
ashok-kumar
We are working on Ringcentral push notification app and now it is in production mode. We need to read other extensions missed call events but when we are trying to subscribe missed-calls and message-store events, then we are getting error as below :
"errorCode": "SUB-527",
"message": "Not allowed subscribe for missed calls of another extension"
Right now it is only allowing to subscribe for the same extension 101 which is admin default extension as shown in developer console. But when we are trying to subscribe for extension 102 or other extensions, it is giving the error as above.
We tested the app in sandbox account earlier and it was working properly. Also we have added permissions for read presence.
Please suggest.
2 Answers
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.
+ Phong
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
1
Hi Ashok,
Subscribing on missed-calls and incoming-call-pickup is allowed for the currently logged-in User due to security reasons. It's used to work this way for a long time. I believe there is no difference between Sandbox and Production for this behavior.
message-store is available for any User with {{ReadMessages}} permission, typically it's available for Admin Users and own extensions.
Could you please describe the scenario why do you need to get missed-calls notifications, which belong to another extension(s)?
Subscribing on missed-calls and incoming-call-pickup is allowed for the currently logged-in User due to security reasons. It's used to work this way for a long time. I believe there is no difference between Sandbox and Production for this behavior.
message-store is available for any User with {{ReadMessages}} permission, typically it's available for Admin Users and own extensions.
Could you please describe the scenario why do you need to get missed-calls notifications, which belong to another extension(s)?
1
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder