Improvement for telephony: just-in-time event revalidation
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 26 Sep 2011 16:06:07 +0000 (12:06 -0400)
committerMike Rylander <mrylander@gmail.com>
Tue, 15 Nov 2011 21:30:00 +0000 (16:30 -0500)
commit02211d5c48e703e691564c69b6ef42a98f5e15b6
tree8d55b21a761e2ac7189312c9e6247332d9349254
parentb10df430e2afc97012bb4749b2b05226876db2db
Improvement for telephony: just-in-time event revalidation

One of the shortcomings with using the Action/Trigger based telephony in
Evergreen until now was that while you might have overdue notices
generated and sent to a system where Asterisk runs for later calling,
but if the notice was generated on a Saturday night, and you have Asterisk
set up not to place any calls again until Monday morning, Asterisk has
no way of revalidating that call at the last minute.  That is, the
system could not determine whether the items that were overdue on
Saturday night are still overdue on Monday morning, and whether the call
should still be made.

Now we have a workable solution to that.

The eg-pbx-allocator.pl script, which takes call files for Asterisk from
a "staging" directory and slowly drips them onto Asterisk's spool can
now consult an open-ils.justintime which in turn asks open-ils.trigger
whether given events, enumerated within the call files themselves, are
still valid.

open-ils.trigger is designed to run as a private service, so that's why
we need a public service that doesn't do anything too sensitive.

This open-ils.justintime service can potentially be extended to offer other
just-in-time information to the allocator right before a call goes onto
Asterisk's spool. For example, that might be a good time to check the time
of day and make a late decision on which phone number to use for a given
user (day_phone, evening_phone, other_phone).

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/examples/opensrf.xml.example
Open-ILS/src/asterisk/pbx-daemon/eg-pbx-allocator.pl
Open-ILS/src/asterisk/pbx-daemon/eg-pbx-daemon.conf
Open-ILS/src/perlmods/lib/OpenILS/Application/JustInTime.pm [new file with mode: 0644]
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/Event.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/Trigger/EventGroup.pm