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

# VoIP and telephony integration

> Bridge SIP trunks, PBX systems, and cloud telephony providers to Humain Kiosk AI sessions.

The Humain SIP gateway bridges telephone infrastructure to AI conversations. An incoming phone
call — from a PSTN line, a cloud telephony provider, or an IP phone — becomes a Humain Kiosk
session. Your PBX or CPaaS handles the telephone network; Humain handles the intelligence.

> [!NOTE]
>
> **Store your credential as an environment variable.** Never hard-code `hk_live_…` tokens in
> source files, dialplans, or configuration files committed to version control. Use an environment
> variable (`HUMAIN_CREDENTIAL`) or a secrets manager and inject the value at runtime.

***

## Choose your integration path

> [card] [Asterisk / FreePBX (technical)](https://humain.mintlify.site/voip/asterisk-agi.md)
>
> Write a dialplan and AGI script to route calls to a Humain Kiosk session. Full control
> over call flow, DTMF handling, and mid-call transfers.

> [card] [FreePBX module (no-code)](https://humain.mintlify.site/plugins/freepbx.md)
>
> Install a GUI module from the FreePBX Module Admin. Configure the Humain extension from
> a form — no dialplan editing required.

> [card] [3CX (no-code)](https://humain.mintlify.site/plugins/3cx.md)
>
> Install a CallFlow app from the 3CX App Marketplace. Route calls to the Humain AI from
> any queue, IVR, or direct inward dial number.

> [card] [Twilio](https://humain.mintlify.site/voip/twilio.md)
>
> Route Twilio phone numbers to a Humain Kiosk session via Media Streams and TwiML webhooks.

> [card] [Vonage](https://humain.mintlify.site/voip/vonage.md)
>
> Connect Vonage Voice API calls to Humain using NCCO and WebSocket audio streaming.

> [card] [Telnyx](https://humain.mintlify.site/voip/telnyx.md)
>
> Use Telnyx Call Control API to fork call audio to a Humain Kiosk voice session.

> [card] [Generic SIP trunk](https://humain.mintlify.site/voip/sip-gateway.md)
>
> Register any SIP-capable endpoint directly to the Humain SIP gateway. Works with any
> standards-compliant PBX, softphone, or ATA.

***

## Call architecture

Every integration path converges on the same architecture. Your telephony layer sends a SIP
`INVITE` to the Humain gateway; the gateway opens a voice session with the AI pipeline and
bridges bidirectional audio.

```mermaid theme={null}
sequenceDiagram
    participant Caller
    participant PBX as PBX / CPaaS
    participant HumainGateway as Humain SIP Gateway
    participant AI as AI Pipeline

    Caller->>PBX: Places call
    PBX->>HumainGateway: SIP INVITE
    HumainGateway->>AI: Open voice session (WebRTC)
    AI-->>HumainGateway: SDP answer
    HumainGateway-->>PBX: 200 OK + SDP
    Note over Caller,AI: Bidirectional audio — G.711 / G.722 / Opus
    Caller->>PBX: Hangs up
    PBX->>HumainGateway: SIP BYE
    HumainGateway->>AI: Close session
```

> [!NOTE]
>
> The SIP gateway handles all codec transcoding and NAT traversal. Your PBX does not need to
> support Opus — G.711 (PCMU/PCMA) and G.722 are both supported on the SIP side. See the
> [codec guide](https://humain.mintlify.site/voip/codec-guide.md) for the full compatibility matrix.

***

## Conceptual background

For a deeper look at how VoIP sessions work — the session flow diagram, codec table, and
security requirements — see the [VoIP / SIP connection type](https://humain.mintlify.site/connections/voip-sip.md) page in
the Guides tab.


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