testing progress
This commit is contained in:
@@ -243,18 +243,18 @@ class TWP_Agent_Manager {
|
||||
// Make a new call to the agent with proper caller ID
|
||||
$twilio = new TWP_Twilio_API();
|
||||
|
||||
// Get the queue's phone number for proper caller ID (same logic as SMS webhook)
|
||||
// Get the queue's notification number for proper caller ID (same logic as SMS webhook)
|
||||
$queues_table = $wpdb->prefix . 'twp_call_queues';
|
||||
$queue_info = $wpdb->get_row($wpdb->prepare(
|
||||
"SELECT phone_number FROM $queues_table WHERE id = %d",
|
||||
"SELECT notification_number FROM $queues_table WHERE id = %d",
|
||||
$call->queue_id
|
||||
));
|
||||
|
||||
// Priority: 1) Queue's phone number, 2) Call's original to_number, 3) Default SMS number
|
||||
// Priority: 1) Queue's notification number, 2) Call's original to_number, 3) Default SMS number
|
||||
$workflow_number = null;
|
||||
if (!empty($queue_info->phone_number)) {
|
||||
$workflow_number = $queue_info->phone_number;
|
||||
error_log('TWP Web Accept: Using queue phone number: ' . $workflow_number);
|
||||
if (!empty($queue_info->notification_number)) {
|
||||
$workflow_number = $queue_info->notification_number;
|
||||
error_log('TWP Web Accept: Using queue notification number: ' . $workflow_number);
|
||||
} elseif (!empty($call->to_number)) {
|
||||
$workflow_number = $call->to_number;
|
||||
error_log('TWP Web Accept: Using original workflow number: ' . $workflow_number);
|
||||
|
Reference in New Issue
Block a user