AI Connect Service - Getting Started

Download OpenAPI specification:Download

Getting Started

At Your Side

  1. Prepare Your Infrastructure

    Ensure your network, compute, and security infrastructure is ready to integrate the AI Connect Service. Confirm that the environment meets prerequisites for hosting your voice applications and connecting to SIP-based services.

  2. Set Up Voice Connectivity

    Establish SIP Trunk or SIPRec connections to enable voice stream routing for analysis. Configure your PBX or voice communication system to support these protocols.

  3. Integrate with AI Platforms

    Choose your preferred AI platform (e.g., Amazon Transcribe, Amazon Lex, Google Contact Center AI (CCAI) platform or Google Dialogflow). Set up credentials and API keys to allow secure communication between the AI Connect Service and your chosen platform. For a custom integration, prepare a WebSocket endpoint that receives live audio and passes it to your application or chosen AI platform. Use WSS for secure transport and follow the setup flow below.

  4. API and Callback Configuration

    Define your integration endpoints using the provided RESTful APIs. Set up callback URLs to receive real-time event notifications, ensuring they are accessible and can handle high-frequency updates.

Provisioning the Service

  1. Register Your Application with the AI Connect Service

    Use the AI Connect Service's interface or APIs to register your voice application. This step ensures the service is configured to process voice streams and metadata from your specific use case.

  2. Set Up Analytics Pipelines

    Configure the desired workflows in your connected application or AI platform, such as real-time transcription, sentiment analysis, or intent recognition. AI Connect supplies the audio and metadata used by these workflows.

  3. Enable Data Storage

    Connect to your cloud or local S3-compatible storage to save transcriptions, logs, and metadata. Assign storage paths for structured data retrieval and compliance tracking.

  4. Define Security Policies

    Apply role-based access controls and encryption settings to protect sensitive data. Ensure secure transmission using TLS and enforce IAM policies for API usage.

Set Up WebSocket Streaming for a SIPRec Session

AI Connect initiates the WebSocket connection to your application and sends live audio. Call metadata and stream events arrive separately through the configured callbacks and event notifications. Your application uses the session and stream identifiers to correlate them with the audio.

  1. Prepare the Receiving Endpoint

    Make your WebSocket server reachable from AI Connect and configure a wss:// URL with a valid TLS certificate. Configure the server to accept the authentication headers used by your integration. The STARTSTREAM command supports optional handshake headers in streamTarget.headers; a Bearer Authorization header matching the /newCall callback configuration is added automatically.

  2. Receive the Session Event

    Establish a SIPRec session and receive SESSIONSTARTED. Use the sessionId, replyId, and response queue information from that event to issue commands for the session. This flow uses the session event model; the legacy recordCall: true method does not emit SESSIONSTARTED.

  3. Start Streaming

    Send STARTSTREAM to the session's SQS response queue. Set streamTarget.url to your receiving endpoint and select the audio channels in streamTarget.channels, using channel indices or SIPRec stream labels. Use streamTarget.chunkDuration to configure the audio chunk duration and, optionally, streamTarget.streamReferenceId to include your application's correlation data in stream events. The SIPRec API documents the command parameters, supported values, and a complete request example.

  4. Verify Audio Delivery and Events

    Wait for STREAMSTARTED and confirm that audio arrives at your WebSocket endpoint with the expected channels. Retain the streamId for later commands and correlate the stream with call metadata. Handle STREAMFAILED if the connection cannot be established or streaming is interrupted.

  5. Stop Streaming

    Send STOPSTREAM using the session identifier, the streamId, and the replyId from STREAMSTARTED, as described in the SIPRec API. Confirm receipt of STREAMSTOPPED. Stopping a stream allows the SIPRec session to continue; streaming also stops when the session ends.

Set Up SIPRec Forwarding to an External Platform

Use SIPRec forwarding when your destination recording, analytics, or archival platform accepts SIPRec. Forwarding can run alongside WebSocket streaming and file recording for the same inbound session.

  1. Configure Voice Connectivity

    Provision the inbound SIPRec service and a SIP Trunk for the external SIP Recording Server (SRS). Configure the trunk's destination match, target, and transport, then construct the forwarding SIP URI using the destination match and your tenant domain.

  2. Start and Verify Forwarding

    Your application can request forwarding in its /newCall response using startSIPRecForward, or start it during an active SIPRec session. Verify that the external platform receives the expected audio and participant metadata and that your application receives forwarding lifecycle events.

Follow the SIPRec Forwarding guide for provisioning steps, SIP URI examples, API controls, and event details.

Testing the Service

  1. Validate Voice Stream Routing

    Perform end-to-end tests to confirm that voice streams are correctly routed through SIP Trunk or SIPRec protocols to the AI Connect Service.

  2. Test Real-Time Analytics

    Use sample calls to confirm that your connected application or AI platform can process the supplied audio and metadata. Verify the transcription, sentiment analysis, or other processing configured in that application.

  3. API and Callback Testing

    Invoke APIs with test scripts and confirm that callback endpoints receive notifications as expected. Validate response times and error handling for API requests.

  4. Check Storage Integration

    Confirm that transcriptions, logs, and metadata are stored in the configured S3-compatible storage. Verify that storage paths match your setup and data is accessible when required.

  5. Monitor Logs for Errors

    Review logs from the AI Connect Service for insights into service functionality. Identify and resolve any errors related to call processing, API communication, or data storage.

This setup ensures that your AI Connect Service is fully operational, seamlessly integrated with voice and AI platforms, and ready to provide actionable insights for your communication workflows.