Skip to main content

Starting Conversations with AI Assistants

Overview

After a successful anonymousLogin, you can initiate calls to your AI Assistant using the standard newCall method. The session is locked to the AI Assistant, so the destination parameter is ignored.

Method Usage

Parameters

Note that you can also provide customHeaders in the newCall method. These headers need to start with the X- prefix and will be mapped to dynamic variables in the AI assistant (e.g., X-Account-Number becomes {{account_number}}). Hyphens in header names are converted to underscores in variable names.

Usage Example

Complete Flow Example

Important Notes

  • Automatic Answer: AI assistants automatically answer calls - no manual answer required
  • Destination Ignored: The destinationNumber parameter is ignored after anonymous login
  • Call Routing: All calls are routed to the AI assistant specified during login
  • Standard Controls: Use existing call management methods (mute, hold, end call)
  • Custom Headers: You can pass custom SIP headers to provide context to the AI assistant. They will be mapped to dynamic variables in the portal. Hyphens in header names are converted to underscores in variable names, e.g. X-Session-Context header maps to {{session_context}} variable.

Call State Management

Monitor call states as you would with regular calls:

Error Handling

Handle call-related errors:

Call Management

Once connected, use standard call management methods:

Next Steps

After starting a conversation:
  1. Set up transcript updates to receive real-time conversation data
  2. Send text messages during the active call
  3. Use standard call controls for mute, hold, and end call operations