Asterisk to OpenAI Realtime: The Definitive MVP (In Progress)

  1. What is this?

I want to share with the community how I’m building a Minimum Viable Product (MVP) to enable calls from Asterisk FreePBX to OpenAI Realtime models with the lowest possible latency. This will be an easy-to-configure and ready-to-use solution.

OpenAI Realtime Reference:

https://platform.openai.com/docs/guides/realtime

  1. How to reach the goal and what is it?

I believe the most user-friendly experience will come from using FreePBX, which provides easy access to features like extensions, trunks, reports, and IVRs. My plan is to build a FreePBX module that includes:

  • An ARI ExternalMedia App
  • OpenAI APIs integration
  • A Control Panel in FreePBX

The Goal:

Enable users to call extension 3000, where an OpenAI Realtime model answers with its voice. The model will listen to your commands, understand them, and respond appropriately with low latency.

  1. Why?
  • To demonstrate how an Asterisk ARI app can integrate with OpenAI’s Realtime provider.
  • To create a foundational project for integrating other AI providers (e.g., Grok 3 Voice) into a single app.
  • To meet new customers who need ARI customizations and professional services.
  1. Who am I?

I’m a Cloud Architect with 15 years of experience working with servers, networks, cloud, and AI. I’ve leveraged AI tools to complete other ARI (Asterisk REST Interface) implementations with AI bots, such as Google DialogFlow and AWS Bedrock. This project is an exciting challenge for me, and I’d love to share it with the community.

  1. Requirements
  • OpenAI API keys and credits, with access to Realtime models.
  • FreePBX installed.
  1. Outcomes/Roadmap
  • Enable seamless, low-latency communication with OpenAI Realtime models via Asterisk.
  • Develop a FreePBX Addon.
  • Build an ARI app using ExternalMedia.
  • Prepare the solution for scalability.
  1. Tested On
  • Debian 12 with FreePBX 17
  1. To-Do List

8.1. Research OpenAI Realtime capabilities and requirements. In Progress - Done

8.2. Build a backend Node.js app replicating the OpenAI Realtime Playground to validate all required steps. In Progress - Done

It works!. I can send and receive voice in streaming using OpenAI websockets. Here are the mini-apps that help me test everything:

8.3. Extract all necessary fields for implementation. In Progress

8.4. Build the first ARI app version 0.1.

8.5. Test and debug.

8.6. Create the FreePBX Module. In Progress

8.7. Test and debug.

8.8. Build the second ARI app version 0.2.

8.9. Test and debug.

8.10. Integrate the most popular requested features.

  1. What can you do?
  • Subscribe to this post for updates until the MVP is complete.
  • Help me test it and report bugs or issues to the GitHub repo once it’s ready.
  • Suggest functionalities! I’ll prioritize the most relevant ones for future versions.
3 Likes

Hi @InfinitoCloud ,

i feel interested to your project, how can we link up for further discussion.

Thanks,

Ok, I continue with the development of the module, step 8.3:

I have just completed an ARI application that integrates the RTP server, this application answers the call, receive the RTP audio, records its input audio for 10 seconds, saves as wav and plays it by injecting it through RTP towards asterisk. For people asking how to get ARI to work with RTP:

2 Likes

Hello everyone,

I see you’re discussing the possibility of integrating Asterisk with OpenAI Realtime.

Could you please tell me if it’s possible to use Node.js with ARI to send a media stream to OpenAI so that it can process the call in real-time?

Hello, that’s exactly what I’m doing, today I was working on the ARI application and I was able to listen for the first time to the openai model real time from an asterisk call, but it fails when playing the following open ai rt audio responses, well, I’m making progress, I’ve made quite a bit of progress I would say. I’m close, follow the updates of this post, at the end I will share the functional ARI application. Greetings.

2 Likes

fantastic job! was also my research and you and you got ahead of me! my research was oriented to include a n8n flux, i follow your work and I will be vailable to extend it to create something awesome

1 Like

Hi, nice idea, it could be integrated with n8n. I’m close to complete the 0.1 version of the ARI app, so, keep tuned.

2 Likes

Will this app allow for a realtime conversation between a user via telephone with an openai bot?

Yes exactly, this ARI application and the subsequent FreePBX module will connect Asterisk with OpenAI Realtime services.

1 Like