From 9176fd464eae3782fe96b53bc9d160b9c0e98f1a Mon Sep 17 00:00:00 2001 From: Ulrich Kleiber Date: Fri, 29 Jul 2011 16:35:40 +0200 Subject: [PATCH] sip2 unicode checksum --- C4/SIP/Sip/Checksum.pm | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/SIP/Sip/Checksum.pm b/C4/SIP/Sip/Checksum.pm index e88567a..ed102c7 100644 --- a/C4/SIP/Sip/Checksum.pm +++ b/C4/SIP/Sip/Checksum.pm @@ -10,7 +10,7 @@ our $debug = 0; sub checksum { my $pkt = shift; - return (-unpack('%16U*', $pkt) & 0xFFFF); + return (-unpack('%16C*', $pkt) & 0xFFFF); } sub verify_cksum { @@ -29,7 +29,7 @@ sub verify_cksum { # Convert the checksum back to hex and calculate the sum of the # pack without the checksum. $cksum = hex($1); - $shortsum = unpack("%16U*", substr($pkt, 0, -4)); + $shortsum = unpack("%16C*", substr($pkt, 0, -4)); # The checksum is valid if the hex sum, plus the checksum of the # base packet short when truncated to 16 bits. -- 1.7.0.4