aboutsummaryrefslogtreecommitdiff
path: root/src/callnotifier/MessageHandler.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/callnotifier/MessageHandler.php')
-rw-r--r--src/callnotifier/MessageHandler.php14
1 files changed, 10 insertions, 4 deletions
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) {