Fix database schema for call recording phone number fields

- Increased from_number and to_number fields from varchar(20) to varchar(50)
- Added automatic migration to update existing table schemas
- Addresses issue with outbound calls having long phone number formats
- Added force_table_updates() method for manual schema updates
- Enhanced ensure_tables_exist() to always run column migrations
- Fixes recording database insertion failures for international numbers

The original varchar(20) was too small for modern phone number formats,
especially for outbound calls which may include client: prefixes and
international numbers with country codes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-08-30 16:42:54 -07:00
parent a306e58bc5
commit 18ace04e5b
2 changed files with 35 additions and 3 deletions

View File

@@ -7379,8 +7379,9 @@ class TWP_Admin {
error_log("TWP: Starting recording for call SID: $call_sid");
// Ensure database table exists
// Ensure database table exists and run any migrations
TWP_Activator::ensure_tables_exist();
TWP_Activator::force_table_updates();
try {
$twilio = new TWP_Twilio_API();