Skip to main content
Question

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

  • 24 June 2015
  • 0 replies
  • 519 views

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);

0 replies

Be the first to reply!

Reply