Skip to content

Communication Mechanism

Here is an overview of our call workflow.

sequenceDiagram
    participant Caller
    participant TelGateway as Telephony Gateway
    participant CallProc as Call Processor
    participant STT as Speech-to-Text
    participant NLP as NLP Engine
    participant DM as Dialogue Manager
    participant BRE as Business Rules Engine
    participant Int as Integration Service
    participant TTS as Text-to-Speech
    participant Agent as Human Agent

    Caller->>TelGateway: Incoming Call
    TelGateway->>CallProc: Route Call
    CallProc->>STT: Initialize Voice Stream

    CallProc->>Caller: Play Greeting

    loop Conversation
        Caller->>TelGateway: Speak
        TelGateway->>STT: Audio Stream
        STT->>NLP: Transcribed Text
        NLP->>DM: Intent + Entities

        DM->>BRE: Check Business Rules
        BRE->>DM: Apply Rules

        alt Integration Needed
            DM->>Int: Request Data
            Int->>DM: Return Data
        end

        DM->>TTS: Generate Response
        TTS->>CallProc: Synthesized Speech
        CallProc->>Caller: AI Response

        alt Information Extraction
            DM->>Int: Store Extracted Data
            Int->>Int: Update External Systems
        end
    end

    alt Appointment Scheduling
        DM->>Int: Check Availability
        Int->>DM: Available Slots
        DM->>TTS: Present Options
        TTS->>Caller: Available Times
        Caller->>STT: Select Time
        STT->>NLP: Process Selection
        NLP->>DM: Selected Time
        DM->>Int: Book Appointment
        Int->>DM: Confirmation
        DM->>TTS: Confirm Booking
        TTS->>Caller: Booking Confirmed
    end

    alt Transfer to Human
        DM->>CallProc: Request Transfer
        CallProc->>TTS: Generate Transfer Message
        TTS->>Caller: Transfer Notification
        CallProc->>Agent: Connect Call
        Caller->>Agent: Conversation
    end

    alt Call Completion
        DM->>TTS: Generate Conclusion
        TTS->>Caller: Goodbye Message
        CallProc->>TelGateway: End Call
        TelGateway->>Caller: Disconnect
        CallProc->>Int: Log Call Details
    end