> ## 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 & SIP

> VoIP and SIP connections require a physical telephony stack and cannot be tested from a browser. Use these tools to test locally.

VoIP mode requires a SIP trunk, PBX, or ATA adapter — none of which run in a browser. Use one of
the tools below to test your VoIP integration locally before connecting to production.

## Testing tools

> [card] [Linphone Desktop](https://www.linphone.org/technical-corner/linphone)
>
> Open-source SIP softphone for macOS, Windows, and Linux. Configure it to register against
> the Humain SIP endpoint and make test calls without physical hardware.

> [card] [PJSUA2 CLI](https://docs.pjsip.org/en/latest/pjsua2/using/index.html)
>
> Command-line SIP client from the PJSIP project. Scriptable and useful for automated
> integration tests in CI pipelines.

> [card] [Asterisk (Docker)](https://hub.docker.com/r/andrius/asterisk)
>
> Run a full Asterisk PBX in Docker. Configure a dial plan to route calls to the Humain SIP
> endpoint and test your IVR replacement end-to-end.

> [card] [Twilio Studio (free tier)](https://www.twilio.com/en-us/studio)
>
> Use Twilio's visual call flow builder to route a real phone number to the Humain SIP
> endpoint. Test with an actual PSTN call from any phone.

## Minimal cURL test

You can still exercise the VoIP session lifecycle from the command line — only the audio bridge
requires telephony hardware:

```bash theme={null}
# 1. Open a VoIP session — use an hk_test_ credential to avoid billing (see /concepts/sandbox-mode)
RESPONSE=$(curl -s -X POST https://api.humain.ai/v1/sessions \
  -H "Authorization: Bearer hk_test_your_credential_here" \
  -H "Content-Type: application/json" \
  -d '{"mode":"voip"}')

SESSION=$(echo "$RESPONSE" | jq -r .session_id)
AGENT_URL=$(echo "$RESPONSE" | jq -r .agent_url)

echo "Session ID: $SESSION"

# 2. End the session (simulating a hang-up) — on agent_url, not necessarily the same host
curl -s -X POST "$AGENT_URL/v1/sessions/$SESSION/end" \
  -H "Authorization: Bearer hk_test_your_credential_here"

echo "Session closed."
```

This verifies that your credential is valid and that session open/close works correctly before you
wire up the SIP bridge.

## Downloads

> [card] [Postman collection](https://github.com/humain/kiosk-c/releases/latest/download/humain-kiosk.postman_collection.json)
>
> Import into Postman to test all Device API endpoints with pre-configured authentication and
> example request bodies.

> [card] [Raspberry Pi test binary](https://github.com/humain/kiosk-c/releases/latest/download/kiosk-test-rpi-arm64)
>
> Prebuilt arm64 binary. Runs on a Raspberry Pi 3/4/5 to verify connectivity and credential
> validity without compiling from source.

> [card] [SIP test config](https://github.com/humain/kiosk-freepbx/releases/latest/download/test-sip-config.zip)
>
> Sample SIP configuration archive for Asterisk and FreePBX. Includes a dialplan, pjsip trunk
> definition, and test call script.

***

## C library voice sessions

WebRTC voice sessions opened via `kiosk_voice_session_open()` cannot be tested from a browser.
The `libdatachannel` ICE stack performs UDP hole-punching and DTLS handshakes that require
a real network socket — not available in a browser sandbox.

To test a voice session from your workstation before deploying to hardware:

1. Install the library locally (`cmake -B build -DKIOSK_WITH_VOICE=ON && sudo cmake --install build`).
2. Compile and run the minimal voice example from the [Raspberry Pi quickstart](https://humain.mintlify.site/embedded/raspberry-pi.md#voice-session-quickstart) on your Linux development machine.
3. Use a USB headset as the ALSA capture and playback device.

```bash theme={null}
export HUMAIN_CREDENTIAL=hk_live_your_credential_here
gcc pi-voice.c -lkiosk -lcurl -o pi-voice
./pi-voice
# [connecting]
# [listening]
# Voice session active — speak into the microphone. Press Ctrl+C to stop.
```

This verifies ICE connectivity, credential validity, and the full audio round-trip before you
deploy to a Raspberry Pi or embedded Linux target.

***

## Next steps

* Read the [VoIP / SIP connection guide](https://humain.mintlify.site/connections/voip-sip.md) for the full setup walkthrough.
* Explore the [C library](https://humain.mintlify.site/embedded/c-library.md) for embedded Linux and microcontroller integration.
* Contact [support@humain.ai](mailto:support@humain.ai) to get the SIP endpoint credentials for
  your workspace.


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