From 80ac37b8be4b95237ca0b8c1cdf64859a33a0946 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 1 Aug 2012 07:35:07 +0200 Subject: [PATCH] list all known parameter types with constants, so we get the names in debug logs --- src/callnotifier/EDSS1/Parameter.php | 47 ++++++++++++++++++++++++++-- src/callnotifier/Logger/Debug.php | 2 +- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/callnotifier/EDSS1/Parameter.php b/src/callnotifier/EDSS1/Parameter.php index 87bc3c3..96d995c 100644 --- a/src/callnotifier/EDSS1/Parameter.php +++ b/src/callnotifier/EDSS1/Parameter.php @@ -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 ''; + } + } ?> diff --git a/src/callnotifier/Logger/Debug.php b/src/callnotifier/Logger/Debug.php index 06f7b08..1b921f3 100644 --- a/src/callnotifier/Logger/Debug.php +++ b/src/callnotifier/Logger/Debug.php @@ -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) -- 2.30.2