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

# Telephony Providers

> How Kallglot resolves managed numbers, external routing connections, and SIP / PBX routes.

# Telephony Providers

<Note>
  **Request vs response naming:** In **`POST /v1/sessions`**, you **only** set telephony on the **`routing`** object. The session **response** may include a read-only string **`provider`** (`twilio`, `telnyx`, `sip`, …) showing which carrier was resolved—do not send that as a nested `provider` object in the request body. Webhooks such as **`session.provider.connected`** describe telephony lifecycle events, not JSON fields for session creation.
</Note>

Kallglot supports three telephony integration paths:

* **Kallglot-managed numbers**
* **External routing connections**
* **SIP / PBX**

This concept page explains how those paths map to the `routing` object in `POST /v1/sessions`.

## Kallglot-managed numbers

Kallglot provisions and manages the underlying phone number for your organization.

Use a managed number when:

* your organization owns an active Kallglot number
* you want to route a session through that number directly
* you do not want to configure an external routing connection

Example:

```json theme={null}
{
  "routing": {
    "phone_number": "+19788006140"
  }
}
```

If that number belongs to your organization and is active, Kallglot automatically resolves the provider (Twilio or Telnyx) from the number configuration.

## External routing connections

External routing connections represent telephony accounts your organization connected in the Developer Portal.

Use an external routing connection when:

* you already run telephony in your own Twilio or Telnyx account
* you want Kallglot to operate on top of that account
* you want explicit routing to a particular routing configuration

Example:

```json theme={null}
{
  "routing": {
    "connection_id": "pcon_01HXYZ",
    "direction": "inbound"
  }
}
```

If you have multiple external routing connections, pass `routing.connection_id` explicitly.

## SIP / PBX

SIP mode is for PBX-first or contact-center integrations that speak standard SIP toward Kallglot.

Use SIP when:

* your calls live inside a PBX or contact center platform
* you want to create a session first, then bridge the call to Kallglot
* you do not need a routing connection record

Example:

```json theme={null}
{
  "routing": {
    "type": "sip"
  }
}
```

After session creation, bridge the call to:

```text theme={null}
sip:<session_id>@sip.kallglot.com
```

## Telephony Resolution Order

Kallglot resolves telephony in this order:

1. `routing.connection_id`, if provided
2. SIP mode when `routing.type` is `sip`
3. active Kallglot-managed number when `routing.phone_number` matches an organization-owned number
4. default active external routing connection, if configured
5. a setup error if no valid route exists

## Routing Fields

| Field                   | Meaning                                                             |
| ----------------------- | ------------------------------------------------------------------- |
| `routing.phone_number`  | Kallglot-managed phone number in E.164 format                       |
| `routing.connection_id` | External provider connection ID (`pcon_xxx`)                        |
| `routing.type`          | Routing type: `sip` or `webrtc`. Only required for SIP/WebRTC modes |
| `routing.direction`     | Call direction: `inbound` or `outbound`                             |
| `routing.sip`           | SIP-specific configuration (when `type` is `sip`)                   |

## Developer Portal Configuration

All telephony options are configured in **Developer Portal > Telephony**:

| Section                          | Description                                            |
| -------------------------------- | ------------------------------------------------------ |
| **Kallglot-managed numbers**     | Buy and manage phone numbers directly through Kallglot |
| **External routing connections** | Connect your own Twilio or Telnyx accounts             |
| **SIP / PBX**                    | Enable SIP access for PBX integration                  |

<Note>
  Set a default routing connection to simplify API requests. When you omit `routing.connection_id`, Kallglot uses your default connection automatically.
</Note>

## Common Patterns

### Managed number

```json theme={null}
{
  "mode": "bidirectional_translation",
  "source_language": "de",
  "target_language": "en",
  "routing": {
    "phone_number": "+19788006140"
  }
}
```

### Bring your own provider

```json theme={null}
{
  "mode": "bidirectional_translation",
  "source_language": "de",
  "target_language": "en",
  "routing": {
    "connection_id": "pcon_01HXYZ",
    "direction": "inbound"
  }
}
```

### SIP / PBX

```json theme={null}
{
  "mode": "bidirectional_translation",
  "source_language": "de",
  "target_language": "en",
  "routing": {
    "type": "sip"
  }
}
```

## Related Guides

* [Choose your telephony integration](/guides/choose-telephony-integration)
* [Twilio Integration](/guides/twilio)
* [Telnyx Integration](/guides/telnyx)
* [SIP Integration](/guides/sip)
