A Node.js application for integrating Jambonz and VAPI phone services with DTMF sequence support.
- Call routing to VAPI via Jambonz trunk
- Call authentication via Versa API
- DTMF sequence sending with configurable delays
- SIP REFER handling for call transfers
- Audio file serving for call music
# Install dependencies
npm install
# Run the application
JAMBONZ_REST_API_BASE_URL=https://jambonz.one/api/v1 \
JAMBONZ_ACCOUNT_SID=your-account-sid \
JAMBONZ_API_KEY=your-api-key \
APP_TRUNK_NAME=your-trunk-name \
VERSA_BASE_URL=https://versa-api.example.com \
VERSA_API_KEY=your-versa-api-key \
npm start- JAMBONZ_REST_API_BASE_URL: Jambonz API base URL
- JAMBONZ_ACCOUNT_SID: Your Jambonz account SID
- JAMBONZ_API_KEY: Your Jambonz API key
- APP_TRUNK_NAME: Jambonz trunk name for VAPI
- VERSA_BASE_URL: Versa API server URL
- VERSA_API_KEY: Versa API key
- HTTP_PORT: Web server port (default: 3000)
- LOGLEVEL: Logging level (default: debug)
- HTTP_USERNAME: Username for websocket HTTP Basic auth (optional)
- HTTP_PASSWORD: Password for websocket HTTP Basic auth (optional)
The websocket endpoints (e.g. /proxy-vapi) support optional HTTP Basic
authentication. Set HTTP_USERNAME and HTTP_PASSWORD to enable it; when set,
incoming websocket upgrade requests must include a matching
Authorization: Basic header or they are rejected with 401 Unauthorized.
In jambonz, configure the application's websocket URL with the same username and password so jambonz sends these credentials on connect. Authentication is only enabled when both variables are set; otherwise it is disabled.
- Regular digits: 0-9, #, *
- Delays: p (100ms), s (500ms), S (1000ms)
- Example: "123#1pp2sS4" - Send "123#1", wait 200ms, send "2", wait 1500ms, send "4"
- /proxy-vapi: Main call routing endpoint
- /dial-test-mint: DTMF testing endpoint
- GET /audios/:audio: Serves audio files
pm2 start ecosystem.config.js