If you’re exploring Asterisk + OpenAI Realtime SIP, you might also consider checking out AVR (Agent Voice Response) — it’s an open-source framework built specifically to connect Asterisk with real-time AI voice agents.
It handles a lot of the heavy lifting for you, such as:
SIP routing
WebSocket bridging
Audio streaming
Function-call events
Multi-call handling
Integrations with Python or other backends
Many people use it as the “glue” between Asterisk and AI models because it avoids having to reinvent all the audio transport and signaling logic from scratch.
If you’re already comfortable with Asterisk, AVR fits right into the workflow: you just configure a trunk to it, and it manages the real-time interaction with the model. From there you can focus on your logic instead of low-level streaming.
If you want, I can walk you through a sample setup or provide a minimal working example.
Thanks buddy. I have finished the project using asterisk and OpenAI with socket. OpenAI webhook for accepting call, asterisk and OpenAI realtime to audio and socket to execute function and add response to the context.
With only these I have a back office for call tracking, summaries of calls, trace tools, config for program when the service must be active or not and other features.
That’s amazing — congratulations on completing the project!
It sounds like you built a very solid architecture: Asterisk + OpenAI realtime + sockets + webhooks, plus all the surrounding back-office features like call tracking, summaries, tracing tools, and scheduling. That’s a complete, production-ready stack.
Well done — really impressive work.
If you ever feel like sharing more details with the community, I’m sure many people would find your setup valuable and inspiring.
The last challenge is to setup well the virtual machine so get secury for production but without affecting the audio and the rest of sip communication between openai sip and you asterisk. Block all you need and allow only needed entries. Here are the needed commands:
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A OUTPUT -p udp --dport 5061 -j ACCEPT
sudo iptables -A INPUT -p udp --sport 5061 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 10000:20000 -j ACCEPT
sudo iptables -A OUTPUT -p udp --sport 10000:20000 -j ACCEPT
sudo ufw allow out 5061/udp
sudo ufw allow 10000:20000/udp
sudo ufw reload