Skip to content

Conversation

Copy link

Copilot AI commented Sep 3, 2025

This PR implements a comprehensive voice manager system that automatically answers phone calls for an online store, providing customers with an interactive voice response (IVR) menu to handle common inquiries.

Overview

The voice manager integrates with the existing Telegram-Creatio chatbot infrastructure, extending it to handle voice calls through Twilio webhooks. All call interactions are automatically logged to the Creatio CRM system for complete customer interaction tracking.

Key Features

🎯 Interactive Voice Menu

  • Automated greeting in Ukrainian language
  • 4-option menu system for customer inquiries
  • Product catalog information (electronics, clothing, home goods, sports)
  • Order status checking functionality
  • Direct operator transfer capability
  • Store contact information and hours

🔧 Technical Implementation

  • New voice_manager.py module with complete IVR logic
  • Three FastAPI endpoints for Twilio webhook integration:
    • POST /voice/incoming - handles incoming calls
    • POST /voice/handle-input - processes user menu selections
    • POST /voice/status - tracks call completion status
  • TwiML response generation for Twilio compatibility
  • Ukrainian language support with Polly.Ruslana text-to-speech

📊 CRM Integration

  • Seamless integration with existing Creatio API functions
  • Automatic call logging with caller phone number
  • User action tracking (menu selections, call duration)
  • Call status monitoring (answered, completed, transferred)

Example Call Flow

Customer calls → System answers:
"Вітаємо у Інтернет Магазин! Для отримання інформації про товари натисніть 1..."

Customer presses 1 → System responds:
"Наш каталог включає електроніку, одяг, товари для дому та спорту..."

All interactions logged to Creatio CRM automatically

Setup Requirements

To deploy the voice manager:

  1. Twilio Account: Register and purchase a phone number
  2. Webhook Configuration:
    • Voice URL: https://your-domain.com/voice/incoming
    • Status Callback: https://your-domain.com/voice/status
  3. Environment Variables: Added STORE_PHONE_NUMBER to deployment config
  4. Dependencies: Added python-multipart for form data handling

Files Changed

  • voice_manager.py - New voice handling module (complete IVR system)
  • main.py - Added voice endpoints to FastAPI app
  • requirements.txt - Added python-multipart dependency
  • render.yaml - Added voice service environment variables
  • VOICE_MANAGER_README.md - Comprehensive documentation
  • .gitignore - Standard Python exclusions

Testing

All functionality has been thoroughly tested:

  • ✅ Voice manager module loads and functions correctly
  • ✅ TwiML responses generate valid XML for Twilio
  • ✅ FastAPI endpoints properly registered
  • ✅ Creatio CRM integration working
  • ✅ Ukrainian language responses validated

The implementation follows the existing codebase patterns and makes minimal changes to the original Telegram bot functionality while adding comprehensive voice capabilities.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits September 3, 2025 10:15
Co-authored-by: igormarswebdev <48925848+igormarswebdev@users.noreply.github.com>
Co-authored-by: igormarswebdev <48925848+igormarswebdev@users.noreply.github.com>
Copilot AI changed the title [WIP] Потрібно реалізувати голосового менеджера інтернет магазину що відповідатиме на дзвінки Implement Voice Manager for Online Store Phone Calls Sep 3, 2025
Copilot AI requested a review from igormarswebdev September 3, 2025 10:17
Copilot finished work on behalf of igormarswebdev September 3, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants