brandon-hein avatar image
brandon-hein asked brandon-hein edited

RingCentral API for smart Incoming Call Routing

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?


1 |3000

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

brandon-hein avatar image
brandon-hein answered brandon-hein edited

Following back up to this... after 2 years, it appears that RC has created some awesome endpoints to leverage for this. More specific to this situation, `CallControl` - Forward Call Party.

Build out process to be like this:
1. Web server app that listens to notification events to your main company line account/extension. Could be serverless with AWS, or using Heroku, or anything that can be hit via http.
2. Subscribe via WebHook presence telephony events.
3. When an incoming call comes in to the webhook... your app does magic to route to a specific person
4. Once found... using the `CallControl` - Forward Call Party. endpoint/request to route the call.
5. Celebrate... because that was easy.

1 |3000

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

John Wang avatar image
John Wang answered
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.!#RefUpdateAnsweringRule

We don't have the ability of looking up a number dynamically yet but this is something we are looking into.
1 |3000

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

brandon-hein avatar image
brandon-hein answered jesse-hendon commented
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?
1 |3000

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

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:
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
1 Like 1 ·
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.
0 Likes 0 ·

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys