RingCentral API for smart Incoming Call Routing

  • 1
  • Question
  • Updated 1 year ago
  • (Edited)
Hi.  I've looked everywhere for this, but have been unable to dig anything up for this.  I would like to create a smart incoming call router using the RC APIs.  If a client called in our standard App Call number line, this 'router' would bump up the incoming phone number against our own CRM, find their assigned user and directly route the call to their phone.  Likewise, if no match was found, it would send an 'invite' to available users, the first to take the cake would have the call routed to them.

I see documentation on using the desktop softphone app to launch an website or application after the call.  I'm talking about before it even connects to one of my team members.

Is there any documentation around call routing via the API/SDK use?

Thanks!
Photo of Brandon Hein

Brandon Hein

  • 348 Points 250 badge 2x thumb
  • awesome

Posted 1 year ago

  • 1
Photo of John Wang

John Wang, Official Rep

  • 5,654 Points 5k badge 2x thumb
Hi Brandon,

Depending on how many contacts you have in your CRM, you can load them in to RingCentral's call handling rules using the Answering Rule API. This way users will be routed to the right user. If a user is not found, you can send the call to a queue or forwarding group.

https://developer.ringcentral.com/api-docs/latest/index.html#!#RefUpdateAnsweringRule

We don't have the ability of looking up a number dynamically yet but this is something we are looking into.
(Edited)
Photo of Brandon Hein

Brandon Hein

  • 348 Points 250 badge 2x thumb
Thanks for the info John. I'd be interesting to have something like that in place. RC reach out to a company webservice, and the webservice would return an extension to route the call too.

These answering rules might be able to work with what I'm trying to accomplish, just an added layer of difficulty needing to be a step ahead of clients potentially calling in. You said 'depending on how many'... what is the cap or max allowed for these answering rules?
Photo of John Wang

John Wang, Official Rep

  • 5,408 Points 5k badge 2x thumb
Calling an external service is in our discussions so it's good to know your desire for this feature.

Regarding the answering rules, I just checked with the engineering team and we don't have any limits so the recommendation is to go ahead and start using it.
(Edited)
Photo of Jesse Hendon

Jesse Hendon

  • 424 Points 250 badge 2x thumb
Brandon, I needed to develop a similar system and here is how I accomplished it using the features RC makes available. 

There are 2 approaches you can take:
The first one makes usage of webRTC in order to create a Bot User that can answer, hangup, and most importantly transfer calls. When the signal that an incoming call has arrived, gather the callerID and consult your DB on what todo, then have the javascript controlled client act accordingly.

The 2nd Option is to define the constraints you want to impose on your routing rules, via source#, dialed#, or Time of Day. Then write an algorithm to solve for when a user in the call queue can or cannot accept the call.

So Given 3 members in a call queue with various constraints, its possible that for some callers only 1 or 2 of the members are eligible to receive. RingCentral makes it difficult because you cant remove people from the routing list based on a routing rule, you can only reshuffle the order. So my workaround is to divide your queues as such:
AAATNNN
Where A = Accepting call queue member given the constraint
           N = Not Accepting members 
           T = Termination node, simplified version of the WebRTC bot that answers and hangs up immediately, thereby preventing the call from progressing past the accepting members into the non-accepting members

If all members accept the constraints, the queue would look like this AAAAAAAAT.
Conversely, it would look likeTAAAAAA if none members accepts given the constraints

Hope that helps at all
(Edited)