A real-time voice bot that integrates with WhatsApp Business API to handle voice calls using WebRTC technology. Users can call your WhatsApp Business number and have natural conversations with an AI-powered bot.
- Facebook Account: Create an account at facebook.com
- Facebook Developer Account: Create an account at developers.facebook.com
- WhatsApp Business App: Create a new WhatsApp Business API application
- Phone Number: Add and verify a WhatsApp Business phone number
- Business Verification: Complete business verification process (required for production only)
- Webhook Configuration: Set up webhook endpoint for your application
Important Note: For production, make sure your WhatsApp Business account has access to this feature.
Find more details here:
Your WhatsApp Business phone number must be configured to accept voice calls[2]:
For development, you'll be provided with a free test phone number valid for 90 days.
- Go to your WhatsApp Business API dashboard in Meta Developer Console
- Navigate to Configuration → Phone Numbers → Manage phone numbers
- Select your phone number
- In the Calls tab, enable "Allow voice calls" capability
- Save the configuration
Set up your webhook endpoint in the Meta Developer Console[3]:
- Go to WhatsApp → Configuration → Webhooks
- Set callback URL:
https://your-domain.com/ - Set verify token:
your_webhook_verification_token- This token should match your
WHATSAPP_WEBHOOK_VERIFICATION_TOKENenvironment variable
- This token should match your
- Click "Verify and save"
- In the webhook fields below, select:
calls(required for voice call events)
- Go to WhatsApp → API Setup
- Click "Generate access token"
- Use this token for your
WHATSAPP_TOKENenvironment variable
- Use this token for your
- Note your Phone Number ID - you'll need this for
PHONE_NUMBER_IDconfiguration
-
Install dependencies:
uv sync
-
Configure environment variables:
cp env.example .env
Edit
.envfile and add your API keys and configuration values.
python server.pyThe server will start and listen for incoming WhatsApp webhook events.
- Find your WhatsApp test number in the Meta Developer Console
- Call the number from your WhatsApp app
- The bot should answer and engage in conversation
- WhatsApp Cloud API Getting Started
- Voice Calling API Documentation
- Webhook Configuration Guide
- SDP Overview and Samples
- Ensure all dependencies are installed before running the server
- Verify your
.envfile contains all required configuration values - Make sure voice calling is enabled for your WhatsApp Business number
- Check that your webhook URL is publicly accessible and properly configured
- Ensure your business account is verified for production use
- Voice calling feature requires WhatsApp Business API access
- Test numbers are valid for 90 days in development mode
- Production deployment requires business verification