> ## Documentation Index
> Fetch the complete documentation index at: https://plivo.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Make and control calls

> Place outbound calls to your agent, transfer a live call to a human, play or record, and start or stop a stream on a live call.

Outbound voice agents start with `plivo voice calls make --from <your number> --to <destination> --answer-url …`; the answer URL returns the same `<Stream>` XML as an inbound call. Human handoff is `plivo voice calls transfer <uuid> --legs aleg --aleg-url …` where the new URL returns a `<Dial>`. Calls cost money, so `make` needs `--yes` (use `--dry-run` to preview).

## Calls

Make outbound calls, list and inspect call records, and control live calls. `voice calls make` spends money and requires `--yes`; live-call controls (`play`, `speak`, `record`, `dtmf`, `transfer`, `stop-*`) act on an established call and do not.

Make and inspect voice calls

| Command                         | What it does                                                                   |
| ------------------------------- | ------------------------------------------------------------------------------ |
| `plivo voice calls dtmf`        | Send DTMF tones into a live call                                               |
| `plivo voice calls get`         | Get a call by UUID                                                             |
| `plivo voice calls hangup`      | Hang up a live call (requires --yes)                                           |
| `plivo voice calls list`        | List calls                                                                     |
| `plivo voice calls make`        | Make an outbound call (requires --yes; spends money: use --dry-run to preview) |
| `plivo voice calls play`        | Play audio file(s) into a live call                                            |
| `plivo voice calls record`      | Start recording a live call                                                    |
| `plivo voice calls speak`       | Speak text into a live call via TTS                                            |
| `plivo voice calls stop-play`   | Stop any audio currently playing in a live call                                |
| `plivo voice calls stop-record` | Stop the active recording on a live call                                       |
| `plivo voice calls stop-speak`  | Stop any TTS currently playing in a live call                                  |
| `plivo voice calls transfer`    | Transfer one or both legs of a live call to new PlivoXML URLs                  |

