Help with Automating Call Handling using Asterisk, Skyline, and Python (STT, TTS, and GPT Integration)

Hello Asterisk Community,

I’m working on a project that aims to automate calls, including answering, processing speech-to-text (STT), generating responses with GPT, and converting text-to-speech (TTS). Here’s my setup:

  • Skyline PBX Account: I have a Skyline account with a phone number, username, and password.
  • Issabel: Using Issabel to manage calls, connect Skyline PBX, and handle SIP configurations.
  • Python for Call Handling: I need Python to interact with Asterisk, answer calls, and handle STT/TTS and GPT processing.

Current Issues

  1. Asterisk ARI Compatibility:

    • I found ari-py, but it’s outdated and works only with Python 2.
    • Tried asyncari, but faced numerous compatibility issues with anyio and ARI event handling.
  2. Goal: I need to connect Python with Asterisk to:

    • Answer incoming calls and handle events.
    • Process voice input (STT) and generate responses (GPT).
    • Play audio responses back to the caller using TTS.

Questions:

  1. Is Issabel suitable for this task with Skyline, or are there recommended alternatives?
  2. Best Practices for connecting Python to Asterisk for real-time call handling?
  3. Recommended libraries or tools for Python-Asterisk integration, considering my STT, TTS, and GPT requirements.

Any guidance, resources, or alternative approaches would be greatly appreciated! I’m open to detailed insights or suggestions (even if there are service costs involved).

Thank you very much in advance!

The Issabel forum is at https://forum.issabel.org/ There is probably even less knowledge of Issabel than of FreePBX, here.

i need to integration asteriks with python, that s problem.
in any library don’t work

Another option for ARI is my seaskirt wrapper. This integrates support for asyncio and includes wrappers for Asterisk’s AMI, AGI, ARI and Console interfaces.

I don’t have much documentation for it, but examples of its use can be found here.

As you are already aware, the Python ARI library is outdated. Anyway, using Python to write your own class with the necessary methods for this task is not a big deal. The challenging part, where many people get stuck, is real-time audio transcription. While everyone knows they need to use ARI and external media, fewer people know how to put the pieces together.