From 2039373b7d60786e5b92a79520cecfcfce34c044 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 20 Jul 2012 07:45:53 +0200 Subject: read TEI and call reference --- src/callnotifier/MessageHandler.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/callnotifier/MessageHandler.php') diff --git a/src/callnotifier/MessageHandler.php b/src/callnotifier/MessageHandler.php index 6181e3a..9e65b81 100644 --- a/src/callnotifier/MessageHandler.php +++ b/src/callnotifier/MessageHandler.php @@ -103,10 +103,7 @@ class MessageHandler } $bytestring = substr($details, 5); - $bytes = ''; - foreach (explode(' ', $bytestring) as $strbyte) { - $bytes .= chr(hexdec($strbyte)); - } + $bytes = static::getBytesFromHexString($bytestring); $msgtype = $bytes{7}; static $interestingTyps = array( @@ -137,6 +134,15 @@ class MessageHandler } } + public static function getBytesFromHexString($bytestring) + { + $bytes = ''; + foreach (explode(' ', $bytestring) as $strbyte) { + $bytes .= chr(hexdec($strbyte)); + } + return $bytes; + } + protected function prepareDump() { if ($this->config->dumpFile === null) { -- cgit v1.2.3