question

tt avatar image
tt 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);
topic-default
1 |1000 characters needed characters left characters exceeded

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

0 Answers

· Write an Answer

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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