use POSIX qw(strftime);
use Socket qw(:crlf);
-use Sip::Constants qw(SIP_DATETIME);
+use Sip::Constants qw(:all);
use Sip::Checksum qw(checksum);
our $VERSION = 0.02;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(y_or_n timestamp add_field maybe_add add_count
- denied sipbool boolspace write_msg read_SIP_packet
- $error_detection $protocol_version $field_delimiter
- $last_response);
+ denied sipbool boolspace write_msg read_SIP_packet
+ $error_detection $protocol_version $field_delimiter
+ $last_response);
our %EXPORT_TAGS = (
- all => [qw(y_or_n timestamp add_field maybe_add
- add_count denied sipbool boolspace write_msg
- read_SIP_packet
- $error_detection $protocol_version
- $field_delimiter $last_response)]);
+ all => [qw(y_or_n timestamp add_field maybe_add
+ add_count denied sipbool boolspace write_msg
+ read_SIP_packet
+ $error_detection $protocol_version
+ $field_delimiter $last_response)]);
our $error_detection = 0;
our $protocol_version = 1;
-our $field_delimiter = '|'; # Protocol Default
+our $field_delimiter = '|'; # Protocol Default
# We need to keep a copy of the last message we sent to the SC,
# in case there's a transmission error and the SC sends us a
my ($i, $ent);
if (!defined($value)) {
- syslog("LOG_DEBUG", "add_field: Undefined value being added to '%s'",
- $field_id);
- $value = '';
+ syslog("LOG_DEBUG", "add_field: Undefined value being added to '%s'",
+ $field_id);
+ $value = '';
}
# Replace any occurences of the field delimiter in the
$ent = sprintf("&#%d;", ord($field_delimiter));
while (($i = index($value, $field_delimiter)) != ($[-1)) {
- substr($value, $i, 1) = $ent;
+ substr($value, $i, 1) = $ent;
}
# SIP2 Protocol document specifies that variable fields are from 0
# If the field is unsupported, it will be undef, return blanks
# as per the spec.
if (!defined($count)) {
- return ' ' x 4;
+ return ' ' x 4;
}
$count = sprintf("%04d", $count);
if (length($count) != 4) {
- syslog("LOG_WARNING", "handle_patron_info: %s wrong size: '%s'",
- $label, $count);
- $count = ' ' x 4;
+ syslog("LOG_WARNING", "handle_patron_info: %s wrong size: '%s'",
+ $label, $count);
+ $count = ' ' x 4;
}
return $count;
}
syslog("LOG_ERR", "Error writing to STDOUT $!") unless $rv;
}
- syslog("LOG_INFO", "OUTPUT MSG: '$msg'");
+ syslog("LOG_INFO", "OUTPUT MSG2: '$msg'");
$last_response = $msg;
}