Update Bird class call logic: adjust polling interval and replace flash call creation with voice call creation

This commit is contained in:
Jeppe Bundgaard
2026-03-26 15:29:18 +01:00
parent fcf9924adc
commit b7fa5540e5
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -906,7 +906,7 @@ class bird implements bird_i
throw new Exception('Failed to create gate flash call: no call id returned');
}
$pollIntervalSeconds = 1;
$pollIntervalSeconds = 5;
$maxPollSeconds = max(5, $normalizedRingTimeout + 5);
$maxAttempts = (int)max(1, floor($maxPollSeconds / $pollIntervalSeconds));
@@ -264,15 +264,15 @@ class department_gates_o extends db
throw new Exception('Invalid phone number for PHONE_CALL gate type');
}
[$countryCode, $phone] = $normalized;
$timeout = (int)($config['call_duration_threshold'] ?? 10);
$client = new bird();
try {
$client->callGatePreferringFlashCall(
(int)$countryCode,
(int)$phone,
$timeout,
$client->createVoiceCall(
$client->config->workplaceId->getVariableValue(),
$client->config->channelId->getVariableValue(),
[
'to' => "{$countryCode}{$phone}",
'maxDuration' => 1
]
);
} catch (\Throwable $e) {
$slack = new slack();