0

I've installed RingCentral app and want to create cases based on conditions on extension number of receiver.

A new task automatically gets created once you receive any call, I am going to write trigger to generate cases if receiver's extension matches my criteria.

Please let me know any workaround to get receiver extension number.

Thanks

Grokify
  • 15,092
  • 6
  • 60
  • 81
Amol
  • 1

1 Answers1

0

I am not sure what you meant by saying that you have installed RingCentral app? But if you somehow have the phone number (from an incoming call, in coming sms, call-log etc.) and you want to detect the extension number of that phone number. Then the first requirement is that, that phone number must belong to the same RingCentral account you are logged in. The second requirement is you must login with the main account number of with an extension that has the Super Admin role. Below is some code in node JS to get extension number.

var incallNumber = "+1234567890"
platform.get('/account/~/phone-number', {
usageType: 'DirectNumber'
})
.then(function(resp){
  console.log(resp)
  var json = resp.json()
  for (var record of json.records){
    //if (incallNumber == record.phoneNumber){
      console.log('Phone number: ' + record.phoneNumber)
      if (record.extension.hasOwnProperty('extensionNumber'))
        console.log('Extension number: ' + record.extension.extensionNumber)
      else
        console.log('No extension number')
      console.log('---')
    //}
  }
})

You can then replace the incallNumber with your number and uncomment the if condition to match them.

Hope this helps.

Paco Vu
  • 211
  • 1
  • 3