ari-client npm package.
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.Prerequisites
- Asterisk 18+ with the
res_arimodule enabled - Node.js 18+
- A Humain device credential
Step 1 — Enable ARI in Asterisk
Edit/etc/asterisk/ari.conf:
/etc/asterisk/http.conf to enable the built-in HTTP server:
Step 2 — Create the Stasis application
Createhumain-ari.js:
Step 3 — Dialplan entry point
Route inbound calls into your Stasis application:Step 4 — Run the application
AGI vs ARI — which should I use?
For most deployments, AGI is simpler to set up and maintain. Use ARI
when you need to react to mid-call events, dynamically join or split bridges, or handle
hundreds of concurrent calls in a single application.