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

  • 1
  • Question
  • Updated 3 years ago
  • Answered
  • (Edited)
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);
Photo of TT

TT, Alum

  • 412 Points 250 badge 2x thumb

Posted 3 years ago

  • 1

Be the first to post a reply!