<AccordionGroup>
  <Accordion title="plivo voice calls dtmf">
    **Command:**

    ```bash theme={null}
    plivo voice calls dtmf <call_uuid> [flags]
    ```

    **Flags**

    * `--digits <string>`: DTMF digits to send, e.g. 1234# (required)
    * `--leg <string>`: aleg|bleg (default "aleg")
  </Accordion>

  <Accordion title="plivo voice calls get">
    **Command:**

    ```bash theme={null}
    plivo voice calls get <call_uuid>
    ```
  </Accordion>

  <Accordion title="plivo voice calls hangup">
    **Command:**

    ```bash theme={null}
    plivo voice calls hangup <call_uuid>
    ```
  </Accordion>

  <Accordion title="plivo voice calls list">
    **Command:**

    ```bash theme={null}
    plivo voice calls list [flags]
    ```

    **Flags**

    * `--direction <string>`: inbound|outbound
    * `--from <string>`: filter by from\_number
    * `--limit <int>`: results per page (default 20)
    * `--offset <int>`: pagination offset
    * `--to <string>`: filter by to\_number
  </Accordion>

  <Accordion title="plivo voice calls make">
    **Command:**

    ```bash theme={null}
    plivo voice calls make [flags]
    ```

    **Flags**

    * `--answer-method <string>`: GET|POST (default "GET")
    * `--answer-url <string>`: URL returning PlivoXML to play on answer (default: Plivo's hello demo) (default "[https://s3.amazonaws.com/static.plivo.com/answer.xml](https://s3.amazonaws.com/static.plivo.com/answer.xml)")
    * `--from <string>`: source number (E.164); must be on your account (required)
    * `--hangup-url <string>`: URL hit when call ends
    * `--machine-detection <string>`: none|true|hangup
    * `--ring-url <string>`: URL hit when call starts ringing
    * `--to <string>`: destination number (E.164) (required)
  </Accordion>

  <Accordion title="plivo voice calls play">
    **Command:**

    ```bash theme={null}
    plivo voice calls play <call_uuid> [flags]
    ```

    **Flags**

    * `--legs <string>`: aleg|bleg|both (default "aleg")
    * `--length <int>`: stop after N seconds (0 = full file)
    * `--loop`: loop the playback
    * `--mix`: mix with the call audio (else replace) (default true)
    * `--urls <string>`: comma-separated list of audio file URLs to play (required)
  </Accordion>

  <Accordion title="plivo voice calls record">
    **Command:**

    ```bash theme={null}
    plivo voice calls record <call_uuid> [flags]
    ```

    **Flags**

    * `--both-legs`: record both legs (default: just A-leg)
    * `--callback-method <string>`: GET|POST (default "POST")
    * `--callback-url <string>`: URL hit when recording finishes
    * `--file-format <string>`: mp3|wav (default "mp3")
    * `--time-limit <int>`: max recording length in seconds (default 60)
    * `--transcribe`: request transcription
  </Accordion>

  <Accordion title="plivo voice calls speak">
    **Command:**

    ```bash theme={null}
    plivo voice calls speak <call_uuid> [flags]
    ```

    **Flags**

    * `--language <string>`: language code, e.g. en-US, en-GB, hi-IN (default "en-US")
    * `--legs <string>`: aleg|bleg|both (default "aleg")
    * `--mix`: mix with the call audio (else replace) (default true)
    * `--text <string>`: text to speak via TTS (required)
    * `--voice <string>`: voice: MAN|WOMAN (default "WOMAN")
  </Accordion>

  <Accordion title="plivo voice calls stop-play">
    **Command:**

    ```bash theme={null}
    plivo voice calls stop-play <call_uuid>
    ```
  </Accordion>

  <Accordion title="plivo voice calls stop-record">
    **Command:**

    ```bash theme={null}
    plivo voice calls stop-record <call_uuid>
    ```
  </Accordion>

  <Accordion title="plivo voice calls stop-speak">
    **Command:**

    ```bash theme={null}
    plivo voice calls stop-speak <call_uuid>
    ```
  </Accordion>

  <Accordion title="plivo voice calls transfer">
    **Command:**

    ```bash theme={null}
    plivo voice calls transfer <call_uuid> [flags]
    ```

    **Flags**

    * `--aleg-method <string>`: GET|POST (default "POST")
    * `--aleg-url <string>`: new URL for A-leg (caller side)
    * `--bleg-method <string>`: GET|POST (default "POST")
    * `--bleg-url <string>`: new URL for B-leg (callee side)
    * `--legs <string>`: which leg(s) to act on: aleg|bleg|both (default "aleg")
  </Accordion>
</AccordionGroup>

## Streams on a live call (REST)

Start an audio stream on an already-answered call (instead of via `<Stream>` XML), list the streams on a call, or stop them.

| Command                           | What it does                                                               |
| --------------------------------- | -------------------------------------------------------------------------- |
| `plivo voice calls streams`       | Live audio streams on a call (WebSocket bridge for transcription / agents) |
| `plivo voice calls streams get`   | Get details for one stream on a call                                       |
| `plivo voice calls streams list`  | List active streams on a call                                              |
| `plivo voice calls streams start` | Start a new audio stream on a call                                         |
| `plivo voice calls streams stop`  | Stop one stream (with id) or all streams (without id) on a call            |

<AccordionGroup>
  <Accordion title="plivo voice calls streams">
    **Command:**

    ```bash theme={null}
    plivo voice calls streams
    ```
  </Accordion>

  <Accordion title="plivo voice calls streams get">
    **Command:**

    ```bash theme={null}
    plivo voice calls streams get <call_uuid> <stream_id>
    ```
  </Accordion>

  <Accordion title="plivo voice calls streams list">
    **Command:**

    ```bash theme={null}
    plivo voice calls streams list <call_uuid>
    ```
  </Accordion>

  <Accordion title="plivo voice calls streams start">
    **Command:**

    ```bash theme={null}
    plivo voice calls streams start <call_uuid> [flags]
    ```

    **Flags**

    * `--audio-track <string>`: inbound|outbound|both (default "inbound")
    * `--bidirectional`: let the WebSocket send audio back into the call
    * `--callback-url <string>`: alias for --stream-status-callback
    * `--content-type <string>`: audio codec content-type (default "audio/x-l16;rate=16000")
    * `--extra-headers <string>`: comma-separated extra WebSocket headers (k1=v1,k2=v2)
    * `--service-type <string>`: Plivo service type override
    * `--stream-status-callback <string>`: URL hit when stream starts/ends
    * `--url <string>`: WebSocket URL to receive audio (wss\://...) (required)
  </Accordion>

  <Accordion title="plivo voice calls streams stop">
    **Command:**

    ```bash theme={null}
    plivo voice calls streams stop <call_uuid> [stream_id]
    ```
  </Accordion>
</AccordionGroup>
