Skip to main content

Telephony Integration & Architecture

LoyJoy is designed to integrate seamlessly with your existing telephony infrastructure. While we support standard legacy connections, we recommend a modern web-based architecture to unlock the full potential of the AI, including lower latency and richer data exchange.

For the best user experience and deepest integration, we recommend connecting your telephony system (PBX/Contact Center Platform) via WebSockets.

Audio Streaming via WebSockets

  • Recommendation: The system should establish a bi-directional WebSocket connection to LoyJoy.
  • Why it helps: This avoids the overhead of legacy telephony protocols. It reduces latency significantly and ensures high-quality audio processing for the AI.
  • How it works: The PBX handles the carrier connection and simply "streams" the audio to LoyJoy via a secure web URL.

Rich Metadata Exchange

  • Recommendation: The system should be capable of exchanging JSON data alongside the audio stream.
  • Why it helps: This allows the phone bot to receive context (e.g., caller ID, previous interactions) and push results back to your system (e.g., transcripts, "Appointment confirmed", logs) in real-time.

2. Universal Compatibility (Legacy Support)

If your system does not support WebSockets, LoyJoy is fully compatible with standard telephony protocols. We ensure connectivity through:

  • SIP Trunking: We can provide a SIP endpoint to connect directly to your VoIP infrastructure.
  • Public Switched Telephone Network (Phone Number): We can provide a standard telephone number to which you can forward calls from your existing system.

Note: While these methods ensure universal connectivity, advanced features like real-time metadata exchange may be more limited compared to the WebSocket integration.

3. General Architecture Principles

Regardless of the connection method (WebSocket or SIP), the following principles apply to keep your setup robust:

Separation of Concerns

  • Routing & Logic: Your telephony system should handle the "telephony intelligence." This includes routing rules, fallback logic (e.g., forwarding to a human agent if the bot is busy), and business hours.
  • Carrier Management: We recommend that you handle number provisioning, SIP trunking contracts, and carrier relationships within your existing environment. LoyJoy acts as the intelligence layer, not the telecommunication carrier.