question

tt2 avatar image
tt2 asked

How to get the status of the ongoing outbound call (polling)?

You may want to know the status of a call while it's in progress. Here is an example of how to do that:

function update(next, delay) {
                 
     if (!rcsdk.getRingoutHelper().isInProgress(ringout)) return;
    platform.apiCall(rcsdk.getRingoutHelper().loadRequest(prevRingoutData))
        .then(function(ajax) {
                 
            // also save ajax.data as, for example, prevRingoutData
           console.log(ajax.data); // updated status of ringout
           timeout = next(delay); // you can increase delay here
       })
       .catch(handleError);
}
 var timeout = rcsdk.getUtils().poll(update, 3000); // stay in RPS limits
 To stop polling:
 rcsdk.getUtils().stopPolling(timeout);
getting started
1 |3000

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

0 Answers

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