Implementation of an AI voice bot for IVR (Interactive Voice Response) AI-IVR replaces the touch-tone menu ("press 1 to...") with a natural dialogue: the user says what he wants, the system directs him to the right place without pressing buttons. Reduces navigation time from 60-120 sec to 10-20 sec. ### Comparison of traditional and AI-IVR | Parameter | DTMF IVR | AI IVR | |---------|----------|--------| | Navigation | 3-5 menu levels | 1-2 questions | | Time to operator | 60-120 sec | 10-20 sec | | Caller experience | Low | High | | Routing accuracy | ~90% (with the right buttons) | 85-95% | | Development cost | Low | Medium | ### NLU for routing
ROUTING_DESTINATIONS = {
"technical_support": [
"не работает", "сломалось", "ошибка", "проблема с", "техподдержка"
],
"billing": [
"оплата", "счёт", "задолженность", "списание", "тариф", "деньги"
],
"new_connection": [
"подключить", "новый договор", "тариф", "оформить", "заявка"
],
"general_info": [
"информация", "узнать", "как работает", "что такое"
]
}
async def route_call(user_text: str) -> str:
"""Определяем направление маршрутизации"""
response = await client.chat.completions.create(
model="gpt-4o-mini",
messages=[{
"role": "system",
"content": f"""Маршрутизируй звонок. Направления: {list(ROUTING_DESTINATIONS.keys())}.
Верни JSON: {{"destination": "...", "confidence": 0.0-1.0}}"""
}, {"role": "user", "content": user_text}],
response_format={"type": "json_object"}
)
result = json.loads(response.choices[0].message.content)
if result["confidence"] < 0.7:
return "clarification_needed"
return result["destination"]
```### Data collection in IVR```python
DATA_COLLECTION_PROMPTS = {
"phone_verification": "Назовите последние 4 цифры вашего номера телефона.",
"order_number": "Назовите номер вашего заказа.",
"date_of_birth": "Назовите дату вашего рождения для верификации."
}
def extract_digits(text: str) -> str:
"""Извлекаем цифры из распознанного текста"""
import re
# "три четыре пять шесть" → "3456"
num_words = {
"один": "1", "два": "2", "три": "3", "четыре": "4",
"пять": "5", "шесть": "6", "семь": "7", "восемь": "8",
"девять": "9", "ноль": "0"
}
result = text
for word, digit in num_words.items():
result = result.replace(word, digit)
return re.sub(r'[^\d]', '', result)
```### Integration with telephony platforms We support integration with: - **Twilio**: TwiML + Media Streams WebSocket - **Voximplant**: VoxEngine + WebSocket - **FreePBX/Asterisk**: AGI + ARI Timeframe: Basic AI-IVR with 5 directions — 2–3 weeks. Complete DTMF replacement with analytics — 4–6 weeks.