'37' => \&handle_payment,
'63' => \&handle_patron_info,
'65' => \&handle_renew_all,
+ '97' => \&handle_resend,
'XS' => \&handle_end_session
};
return OpenILS::Event->new('SIP2_NOT_IMPLEMENTED', {payload => $message})
unless exists $MESSAGE_MAP->{$msg_code};
- return $MESSAGE_MAP->{$msg_code}->($session, $message);
+ my $msg = $MESSAGE_MAP->{$msg_code}->($session, $message);
+
+ if ($msg_code ne '97' && # Don't cache the resend response
+ $session->config->{settings}->{support_acs_resend_messages}) {
+
+ # If resend is supported, toss the last sent message for this
+ # session into the cache.
+ $SC->cache->put_cache("sip2_lastmsg_$seskey", $msg);
+ }
+
+ return $msg;
}
sub handle_end_session {
}
}
+sub handle_resend {
+ my ($session, $message) = @_;
+ my $seskey = $session->seskey;
+
+ return OpenILS::Event->new('SIP2_NOT_IMPLEMENTED') unless
+ $session->config->{settings}->{support_acs_resend_messages};
+
+ return $SC->cache->get_cache("sip2_lastmsg_$seskey");
+}
+
1;
(SELECT id FROM sip.setting WHERE name = 'checkin_hold_as_transit'),
'Checkin local holds as transits',
'sipset', 'description')
+), (
+ 1, 'support_acs_resend_messages', 'false',
+ oils_i18n_gettext(
+ (SELECT id FROM sip.setting WHERE name = 'support_acs_resend_messages'),
+ 'Support ACS Resend Messages (code 97)',
+ 'sipset', 'description')
);
INSERT INTO sip.screen_message (key, message) VALUES (
(SELECT id FROM sip.setting WHERE name = 'checkin_hold_as_transit'),
'Checkin local holds as transits',
'sipset', 'description')
+), (
+ 1, 'support_acs_resend_messages', 'false',
+ oils_i18n_gettext(
+ (SELECT id FROM sip.setting WHERE name = 'support_acs_resend_messages'),
+ 'Support ACS Resend Messages (code 97)',
+ 'sipset', 'description')
);
INSERT INTO sip.screen_message (key, message) VALUES (