Asterisk/FreePBX Integration with AI for Call Processing

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1 servicesAll 1566 services
Asterisk/FreePBX Integration with AI for Call Processing
Medium
from 1 week to 3 months
FAQ
AI Development Areas
AI Solution Development Stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1212
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822

Asterisk/FreePBX Integration with AI for Call Processing Asterisk is an open-source PBX with a vast ecosystem. Integration with AI allows you to add speech recognition and synthesis to your existing telephony infrastructure without replacing the entire platform. A popular choice for on-premise deployments. ### Asterisk + AI Integration Methods AGI (Asterisk Gateway Interface) – a script runs on an incoming call:

# agi_bot.py - AGI скрипт
import sys
from asterisk.agi import AGI

agi = AGI()
agi.answer()
agi.set_variable("CHANNEL(audioreadformat)", "slin16")

# Запись аудио от пользователя
agi.record_file(
    "/tmp/user_audio",
    "wav",
    "#",        # stop key
    3000,       # timeout ms
    0,          # offset
    True,       # beep
    3           # silence threshold
)

# STT + LLM + TTS в отдельном сервисе
import requests
with open("/tmp/user_audio.wav", "rb") as f:
    stt_response = requests.post("http://ai-service/stt", files={"audio": f})
transcript = stt_response.json()["text"]

llm_response = requests.post("http://ai-service/chat",
                              json={"text": transcript})
response_text = llm_response.json()["response"]

tts_response = requests.post("http://ai-service/tts",
                              json={"text": response_text})
with open("/tmp/response.wav", "wb") as f:
    f.write(tts_response.content)

agi.stream_file("/tmp/response")
```**ARI (Asterisk REST Interface)** is a more powerful approach for real-time:```python
import asyncio
import aiohttp
from ari_client import ARIClient

async def handle_stasis(channel_id: str, ari: ARIClient):
    """Обработчик входящего звонка через ARI"""
    await ari.answer(channel_id)

    # Создаём снэпшот аудио канала
    await ari.channel.record(
        channelId=channel_id,
        name=f"call_{channel_id}",
        format="wav",
        terminateOn="silence",
        maxSilenceSeconds=2
    )
```### Asterisk dialplan```ini
; extensions.conf
[ai-bot-context]
exten => _X.,1,NoOp(Входящий звонок)
 same => n,Answer()
 same => n,AGI(agi://127.0.0.1/ai_bot)
 same => n,Hangup()
```### FreePBX IVR via AGI FreePBX provides a web interface for configuration, and AGI adds AI logic:```python
# Заменяем стандартные IVR-пункты на AI-распознавание
# вместо "нажмите 1" → "скажите что хотите"
```Timeframe: AGI integration with Asterisk — 2–3 weeks. Full ARI-based implementation — 1–1.5 months.