X-Git-Url: https://git.cweiske.de/auerswald-callnotifier.git/blobdiff_plain/ed39da2ea138da1b4a8eac805bcde19dedd8c054..HEAD:/src/callnotifier/EDSS1/Parser.php diff --git a/src/callnotifier/EDSS1/Parser.php b/src/callnotifier/EDSS1/Parser.php index f3ebeba..b5a906d 100644 --- a/src/callnotifier/EDSS1/Parser.php +++ b/src/callnotifier/EDSS1/Parser.php @@ -19,16 +19,17 @@ class EDSS1_Parser if ($crLen == 0xFF) { return $m; } - $m->callRefType = ord($cCallRef{0}) >> 7; - $nCallRef = ord($cCallRef{0}) & 127; - if ($crLen > 1) { - $nCallRef = ord($cCallRef{1}) + ($nCallRef << 8); - if ($crLen > 2) { - $nCallRef = ord($cCallRef{2}) + ($nCallRef << 8); + if ($crLen > 0) { + $m->callRefType = ord($cCallRef{0}) >> 7; + $nCallRef = ord($cCallRef{0}) & 127; + if ($crLen > 1) { + $nCallRef = ord($cCallRef{1}) + ($nCallRef << 8); + if ($crLen > 2) { + $nCallRef = ord($cCallRef{2}) + ($nCallRef << 8); + } } + $m->callRef = $nCallRef; } - $m->callRef = $nCallRef; - //var_dump($curpos, dechex($m->callRef)); $m->type = ord($bytes{++$curpos}); $complete = false;