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

@@ -1,4 +1,208 @@
/* Twilio Browser Phone Frontend Styles - Mobile First */
/* Call Control Panel Styles */
.twp-call-controls-panel {
margin: 15px 0;
padding: 15px;
background: #fff;
border-radius: 8px;
border: 1px solid #dee2e6;
}
.call-control-buttons {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
}
.twp-btn-control {
padding: 10px 15px;
background: #6c757d;
color: white;
border: none;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.twp-btn-control:hover {
background: #5a6268;
transform: translateY(-1px);
}
.twp-btn-control.btn-active {
background: #007bff;
}
.twp-btn-control.btn-recording {
background: #dc3545;
animation: recording-pulse 1.5s infinite;
}
@keyframes recording-pulse {
0% { opacity: 1; }
50% { opacity: 0.7; }
100% { opacity: 1; }
}
/* Dialog Overlay Styles */
.twp-dialog-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 10000;
}
.twp-dialog {
background: white;
border-radius: 12px;
padding: 25px;
max-width: 400px;
width: 90%;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.twp-dialog h3 {
margin: 0 0 15px 0;
font-size: 1.3rem;
color: #212529;
}
.twp-dialog p {
margin: 0 0 20px 0;
color: #6c757d;
}
.twp-dialog input[type="tel"],
.twp-dialog select {
width: 100%;
padding: 10px;
border: 2px solid #dee2e6;
border-radius: 6px;
font-size: 16px;
margin-bottom: 20px;
}
.twp-dialog input[type="tel"]:focus,
.twp-dialog select:focus {
outline: none;
border-color: #007bff;
}
.dialog-buttons {
display: flex;
gap: 10px;
justify-content: flex-end;
}
.dialog-buttons .twp-btn {
padding: 10px 20px;
border-radius: 6px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
}
.dialog-buttons .twp-btn-primary {
background: #007bff;
color: white;
border: none;
}
.dialog-buttons .twp-btn-primary:hover {
background: #0056b3;
}
.dialog-buttons .twp-btn-secondary {
background: #6c757d;
color: white;
border: none;
}
.dialog-buttons .twp-btn-secondary:hover {
background: #5a6268;
}
/* Agent Transfer Dialog Styles */
.twp-agent-transfer-dialog {
max-width: 500px;
}
.agent-list {
max-height: 300px;
overflow-y: auto;
margin-bottom: 20px;
border: 1px solid #dee2e6;
border-radius: 6px;
}
.agent-option {
padding: 12px;
border-bottom: 1px solid #e9ecef;
cursor: pointer;
transition: background 0.2s;
display: flex;
justify-content: space-between;
align-items: center;
}
.agent-option:last-child {
border-bottom: none;
}
.agent-option:hover:not(.offline) {
background: #f8f9fa;
}
.agent-option.selected {
background: #e7f3ff;
border-left: 3px solid #007bff;
}
.agent-option.offline {
opacity: 0.5;
cursor: not-allowed;
}
.agent-info {
display: flex;
align-items: center;
gap: 10px;
}
.agent-name {
font-weight: 500;
color: #212529;
}
.agent-method {
font-size: 18px;
}
.agent-status {
font-size: 14px;
white-space: nowrap;
}
.manual-option {
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid #dee2e6;
}
.manual-option p {
margin-bottom: 10px;
font-size: 14px;
color: #6c757d;
}
.twp-browser-phone-container {
max-width: 400px;
margin: 0 auto;