collectStop

View as MarkdownOpen in Claude

Stop an active input collection.

Request

dialobjectRequired
OR
updateobjectRequired
Update a call in progress — cancel, complete, or redirect the SWML flow. State-transition rules: - `status: canceled` is only valid while the leg is `queued` or `ringing`. - `status: completed` is only valid while the leg is `answered` (or in-progress). - Supplying `url` or `swml` (redirect) is only valid while the leg is `answered`. - Calls in terminal states (`busy`, `failed`, `no-answer`, `canceled`, `completed`) cannot be updated.
OR
calling.endobjectRequired
OR
calling.disconnectobjectRequired
OR
calling.ai_holdobjectRequired
OR
calling.ai_unholdobjectRequired
OR
calling.ai_messageobjectRequired
OR
calling.ai.stopobjectRequired
OR
calling.playobjectRequired
Play media (audio files, text-to-speech, silence, or ringtones) on an active call. The HTTP response confirms the command was accepted. Playback lifecycle is delivered asynchronously via the `status_url` webhook, with payloads of the form `{control_id, call_id, node_id, state}` where `state` is one of `playing`, `paused`, `finished`, or `error`.
OR
calling.play.pauseobjectRequired
OR
calling.play.resumeobjectRequired
OR
calling.play.stopobjectRequired
OR
calling.play.volumeobjectRequired
OR
calling.recordobjectRequired
Starts recording an active call. The HTTP response returns the call leg — the recording URL is not included. Recording runs asynchronously; provide `status_url` to receive a webhook when the recording finishes (with the final URL), or query the call's events endpoint.
OR
calling.record.pauseobjectRequired
OR
calling.record.resumeobjectRequired
OR
calling.record.stopobjectRequired
OR
calling.collectobjectRequired
Collect user input (DTMF digits, speech, or both) on an active call. At least one of `digits` or `speech` must be provided; requests missing both return 400. Results are delivered asynchronously via the `status_url` webhook. Digit events have the shape `{control_id, call_id, node_id, result: {type:"digit", params: {digits, terminator}}}` and speech events `{..., result: {type:"speech", params: {text, confidence}}}`. When `start_input_timers` is `false`, the `initial_timeout` clock does not start until you send `calling.collect.start_input_timers` for the same `control_id`.
OR
calling.collect.stopobjectRequired
OR
calling.collect.start_input_timersobjectRequired
OR
calling.detectobjectRequired
Start detection (answering machine, fax tone, or DTMF digits) on an active call. Detection runs asynchronously up to `timeout` seconds. Results are delivered via the `status_url` webhook.
OR
calling.detect.stopobjectRequired
OR
calling.tapobjectRequired
Capture audio from an active call and stream it to an external destination. Audio is streamed via RTP (to a public IP/port) or WebSocket (to a `ws://`/`wss://` URI). Stop the tap with `calling.tap.stop` using the same `control_id`.
OR
calling.tap.stopobjectRequired
OR
calling.streamobjectRequired
Stream call audio to an external WebSocket endpoint. Audio is sent to a `wss://` URL; `custom_parameters` pass through to the endpoint as connection metadata. Stream lifecycle webhooks are delivered to `status_url` (default method `POST`). Stop the stream with `calling.stream.stop` using the same `control_id`.
OR
calling.stream.stopobjectRequired
OR
calling.denoiseobjectRequired
Enable noise reduction on an active call. Denoise is per-call (no `control_id`); a call has at most one active denoise filter. Use `calling.denoise.stop` to disable it.
OR
calling.denoise.stopobjectRequired
OR
calling.live_transcribeobjectRequired
OR
calling.live_translateobjectRequired
OR
calling.transferobjectRequired
OR
calling.send_fax.stopobjectRequired
OR
calling.receive_fax.stopobjectRequired
OR
calling.referobjectRequired
OR
calling.user_eventobjectRequired

Response

Call LegobjectRequired
OR
Fabric Subscriber Device LegobjectRequired

Response Example

Response
1{
2 "id": "0e9c80d7-a149-4917-892d-420043709f45",
3 "from": "+12069708643",
4 "to": "+15550198765",
5 "direction": "outbound-api",
6 "source": "realtime_api",
7 "url": null,
8 "charge": 0,
9 "created_at": "2024-05-06T12:20:00Z",
10 "charge_details": [
11 {
12 "description": "Outbound Voice",
13 "charge": 0.004
14 }
15 ],
16 "status": "queued",
17 "duration": null,
18 "duration_ms": null,
19 "billing_ms": null,
20 "type": "relay_pstn_call",
21 "parent_id": null
22}

Example

1import { RestClient } from "@signalwire/sdk";
2
3const client = new RestClient({
4 project: "your-project-id",
5 token: "your-api-token",
6 host: "your-space.signalwire.com"
7});
8
9await client.calling.collectStop("call-id-xxx", { control_id: "ctrl-id" });