Relay.Calling.DetectAction

View as Markdown

This object returned from one of the asynchronous detect methods that represents a running detector on the call.

Properties

PropertyTypeDescription
resultRelay.Calling.DetectResultFinal detector result
completedbooleanWhether the action has finished
payloadobjectPayload sent to Relay to start this detector
controlIdstringUUID to identify the detector

Methods

stop

Stop the action immediately.

Parameters

None

Returns

Promise<StopResult> - Promise object that will be fulfilled with a Relay.Calling.StopResult object.

Examples

Trying to detect a machine and stop the action after 5 seconds.

1async function main() {
2 const detectAction = await call.detectMachineAsync()
3
4 // For demonstration purposes only..
5 setTimeout(async () => {
6 const stopResult = await detectAction.stop()
7 }, 5000)
8}
9
10main().catch(console.error)