***

title: collect
slug: /reference/python/rest/calling/collect
description: Collect user input (DTMF or speech) on an active call via REST.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Start collecting user input on an active call. Supports DTMF digit collection
and speech recognition. Returns a `control_id` for managing the collection.

<EndpointSchemaSnippet endpoint="POST /api/calling/calls" />

## **Response Example**

<EndpointResponseSnippet endpoint="POST /api/calling/calls" />

## **Examples**

### Collect DTMF Digits

```python {10}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

# Collect DTMF digits
result = client.calling.collect(
    call_id="call-id-xxx",
    digits={"max": 4, "terminators": "#", "digit_timeout": 5.0},
    initial_timeout=10.0,
)
```

### Collect Speech

```python {9}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

result = client.calling.collect(
    call_id="call-id-xxx",
    speech={
        "end_silence_timeout": 1.0,
        "language": "en-US",
    },
)
```

### Collect Both

```python {9}
from signalwire.rest import RestClient

client = RestClient(
    project="your-project-id",
    token="your-api-token",
    host="your-space.signalwire.com",
)

result = client.calling.collect(
    call_id="call-id-xxx",
    digits={"max": 1, "terminators": "#"},
    speech={"end_silence_timeout": 2.0},
    initial_timeout=15.0,
)
```