question

ashok-kumar avatar image
ashok-kumar asked ·

Not allowed subscribe for missed calls of another extension

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.
topic-default
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

igor-bebin avatar image
igor-bebin answered ·
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)?


2 comments Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks Igor for your feedback.
We have a requirement that if client gets any missed call on any of his extensions, then we need to add an action in velocify. For that we were working on getting the missed call event on our own server and from there pushing to velocify.
Is there any other way we can get the missed call push notification for all extensions?
0 Likes 0 · ·
Please Reply as soon as possible.
0 Likes 0 · ·
Phong Vu avatar image
Phong Vu answered ·
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
1 comment Share
1 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Thanks Phong Vu we will check.
0 Likes 0 · ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.