Improvement for telephony: just-in-time event revalidation user/senator/telephony-revalidate
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 26 Sep 2011 16:06:07 +0000 (12:06 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 27 Sep 2011 14:55:44 +0000 (10:55 -0400)
commite41e515f0e86dd73b700fbefeee41b3054acae93
treeb2ec088162e646e96b4c79449e6ac8816e403942
parent250ec72283a24e4aec4f672f4bbc51dfa2b7e211
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 XML RPC service which in turn asks open-ils.trigger
whether given events, enumerated within the call files themselves, are
still valid.

Why the indirection?  Why not just ask open-ils.trigger directly?
Evergreen Telephony with Action/Trigger was designed so that Asterisk can
be run on a machine separate from your Evergreen servers, if desired,
and not on the OpenSRF network with them.  If open-ils.trigger were a
public service, we could access it via the HTTP gateway or other methods,
but since it's a sensitive service not designed to be public, the XML
RPC server introduced here allows only the necessary narrow access to
one new open-ils.trigger method for event revalidation.  This means that
if you want to use this feature, your Asterisk server does need minimal
network connectivity into your Evergreen system, but with conservative
network configuration, you can limit that connectivity to a single TCP
port on a utility server, and not full blown access.

If you don't plan to segregate Asterisk on a system that's not on the
OpenSRF network, then you don't care about the preceding paragraph, and
everything still works.

The XML RPC server I've been talking about (revalidator-daemon.pl) could
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>
Open-ILS/src/asterisk/pbx-daemon/eg-pbx-allocator.pl
Open-ILS/src/asterisk/pbx-daemon/eg-pbx-daemon.conf
Open-ILS/src/asterisk/revalidator/README [new file with mode: 0644]
Open-ILS/src/asterisk/revalidator/revalidator-daemon.pl [new file with mode: 0755]
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