From: djfiander Date: Thu, 31 Aug 2006 23:06:14 +0000 (+0000) Subject: Log both raw input and raw output messages. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f8b7055d020f2ca7de2105e2330dce3ca775a794;p=SIPServer.git Log both raw input and raw output messages. Zero-pad the checksum that we transmit. --- diff --git a/Sip.pm b/Sip.pm index ea0c9d4..3b826ef 100644 --- a/Sip.pm +++ b/Sip.pm @@ -142,9 +142,12 @@ sub boolspace { # sub read_SIP_packet { my $file = shift; + my $record; local $/ = "\r"; - return readline($file); + $record = readline($file); + syslog("LOG_INFO", "INPUT MSG: '$record'") if $record; + return $record; } # @@ -168,7 +171,7 @@ sub write_msg { } $msg .= 'AZ'; $cksum = checksum($msg); - $msg .= sprintf('%4X', $cksum); + $msg .= sprintf('%04.4X', $cksum); } @@ -176,7 +179,7 @@ sub write_msg { print $file "$msg\r"; } else { print "$msg\r"; - syslog("LOG_DEBUG", "OUTPUT MSG: '$msg'"); + syslog("LOG_INFO", "OUTPUT MSG: '$msg'"); } $last_response = $msg;