transfer command to bridge the call audio to the Humain SIP gateway, or the stream_start
command to pipe audio over a WebSocket.
This guide uses the SIP transfer approach, which requires minimal server-side code and works
with any Telnyx voice plan.
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.How it works
Webhook handler
Telnyx portal configuration
- In the Telnyx Mission Control Portal, go to Call Control → Applications.
- Create a new application. Set Webhook URL to
https://your-server.example.com/webhook. - Set Webhook API Version to API v2.
- Under Numbers, assign your Telnyx number to the application.
Telnyx expects your webhook to return
200 OK within 2 seconds of receiving the event.
The handler above responds 200 immediately before processing, which prevents timeouts even
when the Humain API call takes 200–400 ms.Verifying the integration
Use the Telnyx CLI to trigger a test call:call.initiated → call.answered → call.bridged → call.hangup.