A comprehensive autodialer module for FreePBX that allows you to create and manage automated calling campaigns with scheduling, contact management, and detailed reporting.
- Automated Dialing: Create campaigns that automatically dial through contact lists
- Smart Scheduling: Set campaigns to start automatically at specific times
- Contact Management: Upload CSV files with contact lists during campaign creation
- Real-time Progress: Live progress tracking with visual indicators
- Campaign Reports: Detailed reports with call statistics and results
- Audio Integration: Uses FreePBX system recordings for campaign audio
- Multiple Campaign Types: Immediate start or scheduled campaigns
- Contact Upload: Integrated CSV upload during campaign creation
- Progress Tracking: Real-time progress bars with completion status
- Status Management: Visual indicators for scheduled, active, completed campaigns
- Automatic Cleanup: Auto-delete old reports after 7 days
- Automatic Scheduling: Campaigns start automatically at scheduled times
- Smart Validation: Prevents manual starting of scheduled campaigns
- Scheduler Daemon: Background process monitors and starts campaigns
- Visual Feedback: Clear status indicators for scheduled vs active campaigns
- Streamlined Workflow: Create campaign and upload contacts in one step
- Smart Auto-refresh: Updates every 30 seconds when viewing campaigns
- Modal-aware Refresh: Pauses updates when editing to avoid interruptions
- Visual Progress: Color-coded progress bars (blue=active, green=completed)
- Confirmation Messages: Clear feedback for all actions
- FreePBX system with administrative access
- PHP 7.4+ with CLI access
- MySQL/MariaDB database
- Asterisk Manager Interface (AMI) configured
soxaudio conversion tool (for audio processing)
-
Download the module:
cd /var/www/html/admin/modules/ git clone https://github.com/PJL-Telecom/freepbx-simple-dialer.git simpledialer -
Install AGI script (required for call status tracking):
cp /var/www/html/admin/modules/simpledialer/agi/simpledialer_update.php /var/lib/asterisk/agi-bin/ chmod +x /var/lib/asterisk/agi-bin/simpledialer_update.php chown asterisk:asterisk /var/lib/asterisk/agi-bin/simpledialer_update.php
-
Install dialplan context:
cp /var/www/html/admin/modules/simpledialer/extensions_simpledialer.conf /etc/asterisk/ asterisk -rx "dialplan reload" -
Set permissions:
chmod +x /var/www/html/admin/modules/simpledialer/bin/*.php chown -R asterisk:asterisk /var/www/html/admin/modules/simpledialer/ -
Install the module:
- Go to Admin → Module Admin in FreePBX
- Click "Scan for new modules"
- Find "Simple Dialer" and click Install
- Apply configuration changes
-
Set up scheduler (required for automatic scheduling):
# Add to crontab for automatic campaign scheduling crontab -e # Add this line: * * * * * php /var/www/html/admin/modules/simpledialer/bin/scheduler.php >> /var/log/asterisk/simpledialer_scheduler.log 2>&1
If you're upgrading from an earlier version:
cd /var/www/html/admin/modules/simpledialer
git pull origin main
# Install/update AGI script
cp agi/simpledialer_update.php /var/lib/asterisk/agi-bin/
chmod +x /var/lib/asterisk/agi-bin/simpledialer_update.php
chown asterisk:asterisk /var/lib/asterisk/agi-bin/simpledialer_update.php
# Update dialplan
cp extensions_simpledialer.conf /etc/asterisk/
asterisk -rx "dialplan reload"
# No database migrations required-
Navigate to Simple Dialer:
- Go to Applications → Simple Dialer
-
Create New Campaign:
- Click "Add Campaign"
- Fill in campaign details:
- Name: Campaign identifier
- Description: Optional description
- Audio File: Select from system recordings
- Trunk: Choose outbound trunk
- Caller ID: Set caller ID for calls
- Max Concurrent: Maximum simultaneous calls
- Delay Between Calls: Seconds between call attempts
- Scheduled Time: Optional - set for automatic scheduling
-
Upload Contacts:
- In the same modal, upload a CSV file with contacts
- CSV format:
phone_number,name - Example:
15551234567,John Doe
-
Save and Start:
- Click "Save Campaign & Upload Contacts"
- For immediate campaigns: Click the green play button
- For scheduled campaigns: They start automatically at the scheduled time
- No scheduled time set
- Start manually with the green play button
- Begin dialing immediately when started
- Set a specific date/time for automatic start
- Show blue "Scheduled" or orange "Pending" status
- Start automatically via the scheduler daemon
- Cannot be started manually (prevents conflicts)
- Live Progress Tracking: Campaign progress updates every 2 seconds during active calls
- Frontend Auto-refresh: Page refreshes every 30 seconds to show latest campaign status
- Progress Bars: Visual completion status with live "X/Y calling" indicators
- Color Coding: Blue (active), Green (completed), Red (stopped)
- Call Status: Shows "calling" → "called" transition in real-time
- Inactive: Newly created, ready to start
- Scheduled: Future scheduled time set
- Pending: Past scheduled time, waiting for scheduler
- Active: Currently running and making calls (shows live progress)
- Completed: Finished successfully
- Stopped: Manually stopped
- Failed: Error occurred during execution
- Generated automatically when campaigns complete
- Saved to
/var/log/asterisk/simpledialer_reports/ - Include detailed call statistics, contact details, and success rates
- Emailed to system administrator if configured
Reports now include granular call outcome statistics:
- Answered: Calls that were successfully connected
- No Answer: Calls that rang but weren't picked up
- Busy: Line was busy
- Congestion: Network or trunk congestion
- Unavailable: Channel unavailable
- Cancelled: Call was cancelled before completion
Additional metrics:
- Total and average call duration
- Voicemail detection (human vs. answering machine)
- Answer and hangup timestamps
- Hangup cause codes for troubleshooting
- View reports in the Reports tab
- Download individual reports
- Automatic cleanup after 7 days
- Manual deletion available
The module uses FreePBX system recordings for campaign audio:
-
Upload Recordings:
- Go to Audio Files tab in Simple Dialer
- Upload WAV, MP3, or GSM files
- Files are automatically converted to all required formats
-
System Integration:
- Recordings are stored in
/var/lib/asterisk/sounds/en/ - Automatically generates multiple audio formats
- Integrated with FreePBX recording management
- Recordings are stored in
- Use existing FreePBX trunks for outbound calling
- Supports SIP, IAX, and other trunk types
- Configure trunk capacity for concurrent calls
The scheduler daemon enables automatic campaign starting:
# Check scheduler status
tail -f /var/log/asterisk/simpledialer_scheduler.log
# Manual scheduler run (for testing)
php /var/www/html/admin/modules/simpledialer/bin/scheduler.phpsimpledialer/
├── README.md # This file
├── CHANGELOG.md # Detailed version history
├── module.xml # FreePBX module definition
├── Simpledialer.class.php # Main module class
├── page.simpledialer.php # Web interface
├── extensions_simpledialer.conf # Asterisk dialplan context
├── agi/
│ └── simpledialer_update.php # AGI script for database updates
├── bin/
│ ├── simpledialer_daemon.php # Campaign dialing daemon
│ └── scheduler.php # Automatic campaign scheduler
├── install.php # Installation script
└── uninstall.php # Uninstallation script
The module creates three main tables:
- simpledialer_campaigns: Campaign definitions and settings
- simpledialer_contacts: Contact lists for each campaign
- simpledialer_call_logs: Detailed call attempt logs
# Check scheduler is running
ps aux | grep scheduler.php
# Check scheduler logs
tail -f /var/log/asterisk/simpledialer_scheduler.log
# Verify cron job
crontab -l | grep scheduler# Check audio file formats exist
ls -la /var/lib/asterisk/sounds/en/your_audio_file.*
# Check asterisk can access files
chown asterisk:asterisk /var/lib/asterisk/sounds/en/*# Check AMI connection
asterisk -rx "manager show connected"
# Check trunk availability
asterisk -rx "sip show peers" # or "pjsip show endpoints"
# Check dialplan
asterisk -rx "dialplan show simpledialer-outbound"Note on Trunk Authentication (v1.1.1+):
The module now routes calls through FreePBX's outbound routes (Local/{number}@from-internal) instead of dialing trunks directly. This ensures:
- Proper trunk authentication (no more 403 errors)
- Outbound route rules are applied correctly
- Caller ID manipulation works as configured
- Compatible with all trunk types (PJSIP, SIP, IAX, etc.)
If you're upgrading from an older version and experiencing issues, ensure:
- Your outbound routes are configured correctly in FreePBX
- The trunk you selected in the campaign is accessible via outbound routes
- Test by making a regular call from an extension first
- Scheduler:
/var/log/asterisk/simpledialer_scheduler.log - Campaign Logs:
/var/log/asterisk/simpledialer_[campaign_id].log - Reports:
/var/log/asterisk/simpledialer_reports/ - FreePBX:
/var/log/asterisk/freepbx.log
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Follow FreePBX module development standards
- Use PSR-4 autoloading conventions
- Document all public methods
- Include error handling and logging
This project is licensed under the GPL v3 License - see the LICENSE file for details.
- Issues: Report bugs and feature requests on GitHub
- Documentation: Check the FreePBX wiki for general module development
- Community: Join the FreePBX community forums
- 403 Trunk Authentication Errors: Campaigns now route calls through FreePBX outbound routes (
Local/{number}@from-internal) instead of dialing trunks directly. Ensures proper trunk authentication and routing rules are applied. - All Calls Showing "Answered": Implemented granular call status tracking with accurate reporting of answered, no-answer, busy, congestion, unavailable, and cancelled calls.
- Campaign Stuck In-Progress: Fixed daemon getting stuck waiting for calls to complete. Campaigns now properly transition to "completed" status.
- Caller ID Not Honored: Fixed caller ID propagation through Local channels. Campaign caller ID now displays correctly on receiving end.
- Progress Bar Not Updating Live: Implemented real-time progress tracking with database polling. Frontend now shows live updates every 2 seconds during campaign execution.
- Incorrect Call Durations: Fixed duration calculation bug that showed millions of seconds. Now uses proper ANSWER_EPOCH for accurate duration tracking.
- Premature Campaign Completion: Removed channel status checking that caused campaigns to complete before calls finished.
- AGI Database Update Script: New
agi/simpledialer_update.phpprovides reliable database updates using FreePBX's authenticated connection - Live Progress Tracking: Real-time campaign progress with "X/Y calling" updates during active calls
- Granular Call Status: Detailed breakdown of call outcomes in reports
- Enhanced Campaign Reports: Comprehensive statistics with call metrics, duration analysis, and voicemail detection
- Active Campaign Status: Campaign status now changes to "active" during execution for better visibility
- Database polling every 2 seconds for status updates
- Campaign and contact status tracking throughout call lifecycle
- Prevention of duplicate database updates via flag system
- Proper handling of h-extension to avoid status overwrites
- Maps Asterisk DIALSTATUS to user-friendly status names
- Added AMD (Answering Machine Detection) support
- New dialplan context for voicemail detection
- Updated database schema
- Improved deployment scripts
- Initial release
- Campaign creation and management
- Contact CSV upload integration
- Automatic scheduling with cron
- Real-time progress tracking
- Report generation and email
- Smart auto-refresh interface
- System recording integration
- Comprehensive error handling
Developed for the FreePBX community. Special thanks to all contributors and testers.
Note: This module handles outbound calling. Ensure compliance with local telemarketing and calling regulations in your jurisdiction.