Add comprehensive call control features and web phone transfer capabilities

## New Call Control Features
- Call hold/unhold with music playback
- Call transfer with agent selection dialog
- Call requeue to different queues
- Call recording with start/stop controls
- Real-time recording status tracking

## Enhanced Transfer System
- Transfer to agents with cell phones (direct)
- Transfer to web phone agents via personal queues
- Automatic queue creation for each user
- Real-time agent availability status
- Visual agent selection with status indicators (📱 phone, 💻 web)

## Call Recordings Management
- New database table for call recordings
- Recordings tab in voicemail interface
- Play/download recordings functionality
- Admin-only delete capability
- Integration with Twilio recording webhooks

## Agent Queue System
- Personal queues (agent_[user_id]) for web phone transfers
- Automatic polling for incoming transfers
- Transfer notifications with browser alerts
- Agent status tracking (available/busy/offline)

## Technical Enhancements
- 8 new AJAX endpoints for call controls
- Recording status webhooks
- Enhanced transfer dialogs with agent selection
- Improved error handling and user feedback
- Mobile-responsive call control interface

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-30 11:52:50 -07:00
parent 7398f97f24
commit dc3c12e006
8 changed files with 1721 additions and 33 deletions

View File

@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
**THIS PLUGIN RUNS ON A REMOTE SERVER IN A DOCKER CONTAINER - NOT LOCALLY**
- **Production Server Path**: `/home/shadowdao/public_html/wp-content/plugins/twilio-wp-plugin/`
- **Website URL**: `https://www.streamers.channel/`
- **Website URL**: `https://phone.cloud-hosting.io/`
- **Development Path**: `/home/jknapp/code/twilio-wp-plugin/`
- **Deployment Method**: Files synced via rsync from development to Docker container
@@ -38,39 +38,10 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
- **Test Agent Number**: `+19095737372`
- **Fake Test Number**: `+19512345678` (DO NOT SEND SMS TO THIS)
## 🧪 Testing Procedures
### ✅ Working: Direct Twilio Test
```bash
# SSH into server
cd /home/shadowdao/public_html/wp-content/plugins/twilio-wp-plugin/
php test-twilio-direct.php send
```
**Result**: SMS sends successfully via Twilio SDK
### ❌ Not Working: WordPress Admin SMS
- Admin pages load and show success messages
- But SMS doesn't actually send
- No PHP errors logged
- No Twilio API calls recorded
### Webhook URLs:
- **SMS**: `https://www.streamers.channel/wp-json/twilio-webhook/v1/sms`
- **Voice**: `https://www.streamers.channel/wp-json/twilio-webhook/v1/voice`
## Known Issues & Solutions
### Issue: SMS not sending from WordPress admin
**Symptoms**:
- Direct PHP test works
- WordPress admin shows success but no SMS sent
- No errors in logs
**Possible Causes**:
1. WordPress execution context differs from CLI
2. Silent failures in WordPress AJAX/admin context
3. Plugin initialization issues in admin context
## Project Overview
This is a comprehensive WordPress plugin for Twilio voice and SMS integration, featuring:
@@ -312,4 +283,5 @@ composer require twilio/sdk
- **Phone Validation**: Auto-formats US numbers to +1 format
- **Duplicate Prevention**: Checks phone numbers across all users
This plugin provides a complete call center solution with professional-grade features suitable for business use.
This plugin provides a complete call center solution with professional-grade features suitable for business use.
- our production url is https://phone.cloud-hosting.io