read TEI and call reference
[auerswald-callnotifier.git] / src / callnotifier / MessageHandler.php
index 6181e3a39a5e15545c17d49415278e7ce852e877..9e65b8138db75d50b9c02c9444ad1d871b2384c8 100644 (file)
@@ -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) {