Skip to content

Commit

Permalink
Never change message status to 'pending', it may be causing duplicate…
Browse files Browse the repository at this point in the history
… calls
  • Loading branch information
kylemhall committed Jan 15, 2021
1 parent cccbf47 commit e49ddd6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Koha/Plugin/Com/ByWaterSolutions/TwilioVoice/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ sub update_message_status {

warn "TWILIO: update_message_status(): " . Data::Dumper::Dumper( \%data );

my $status = $twilio_status eq 'queued' ? 'pending' : # We should get another status update later
$twilio_status eq 'ringing' ? 'pending' : # Ditto
$twilio_status eq 'in-progress' ? 'sent' : # The person picked up, basically completed
$twilio_status eq 'completed' ? 'sent' : # Clearly completed
$twilio_status eq 'busy' ? 'pending' : # Phone was busy, requeue and try again
$twilio_status eq 'failed' ? 'failed' : # Phone number was most likely invalid
$twilio_status eq 'no-answer' ? 'pending' : # Nobody picked up, requeue and try again
'failed' ; # Staus was something we didn't expect
my $status = $twilio_status eq 'queued' ? 'sent' : # We should get another status update later
$twilio_status eq 'ringing' ? 'sent' : # Ditto
$twilio_status eq 'in-progress' ? 'sent' : # The person picked up, basically completed
$twilio_status eq 'completed' ? 'sent' : # Clearly completed
$twilio_status eq 'busy' ? 'failed' : # TODO: Make retrying busy a plugin setting
$twilio_status eq 'failed' ? 'failed' : # Phone number was most likely invalid
$twilio_status eq 'no-answer' ? 'failed' : # See TODO above
'failed' ; # Staus was something we didn't expect
$message->status($status);
$message->store();

Expand Down

0 comments on commit e49ddd6

Please sign in to comment.