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
TwiML response
When Twilio calls your webhook, respond with this TwiML to start the audio stream:{session_id} with the ID returned by POST /v1/sessions.
Webhook handler
- Node.js
- Python
Twilio console configuration
- In the Twilio Console, open Phone Numbers → Manage → Active numbers.
- Click your number and scroll to Voice Configuration.
- Set A call comes in → Webhook →
https://your-server.example.com/incoming-call(HTTP POST). - Set Call status changes →
https://your-server.example.com/call-status(HTTP POST). - Save.
Your webhook server must be publicly reachable by Twilio. During local development, use
ngrok or the Twilio CLI to
expose your local port.