code push

This commit is contained in:
2025-08-07 15:24:29 -07:00
parent b5e091d845
commit 3b499e2074
15 changed files with 1225 additions and 232 deletions

View File

@@ -239,8 +239,7 @@ class TWP_Agent_Manager {
// Create TwiML to redirect the call
$twiml = new \Twilio\TwiML\VoiceResponse();
$dial = $twiml->dial();
$dial->number($phone_number, [
$twiml->dial($phone_number, [
'statusCallback' => home_url('/wp-json/twilio-webhook/v1/call-status'),
'statusCallbackEvent' => array('completed')
]);
@@ -307,20 +306,17 @@ class TWP_Agent_Manager {
// Play a message while dialing
$twiml->say('Please wait while we connect your call...', ['voice' => 'alice']);
// Create a dial with simultaneous ring
// Create a dial with simultaneous ring to all group members
$dial = $twiml->dial([
'timeout' => 30,
'action' => home_url('/wp-json/twilio-webhook/v1/dial-status'),
'method' => 'POST'
]);
// Add each member's number to the dial
// Add each member's number to the dial for simultaneous ring
foreach ($members as $member) {
if ($member['phone_number']) {
$dial->number($member['phone_number'], [
'statusCallback' => home_url('/wp-json/twilio-webhook/v1/member-status'),
'statusCallbackEvent' => array('answered', 'completed')
]);
$dial->number($member['phone_number']);
}
}