forwarding or transfering for scenario?

  • 1
  • Question
  • Updated 4 weeks ago
  • (Edited)
My scenario: I need to forward calls coming in from certain 800#s to other internal numbers (ring groups) using custom routing logic.

What is the best method to use in my case? The Forward or Transfer method?

Additionally, both of those methods are marked under the Light usage plan. These 800#s will be called frequently and it's possible the Light usage plan might not allow enough calls to go through at peak times. What method should I use to route calls for this scenario?
Photo of Tim Falkins

Tim Falkins

  • 240 Points 100 badge 2x thumb

Posted 1 month ago

  • 1
Photo of Tim Falkins

Tim Falkins

  • 240 Points 100 badge 2x thumb
BTW, when I try the Forward method I get an error (although the forward does actually take place):

RingCentral.RestException: 'Response:
StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Connection: keep-alive
  X-Rate-Limit-Group: light
  X-Rate-Limit-Limit: 50
  X-Rate-Limit-Remaining: 49
  X-Rate-Limit-Window: 60
  Date: Fri, 19 Apr 2019 19:37:38 GMT
  Server: nginx
  Content-Length: 123
  Content-Type: application/json
}
Content: {
   "errors" : [
      {
         "errorCode" : "TAS-106",
         "message" : "Operation is not allowed"
      }
   ]
}
Photo of Phong Vu

Phong Vu, Devangelist

  • 5,426 Points 5k badge 2x thumb
Hi Tim,

My understanding is that:

Forward = Is used in the case of a call is directly redirected to another number before the call was answered. Think about those forwarding rules.

Transfer:
1. Warm transfer is when a call was picked up and the agent calls another number then connect the call.
2. Blind transfer is when the case a call was picked up by and agent and the agent just transfers the call to another number w/o knowing if that number is available.

Regarding the rate limit, just test your app and graduate it then send a request for increasing the rate limit with your business justification to devsupport@ringcentral.com. Our support engineers will evaluate your case and grant higher rate accordingly.
Photo of Tim Falkins

Tim Falkins

  • 240 Points 100 badge 2x thumb
Thanks. What about the error I provided in my second reply? The forward does seem to actually work, but the exception is thrown regardless.
Photo of Tim Falkins

Tim Falkins

  • 240 Points 100 badge 2x thumb
OK - I'm confused then about what account is the admin account. The main account in my sandbox is what I thought was the admin account. I authorize using that number/extension. Here's the snippet:

I also created a second number in my account and that's the number I'm trying to monitor with the presence event, which is when I get that error. What am I doing wrong? Thanks.
(Edited)
Photo of Phong Vu

Phong Vu, Devangelist

  • 5,406 Points 5k badge 2x thumb
First of all, you are confused about account and extensions. An account can have multiple extensions (A.K.A users), and by default, it has one extension 101 which has the admin role. You can create more extensions, specify the role and add phone numbers to the extensions.

So your 101 extension must be the admin one and you should be able to subscribe for the presence notification at the account level. I doubt that you specified the extension id incorrectly. The extension Id is the internal id of an extension, NOT the extension number 101, 102 etc.

Here is the code for you to read all extension info under an account and get the extension id for adding to the presence filters.

static private async Task read_extension_info()
        {
            RestClient rc = new RestClient(RINGCENTRAL_CLIENTID, RINGCENTRAL_CLIENTSECRET, false);
            await rc.Authorize(RINGCENTRAL_USERNAME, RINGCENTRAL_EXTENSION, RINGCENTRAL_PASSWORD);
            if (rc.token.access_token.Length > 0)
            {
                var parameters = new ListExtensionsParameters();
                parameters.type = new [] { "User" };
                var resp = await rc.Restapi().Account().Extension().List(parameters);
                foreach (var record in resp.records)
                {
                    Console.WriteLine("-----");
                    Console.WriteLine("Extension id: " + record.id);
                }
            }
        }   
Photo of Tim Falkins

Tim Falkins

  • 240 Points 100 badge 2x thumb
I see. So when I try to monitor the presence event using the extension Id, the presenceStatus = Offline and therefore can't grab other information like session Id. However, if I log into that extension to to force the presence to be online, I can monitor the calls. 

So that leads me to ask, "How do you monitor calls on an extension that isn't tied to an active user account?" Again, I want to monitor an 800 toll-free line and forward calls from there.

Thanks.
Photo of Phong Vu

Phong Vu, Devangelist

  • 5,406 Points 5k badge 2x thumb
That seems not true. I just tested to set an extension user's presence status to "offline" then I made a call to the phone number belonged to that extension and I could still get the incoming call notification. Can you try again.

Any phone number must be belonged to an extension, including those toll-free 800 xxx-xxxx. Just check which extension owns the toll-free phone number then set the filter for that extension.
Photo of Tim Falkins

Tim Falkins

  • 240 Points 100 badge 2x thumb
OK - I tried again and monitored it without issues; however, I get this exception when trying to forward the call from that extension (ext 102) when monitoring from my primary account (ext 101):

RingCentral.RestException
  HResult=0x80131500
  Message=Response:
StatusCode: 504, ReasonPhrase: 'Gateway Time-out', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
  Transfer-Encoding: chunked
  Connection: keep-alive
  X-Rate-Limit-Group: light
  X-Rate-Limit-Limit: 50
  X-Rate-Limit-Remaining: 49
  X-Rate-Limit-Window: 60
  RoutingKey: SJC11P01
  RCRequestId: 635cd774-6a80-11e9-80d5-005056bba23b
  Date: Mon, 29 Apr 2019 13:12:06 GMT
  Server: nginx
  Content-Type: text/plain
}

To reiterate, I'm getting this when trying to call the Forward method using the following code:

                    await rc.Restapi().Account().Telephony().Sessions(sessionId)
                        .Parties(partyId)
                        .Forward().Post(new ForwardTarget
                        {
                            phoneNumber = "+15151234567"
                        });
(Edited)