progress made
This commit is contained in:
69
CLAUDE.md
69
CLAUDE.md
@@ -2,6 +2,75 @@
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## 🚨 CRITICAL: Testing & Deployment Environment
|
||||
|
||||
**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/`
|
||||
- **Development Path**: `/home/jknapp/code/twilio-wp-plugin/`
|
||||
- **Deployment Method**: Files synced via rsync from development to Docker container
|
||||
|
||||
**IMPORTANT**:
|
||||
- NEVER assume local testing - all tests must work on remote server
|
||||
- Direct PHP tests work (`php test-twilio-direct.php send`)
|
||||
- WordPress admin context has issues that need investigation
|
||||
|
||||
## 📞 Standardized Phone Number Variable Names
|
||||
|
||||
**THESE NAMING CONVENTIONS MUST BE STRICTLY FOLLOWED:**
|
||||
|
||||
### Required Variable Names:
|
||||
- **`incoming_number`** = Phone number that initiated contact (sent SMS/call TO the system)
|
||||
- **`agent_number`** = Phone number used to reach a specific agent
|
||||
- **`customer_number`** = Phone number of customer calling into the system
|
||||
- **`workflow_number`** = Twilio number assigned to a specific workflow
|
||||
- **`queue_number`** = Twilio number assigned to a specific queue
|
||||
- **`default_number`** = Default Twilio number when none specified
|
||||
|
||||
### BANNED Variable Names (DO NOT USE):
|
||||
- ❌ `from_number` - Ambiguous, could be customer or system
|
||||
- ❌ `to_number` - Ambiguous, could be agent or system
|
||||
- ❌ `phone_number` - Too generic, must specify whose number
|
||||
- ❌ `$agent_phone` - Use `$agent_number` instead
|
||||
|
||||
### Test Numbers:
|
||||
- **Twilio Number**: `+19516215107`
|
||||
- **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:
|
||||
|
Reference in New Issue
Block a user