Fix extension transfer system and browser phone compatibility
Major Fixes: - Fixed extension transfers going directly to voicemail for available agents - Resolved browser phone call disconnections during transfers - Fixed voicemail transcription placeholder text issue - Added Firefox compatibility with automatic media permissions Extension Transfer Improvements: - Changed from active client dialing to proper queue-based system - Fixed client name generation consistency (user_login vs display_name) - Added 2-minute timeout with automatic voicemail fallback - Enhanced agent availability detection for browser phone users Browser Phone Enhancements: - Added automatic microphone/speaker permission requests - Improved Firefox compatibility with explicit getUserMedia calls - Fixed client naming consistency across capability tokens and call acceptance - Added comprehensive error handling for permission denials Database & System Updates: - Added auto_busy_at column for automatic agent status reversion - Implemented 1-minute auto-revert system for busy agents with cron job - Updated database version to 1.6.2 for automatic migration - Fixed voicemail user_id association for extension voicemails Call Statistics & Logging: - Fixed browser phone calls not appearing in agent statistics - Enhanced call logging with proper agent_id association in JSON format - Improved customer number detection for complex call topologies - Added comprehensive debugging for call leg detection Voicemail & Transcription: - Replaced placeholder transcription with real Twilio API integration - Added manual transcription request capability for existing voicemails - Enhanced voicemail callback handling with user_id support - Fixed transcription webhook processing for extension voicemails Technical Improvements: - Standardized client name generation across all components - Added ElevenLabs TTS integration to agent connection messages - Enhanced error handling and logging throughout transfer system - Fixed TwiML generation syntax errors in dial() methods 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,11 @@ class TWP_Activator {
|
||||
|
||||
// Create webhook endpoints
|
||||
flush_rewrite_rules();
|
||||
|
||||
// Initialize user queues for existing users with phone numbers
|
||||
if (class_exists('TWP_User_Queue_Manager')) {
|
||||
TWP_User_Queue_Manager::initialize_all_user_queues();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -428,6 +433,14 @@ class TWP_Activator {
|
||||
}
|
||||
}
|
||||
|
||||
// Add user_id column to voicemails table for extension voicemails
|
||||
$table_voicemails = $wpdb->prefix . 'twp_voicemails';
|
||||
$voicemail_user_id_exists = $wpdb->get_results("SHOW COLUMNS FROM $table_voicemails LIKE 'user_id'");
|
||||
if (empty($voicemail_user_id_exists)) {
|
||||
$wpdb->query("ALTER TABLE $table_voicemails ADD COLUMN user_id int(11) DEFAULT NULL AFTER workflow_id");
|
||||
$wpdb->query("ALTER TABLE $table_voicemails ADD INDEX user_id (user_id)");
|
||||
}
|
||||
|
||||
// Add login tracking columns to agent_status table
|
||||
$table_agent_status = $wpdb->prefix . 'twp_agent_status';
|
||||
|
||||
@@ -441,6 +454,12 @@ class TWP_Activator {
|
||||
$wpdb->query("ALTER TABLE $table_agent_status ADD COLUMN logged_in_at datetime AFTER is_logged_in");
|
||||
}
|
||||
|
||||
// Add auto_busy_at column to track when agent was automatically set to busy
|
||||
$auto_busy_at_exists = $wpdb->get_results("SHOW COLUMNS FROM $table_agent_status LIKE 'auto_busy_at'");
|
||||
if (empty($auto_busy_at_exists)) {
|
||||
$wpdb->query("ALTER TABLE $table_agent_status ADD COLUMN auto_busy_at datetime DEFAULT NULL AFTER logged_in_at");
|
||||
}
|
||||
|
||||
$table_schedules = $wpdb->prefix . 'twp_phone_schedules';
|
||||
|
||||
// Check if holiday_dates column exists
|
||||
|
Reference in New Issue
Block a user