Hi everyone,
I’m currently working on building a complete IVR (Interactive Voice Response) system with the following goals:
- Receive incoming calls on a Twilio number
- Route calls dynamically based on IVR flow stored in PostgreSQL
- Allow agents to make outbound calls
- Manage IVR flow and logic using Node.js (with ARI)
Here’s what I’ve done so far:
Purchased a Twilio phone number
Set up Asterisk + FreePBX server
Built a Node.js backend that uses Asterisk ARI to handle call logic
Created API endpoints to store and retrieve IVR flows (using PostgreSQL)
What I Need Help With:
- How do I connect the Twilio number with Asterisk/FreePBX for inbound calls?
- Should I use SIP trunking?
- Do I need to register a SIP domain with Twilio and route it to Asterisk?
- How can I ensure incoming calls reach the
Stasis()
application?
- Once the call reaches Asterisk, how do I trigger my Node.js logic using ARI?
- I’ve registered my ARI app (
ivrapp
) and listening onStasisStart
, but it’s not receiving events yet. - What dialplan or context config is required to ensure the call enters
Stasis(ivrapp)
?
- How to allow outbound calls for agents via Asterisk (using Twilio or any other SIP trunk)?