stop
Stop detection immediately.
Returns
Promise<Record<string, unknown>> — Server acknowledgment.
Stop detection immediately.
Promise<Record<string, unknown>> — Server acknowledgment.
1 import { RelayClient } from '@signalwire/sdk'; 2 3 const client = new RelayClient({ 4 project: process.env.SIGNALWIRE_PROJECT_ID!, 5 token: process.env.SIGNALWIRE_API_TOKEN!, 6 contexts: ['default'] 7 }); 8 9 client.onCall(async (call) => { 10 await call.answer(); 11 const action = await call.detect({ 12 type: 'machine', 13 params: { initialTimeout: 5.0 }, 14 }); 15 16 // Stop detection early 17 await action.stop(); 18 }); 19 20 await client.run();