list all known parameter types with constants, so we get the names in debug logs
authorChristian Weiske <cweiske@cweiske.de>
Wed, 1 Aug 2012 05:35:07 +0000 (07:35 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 1 Aug 2012 05:35:07 +0000 (07:35 +0200)
src/callnotifier/EDSS1/Parameter.php
src/callnotifier/Logger/Debug.php

index 87bc3c3482adb60d05b31cff7c41e8fb9d762977..96d995c354bbdcc599a36ac979baa5f5e3139295 100644 (file)
@@ -6,10 +6,41 @@ namespace callnotifier;
  */
 class EDSS1_Parameter
 {
+    const BEARER_CAPABILITY = 0x04;
+    const CAUSE = 0x08;
+    const CALL_IDENTITY = 0x10;
+    const CALL_STATE = 0x14;
+    const CHANNEL_IDENTIFICATION = 0x18;
+    const PROGRESS_INDICATOR = 0x1E;
+    const NETWORK_FACILITIES = 0x20;
+    const NOTIFICATION_IDENDICATOR = 0x27;
+    const DISPLAY = 0x28;
+    const DATE_TIME = 0x29;
+    const KEYPAD = 0x2C;
+    const SIGNAL = 0x34;
+    const INFORMATION_RATE = 0x40;
+    const END_TO_END_TRANSIT_DELAY = 0x42;
+    const TRANSIT_DELAY = 0x43;
+    const PACKET_LAYER_BIN_PARAMS = 0x44;
+    const PACKET_LAYER_WINDOW_SIZE = 0x45;
+    const PACKET_SIZE = 0x46;
+    const REVERSE_CHARGING_INDICATION = 0x4A;
+    const CONNECTED_NUMBER = 0x4C;
+    const CLOSED_USER_GROUP = 0x47;
+    const INFORMATION_RATE2 = 0x60;
     const CALLING_PARTY_NUMBER = 0x6C;
+    const CALLING_PARTY_NUMBER_SUBADDRESS = 0x6D;
     const CALLED_PARTY_NUMBER = 0x70;
-    const CONNECTED_NUMBER = 0x4C;
-    const KEYPAD = 0x2C;
+    const CALLED_PARTY_NUMBER_SUBADDRESS = 0x71;
+    const REDIRECTING_NUMBER = 0x74;
+    const TRANSIT_NETWORK_SELECTION = 0x78;
+    const RESTART_INDICATOR = 0x79;
+    const LOW_LAYER_COMPAT = 0x7C;
+    const HIGH_LAYER_COMPAT = 0x7D;
+    const END_USER = 0x7E;
+    const EXTENSION_ESCAPE = 0x7F;
+    const MORE_DATA = 0xA0;
+    const SENDING_COMPLETE = 0xA1;
 
     public $type;
     public $length;
@@ -29,6 +60,18 @@ class EDSS1_Parameter
     {
         $this->data = $data;
     }
+
+    public function getTypeName()
+    {
+        $rc = new \ReflectionClass($this);
+        foreach ($rc->getConstants() as $name => $value) {
+            if ($value == $this->type) {
+                return $name;
+            }
+        }
+        return '';
+    }
+
 }
 
 ?>
index 06f7b08b72b7e98362596852240924f459291ee1..1b921f3f841b0a5961a6df8f7c78c411d6770c03 100644 (file)
@@ -82,7 +82,7 @@ class Logger_Debug implements Logger
                 $param->type,
                 $param->title
                 ? ' ' . $this->purple . $param->title . $this->end
-                : '',
+                : ' ' . $this->purple . $param->getTypeName() . $this->end,
                 $param->length,
                 preg_replace('/[^[:print:]]/', '?', $param->data)
                 . (isset($param->number)