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 1177-1182
sub handle_item_status_update {
Link Here
|
1177 |
$item_props = $fields->{ (FID_ITEM_PROPS) }; |
1204 |
$item_props = $fields->{ (FID_ITEM_PROPS) }; |
1178 |
|
1205 |
|
1179 |
if ( !defined($item_id) ) { |
1206 |
if ( !defined($item_id) ) { |
|
|
1207 |
C4::SIP::SIPServer::get_logger()->warn("handle_item_status: received message without Item ID field"); |
1180 |
syslog( "LOG_WARNING", "handle_item_status: received message without Item ID field" ); |
1208 |
syslog( "LOG_WARNING", "handle_item_status: received message without Item ID field" ); |
1181 |
} else { |
1209 |
} else { |
1182 |
$item = $ils->find_item($item_id); |
1210 |
$item = $ils->find_item($item_id); |
Lines 1222-1227
sub handle_patron_enable {
Link Here
|
1222 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
1250 |
$patron_id = $fields->{ (FID_PATRON_ID) }; |
1223 |
$patron_pwd = $fields->{ (FID_PATRON_PWD) }; |
1251 |
$patron_pwd = $fields->{ (FID_PATRON_PWD) }; |
1224 |
|
1252 |
|
|
|
1253 |
C4::SIP::SIPServer::get_logger()->debug("handle_patron_enable: patron_id: '$patron_id', patron_pwd: '$patron_pwd'"); |
1225 |
syslog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd ); |
1254 |
syslog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd ); |
1226 |
|
1255 |
|
1227 |
$patron = $ils->find_patron($patron_id); |
1256 |
$patron = $ils->find_patron($patron_id); |
Lines 1292-1297
sub handle_hold {
Link Here
|
1292 |
} elsif ( $hold_mode eq '*' ) { |
1321 |
} elsif ( $hold_mode eq '*' ) { |
1293 |
$status = $ils->alter_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack ); |
1322 |
$status = $ils->alter_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack ); |
1294 |
} else { |
1323 |
} else { |
|
|
1324 |
C4::SIP::SIPServer::get_logger()->warn("handle_hold: Unrecognized hold mode '$hold_mode' from terminal '$server->{account}->{id}'"); |
1295 |
syslog( "LOG_WARNING", "handle_hold: Unrecognized hold mode '%s' from terminal '%s'", $hold_mode, $server->{account}->{id} ); |
1325 |
syslog( "LOG_WARNING", "handle_hold: Unrecognized hold mode '%s' from terminal '%s'", $hold_mode, $server->{account}->{id} ); |
1296 |
$status = $ils->Transaction::Hold; # new? |
1326 |
$status = $ils->Transaction::Hold; # new? |
1297 |
$status->screen_msg("System error. Please contact library staff."); |
1327 |
$status->screen_msg("System error. Please contact library staff."); |
Lines 1340-1345
sub handle_renew {
Link Here
|
1340 |
$ils->check_inst_id( $fields->{ (FID_INST_ID) }, "handle_renew" ); |
1370 |
$ils->check_inst_id( $fields->{ (FID_INST_ID) }, "handle_renew" ); |
1341 |
|
1371 |
|
1342 |
if ( $no_block eq 'Y' ) { |
1372 |
if ( $no_block eq 'Y' ) { |
|
|
1373 |
C4::SIP::SIPServer::get_logger()->warn("handle_renew: received 'no block' renewal from terminal '$server->{account}->{id}'"); |
1343 |
syslog( "LOG_WARNING", "handle_renew: received 'no block' renewal from terminal '%s'", $server->{account}->{id} ); |
1374 |
syslog( "LOG_WARNING", "handle_renew: received 'no block' renewal from terminal '%s'", $server->{account}->{id} ); |
1344 |
} |
1375 |
} |
1345 |
|
1376 |
|
Lines 1507-1512
sub send_acs_status {
Link Here
|
1507 |
$retries = sprintf( "%03d", $policy->{retries} ); |
1538 |
$retries = sprintf( "%03d", $policy->{retries} ); |
1508 |
|
1539 |
|
1509 |
if ( length($retries) != 3 ) { |
1540 |
if ( length($retries) != 3 ) { |
|
|
1541 |
C4::SIP::SIPServer::get_logger()->error("handle_acs_status: timeout field wrong size: '$timeout'"); |
1510 |
syslog( "LOG_ERR", "handle_acs_status: retries field wrong size: '%s'", $retries ); |
1542 |
syslog( "LOG_ERR", "handle_acs_status: retries field wrong size: '%s'", $retries ); |
1511 |
$retries = '000'; |
1543 |
$retries = '000'; |
1512 |
} |
1544 |
} |
Lines 1520-1525
sub send_acs_status {
Link Here
|
1520 |
} elsif ( $protocol_version == 2 ) { |
1552 |
} elsif ( $protocol_version == 2 ) { |
1521 |
$msg .= '2.00'; |
1553 |
$msg .= '2.00'; |
1522 |
} else { |
1554 |
} else { |
|
|
1555 |
C4::SIP::SIPServer::get_logger()->error("Bad setting for \$protocol_version, '$protocol_version' in send_acs_status"); |
1523 |
syslog( "LOG_ERR", 'Bad setting for $protocol_version, "%s" in send_acs_status', $protocol_version ); |
1556 |
syslog( "LOG_ERR", 'Bad setting for $protocol_version, "%s" in send_acs_status', $protocol_version ); |
1524 |
$msg .= '1.00'; |
1557 |
$msg .= '1.00'; |
1525 |
} |
1558 |
} |
Lines 1540-1545
sub send_acs_status {
Link Here
|
1540 |
} |
1573 |
} |
1541 |
} |
1574 |
} |
1542 |
if ( length($supported_msgs) < 16 ) { |
1575 |
if ( length($supported_msgs) < 16 ) { |
|
|
1576 |
C4::SIP::SIPServer::get_logger()->error("send_acs_status: supported messages '$supported_msgs' too short"); |
1543 |
syslog( "LOG_ERR", 'send_acs_status: supported messages "%s" too short', $supported_msgs ); |
1577 |
syslog( "LOG_ERR", 'send_acs_status: supported messages "%s" too short', $supported_msgs ); |
1544 |
} |
1578 |
} |
1545 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs ); |
1579 |
$msg .= add_field( FID_SUPPORTED_MSGS, $supported_msgs ); |
Lines 1550-1555
sub send_acs_status {
Link Here
|
1550 |
if ( defined( $account->{print_width} ) |
1584 |
if ( defined( $account->{print_width} ) |
1551 |
&& defined($print_line) |
1585 |
&& defined($print_line) |
1552 |
&& $account->{print_width} < length($print_line) ) { |
1586 |
&& $account->{print_width} < length($print_line) ) { |
|
|
1587 |
C4::SIP::SIPServer::get_logger()->warn("send_acs_status: print line '$print_line' too long. Truncating"); |
1553 |
syslog( "LOG_WARNING", "send_acs_status: print line '%s' too long. Truncating", $print_line ); |
1588 |
syslog( "LOG_WARNING", "send_acs_status: print line '%s' too long. Truncating", $print_line ); |
1554 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
1589 |
$print_line = substr( $print_line, 0, $account->{print_width} ); |
1555 |
} |
1590 |
} |
Lines 1570-1575
sub patron_status_string {
Link Here
|
1570 |
my $patron = shift; |
1605 |
my $patron = shift; |
1571 |
my $patron_status; |
1606 |
my $patron_status; |
1572 |
|
1607 |
|
|
|
1608 |
C4::SIP::SIPServer::get_logger()->debug("patron_status_string: $patron->id charge_ok: $patron->charge_ok"); |
1573 |
syslog( "LOG_DEBUG", "patron_status_string: %s charge_ok: %s", $patron->id, $patron->charge_ok ); |
1609 |
syslog( "LOG_DEBUG", "patron_status_string: %s charge_ok: %s", $patron->id, $patron->charge_ok ); |
1574 |
$patron_status = sprintf( |
1610 |
$patron_status = sprintf( |
1575 |
'%s%s%s%s%s%s%s%s%s%s%s%s%s%s', |
1611 |
'%s%s%s%s%s%s%s%s%s%s%s%s%s%s', |