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

Hello,

I’m the author of the demo. I can offer support services if you need it to work for your specific use case.

Thanks.

How do I reach out to you? I am new to this community

UPDATES!

8.5. Test and debug. - Done

8.6. Create the FreePBX Module. - Done

8.7. Test and debug. - Done

8.8. Build the second ARI app version 0.2. - Done, better buffers, syncro and debug.

8.9. Test and debug. - Done. Sip Trunks and Remote Extensions.

8.10. Integrate the most popular requested features. - Done, included support for SIP Trunks and Remote Extensions.

  1. What can you do? - Share this post please!

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.

To do:

  • I’ll make the FreePBX module URL installation package.
  • Create a demo of SIP Trunk and Remote Extension support.
  • Upgrade the github repo.

Spam:

Do you want to integrate Asterisk with OpenAI in real time for your specific use case?
Want to save lots time and money on research?
I can help. I offer support services for Asterisk ARI applications. Free consultation! Guaranteed. Email me at: hello@infinitocloud.com

Thanks.

This is very good.. I have been trying for a while to connect but with an internal model So that the whole process is local. But there were some problems with the sound transmission.

Do you have a Discord so I can contact you?
My discord is : KishoOoOo#9664

Hi, It’s work like you said, Thanks

I tried in spanish. I’ll make more testing.

Regards


Running as user 'asterisk'
Running under group 'asterisk'
Connected to Asterisk 20.13.0 currently running on asterisk113 (pid = 463445)
asterisk113*CLI> 

S-0042 | 2025-05-06T22:47:18.766Z [INFO] [Server] Sent audio transcribed for channel 1746571633.9 | Transcript: "Hola, ¿me escuchas?" | Duration: 0.94s | Status: Received
S-0045 | 2025-05-06T22:47:18.822Z [INFO] [Server] Audio delta received for channel 1746571633.9 | Size: 11.72 KB
S-0047 | 2025-05-06T22:47:18.913Z [INFO] [Server] Audio delta received for channel 1746571633.9 | Size: 23.44 KB
S-0049 | 2025-05-06T22:47:19.056Z [INFO] [Server] Audio delta received for channel 1746571633.9 | Size: 35.16 KB
S-0051 | 2025-05-06T22:47:19.117Z [INFO] [Server] Audio delta received for channel 1746571633.9 | Size: 39.84 KB
S-0054 | 2025-05-06T22:47:19.127Z [INFO] [Server] Response received for channel 1746571633.9 | Transcript: "¡Hola! Sí, te escucho. ¿En qué puedo ayudarte hoy?" | Duration: 1.31s | Status: Received
S-0058 | 2025-05-06T22:47:19.130Z [INFO] [Server] Response completed for channel 1746571633.9 | Duration: 0.65s | Audio Fragments: 9 | Text Fragments: 16 | RTP Packets: 74 | RTP Bytes: 8800
C-0003 | 2025-05-06T22:47:19.130Z [INFO] [Client] Cleared OpenAI audio buffer for channel 1746571633.9

hi hzapa do you have any discord? i want to ask something about this

Well, the Ari app was designed and tested solely for OpenAI Realtime models, which means no other model can work as it does.
To make it work with another AI model, significant code changes are required.
Obviously, it’s a huge advantage to work with local models to reduce costs, but you also need to consider whether your local model is multimodal with audio support and the latency of its response. There are many aspects to consider when using a different model than the one the Ari app was designed for.

Great!

Course

Does it support Azure OpenAI API?

Hi, yes, I have a version for Azure OpenAI that works well, with support for SIP trunks. You can contact me at: hello@infinitocloud.com
Regards.

Hi, I think you can improve the code by not doing conversions. Open ai realtime excepts g711_ulaw
So in session: add
input_audio_format: ‘g711_ulaw’,
output_audio_format: ‘g711_ulaw’,
Remove the conversions muLawToPcm24kHz and pcmToMuLaw

Yes, I’m working on an improved version to share and update the repository, also focusing on ptime 20 ms and others.

Hi, here is the updated version, please test it and leave your comments. Thanks!

Asterisk to OpenAI Realtime Community Edition

Asterisk to OpenAI Realtime PRO Edition