Update Bird class call logic: adjust polling interval and replace flash call creation with voice call creation
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user