How to Set Up an Asterisk AI Voice Agent with Google Live, Deepgram, and OpenAI
Businesses waste thousands of hours handling basic phone inquiries manually. This step-by-step guide shows how to deploy an AI voice agent with Asterisk PBX that answers calls naturally using multiple AI providers. Get sub-1 second response times with true duplex conversation capabilities.
What Is an Asterisk AI Voice Agent?
Traditional IVR systems frustrate callers with rigid menu trees and limited understanding. An Asterisk AI voice agent transforms this experience by combining the open-source Asterisk PBX platform with modern AI capabilities. The result is a system that understands natural language, responds conversationally, and can integrate with your business systems.
As shown in the demo, this setup supports multiple AI providers including Google Live (with sub-1 second latency), Deepgram, and OpenAI. Each offers different strengths - Google Live provides the fastest response times, while others may offer better accuracy for specific use cases.
Key benefit: The system maintains true duplex communication, allowing natural turn-taking in conversations rather than forcing callers to wait for beeps or prompts.
Prerequisites and Setup
Before configuring your AI voice agent, you'll need three core components: 1) An Asterisk PBX server (FreePBX works well), 2) The AI voice agent software (available as open-source), and 3) API keys from your chosen AI providers.
The demo uses a fresh FreePBX installation. The first step is cloning the repository and running the pre-flight script (timestamp 0:45 in the video). This automatically installs Docker, Docker Compose, and other dependencies. The script handles most of the heavy lifting, though you may need to manually install git if not present.
Step 1: Clone the Repository
Access your server via CLI and clone the staging branch (or main branch for production):
git clone -b staging https://github.com/hkjarl/asterisk-ai-agent.git Step 2: Run Pre-flight Script
Navigate to the project directory and execute:
./pre-flight.sh This installs all required dependencies and prepares your environment.
Google Live Configuration
Google Live offers the fastest response times of the three providers demonstrated. At 4:30 in the video, we see the setup wizard guiding through the configuration process.
Step 1: Obtain API Key
You'll need a Google Generative Language API key from either Google AI Studio or Google Console.
Step 2: Configure ARI Credentials
In FreePBX, create a new REST interface user (demo shows "my_ai_agent") with read/write permissions. Ensure the static REST interface is enabled under Advanced Settings.
Step 3: Test Connection
Enter your Asterisk host, ARI username/password in the setup wizard and test the connection. The demo shows a successful connection at 5:50.
Performance note: Google Live consistently delivers responses under 1 second, making it ideal for natural conversations where latency matters.
Deepgram Configuration
Deepgram requires both a Deepgram API key and an OpenAI key for the LLM component. The setup process is similar but requires both credentials (shown at 9:30 in the video).
Step 1: Create Custom Destination
In FreePBX, add a new custom destination (demo uses "D testing") that routes to the Deepgram context.
Step 2: Update Dial Plan
Modify extension_custom.conf to use the Deepgram-specific context. The demo shows this configuration at 10:15.
Step 3: Route Inbound Calls
Update your inbound route to point to the Deepgram custom destination rather than the Google Live one.
The test call at 10:45 demonstrates Deepgram's slightly different response pattern compared to Google Live.
OpenAI Configuration
The OpenAI configuration follows the same pattern but uses OpenAI's real-time voice API. At 12:30 in the video, we see the provider being switched in the web interface.
Step 1: Change AI Provider
In the environment section, add your OpenAI API key and test the connection.
Step 2: Update Context
Modify the dial plan context to use "demo_open_AI" instead of the Deepgram context.
Step 3: Test Call
The test call at 13:00 shows OpenAI's response pattern and greeting message.
Implementation tip: You can maintain multiple contexts and switch between them based on time of day, caller ID, or other factors.
Testing and Provider Comparison
The demo includes test calls with all three providers (Google Live at 7:00, Deepgram at 10:45, and OpenAI at 13:00), allowing direct comparison of their performance and interaction styles.
Google Live: Fastest responses (under 1 second), true duplex communication, most natural turn-taking.
Deepgram: Slightly higher latency but excellent speech recognition accuracy, especially for technical terms.
OpenAI: Most flexible conversation capabilities but generally higher latency than the other options.
The system logs all calls and can optionally email transcripts to callers (though this feature was declined in the demo calls).
Customization Options
The AI voice agent offers several customization points to tailor it to your business needs:
Agent Personality
Change the agent name (default "Ava"), role description, and greeting message in the setup wizard.
Caller Variables
The system can pass caller information (like name) from Asterisk if configured in your dial plan.
Multiple Contexts
Create different contexts for different call flows or departments, each with their own AI configuration.
At 14:00, the video shows how to modify these settings through the web interface without needing to edit configuration files directly.
Watch the Full Tutorial
The complete 15-minute video tutorial shows the entire setup process from start to finish, including real test calls with all three AI providers. Pay special attention to the FreePBX configuration at 5:00 and the provider switching demonstration at 12:30.
Key Takeaways
Setting up an AI voice agent with Asterisk PBX can transform your phone system from a cost center to a competitive advantage. The open-source solution demonstrated provides enterprise-grade capabilities without the enterprise price tag.
In summary: 1) The system supports multiple AI providers with different strengths, 2) Google Live offers the fastest sub-1 second responses, 3) Configuration requires API keys and basic Asterisk knowledge, and 4) The web interface makes ongoing management accessible to non-technical staff.
Frequently Asked Questions
Common questions about this topic
An Asterisk AI voice agent combines the open-source Asterisk PBX telephony platform with artificial intelligence to create interactive voice response systems. Unlike traditional IVRs with rigid menus, the AI agent understands natural language and responds conversationally.
The system handles calls in real-time with sub-1 second latency when using providers like Google Live. It supports true duplex communication allowing natural turn-taking in conversations rather than forcing callers to wait for prompts.
- Integrates with Asterisk PBX (including FreePBX)
- Supports multiple AI providers (Google Live, Deepgram, OpenAI)
- Maintains conversation context throughout calls
You need three main components: 1) An Asterisk PBX server (FreePBX works well), 2) The AI voice agent software (available as open-source), and 3) API keys from your chosen AI providers.
The setup also requires Docker and basic Linux server administration skills. The pre-flight script handles most dependency installation automatically, but you should have root access to your server.
- Asterisk/FreePBX server
- AI voice agent software
- API keys for your chosen providers
Google Live provides the fastest response times with latency under 1 second. It supports true duplex communication allowing natural turn-taking in conversations without artificial pauses.
Deepgram and OpenAI offer slightly higher latency but may provide better accuracy for certain use cases depending on your requirements. The demo shows noticeable differences in response patterns between the providers.
- Google Live: Under 1 second latency
- Deepgram: 1-2 second latency
- OpenAI: 2-3 second latency typically
Yes, the system allows you to easily switch between Google Live, Deepgram, and OpenAI. Each provider can be configured separately through the web interface, and you can route calls to different providers based on your needs.
The demo shows how to test all three providers with the same setup by simply changing the dial plan context and inbound route destination. You could also implement time-based or caller-based routing rules.
- Switch providers via web interface
- Route calls based on time, caller ID, or other factors
- Maintain multiple configurations simultaneously
The main steps are: 1) Clone the repository and run the pre-flight script, 2) Configure your Asterisk ARI credentials, 3) Set up API keys for your chosen AI providers, 4) Create custom dial plan contexts in FreePBX, and 5) Test the configuration with inbound calls.
The entire process takes about 15-30 minutes for initial setup. The video tutorial shows each step in detail, with the pre-flight script handling most of the dependency installation automatically.
- Clone repository and run pre-flight script
- Configure Asterisk ARI credentials
- Set up AI provider API keys
After setup, you can make test calls to your Asterisk server. The system provides sample dial plan configurations you can use in FreePBX's extension_custom.conf. Each call will be answered by your AI agent using the configured provider.
The demo shows testing with all three providers (Google Live, Deepgram, and OpenAI) with real call examples. You can view detailed logs in the web interface to troubleshoot any issues during testing.
- Use provided sample dial plan configurations
- Make test calls to your Asterisk server
- Monitor logs in the web interface
You can customize the agent name, greeting message, and conversation context. The system allows passing caller information as variables from Asterisk. You can also configure different behaviors for different call flows by creating multiple contexts in the dial plan.
The web interface makes these customizations accessible without needing to edit configuration files directly. The demo shows modifying these settings at 14:00, including changing the agent name and greeting message.
- Custom agent name and greeting
- Pass caller information as variables
- Create multiple contexts for different call flows
GrowwStacks helps businesses implement AI voice agents with Asterisk PBX, including custom configurations for specific use cases. We can set up the complete system, integrate with your existing telephony infrastructure, and optimize for your business needs.
Our team provides free consultations to discuss your voice automation requirements and implementation options. We handle everything from initial setup to ongoing maintenance, allowing you to focus on your business while benefiting from cutting-edge AI telephony.
- Complete Asterisk AI voice agent implementation
- Custom configurations for your specific needs
- Free consultation to discuss your requirements
Ready to Transform Your Phone System with AI?
Manual call handling costs businesses thousands in lost productivity each year. Our team can have your AI voice agent answering calls naturally in under 48 hours.