Lines 264-276
sub new {
Link Here
|
264 |
# it's using the 2.00 login process, so it must support 2.00. |
264 |
# it's using the 2.00 login process, so it must support 2.00. |
265 |
$protocol_version = 2; |
265 |
$protocol_version = 2; |
266 |
} |
266 |
} |
|
|
267 |
C4::SIP::SIPServer::get_logger()->debug("Sip::MsgType::new('$class', '". |
268 |
substr($msg, 0, 10). |
269 |
"...', '$msgtag'): seq.no '$seqno', protocol $protocol_version"); |
267 |
syslog( "LOG_DEBUG", "Sip::MsgType::new('%s', '%s...', '%s'): seq.no '%s', protocol %s", $class, substr( $msg, 0, 10 ), $msgtag, $seqno, $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 ); |
268 |
|
271 |
|
269 |
# warn "SIP PROTOCOL: $protocol_version"; |
272 |
# warn "SIP PROTOCOL: $protocol_version"; |
270 |
if ( !exists( $handlers{$msgtag} ) ) { |
273 |
if ( !exists( $handlers{$msgtag} ) ) { |
|
|
274 |
C4::SIP::SIPServer::get_logger()->warn("new Sip::MsgType: Skipping message of unknown type '$msgtag' in '$msg'"); |
271 |
syslog( "LOG_WARNING", "new Sip::MsgType: Skipping message of unknown type '%s' in '%s'", $msgtag, $msg ); |
275 |
syslog( "LOG_WARNING", "new Sip::MsgType: Skipping message of unknown type '%s' in '%s'", $msgtag, $msg ); |
272 |
return; |
276 |
return; |
273 |
} elsif ( !exists( $handlers{$msgtag}->{protocol}->{$protocol_version} ) ) { |
277 |
} 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'"); |
274 |
syslog( "LOG_WARNING", "new Sip::MsgType: Skipping message '%s' unsupported by protocol rev. '%d'", $msgtag, $protocol_version ); |
279 |
syslog( "LOG_WARNING", "new Sip::MsgType: Skipping message '%s' unsupported by protocol rev. '%d'", $msgtag, $protocol_version ); |
275 |
return; |
280 |
return; |
276 |
} |
281 |
} |
Lines 303-308
sub _initialize {
Link Here
|
303 |
$self->{fields}->{$field} = undef; |
308 |
$self->{fields}->{$field} = undef; |
304 |
} |
309 |
} |
305 |
|
310 |
|
|
|
311 |
C4::SIP::SIPServer::get_logger()->debug("Sip::MsgType::_initialize('$self->{name}', '$msg', '$proto->{template}', '$proto->{template_len}', ...)"); |
306 |
syslog( "LOG_DEBUG", "Sip::MsgType::_initialize('%s', '%s', '%s', '%s', ...)", $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} ); |
307 |
|
313 |
|
308 |
$self->{fixed_fields} = [ unpack( $proto->{template}, $msg ) ]; # see http://perldoc.perl.org/5.8.8/functions/unpack.html |
314 |
$self->{fixed_fields} = [ unpack( $proto->{template}, $msg ) ]; # see http://perldoc.perl.org/5.8.8/functions/unpack.html |
Lines 313-320
sub _initialize {
Link Here
|
313 |
$fn = substr( $field, 0, 2 ); |
319 |
$fn = substr( $field, 0, 2 ); |
314 |
|
320 |
|
315 |
if ( !exists( $self->{fields}->{$fn} ) ) { |
321 |
if ( !exists( $self->{fields}->{$fn} ) ) { |
|
|
322 |
C4::SIP::SIPServer::get_logger()->warn("Unsupported field '$fn' in $self->{name}, message '$msg'"); |
316 |
syslog( "LOG_WARNING", "Unsupported field '%s' in %s message '%s'", $fn, $self->{name}, $msg ); |
323 |
syslog( "LOG_WARNING", "Unsupported field '%s' in %s message '%s'", $fn, $self->{name}, $msg ); |
317 |
} elsif ( defined( $self->{fields}->{$fn} ) ) { |
324 |
} 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'"); |
318 |
syslog( "LOG_WARNING", "Duplicate field '%s' (previous value '%s') in %s message '%s'", $fn, $self->{fields}->{$fn}, $self->{name}, $msg ); |
326 |
syslog( "LOG_WARNING", "Duplicate field '%s' (previous value '%s') in %s message '%s'", $fn, $self->{fields}->{$fn}, $self->{name}, $msg ); |
319 |
} else { |
327 |
} else { |
320 |
$self->{fields}->{$fn} = substr( $field, 2 ); |
328 |
$self->{fields}->{$fn} = substr( $field, 2 ); |
Lines 351-356
sub handle {
Link Here
|
351 |
$error_detection = 1; |
359 |
$error_detection = 1; |
352 |
|
360 |
|
353 |
if ( !verify_cksum($msg) ) { |
361 |
if ( !verify_cksum($msg) ) { |
|
|
362 |
C4::SIP::SIPServer::get_logger()->warn("Checksum failed on message '$msg'"); |
354 |
syslog( "LOG_WARNING", "Checksum failed on message '%s'", $msg ); |
363 |
syslog( "LOG_WARNING", "Checksum failed on message '%s'", $msg ); |
355 |
|
364 |
|
356 |
# REQUEST_SC_RESEND with error detection |
365 |
# REQUEST_SC_RESEND with error detection |
Lines 367-372
sub handle {
Link Here
|
367 |
|
376 |
|
368 |
# We received a non-ED message when ED is supposed to be active. |
377 |
# We received a non-ED message when ED is supposed to be active. |
369 |
# Warn about this problem, then process the message anyway. |
378 |
# Warn about this problem, then process the message anyway. |
|
|
379 |
C4::SIP::SIPServer::get_logger()->warn("Received message without error detection: '$msg'"); |
370 |
syslog( "LOG_WARNING", "Received message without error detection: '%s'", $msg ); |
380 |
syslog( "LOG_WARNING", "Received message without error detection: '%s'", $msg ); |
371 |
$error_detection = 0; |
381 |
$error_detection = 0; |
372 |
$self = C4::SIP::Sip::MsgType->new( $msg, 0 ); |
382 |
$self = C4::SIP::Sip::MsgType->new( $msg, 0 ); |
Lines 380-385
sub handle {
Link Here
|
380 |
return substr( $msg, 0, 2 ); |
390 |
return substr( $msg, 0, 2 ); |
381 |
} |
391 |
} |
382 |
unless ( $self->{handler} ) { |
392 |
unless ( $self->{handler} ) { |
|
|
393 |
C4::SIP::SIPServer::get_logger()->warn("No handler defined for '$msg'"); |
383 |
syslog( "LOG_WARNING", "No handler defined for '%s'", $msg ); |
394 |
syslog( "LOG_WARNING", "No handler defined for '%s'", $msg ); |
384 |
$last_response = REQUEST_SC_RESEND; |
395 |
$last_response = REQUEST_SC_RESEND; |
385 |
print("$last_response\r"); |
396 |
print("$last_response\r"); |
Lines 503-508
sub handle_checkout {
Link Here
|
503 |
|
514 |
|
504 |
# Off-line transactions need to be recorded, but there's |
515 |
# Off-line transactions need to be recorded, but there's |
505 |
# not a lot we can do about it |
516 |
# not a lot we can do about it |
|
|
517 |
C4::SIP::SIPServer::get_logger()->warn("received no-block checkout from terminal '$account->{id}'"); |
506 |
syslog( "LOG_WARNING", "received no-block checkout from terminal '%s'", $account->{id} ); |
518 |
syslog( "LOG_WARNING", "received no-block checkout from terminal '%s'", $account->{id} ); |
507 |
|
519 |
|
508 |
$status = $ils->checkout_no_block( $patron_id, $item_id, $sc_renewal_policy, $trans_date, $nb_due_date ); |
520 |
$status = $ils->checkout_no_block( $patron_id, $item_id, $sc_renewal_policy, $trans_date, $nb_due_date ); |
Lines 630-635
sub handle_checkin {
Link Here
|
630 |
if ( $no_block eq 'Y' ) { |
642 |
if ( $no_block eq 'Y' ) { |
631 |
|
643 |
|
632 |
# Off-line transactions, ick. |
644 |
# Off-line transactions, ick. |
|
|
645 |
C4::SIP::SIPServer::get_logger()->warn("received no-block checkin from terminal '$account->{id}'"); |
633 |
syslog( "LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id} ); |
646 |
syslog( "LOG_WARNING", "received no-block checkin from terminal '%s'", $account->{id} ); |
634 |
$status = $ils->checkin_no_block( $item_id, $trans_date, $return_date, $item_props, $cancel ); |
647 |
$status = $ils->checkin_no_block( $item_id, $trans_date, $return_date, $item_props, $cancel ); |
635 |
} else { |
648 |
} else { |
Lines 744-761
sub handle_sc_status {
Link Here
|
744 |
} elsif ( $sc_protocol_version =~ /^2\./ ) { |
757 |
} elsif ( $sc_protocol_version =~ /^2\./ ) { |
745 |
$new_proto = 2; |
758 |
$new_proto = 2; |
746 |
} else { |
759 |
} else { |
|
|
760 |
C4::SIP::SIPServer::get_logger()->warn("Unrecognized protocol revision '$sc_protocol_version', falling back to '1'"); |
747 |
syslog( "LOG_WARNING", "Unrecognized protocol revision '%s', falling back to '1'", $sc_protocol_version ); |
761 |
syslog( "LOG_WARNING", "Unrecognized protocol revision '%s', falling back to '1'", $sc_protocol_version ); |
748 |
$new_proto = 1; |
762 |
$new_proto = 1; |
749 |
} |
763 |
} |
750 |
|
764 |
|
751 |
if ( $new_proto != $protocol_version ) { |
765 |
if ( $new_proto != $protocol_version ) { |
|
|
766 |
C4::SIP::SIPServer::get_logger()->info("Setting protocol level to $new_proto"); |
752 |
syslog( "LOG_INFO", "Setting protocol level to $new_proto" ); |
767 |
syslog( "LOG_INFO", "Setting protocol level to $new_proto" ); |
753 |
$protocol_version = $new_proto; |
768 |
$protocol_version = $new_proto; |
754 |
} |
769 |
} |
755 |
|
770 |
|
756 |
if ( $status == SC_STATUS_PAPER ) { |
771 |
if ( $status == SC_STATUS_PAPER ) { |
|
|
772 |
C4::SIP::SIPServer::get_logger()->warn("Self-Check unit '$self->{account}->{id}@$self->{account}->{institution}' out of paper"); |
757 |
syslog( "LOG_WARNING", "Self-Check unit '%s@%s' out of paper", $self->{account}->{id}, $self->{account}->{institution} ); |
773 |
syslog( "LOG_WARNING", "Self-Check unit '%s@%s' out of paper", $self->{account}->{id}, $self->{account}->{institution} ); |
758 |
} elsif ( $status == SC_STATUS_SHUTDOWN ) { |
774 |
} elsif ( $status == SC_STATUS_SHUTDOWN ) { |
|
|
775 |
C4::SIP::SIPServer::get_logger()->warn("Self-Check unit '$self->{account}->{id}@$self->{account}->{institution}' shutting down"); |
759 |
syslog( "LOG_WARNING", "Self-Check unit '%s@%s' shutting down", $self->{account}->{id}, $self->{account}->{institution} ); |
776 |
syslog( "LOG_WARNING", "Self-Check unit '%s@%s' shutting down", $self->{account}->{id}, $self->{account}->{institution} ); |
760 |
} |
777 |
} |
761 |
|
778 |
|
Lines 796-804
sub login_core {
Link Here
|
796 |
my $pwd = shift; |
813 |
my $pwd = shift; |
797 |
my $status = 1; # Assume it all works |
814 |
my $status = 1; # Assume it all works |
798 |
if ( !exists( $server->{config}->{accounts}->{$uid} ) ) { |
815 |
if ( !exists( $server->{config}->{accounts}->{$uid} ) ) { |
|
|
816 |
C4::SIP::SIPServer::get_logger()->warn("MsgType::login_core: Unknown login '$uid'"); |
799 |
syslog( "LOG_WARNING", "MsgType::login_core: Unknown login '$uid'" ); |
817 |
syslog( "LOG_WARNING", "MsgType::login_core: Unknown login '$uid'" ); |
800 |
$status = 0; |
818 |
$status = 0; |
801 |
} elsif ( $server->{config}->{accounts}->{$uid}->{password} ne $pwd ) { |
819 |
} elsif ( $server->{config}->{accounts}->{$uid}->{password} ne $pwd ) { |
|
|
820 |
C4::SIP::SIPServer::get_logger()->warn("MsgType::login_core: Invalid password for login '$uid'"); |
802 |
syslog( "LOG_WARNING", "MsgType::login_core: Invalid password for login '$uid'" ); |
821 |
syslog( "LOG_WARNING", "MsgType::login_core: Invalid password for login '$uid'" ); |
803 |
$status = 0; |
822 |
$status = 0; |
804 |
} else { |
823 |
} else { |
Lines 813-827
sub login_core {
Link Here
|
813 |
|
832 |
|
814 |
my $auth_status = api_auth( $uid, $pwd, $inst ); |
833 |
my $auth_status = api_auth( $uid, $pwd, $inst ); |
815 |
if ( !$auth_status or $auth_status !~ /^ok$/i ) { |
834 |
if ( !$auth_status or $auth_status !~ /^ok$/i ) { |
|
|
835 |
C4::SIP::SIPServer::get_logger()->warn("api_auth failed for SIP terminal '$uid' of '$inst': " . ($auth_status||'unknown') ); |
816 |
syslog( "LOG_WARNING", "api_auth failed for SIP terminal '%s' of '%s': %s", $uid, $inst, ( $auth_status || 'unknown' ) ); |
836 |
syslog( "LOG_WARNING", "api_auth failed for SIP terminal '%s' of '%s': %s", $uid, $inst, ( $auth_status || 'unknown' ) ); |
817 |
$status = 0; |
837 |
$status = 0; |
818 |
} else { |
838 |
} else { |
|
|
839 |
C4::SIP::SIPServer::get_logger()->info("Successful login/auth for '$server->{account}->{id}' of '$inst'"); |
819 |
syslog( "LOG_INFO", "Successful login/auth for '%s' of '%s'", $server->{account}->{id}, $inst ); |
840 |
syslog( "LOG_INFO", "Successful login/auth for '%s' of '%s'", $server->{account}->{id}, $inst ); |
820 |
|
841 |
|
821 |
# |
842 |
# |
822 |
# initialize connection to ILS |
843 |
# initialize connection to ILS |
823 |
# |
844 |
# |
824 |
my $module = $server->{config}->{institutions}->{$inst}->{implementation}; |
845 |
my $module = $server->{config}->{institutions}->{$inst}->{implementation}; |
|
|
846 |
C4::SIP::SIPServer::get_logger()->debug("login_core: " . Dumper($module) ); |
825 |
syslog( "LOG_DEBUG", 'login_core: ' . Dumper($module) ); |
847 |
syslog( "LOG_DEBUG", 'login_core: ' . Dumper($module) ); |
826 |
|
848 |
|
827 |
# Suspect this is always ILS but so we don't break any eccentic install (for now) |
849 |
# Suspect this is always ILS but so we don't break any eccentic install (for now) |
Lines 830-835
sub login_core {
Link Here
|
830 |
} |
852 |
} |
831 |
$module->use; |
853 |
$module->use; |
832 |
if ($@) { |
854 |
if ($@) { |
|
|
855 |
C4::SIP::SIPServer::get_logger()->error("$server->{service}: Loading ILS implementation '$module' for institution '$inst' failed"); |
833 |
syslog( "LOG_ERR", "%s: Loading ILS implementation '%s' for institution '%s' failed", $server->{service}, $module, $inst ); |
856 |
syslog( "LOG_ERR", "%s: Loading ILS implementation '%s' for institution '%s' failed", $server->{service}, $module, $inst ); |
834 |
die("Failed to load ILS implementation '$module' for $inst"); |
857 |
die("Failed to load ILS implementation '$module' for $inst"); |
835 |
} |
858 |
} |
Lines 837-842
sub login_core {
Link Here
|
837 |
# like ILS->new(), I think. |
860 |
# like ILS->new(), I think. |
838 |
$server->{ils} = $module->new( $server->{institution}, $server->{account} ); |
861 |
$server->{ils} = $module->new( $server->{institution}, $server->{account} ); |
839 |
if ( !$server->{ils} ) { |
862 |
if ( !$server->{ils} ) { |
|
|
863 |
C4::SIP::SIPServer::get_logger()->error("$server->{service}: ILS connection to '$inst' failed"); |
840 |
syslog( "LOG_ERR", "%s: ILS connection to '%s' failed", $server->{service}, $inst ); |
864 |
syslog( "LOG_ERR", "%s: ILS connection to '%s' failed", $server->{service}, $inst ); |
841 |
die("Unable to connect to ILS '$inst'"); |
865 |
die("Unable to connect to ILS '$inst'"); |
842 |
} |
866 |
} |
Lines 860-865
sub handle_login {
Link Here
|
860 |
$pwd = $fields->{ (FID_LOGIN_PWD) }; # Terminal PWD, not patron PWD. |
884 |
$pwd = $fields->{ (FID_LOGIN_PWD) }; # Terminal PWD, not patron PWD. |
861 |
|
885 |
|
862 |
if ( $uid_algorithm || $pwd_algorithm ) { |
886 |
if ( $uid_algorithm || $pwd_algorithm ) { |
|
|
887 |
C4::SIP::SIPServer::get_logger()->error("LOGIN: Unsupported non-zero encryption method(s): uid = $uid_algorithm, pwd = $pwd_algorithm"); |
863 |
syslog( "LOG_ERR", "LOGIN: Unsupported non-zero encryption method(s): uid = $uid_algorithm, pwd = $pwd_algorithm" ); |
888 |
syslog( "LOG_ERR", "LOGIN: Unsupported non-zero encryption method(s): uid = $uid_algorithm, pwd = $pwd_algorithm" ); |
864 |
$status = 0; |
889 |
$status = 0; |
865 |
} else { |
890 |
} else { |
Lines 899-910
sub summary_info {
Link Here
|
899 |
return ''; # No detailed information required |
924 |
return ''; # No detailed information required |
900 |
} |
925 |
} |
901 |
|
926 |
|
|
|
927 |
C4::SIP::SIPServer::get_logger()->debug("Summary_info: index == '$summary_type', field '$summary_map[$summary_type]->{fid}'"); |
902 |
syslog( "LOG_DEBUG", "Summary_info: index == '%d', field '%s'", $summary_type, $summary_map[$summary_type]->{fid} ); |
928 |
syslog( "LOG_DEBUG", "Summary_info: index == '%d', field '%s'", $summary_type, $summary_map[$summary_type]->{fid} ); |
903 |
|
929 |
|
904 |
my $func = $summary_map[$summary_type]->{func}; |
930 |
my $func = $summary_map[$summary_type]->{func}; |
905 |
my $fid = $summary_map[$summary_type]->{fid}; |
931 |
my $fid = $summary_map[$summary_type]->{fid}; |
906 |
my $itemlist = &$func( $patron, $start, $end, $server ); |
932 |
my $itemlist = &$func( $patron, $start, $end, $server ); |
907 |
|
933 |
|
|
|
934 |
C4::SIP::SIPServer::get_logger()->debug("summary_info: list = (" . join(", ", @{$itemlist}) . ")"); |
908 |
syslog( "LOG_DEBUG", "summary_info: list = (%s)", join( ", ", @{$itemlist} ) ); |
935 |
syslog( "LOG_DEBUG", "summary_info: list = (%s)", join( ", ", @{$itemlist} ) ); |
909 |
foreach my $i ( @{$itemlist} ) { |
936 |
foreach my $i ( @{$itemlist} ) { |
910 |
$resp .= add_field( $fid, $i->{barcode} ); |
937 |
$resp .= add_field( $fid, $i->{barcode} ); |
Lines 1179-1184
sub handle_item_status_update {
Link Here
|
1179 |
$item_props = $fields->{ (FID_ITEM_PROPS) }; |
1206 |
$item_props = $fields->{ (FID_ITEM_PROPS) }; |
1180 |
|
1207 |
|
1181 |
if ( !defined($item_id) ) { |
1208 |
if ( !defined($item_id) ) { |
|
|
1209 |
C4::SIP::SIPServer::get_logger()->warn("handle_item_status: received message without Item ID field"); |
1182 |
syslog( "LOG_WARNING", "handle_item_status: received message without Item ID field" ); |
1210 |
syslog( "LOG_WARNING", "handle_item_status: received message without Item ID field" ); |
1183 |
} else { |
1211 |
} else { |
1184 |
$item = $ils->find_item($item_id); |
1212 |
$item = $ils->find_item($item_id); |
Lines 1224-1229
sub handle_patron_enable {
Link Here
|
1224 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
1252 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
1225 |
$patron_pwd = $fields->{ (FID_PATRON_PWD) }; |
1253 |
$patron_pwd = $fields->{ (FID_PATRON_PWD) }; |
1226 |
|
1254 |
|
|
|
1255 |
C4::SIP::SIPServer::get_logger()->debug("handle_patron_enable: patron_id: '$patron_id', patron_pwd: '$patron_pwd'"); |
1227 |
syslog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd ); |
1256 |
syslog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd ); |
1228 |
|
1257 |
|
1229 |
$patron = $ils->find_patron($patron_id); |
1258 |
$patron = $ils->find_patron($patron_id); |
Lines 1294-1299
sub handle_hold {
Link Here
|
1294 |
} elsif ( $hold_mode eq '*' ) { |
1323 |
} elsif ( $hold_mode eq '*' ) { |
1295 |
$status = $ils->alter_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack ); |
1324 |
$status = $ils->alter_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack ); |
1296 |
} else { |
1325 |
} else { |
|
|
1326 |
C4::SIP::SIPServer::get_logger()->warn("handle_hold: Unrecognized hold mode '$hold_mode' from terminal '$server->{account}->{id}'"); |
1297 |
syslog( "LOG_WARNING", "handle_hold: Unrecognized hold mode '%s' from terminal '%s'", $hold_mode, $server->{account}->{id} ); |
1327 |
syslog( "LOG_WARNING", "handle_hold: Unrecognized hold mode '%s' from terminal '%s'", $hold_mode, $server->{account}->{id} ); |
1298 |
$status = $ils->Transaction::Hold; # new? |
1328 |
$status = $ils->Transaction::Hold; # new? |
1299 |
$status->screen_msg("System error. Please contact library staff."); |
1329 |
$status->screen_msg("System error. Please contact library staff."); |
Lines 1342-1347
sub handle_renew {
Link Here
|
1342 |
$ils->check_inst_id( $fields->{ (FID_INST_ID) }, "handle_renew" ); |
1372 |
$ils->check_inst_id( $fields->{ (FID_INST_ID) }, "handle_renew" ); |
1343 |
|
1373 |
|
1344 |
if ( $no_block eq 'Y' ) { |
1374 |
if ( $no_block eq 'Y' ) { |
|
|
1375 |
C4::SIP::SIPServer::get_logger()->warn("handle_renew: received 'no block' renewal from terminal '$server->{account}->{id}'"); |
1345 |
syslog( "LOG_WARNING", "handle_renew: received 'no block' renewal from terminal '%s'", $server->{account}->{id} ); |
1376 |
syslog( "LOG_WARNING", "handle_renew: received 'no block' renewal from terminal '%s'", $server->{account}->{id} ); |
1346 |
} |
1377 |
} |
1347 |
|
1378 |
|
Lines 1509-1514
sub send_acs_status {
Link Here
|
1509 |
$retries = sprintf( "%03d", $policy->{retries} ); |
1540 |
$retries = sprintf( "%03d", $policy->{retries} ); |
1510 |
|
1541 |
|
1511 |
if ( length($retries) != 3 ) { |
1542 |
if ( length($retries) != 3 ) { |
|
|
1543 |
C4::SIP::SIPServer::get_logger()->error("handle_acs_status: timeout field wrong size: '$timeout'"); |
1512 |
syslog( "LOG_ERR", "handle_acs_status: retries field wrong size: '%s'", $retries ); |
1544 |
syslog( "LOG_ERR", "handle_acs_status: retries field wrong size: '%s'", $retries ); |
1513 |
$retries = '000'; |
1545 |
$retries = '000'; |
1514 |
} |
1546 |
} |
Lines 1522-1527
sub send_acs_status {
Link Here
|
1522 |
} elsif ( $protocol_version == 2 ) { |
1554 |
} elsif ( $protocol_version == 2 ) { |
1523 |
$msg .= '2.00'; |
1555 |
$msg .= '2.00'; |
1524 |
} else { |
1556 |
} else { |
|
|
1557 |
C4::SIP::SIPServer::get_logger()->error("Bad setting for \$protocol_version, '$protocol_version' in send_acs_status"); |
1525 |
syslog( "LOG_ERR", 'Bad setting for $protocol_version, "%s" in send_acs_status', $protocol_version ); |
1558 |
syslog( "LOG_ERR", 'Bad setting for $protocol_version, "%s" in send_acs_status', $protocol_version ); |
1526 |
$msg .= '1.00'; |
1559 |
$msg .= '1.00'; |
1527 |
} |
1560 |
} |
Lines 1542-1547
sub send_acs_status {
Link Here
|
1542 |
} |
1575 |
} |
1543 |
} |
1576 |
} |
1544 |
if ( length($supported_msgs) < 16 ) { |
1577 |
if ( length($supported_msgs) < 16 ) { |
|
|
1578 |
C4::SIP::SIPServer::get_logger()->error("send_acs_status: supported messages '$supported_msgs' too short"); |
1545 |
syslog( "LOG_ERR", 'send_acs_status: supported messages "%s" too short', $supported_msgs ); |
1579 |
syslog( "LOG_ERR", 'send_acs_status: supported messages "%s" too short', $supported_msgs ); |
1546 |
} |
1580 |
} |
1547 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs ); |
1581 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs ); |
Lines 1552-1557
sub send_acs_status {
Link Here
|
1552 |
if ( defined( $account->{print_width} ) |
1586 |
if ( defined( $account->{print_width} ) |
1553 |
&& defined($print_line) |
1587 |
&& defined($print_line) |
1554 |
&& $account->{print_width} < length($print_line) ) { |
1588 |
&& $account->{print_width} < length($print_line) ) { |
|
|
1589 |
C4::SIP::SIPServer::get_logger()->warn("send_acs_status: print line '$print_line' too long. Truncating"); |
1555 |
syslog( "LOG_WARNING", "send_acs_status: print line '%s' too long. Truncating", $print_line ); |
1590 |
syslog( "LOG_WARNING", "send_acs_status: print line '%s' too long. Truncating", $print_line ); |
1556 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
1591 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
1557 |
} |
1592 |
} |
Lines 1572-1577
sub patron_status_string {
Link Here
|
1572 |
my $patron = shift; |
1607 |
my $patron = shift; |
1573 |
my $patron_status; |
1608 |
my $patron_status; |
1574 |
|
1609 |
|
|
|
1610 |
C4::SIP::SIPServer::get_logger()->debug("patron_status_string: $patron->id charge_ok: $patron->charge_ok"); |
1575 |
syslog( "LOG_DEBUG", "patron_status_string: %s charge_ok: %s", $patron->id, $patron->charge_ok ); |
1611 |
syslog( "LOG_DEBUG", "patron_status_string: %s charge_ok: %s", $patron->id, $patron->charge_ok ); |
1576 |
$patron_status = sprintf( |
1612 |
$patron_status = sprintf( |
1577 |
'%s%s%s%s%s%s%s%s%s%s%s%s%s%s', |
1613 |
'%s%s%s%s%s%s%s%s%s%s%s%s%s%s', |