stop
Stop the collect operation.
Returns
Promise<Record<string, unknown>> — Server acknowledgment.
Stop the collect operation.
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.collect({ 12 speech: { end_silence_timeout: 2.0 }, 13 initialTimeout: 10.0, 14 startInputTimers: false, 15 }); 16 17 // Stop the collect operation 18 await action.stop(); 19 }); 20 21 await client.run();