waitFor
waitFor
- waitFor(
params):Promise<boolean>
Returns a promise that is resolved only after the current call is in one of the specified states.
Parameters
params
The call state(s) to wait for.
Returns
Promise<boolean>
A promise that resolves to true if the call is in one of the specified states, or false if the call is ended.
Example
In this example, we dial a phone number and play a TTS message. After the TTS message is finished, we hangup the call and wait for the call to end before printing a message to console.