AI Connect Service - Getting Started
Download OpenAPI specification:Download
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.
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.
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.
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.
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.
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.
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.
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.
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.
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. TheSTARTSTREAMcommand supports optional handshake headers instreamTarget.headers; a Bearer Authorization header matching the/newCallcallback configuration is added automatically.Receive the Session Event
Establish a SIPRec session and receive
SESSIONSTARTED. Use thesessionId,replyId, and response queue information from that event to issue commands for the session. This flow uses the session event model; the legacyrecordCall: truemethod does not emitSESSIONSTARTED.Start Streaming
Send
STARTSTREAMto the session's SQS response queue. SetstreamTarget.urlto your receiving endpoint and select the audio channels instreamTarget.channels, using channel indices or SIPRec stream labels. UsestreamTarget.chunkDurationto configure the audio chunk duration and, optionally,streamTarget.streamReferenceIdto include your application's correlation data in stream events. The SIPRec API documents the command parameters, supported values, and a complete request example.Verify Audio Delivery and Events
Wait for
STREAMSTARTEDand confirm that audio arrives at your WebSocket endpoint with the expected channels. Retain thestreamIdfor later commands and correlate the stream with call metadata. HandleSTREAMFAILEDif the connection cannot be established or streaming is interrupted.Stop Streaming
Send
STOPSTREAMusing the session identifier, thestreamId, and thereplyIdfromSTREAMSTARTED, as described in the SIPRec API. Confirm receipt ofSTREAMSTOPPED. Stopping a stream allows the SIPRec session to continue; streaming also stops when the session ends.
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.
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.
Start and Verify Forwarding
Your application can request forwarding in its
/newCallresponse usingstartSIPRecForward, 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.
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.
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.
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.
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.
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.