Overview
Purpose:Host agents using our Indian phone number. Use cases:
- Outbound calls: sales, reminders, scheduling, comfirmations, surveys
- Inbound calls: service, support
- Bi-directional
Setup
Before using this feature, make sure you:- Have your agent ready and running on a publically accessible WebSocket endpoint.
- Have an Awaaz AI account with:
- A template set up for calls
- An Indian phone number assigned
- The WebSocket URL configured
How to Use
Once setup is complete, you can use Awaaz AI Telephony in these steps:1. Upload Messages
- Log in to the Awaaz AI Portal UI
- Upload the messages you want to deliver via the XFin API
- Awaaz AI scheduler will queue up the messages for sending calls
2. Outgoing Calls
- Calls are triggered to end users via your Indian phone number.
- During each call, Awaaz AI opens a WebSocket connection to your agent.
3. Real-Time Audio Exchange
- Once connected:
- User → Awaaz AI → Agent (user’s audio is sent as encoded JSON messages).
- Agent → Awaaz AI → User (agent’s audio is returned the same way).
Message Formats
Awaaz AI uses pre-defined JSON formats to exchange audio and events.Messages from Awaaz AI
- Start Message:
- This message will be sent directly after websocket connection is established.
- It will contain audio formating information and any data that might be required by the agent for executing call.
- Media Message:
- AwaazAI will continuously send call audio in below json encoded message format.
- Each payload will contain 320 bytes of base64 encoded, 16-bit PCM, 8 kHz audio.
- DTMF Message:
- This message will be sent when a digit is pressed in call by user.
- Mark Message:
- This message is used to notify when media processing is completed
- Stop Message:
- This message will be sent when call has ended.
Messages to Awaaz AI
All messages sent to Awaaz AI should follow this format for audio messages- Media Message:
- This message will be received from your websocket with audio to be played in call
- Mark Message:
- This message is sent by your websocket to mark a media point. Once audio is processed, you will recieve mark event message from Awaaz AI with matching name
- Clear Message:
- Send this message to clear audio that has been sent but not played yet.
Example Client Code for Your Application
We provide a sample client implementation in our GitHub repository. This boilerplate demonstrates how to interact with the application by:- Receiving audio chunks in JSON messages.
- Accumulating a certain number of chunks.
- Sends audio from an audio file in chunks
Note: This example is intended as a reference. You should refactor it to fit the specific requirements of your agent or application.You can explore the full sample and get started quickly by cloning the repo:
View Example Client Code