name facility information
[auerswald-callnotifier.git] / src / callnotifier / EDSS1 / Parameter.php
1 <?php
2 namespace callnotifier;
3
4 /**
5  * A parameter is what the specs call a "information element"
6  */
7 class EDSS1_Parameter
8 {
9     const BEARER_CAPABILITY = 0x04;
10     const CAUSE = 0x08;
11     const CALL_IDENTITY = 0x10;
12     const FACILITY_INFORMATION = 0x1C;
13     const CALL_STATE = 0x14;
14     const CHANNEL_IDENTIFICATION = 0x18;
15     const PROGRESS_INDICATOR = 0x1E;
16     const NETWORK_FACILITIES = 0x20;
17     const NOTIFICATION_IDENDICATOR = 0x27;
18     const DISPLAY = 0x28;
19     const DATE_TIME = 0x29;
20     const KEYPAD = 0x2C;
21     const SIGNAL = 0x34;
22     const INFORMATION_RATE = 0x40;
23     const END_TO_END_TRANSIT_DELAY = 0x42;
24     const TRANSIT_DELAY = 0x43;
25     const PACKET_LAYER_BIN_PARAMS = 0x44;
26     const PACKET_LAYER_WINDOW_SIZE = 0x45;
27     const PACKET_SIZE = 0x46;
28     const REVERSE_CHARGING_INDICATION = 0x4A;
29     const CONNECTED_NUMBER = 0x4C;
30     const CLOSED_USER_GROUP = 0x47;
31     const INFORMATION_RATE2 = 0x60;
32     const CALLING_PARTY_NUMBER = 0x6C;
33     const CALLING_PARTY_NUMBER_SUBADDRESS = 0x6D;
34     const CALLED_PARTY_NUMBER = 0x70;
35     const CALLED_PARTY_NUMBER_SUBADDRESS = 0x71;
36     const REDIRECTING_NUMBER = 0x74;
37     const TRANSIT_NETWORK_SELECTION = 0x78;
38     const RESTART_INDICATOR = 0x79;
39     const LOW_LAYER_COMPAT = 0x7C;
40     const HIGH_LAYER_COMPAT = 0x7D;
41     const END_USER = 0x7E;
42     const EXTENSION_ESCAPE = 0x7F;
43     const MORE_DATA = 0xA0;
44     const SENDING_COMPLETE = 0xA1;
45
46     public $type;
47     public $length;
48     public $data;
49
50     /**
51      * Internal title of the parameter type
52      */
53     public $title;
54
55     public function __construct($type = null)
56     {
57         $this->type = $type;
58     }
59
60     public function setData($data)
61     {
62         $this->data = $data;
63     }
64
65     public function getTypeName()
66     {
67         $rc = new \ReflectionClass($this);
68         foreach ($rc->getConstants() as $name => $value) {
69             if ($value == $this->type) {
70                 return $name;
71             }
72         }
73         return '';
74     }
75
76 }
77
78 ?>