Skip to content

Commit

Permalink
backporting retry logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dgershman committed Aug 27, 2023
1 parent 968207e commit 54a9c72
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release Notes

### 4.2.11 (UNRELEASED)
* Sometime in August 2023, Twilio introduced a change in API Behavior. The conferences API now seems to be eventually consistent. This change adds retry logic that addresses this timing issue.

### 4.2.10 (July 2, 2023)
* Added explicit notification that SMS will be sent in response to meeting search request; reflected this in report. This is to satisfy regulatory requirements regarding explicit consent.

Expand Down
2 changes: 1 addition & 1 deletion legacy/_includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if (isset($_GET["CallSid"])) {
insertSession($_GET["CallSid"]);
}
$GLOBALS['version'] = "4.2.10";
$GLOBALS['version'] = "4.2.11";
$GLOBALS['settings_allowlist'] = [
'announce_servicebody_volunteer_routing' => [ 'description' => '/helpline/announce_servicebody_volunteer_routing' , 'default' => false, 'overridable' => true, 'hidden' => false],
'blocklist' => [ 'description' => '/general/blocklist' , 'default' => '', 'overridable' => true, 'hidden' => false],
Expand Down
13 changes: 12 additions & 1 deletion legacy/helpline-dialer.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,18 @@ function getCallConfig($serviceBodyCallHandling)
exit();
}

$conferences = $twilioClient->conferences->read(array ("friendlyName" => $_REQUEST['FriendlyName'] ));
$conferences = [];
for ($i = 0; $i < 7; $i++) {
$conferences = $twilioClient->conferences->read(array ("friendlyName" => $_REQUEST['FriendlyName'] ));
if ($i > 0) {
log_debug("conferences eventual consistency issue, retry $i");
}
if (count($conferences)) {
break;
}
sleep(0.5);
}

if (count($conferences) > 0 && $conferences[0]->status != "completed") {
$sms_body = word('you_have_an_incoming_phoneline_call_from') . " ";

Expand Down

0 comments on commit 54a9c72

Please sign in to comment.