# Keypad input

> Let callers answer with the keypad via `keypad_input`, and press keys into an IVR with the `send_dtmf` operation.

Two DTMF features: **`keypad_input`** on the agent turns a caller's keypresses into a turn
the agent can answer, and the **`send_dtmf`** tool operation presses keys on the call. Both
work on phone calls and [media streams](https://docs.talqing.com/channels/media-streams.md); web calls and chats have
no keypad.

> **Warning:**
> **Digits are read as out-of-band events, never as tones in the audio.** On a line that
> only carries in-band tones, keypresses reach nothing. Because they never enter the audio,
> typed digits (a PIN, say) are absent from the call recording.

## Caller to agent: keypad_input

`voice` agents only — enabling it on `video` or `text` is refused.

```json
{ "keypad_input": { "enabled": true, "timeout": 2.0, "terminator": "#" } }
```

| Field | Type | Default | Meaning |
| --- | --- | --- | --- |
| `enabled` | boolean | `false` | Deliver keypresses to the agent |
| `timeout` | number | `2.0` | 0–10. Seconds of quiet that end an entry; `0` waits for the terminator |
| `terminator` | `"#"` \| `"*"` \| `""` | `"#"` | Key that ends an entry (not included in it); `""` = timeout only |

Each entry arrives as one labelled user turn:

```text
Keypad entry: 4821
```

- The first keypress interrupts the agent.
- The terminator on an empty buffer is ignored.
- An entry flushes at 50 characters.
- A keypad entry does **not** fire the `on_user_turn_completed`
  [hook](https://docs.talqing.com/agents/lifecycle-hooks.md).
- `timeout: 0` with `terminator: ""` is refused at publish — nothing would ever end an
  entry.

## Agent to keypad: send_dtmf

A tool operation that presses keys on the current call — navigating an IVR, entering an
account number.

```json
{ "kind": "send_dtmf", "config": { "digits": "2w{{args.account_number}}#" } }
```

| Character | Meaning |
| --- | --- |
| `0`–`9`, `*`, `#` | Standard keys |
| `A`–`D` | Fourth-column keys used by some private systems |
| `w` | Wait 0.5 s |
| `W` | Wait 1 s |

Digits are sent with 0.3 s between them. `digits` is templated (unlike a transfer
destination). The operation is not terminal; the tool continues after it.

| Channel | `send_dtmf` |
| --- | --- |
| Phone call, inbound or outbound | Works |
| Media stream: SparkTG, Plivo | Works |
| Media stream: Twilio, Exotel, Vonage | Refused |
| Web call, chat | Refused |

A refusal is reported to the model as a tool error with the reason.

## Next

- [Media streams](https://docs.talqing.com/channels/media-streams.md): Which partner platforms carry keypresses.
- [Operation tree](https://docs.talqing.com/tools/operation-tree.md): Where `send_dtmf` sits among operations.
