A Flask-based web application for testing call center systems using Twilio's voice API. This tool allows you to make test calls to phone numbers with customizable audio playback options.
- Password Protection: Secure login system to protect the application
- Session Management: Maintain user sessions for seamless usage
- Logout Functionality: Easily end your session when finished
- Simultaneous Calls: Make calls to multiple phone numbers with configurable delay between calls
- Load Control: Set the maximum number of simultaneous calls to control system load
- Real-time Tracking: Monitor each call's status in real-time
- Text-to-Speech Only: Use Twilio's TTS or Eleven Labs for voice synthesis
- Text-to-Speech + MP3: Play a custom greeting followed by an MP3 file
- MP3 Only: Play only an MP3 file during the call
- Natural-Sounding Voices: High-quality, realistic voice synthesis
- Multiple Voice Options: Choose from various voice profiles with adjustable settings
- Direct API Integration: Seamless integration with Eleven Labs API
- Performance Optimization: Audio caching to improve responsiveness
- Easy Upload: Upload MP3 files through the intuitive web interface
- File Operations: Delete or rename existing MP3 files
- Preview Capability: Listen to MP3 files before using them in calls
- Live Monitoring: Track call progress with Socket.IO
- Detailed Logging: View comprehensive logs for troubleshooting
- Call Control: Abort ongoing calls when needed
- Dedicated pages for testing MP3 playback, static file serving, and Twilio integration
-
Clone this repository:
git clone https://github.com/webdevtodayjason/callcenter-testing.git cd callcenter-testing
-
Create and activate a Conda environment:
conda create -n callcenter python=3.11 conda activate callcenter
-
Install the required dependencies:
pip install -r requirements.txt
-
Create a
.env
file based on the provided.env.example
:cp .env.example .env
-
Edit the
.env
file with your Twilio credentials, admin login credentials, and other configuration options.
-
Start the application:
python app.py
-
Open your browser and navigate to
http://localhost:5005
-
Log in with the admin credentials configured in your
.env
file (default: usernameadmin
, passwordpassword
) -
Configure your call settings:
- Enter phone numbers (one per line) in E.164 format (e.g., +15551234567)
- Set the delay between calls (minimum 1 second)
- Set the maximum number of simultaneous calls (1-50)
- Choose playback mode (Text-to-Speech Only, Text-to-Speech + MP3, or MP3 Only)
- Select MP3 options (random or specific file)
- Configure Text-to-Speech settings
-
Click "Start Calls" to initiate the calls
-
Monitor call status in real-time on the page
The application provides a dedicated page for managing MP3 files:
- Navigate to the "Manage MP3 Files" page from the main interface
- Upload new MP3 files (up to 16MB)
- Preview existing MP3 files
- Rename or delete MP3 files as needed
The application features full integration with Eleven Labs for enhanced text-to-speech:
- Sign up for an Eleven Labs account at https://elevenlabs.io
- Get your API key from the Eleven Labs dashboard
- Add your API key to the
.env
file - Configure your voice IDs in the
ELEVENLABS_VOICES
environment variable - Select "Eleven Labs" as your TTS provider in the web interface
- Choose from available voices and customize settings as needed
Benefits of using Eleven Labs:
- Higher quality, more natural-sounding voices compared to Twilio's built-in TTS
- Multiple voice options to choose from
- Ability to save generated audio for reuse
For testing callbacks locally:
- Install ngrok: https://ngrok.com/download
- Start ngrok on port 5005:
ngrok http 5005
- Update the
BASE_URL
in your.env
file with the ngrok URL
The application includes several test pages to verify functionality:
/test-mp3
: Test MP3 file playback/test-static
: Test static file serving/test-twilio
: Test Twilio account integration/test-call
: Test TwiML response
This project is licensed under the MIT License.
MIT License
Copyright (c) 2025 Jason Brashear
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Jason Brashear
- Twilio for their excellent voice API
- Flask for the web framework
- Socket.IO for real-time communication
- Eleven Labs for advanced text-to-speech capabilities