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

# Connect a phone line

> Put your Mantle agent behind a phone number with Twilio, jambonz, AudioCodes, or Genesys.

When your agent sounds right in the Inspector, connect it to a phone line. Your
telephony provider answers the call and streams the audio to your agent. The
agent transcribes it, runs the turn, and streams speech back, using the
[speech providers](https://mantle.rasa.com/reference/speech-providers.md) you name on the channel or in
`agent.yml`.

Your skills do not change. You add one channel to `integrations.yml` and point
your provider at it.

## Before you start

* **A license with voice enabled.** Telephony channels check for it at startup.
  The Inspector's voice mode does not need it.
* **A public URL for your agent.** The provider must reach your server over the
  internet. For local testing, use a tunnel such as ngrok.
* **A speech provider API key**: `DEEPGRAM_API_KEY` for the Deepgram default,
  or `SPEECHMATICS_API_KEY`, `AZURE_SPEECH_API_KEY`, `CARTESIA_API_KEY`, or
  `RIME_API_KEY` for the other supported providers.

## Add the channel

Every telephony channel takes the same core settings:

```yaml integrations.yml theme={null}
model_groups:
  - id: phone_asr
    models:
      - provider: deepgram_flux
        api_key: ${DEEPGRAM_API_KEY}
        language_map:
          en:
            language: en
            model: flux-general-en
  - id: phone_tts
    models:
      - provider: deepgram_flux
        api_key: ${DEEPGRAM_API_KEY}
        language_map:
          en:
            model: flux-alexis-en

channels:
  rest: { enabled: true }
  inspector: { enabled: true }
  twilio_media_streams:
    enabled: true
    server_url: agent.example.com
    asr: phone_asr
    tts: phone_tts
    interruptions:
      enabled: true
```

`server_url` is the public host name of your agent. `asr` and `tts` name the
speech model groups (see [Speech providers](https://mantle.rasa.com/reference/speech-providers.md)). You
can set those ids on the channel, as here, or once in
[`agent.yml`](https://mantle.rasa.com/reference/agent-yml#asr-and-tts) `voice.asr` and `voice.tts`. A
telephony channel has no speech default, so each side has to be set in one of
those places. `server_url` is required on the channel. Callers can talk over
the agent only if you turn on `interruptions`,
which are off by default on telephony channels. To play office or call-centre
noise under the call, add `background_audio`. These options and `silence_timeout`
are described under
[Voice channels](https://mantle.rasa.com/reference/integrations-yml.md#voice-channels).

Restart the agent after changing `integrations.yml`. Every channel's URLs start
with `https://<server_url>/webhooks/<channel>/`.

## Choose your provider

### Twilio

Use `twilio_media_streams`. Optional `username` and `password` protect the
webhook with HTTP basic authentication.

In the Twilio console, set your phone number's incoming-call webhook to
`https://<server_url>/webhooks/twilio_media_streams/webhook` (HTTP POST). The
webhook answers with TwiML that connects the call's audio to your agent.

Twilio channels need the `channels` extra: `pip install "rasa-pro[channels]"`.

### jambonz

Use `jambonz_stream`. Optional `username` and `password` protect the webhook
with HTTP basic authentication, and must be set together.

In jambonz, create an application whose calling webhook is
`https://<server_url>/webhooks/jambonz_stream/webhook` and whose call status
webhook is `https://<server_url>/webhooks/jambonz_stream/call_status`, then
route your number to it.

### AudioCodes

Use `audiocodes_stream` (beta), and set `token` to a shared secret.

In AudioCodes VoiceAI Connect, configure a bot connection that streams audio to
`wss://<server_url>/webhooks/audiocodes_stream/websocket`, with the same token.

### Genesys Cloud

Use `genesys`, which connects through Genesys AudioHook. Set `api_key`, and
optionally `client_secret` to verify request signatures.

In Genesys Cloud, configure an AudioHook integration that connects to
`wss://<server_url>/webhooks/genesys/websocket` with the same credentials.

On Genesys, an accepted interruption ends the agent's turn, but audio already
sent to Genesys still plays.

## Keypad input (DTMF)

Twilio, jambonz, AudioCodes, and Genesys pass keypad presses (DTMF) to your
agent. To collect digits, add `dtmf:` to a collect step. See
[DTMF collect steps](https://mantle.rasa.com/reference/ordered-block-steps.md#dtmf).
The Inspector does not send keypad input, so test those steps on a real call.

## Caller details

Channels can pass metadata about the call, such as the caller's number, when
the conversation starts. To use a value in your skills, declare a project memory
field with `seed: true`. See
[Seeding from session start](https://mantle.rasa.com/reference/memory-yml.md#seeding-from-session-start).

## Test the line

1. Start the agent with `rasa run`, and make sure the provider can reach
   `server_url`.
2. Call your number. With a greeting skill, you hear the agent first; otherwise
   speak first.
3. Watch the call in your traces and metrics. See
   [Test and monitor voice](https://mantle.rasa.com/voice/testing.md).

Repeat the speech-path cases on this line, including short confirmations,
interruptions, and keypad entry. An Inspector test does not exercise your
provider's webhook, WebSocket connection, or telephony audio conversion.

If the call connects but there is no greeting, check that the session-start skill
actually speaks and that TTS starts successfully. If it never reaches the agent,
check the public host, TLS certificate, webhook path and method, and any shared
credentials. Your proxy must allow WebSocket upgrades for the streaming
connection. Do not include credentials in shared diagnostic logs.

## Reference

All channel keys, including the Inspector's voice settings, are on
[`integrations.yml` → Voice channels](https://mantle.rasa.com/reference/integrations-yml#voice-channels).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.