aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/callnotifier/EDSS1/Message.php11
-rw-r--r--src/callnotifier/EDSS1/Parser.php10
2 files changed, 20 insertions, 1 deletions
diff --git a/src/callnotifier/EDSS1/Message.php b/src/callnotifier/EDSS1/Message.php
index d490005..421df79 100644
--- a/src/callnotifier/EDSS1/Message.php
+++ b/src/callnotifier/EDSS1/Message.php
@@ -28,6 +28,17 @@ class EDSS1_Message
public $callRef;
/**
+ * If the message is from the call originating device, or the
+ * other side.
+ *
+ * - 0 = device that originated the call
+ * - 1 = device that answers to orignator requests
+ *
+ * @var integer
+ */
+ public $callRefType;
+
+ /**
* Service AccessPoint Identifier
*
* @var integer
diff --git a/src/callnotifier/EDSS1/Parser.php b/src/callnotifier/EDSS1/Parser.php
index 0c9b86a..f3ebeba 100644
--- a/src/callnotifier/EDSS1/Parser.php
+++ b/src/callnotifier/EDSS1/Parser.php
@@ -19,7 +19,15 @@ class EDSS1_Parser
if ($crLen == 0xFF) {
return $m;
}
- $m->callRef = ord($cCallRef);
+ $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;
//var_dump($curpos, dechex($m->callRef));
$m->type = ord($bytes{++$curpos});