disconnected
disconnected
- disconnected():
Promise<Call>
Call this method after connecting a peer (e.g., using connect, connectPhone, or connectSip) to wait until the peer disconnects.
This is equivalent to calling peer.waitFor("ended") on the connected peer.
Returns
Promise<Call>
A promise that resolves to the Call object that you can use to control the call.
Example
In this example, we answer an incoming call and connect the call to a peer call. After connecting to the peer, we wait 3 seconds and then disconnect the peer. Once the peer is disconnected, we play a TTS message to the inbound call leg and then hangup the call.