|
Lines 9-15
package C4::SIP::Sip::MsgType;
Link Here
|
| 9 |
use strict; |
9 |
use strict; |
| 10 |
use warnings; |
10 |
use warnings; |
| 11 |
use Exporter; |
11 |
use Exporter; |
| 12 |
use Sys::Syslog qw(syslog); |
|
|
| 13 |
|
12 |
|
| 14 |
use C4::SIP::Sip qw(:all); |
13 |
use C4::SIP::Sip qw(:all); |
| 15 |
use C4::SIP::Sip::Constants qw(:all); |
14 |
use C4::SIP::Sip::Constants qw(:all); |
|
Lines 267-282
sub new {
Link Here
|
| 267 |
C4::SIP::SIPServer::get_logger()->debug("Sip::MsgType::new('$class', '". |
266 |
C4::SIP::SIPServer::get_logger()->debug("Sip::MsgType::new('$class', '". |
| 268 |
substr($msg, 0, 10). |
267 |
substr($msg, 0, 10). |
| 269 |
"...', '$msgtag'): seq.no '$seqno', protocol $protocol_version"); |
268 |
"...', '$msgtag'): seq.no '$seqno', protocol $protocol_version"); |
| 270 |
syslog( "LOG_DEBUG", "Sip::MsgType::new('%s', '%s...', '%s'): seq.no '%s', protocol %s", $class, substr( $msg, 0, 10 ), $msgtag, $seqno, $protocol_version ); |
|
|
| 271 |
|
269 |
|
| 272 |
# warn "SIP PROTOCOL: $protocol_version"; |
270 |
# warn "SIP PROTOCOL: $protocol_version"; |
| 273 |
if ( !exists( $handlers{$msgtag} ) ) { |
271 |
if ( !exists( $handlers{$msgtag} ) ) { |
| 274 |
C4::SIP::SIPServer::get_logger()->warn("new Sip::MsgType: Skipping message of unknown type '$msgtag' in '$msg'"); |
272 |
C4::SIP::SIPServer::get_logger()->warn("new Sip::MsgType: Skipping message of unknown type '$msgtag' in '$msg'"); |
| 275 |
syslog( "LOG_WARNING", "new Sip::MsgType: Skipping message of unknown type '%s' in '%s'", $msgtag, $msg ); |
|
|
| 276 |
return; |
273 |
return; |
| 277 |
} elsif ( !exists( $handlers{$msgtag}->{protocol}->{$protocol_version} ) ) { |
274 |
} elsif ( !exists( $handlers{$msgtag}->{protocol}->{$protocol_version} ) ) { |
| 278 |
C4::SIP::SIPServer::get_logger()->warn("new Sip::MsgType: Skipping message '$msgtag' unsupported by protocol rev. '$protocol_version'"); |
275 |
C4::SIP::SIPServer::get_logger()->warn("new Sip::MsgType: Skipping message '$msgtag' unsupported by protocol rev. '$protocol_version'"); |
| 279 |
syslog( "LOG_WARNING", "new Sip::MsgType: Skipping message '%s' unsupported by protocol rev. '%d'", $msgtag, $protocol_version ); |
|
|
| 280 |
return; |
276 |
return; |
| 281 |
} |
277 |
} |
| 282 |
|
278 |
|
|
Lines 309-315
sub _initialize {
Link Here
|
| 309 |
} |
305 |
} |
| 310 |
|
306 |
|
| 311 |
C4::SIP::SIPServer::get_logger()->debug("Sip::MsgType::_initialize('$self->{name}', '$msg', '$proto->{template}', '$proto->{template_len}', ...)"); |
307 |
C4::SIP::SIPServer::get_logger()->debug("Sip::MsgType::_initialize('$self->{name}', '$msg', '$proto->{template}', '$proto->{template_len}', ...)"); |
| 312 |
syslog( "LOG_DEBUG", "Sip::MsgType::_initialize('%s', '%s', '%s', '%s', ...)", $self->{name}, $msg, $proto->{template}, $proto->{template_len} ); |
|
|
| 313 |
|
308 |
|
| 314 |
$self->{fixed_fields} = [ unpack( $proto->{template}, $msg ) ]; # see http://perldoc.perl.org/5.8.8/functions/unpack.html |
309 |
$self->{fixed_fields} = [ unpack( $proto->{template}, $msg ) ]; # see http://perldoc.perl.org/5.8.8/functions/unpack.html |
| 315 |
|
310 |
|
|
Lines 320-329
sub _initialize {
Link Here
|
| 320 |
|
315 |
|
| 321 |
if ( !exists( $self->{fields}->{$fn} ) ) { |
316 |
if ( !exists( $self->{fields}->{$fn} ) ) { |
| 322 |
C4::SIP::SIPServer::get_logger()->warn("Unsupported field '$fn' in $self->{name}, message '$msg'"); |
317 |
C4::SIP::SIPServer::get_logger()->warn("Unsupported field '$fn' in $self->{name}, message '$msg'"); |
| 323 |
syslog( "LOG_WARNING", "Unsupported field '%s' in %s message '%s'", $fn, $self->{name}, $msg ); |
|
|
| 324 |
} elsif ( defined( $self->{fields}->{$fn} ) ) { |
318 |
} elsif ( defined( $self->{fields}->{$fn} ) ) { |
| 325 |
C4::SIP::SIPServer::get_logger()->warn("Duplicate field '$fn' (previous value '$self->{fields}->{$fn}') in $self->{name} message '$msg'"); |
319 |
C4::SIP::SIPServer::get_logger()->warn("Duplicate field '$fn' (previous value '$self->{fields}->{$fn}') in $self->{name} message '$msg'"); |
| 326 |
syslog( "LOG_WARNING", "Duplicate field '%s' (previous value '%s') in %s message '%s'", $fn, $self->{fields}->{$fn}, $self->{name}, $msg ); |
|
|
| 327 |
} else { |
320 |
} else { |
| 328 |
$self->{fields}->{$fn} = substr( $field, 2 ); |
321 |
$self->{fields}->{$fn} = substr( $field, 2 ); |
| 329 |
} |
322 |
} |
|
Lines 360-366
sub handle {
Link Here
|
| 360 |
|
353 |
|
| 361 |
if ( !verify_cksum($msg) ) { |
354 |
if ( !verify_cksum($msg) ) { |
| 362 |
C4::SIP::SIPServer::get_logger()->warn("Checksum failed on message '$msg'"); |
355 |
C4::SIP::SIPServer::get_logger()->warn("Checksum failed on message '$msg'"); |
| 363 |
syslog( "LOG_WARNING", "Checksum failed on message '%s'", $msg ); |
|
|
| 364 |
|
356 |
|
| 365 |
# REQUEST_SC_RESEND with error detection |
357 |
# REQUEST_SC_RESEND with error detection |
| 366 |
$last_response = REQUEST_SC_RESEND_CKSUM; |
358 |
$last_response = REQUEST_SC_RESEND_CKSUM; |
|
Lines 377-383
sub handle {
Link Here
|
| 377 |
# We received a non-ED message when ED is supposed to be active. |
369 |
# We received a non-ED message when ED is supposed to be active. |
| 378 |
# Warn about this problem, then process the message anyway. |
370 |
# Warn about this problem, then process the message anyway. |
| 379 |
C4::SIP::SIPServer::get_logger()->warn("Received message without error detection: '$msg'"); |
371 |
C4::SIP::SIPServer::get_logger()->warn("Received message without error detection: '$msg'"); |
| 380 |
syslog( "LOG_WARNING", "Received message without error detection: '%s'", $msg ); |
|
|
| 381 |
$error_detection = 0; |
372 |
$error_detection = 0; |
| 382 |
$self = C4::SIP::Sip::MsgType->new( $msg, 0 ); |
373 |
$self = C4::SIP::Sip::MsgType->new( $msg, 0 ); |
| 383 |
} else { |
374 |
} else { |
|
Lines 391-397
sub handle {
Link Here
|
| 391 |
} |
382 |
} |
| 392 |
unless ( $self->{handler} ) { |
383 |
unless ( $self->{handler} ) { |
| 393 |
C4::SIP::SIPServer::get_logger()->warn("No handler defined for '$msg'"); |
384 |
C4::SIP::SIPServer::get_logger()->warn("No handler defined for '$msg'"); |
| 394 |
syslog( "LOG_WARNING", "No handler defined for '%s'", $msg ); |
|
|
| 395 |
$last_response = REQUEST_SC_RESEND; |
385 |
$last_response = REQUEST_SC_RESEND; |
| 396 |
print("$last_response\r"); |
386 |
print("$last_response\r"); |
| 397 |
return REQUEST_ACS_RESEND; |
387 |
return REQUEST_ACS_RESEND; |
|
Lines 515-521
sub handle_checkout {
Link Here
|
| 515 |
# Off-line transactions need to be recorded, but there's |
505 |
# Off-line transactions need to be recorded, but there's |
| 516 |
# not a lot we can do about it |
506 |
# not a lot we can do about it |
| 517 |
C4::SIP::SIPServer::get_logger()->warn("received no-block checkout from terminal '$account->{id}'"); |
507 |
C4::SIP::SIPServer::get_logger()->warn("received no-block checkout from terminal '$account->{id}'"); |
| 518 |
syslog( "LOG_WARNING", "received no-block checkout from terminal '%s'", $account->{id} ); |
|
|
| 519 |
|
508 |
|
| 520 |
$status = $ils->checkout_no_block( $patron_id, $item_id, $sc_renewal_policy, $trans_date, $nb_due_date ); |
509 |
$status = $ils->checkout_no_block( $patron_id, $item_id, $sc_renewal_policy, $trans_date, $nb_due_date ); |
| 521 |
} else { |
510 |
} else { |
|
Lines 643-649
sub handle_checkin {
Link Here
|
| 643 |
|
632 |
|
| 644 |
# Off-line transactions, ick. |
633 |
# Off-line transactions, ick. |
| 645 |
C4::SIP::SIPServer::get_logger()->warn("received no-block checkin from terminal '$account->{id}'"); |
634 |
C4::SIP::SIPServer::get_logger()->warn("received no-block checkin from terminal '$account->{id}'"); |
| 646 |
syslog( "LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id} ); |
|
|
| 647 |
$status = $ils->checkin_no_block( $item_id, $trans_date, $return_date, $item_props, $cancel ); |
635 |
$status = $ils->checkin_no_block( $item_id, $trans_date, $return_date, $item_props, $cancel ); |
| 648 |
} else { |
636 |
} else { |
| 649 |
$status = $ils->checkin( $item_id, $trans_date, $return_date, $my_branch, $item_props, $cancel, $account->{checked_in_ok} ); |
637 |
$status = $ils->checkin( $item_id, $trans_date, $return_date, $my_branch, $item_props, $cancel, $account->{checked_in_ok} ); |
|
Lines 766-787
sub handle_sc_status {
Link Here
|
| 766 |
$new_proto = 2; |
754 |
$new_proto = 2; |
| 767 |
} else { |
755 |
} else { |
| 768 |
C4::SIP::SIPServer::get_logger()->warn("Unrecognized protocol revision '$sc_protocol_version', falling back to '1'"); |
756 |
C4::SIP::SIPServer::get_logger()->warn("Unrecognized protocol revision '$sc_protocol_version', falling back to '1'"); |
| 769 |
syslog( "LOG_WARNING", "Unrecognized protocol revision '%s', falling back to '1'", $sc_protocol_version ); |
|
|
| 770 |
$new_proto = 1; |
757 |
$new_proto = 1; |
| 771 |
} |
758 |
} |
| 772 |
|
759 |
|
| 773 |
if ( $new_proto != $protocol_version ) { |
760 |
if ( $new_proto != $protocol_version ) { |
| 774 |
C4::SIP::SIPServer::get_logger()->info("Setting protocol level to $new_proto"); |
761 |
C4::SIP::SIPServer::get_logger()->info("Setting protocol level to $new_proto"); |
| 775 |
syslog( "LOG_INFO", "Setting protocol level to $new_proto" ); |
|
|
| 776 |
$protocol_version = $new_proto; |
762 |
$protocol_version = $new_proto; |
| 777 |
} |
763 |
} |
| 778 |
|
764 |
|
| 779 |
if ( $status == SC_STATUS_PAPER ) { |
765 |
if ( $status == SC_STATUS_PAPER ) { |
| 780 |
C4::SIP::SIPServer::get_logger()->warn("Self-Check unit '$self->{account}->{id}@$self->{account}->{institution}' out of paper"); |
766 |
C4::SIP::SIPServer::get_logger()->warn("Self-Check unit '$self->{account}->{id}@$self->{account}->{institution}' out of paper"); |
| 781 |
syslog( "LOG_WARNING", "Self-Check unit '%s@%s' out of paper", $self->{account}->{id}, $self->{account}->{institution} ); |
|
|
| 782 |
} elsif ( $status == SC_STATUS_SHUTDOWN ) { |
767 |
} elsif ( $status == SC_STATUS_SHUTDOWN ) { |
| 783 |
C4::SIP::SIPServer::get_logger()->warn("Self-Check unit '$self->{account}->{id}@$self->{account}->{institution}' shutting down"); |
768 |
C4::SIP::SIPServer::get_logger()->warn("Self-Check unit '$self->{account}->{id}@$self->{account}->{institution}' shutting down"); |
| 784 |
syslog( "LOG_WARNING", "Self-Check unit '%s@%s' shutting down", $self->{account}->{id}, $self->{account}->{institution} ); |
|
|
| 785 |
} |
769 |
} |
| 786 |
|
770 |
|
| 787 |
$self->{account}->{print_width} = $print_width; |
771 |
$self->{account}->{print_width} = $print_width; |
|
Lines 822-832
sub login_core {
Link Here
|
| 822 |
my $status = 1; # Assume it all works |
806 |
my $status = 1; # Assume it all works |
| 823 |
if ( !exists( $server->{config}->{accounts}->{$uid} ) ) { |
807 |
if ( !exists( $server->{config}->{accounts}->{$uid} ) ) { |
| 824 |
C4::SIP::SIPServer::get_logger()->warn("MsgType::login_core: Unknown login '$uid'"); |
808 |
C4::SIP::SIPServer::get_logger()->warn("MsgType::login_core: Unknown login '$uid'"); |
| 825 |
syslog( "LOG_WARNING", "MsgType::login_core: Unknown login '$uid'" ); |
|
|
| 826 |
$status = 0; |
809 |
$status = 0; |
| 827 |
} elsif ( $server->{config}->{accounts}->{$uid}->{password} ne $pwd ) { |
810 |
} elsif ( $server->{config}->{accounts}->{$uid}->{password} ne $pwd ) { |
| 828 |
C4::SIP::SIPServer::get_logger()->warn("MsgType::login_core: Invalid password for login '$uid'"); |
811 |
C4::SIP::SIPServer::get_logger()->warn("MsgType::login_core: Invalid password for login '$uid'"); |
| 829 |
syslog( "LOG_WARNING", "MsgType::login_core: Invalid password for login '$uid'" ); |
|
|
| 830 |
$status = 0; |
812 |
$status = 0; |
| 831 |
} else { |
813 |
} else { |
| 832 |
|
814 |
|
|
Lines 841-858
sub login_core {
Link Here
|
| 841 |
my $auth_status = api_auth( $uid, $pwd, $inst ); |
823 |
my $auth_status = api_auth( $uid, $pwd, $inst ); |
| 842 |
if ( !$auth_status or $auth_status !~ /^ok$/i ) { |
824 |
if ( !$auth_status or $auth_status !~ /^ok$/i ) { |
| 843 |
C4::SIP::SIPServer::get_logger()->warn("api_auth failed for SIP terminal '$uid' of '$inst': " . ($auth_status||'unknown') ); |
825 |
C4::SIP::SIPServer::get_logger()->warn("api_auth failed for SIP terminal '$uid' of '$inst': " . ($auth_status||'unknown') ); |
| 844 |
syslog( "LOG_WARNING", "api_auth failed for SIP terminal '%s' of '%s': %s", $uid, $inst, ( $auth_status || 'unknown' ) ); |
|
|
| 845 |
$status = 0; |
826 |
$status = 0; |
| 846 |
} else { |
827 |
} else { |
| 847 |
C4::SIP::SIPServer::get_logger()->info("Successful login/auth for '$server->{account}->{id}' of '$inst'"); |
828 |
C4::SIP::SIPServer::get_logger()->info("Successful login/auth for '$server->{account}->{id}' of '$inst'"); |
| 848 |
syslog( "LOG_INFO", "Successful login/auth for '%s' of '%s'", $server->{account}->{id}, $inst ); |
|
|
| 849 |
|
829 |
|
| 850 |
# |
830 |
# |
| 851 |
# initialize connection to ILS |
831 |
# initialize connection to ILS |
| 852 |
# |
832 |
# |
| 853 |
my $module = $server->{config}->{institutions}->{$inst}->{implementation}; |
833 |
my $module = $server->{config}->{institutions}->{$inst}->{implementation}; |
| 854 |
C4::SIP::SIPServer::get_logger()->debug("login_core: " . Dumper($module) ); |
834 |
C4::SIP::SIPServer::get_logger()->debug("login_core: " . Dumper($module) ); |
| 855 |
syslog( "LOG_DEBUG", 'login_core: ' . Dumper($module) ); |
|
|
| 856 |
|
835 |
|
| 857 |
# Suspect this is always ILS but so we don't break any eccentic install (for now) |
836 |
# Suspect this is always ILS but so we don't break any eccentic install (for now) |
| 858 |
if ( $module eq 'ILS' ) { |
837 |
if ( $module eq 'ILS' ) { |
|
Lines 861-867
sub login_core {
Link Here
|
| 861 |
$module->use; |
840 |
$module->use; |
| 862 |
if ($@) { |
841 |
if ($@) { |
| 863 |
C4::SIP::SIPServer::get_logger()->error("$server->{service}: Loading ILS implementation '$module' for institution '$inst' failed"); |
842 |
C4::SIP::SIPServer::get_logger()->error("$server->{service}: Loading ILS implementation '$module' for institution '$inst' failed"); |
| 864 |
syslog( "LOG_ERR", "%s: Loading ILS implementation '%s' for institution '%s' failed", $server->{service}, $module, $inst ); |
|
|
| 865 |
die("Failed to load ILS implementation '$module' for $inst"); |
843 |
die("Failed to load ILS implementation '$module' for $inst"); |
| 866 |
} |
844 |
} |
| 867 |
|
845 |
|
|
Lines 869-875
sub login_core {
Link Here
|
| 869 |
$server->{ils} = $module->new( $server->{institution}, $server->{account} ); |
847 |
$server->{ils} = $module->new( $server->{institution}, $server->{account} ); |
| 870 |
if ( !$server->{ils} ) { |
848 |
if ( !$server->{ils} ) { |
| 871 |
C4::SIP::SIPServer::get_logger()->error("$server->{service}: ILS connection to '$inst' failed"); |
849 |
C4::SIP::SIPServer::get_logger()->error("$server->{service}: ILS connection to '$inst' failed"); |
| 872 |
syslog( "LOG_ERR", "%s: ILS connection to '%s' failed", $server->{service}, $inst ); |
|
|
| 873 |
die("Unable to connect to ILS '$inst'"); |
850 |
die("Unable to connect to ILS '$inst'"); |
| 874 |
} |
851 |
} |
| 875 |
} |
852 |
} |
|
Lines 893-899
sub handle_login {
Link Here
|
| 893 |
|
870 |
|
| 894 |
if ( $uid_algorithm || $pwd_algorithm ) { |
871 |
if ( $uid_algorithm || $pwd_algorithm ) { |
| 895 |
C4::SIP::SIPServer::get_logger()->error("LOGIN: Unsupported non-zero encryption method(s): uid = $uid_algorithm, pwd = $pwd_algorithm"); |
872 |
C4::SIP::SIPServer::get_logger()->error("LOGIN: Unsupported non-zero encryption method(s): uid = $uid_algorithm, pwd = $pwd_algorithm"); |
| 896 |
syslog( "LOG_ERR", "LOGIN: Unsupported non-zero encryption method(s): uid = $uid_algorithm, pwd = $pwd_algorithm" ); |
|
|
| 897 |
$status = 0; |
873 |
$status = 0; |
| 898 |
} else { |
874 |
} else { |
| 899 |
$status = login_core( $server, $uid, $pwd ); |
875 |
$status = login_core( $server, $uid, $pwd ); |
|
Lines 933-946
sub summary_info {
Link Here
|
| 933 |
} |
909 |
} |
| 934 |
|
910 |
|
| 935 |
C4::SIP::SIPServer::get_logger()->debug("Summary_info: index == '$summary_type', field '$summary_map[$summary_type]->{fid}'"); |
911 |
C4::SIP::SIPServer::get_logger()->debug("Summary_info: index == '$summary_type', field '$summary_map[$summary_type]->{fid}'"); |
| 936 |
syslog( "LOG_DEBUG", "Summary_info: index == '%d', field '%s'", $summary_type, $summary_map[$summary_type]->{fid} ); |
|
|
| 937 |
|
912 |
|
| 938 |
my $func = $summary_map[$summary_type]->{func}; |
913 |
my $func = $summary_map[$summary_type]->{func}; |
| 939 |
my $fid = $summary_map[$summary_type]->{fid}; |
914 |
my $fid = $summary_map[$summary_type]->{fid}; |
| 940 |
my $itemlist = &$func( $patron, $start, $end, $server ); |
915 |
my $itemlist = &$func( $patron, $start, $end, $server ); |
| 941 |
|
916 |
|
| 942 |
C4::SIP::SIPServer::get_logger()->debug("summary_info: list = (" . join(", ", @{$itemlist}) . ")"); |
917 |
C4::SIP::SIPServer::get_logger()->debug("summary_info: list = (" . join(", ", @{$itemlist}) . ")"); |
| 943 |
syslog( "LOG_DEBUG", "summary_info: list = (%s)", join( ", ", @{$itemlist} ) ); |
|
|
| 944 |
foreach my $i ( @{$itemlist} ) { |
918 |
foreach my $i ( @{$itemlist} ) { |
| 945 |
$resp .= add_field( $fid, $i->{barcode} ); |
919 |
$resp .= add_field( $fid, $i->{barcode} ); |
| 946 |
} |
920 |
} |
|
Lines 1207-1213
sub handle_item_status_update {
Link Here
|
| 1207 |
|
1181 |
|
| 1208 |
if ( !defined($item_id) ) { |
1182 |
if ( !defined($item_id) ) { |
| 1209 |
C4::SIP::SIPServer::get_logger()->warn("handle_item_status: received message without Item ID field"); |
1183 |
C4::SIP::SIPServer::get_logger()->warn("handle_item_status: received message without Item ID field"); |
| 1210 |
syslog( "LOG_WARNING", "handle_item_status: received message without Item ID field" ); |
|
|
| 1211 |
} else { |
1184 |
} else { |
| 1212 |
$item = $ils->find_item($item_id); |
1185 |
$item = $ils->find_item($item_id); |
| 1213 |
} |
1186 |
} |
|
Lines 1253-1259
sub handle_patron_enable {
Link Here
|
| 1253 |
$patron_pwd = $fields->{ (FID_PATRON_PWD) }; |
1226 |
$patron_pwd = $fields->{ (FID_PATRON_PWD) }; |
| 1254 |
|
1227 |
|
| 1255 |
C4::SIP::SIPServer::get_logger()->debug("handle_patron_enable: patron_id: '$patron_id', patron_pwd: '$patron_pwd'"); |
1228 |
C4::SIP::SIPServer::get_logger()->debug("handle_patron_enable: patron_id: '$patron_id', patron_pwd: '$patron_pwd'"); |
| 1256 |
syslog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd ); |
|
|
| 1257 |
|
1229 |
|
| 1258 |
$patron = $ils->find_patron($patron_id); |
1230 |
$patron = $ils->find_patron($patron_id); |
| 1259 |
|
1231 |
|
|
Lines 1324-1330
sub handle_hold {
Link Here
|
| 1324 |
$status = $ils->alter_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack ); |
1296 |
$status = $ils->alter_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack ); |
| 1325 |
} else { |
1297 |
} else { |
| 1326 |
C4::SIP::SIPServer::get_logger()->warn("handle_hold: Unrecognized hold mode '$hold_mode' from terminal '$server->{account}->{id}'"); |
1298 |
C4::SIP::SIPServer::get_logger()->warn("handle_hold: Unrecognized hold mode '$hold_mode' from terminal '$server->{account}->{id}'"); |
| 1327 |
syslog( "LOG_WARNING", "handle_hold: Unrecognized hold mode '%s' from terminal '%s'", $hold_mode, $server->{account}->{id} ); |
|
|
| 1328 |
$status = $ils->Transaction::Hold; # new? |
1299 |
$status = $ils->Transaction::Hold; # new? |
| 1329 |
$status->screen_msg("System error. Please contact library staff."); |
1300 |
$status->screen_msg("System error. Please contact library staff."); |
| 1330 |
} |
1301 |
} |
|
Lines 1373-1379
sub handle_renew {
Link Here
|
| 1373 |
|
1344 |
|
| 1374 |
if ( $no_block eq 'Y' ) { |
1345 |
if ( $no_block eq 'Y' ) { |
| 1375 |
C4::SIP::SIPServer::get_logger()->warn("handle_renew: received 'no block' renewal from terminal '$server->{account}->{id}'"); |
1346 |
C4::SIP::SIPServer::get_logger()->warn("handle_renew: received 'no block' renewal from terminal '$server->{account}->{id}'"); |
| 1376 |
syslog( "LOG_WARNING", "handle_renew: received 'no block' renewal from terminal '%s'", $server->{account}->{id} ); |
|
|
| 1377 |
} |
1347 |
} |
| 1378 |
|
1348 |
|
| 1379 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
1349 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
|
Lines 1541-1547
sub send_acs_status {
Link Here
|
| 1541 |
|
1511 |
|
| 1542 |
if ( length($retries) != 3 ) { |
1512 |
if ( length($retries) != 3 ) { |
| 1543 |
C4::SIP::SIPServer::get_logger()->error("handle_acs_status: timeout field wrong size: '$timeout'"); |
1513 |
C4::SIP::SIPServer::get_logger()->error("handle_acs_status: timeout field wrong size: '$timeout'"); |
| 1544 |
syslog( "LOG_ERR", "handle_acs_status: retries field wrong size: '%s'", $retries ); |
|
|
| 1545 |
$retries = '000'; |
1514 |
$retries = '000'; |
| 1546 |
} |
1515 |
} |
| 1547 |
|
1516 |
|
|
Lines 1555-1561
sub send_acs_status {
Link Here
|
| 1555 |
$msg .= '2.00'; |
1524 |
$msg .= '2.00'; |
| 1556 |
} else { |
1525 |
} else { |
| 1557 |
C4::SIP::SIPServer::get_logger()->error("Bad setting for \$protocol_version, '$protocol_version' in send_acs_status"); |
1526 |
C4::SIP::SIPServer::get_logger()->error("Bad setting for \$protocol_version, '$protocol_version' in send_acs_status"); |
| 1558 |
syslog( "LOG_ERR", 'Bad setting for $protocol_version, "%s" in send_acs_status', $protocol_version ); |
|
|
| 1559 |
$msg .= '1.00'; |
1527 |
$msg .= '1.00'; |
| 1560 |
} |
1528 |
} |
| 1561 |
|
1529 |
|
|
Lines 1576-1582
sub send_acs_status {
Link Here
|
| 1576 |
} |
1544 |
} |
| 1577 |
if ( length($supported_msgs) < 16 ) { |
1545 |
if ( length($supported_msgs) < 16 ) { |
| 1578 |
C4::SIP::SIPServer::get_logger()->error("send_acs_status: supported messages '$supported_msgs' too short"); |
1546 |
C4::SIP::SIPServer::get_logger()->error("send_acs_status: supported messages '$supported_msgs' too short"); |
| 1579 |
syslog( "LOG_ERR", 'send_acs_status: supported messages "%s" too short', $supported_msgs ); |
|
|
| 1580 |
} |
1547 |
} |
| 1581 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs ); |
1548 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs ); |
| 1582 |
} |
1549 |
} |
|
Lines 1587-1593
sub send_acs_status {
Link Here
|
| 1587 |
&& defined($print_line) |
1554 |
&& defined($print_line) |
| 1588 |
&& $account->{print_width} < length($print_line) ) { |
1555 |
&& $account->{print_width} < length($print_line) ) { |
| 1589 |
C4::SIP::SIPServer::get_logger()->warn("send_acs_status: print line '$print_line' too long. Truncating"); |
1556 |
C4::SIP::SIPServer::get_logger()->warn("send_acs_status: print line '$print_line' too long. Truncating"); |
| 1590 |
syslog( "LOG_WARNING", "send_acs_status: print line '%s' too long. Truncating", $print_line ); |
|
|
| 1591 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
1557 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
| 1592 |
} |
1558 |
} |
| 1593 |
|
1559 |
|
|
Lines 1608-1614
sub patron_status_string {
Link Here
|
| 1608 |
my $patron_status; |
1574 |
my $patron_status; |
| 1609 |
|
1575 |
|
| 1610 |
C4::SIP::SIPServer::get_logger()->debug("patron_status_string: $patron->id charge_ok: $patron->charge_ok"); |
1576 |
C4::SIP::SIPServer::get_logger()->debug("patron_status_string: $patron->id charge_ok: $patron->charge_ok"); |
| 1611 |
syslog( "LOG_DEBUG", "patron_status_string: %s charge_ok: %s", $patron->id, $patron->charge_ok ); |
|
|
| 1612 |
$patron_status = sprintf( |
1577 |
$patron_status = sprintf( |
| 1613 |
'%s%s%s%s%s%s%s%s%s%s%s%s%s%s', |
1578 |
'%s%s%s%s%s%s%s%s%s%s%s%s%s%s', |
| 1614 |
denied( $patron->charge_ok ), |
1579 |
denied( $patron->charge_ok ), |