96d995c354bbdcc599a36ac979baa5f5e3139295
[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 CALL_STATE = 0x14;
13     const CHANNEL_IDENTIFICATION = 0x18;
14     const PROGRESS_INDICATOR = 0x1E;
15     const NETWORK_FACILITIES = 0x20;
16     const NOTIFICATION_IDENDICATOR = 0x27;
17     const DISPLAY = 0x28;
18     const DATE_TIME = 0x29;
19     const KEYPAD = 0x2C;
20     const SIGNAL = 0x34;
21     const INFORMATION_RATE = 0x40;
22     const END_TO_END_TRANSIT_DELAY = 0x42;
23     const TRANSIT_DELAY = 0x43;
24     const PACKET_LAYER_BIN_PARAMS = 0x44;
25     const PACKET_LAYER_WINDOW_SIZE = 0x45;
26     const PACKET_SIZE = 0x46;
27     const REVERSE_CHARGING_INDICATION = 0x4A;
28     const CONNECTED_NUMBER = 0x4C;
29     const CLOSED_USER_GROUP = 0x47;
30     const INFORMATION_RATE2 = 0x60;
31     const CALLING_PARTY_NUMBER = 0x6C;
32     const CALLING_PARTY_NUMBER_SUBADDRESS = 0x6D;
33     const CALLED_PARTY_NUMBER = 0x70;
34     const CALLED_PARTY_NUMBER_SUBADDRESS = 0x71;
35     const REDIRECTING_NUMBER = 0x74;
36     const TRANSIT_NETWORK_SELECTION = 0x78;
37     const RESTART_INDICATOR = 0x79;
38     const LOW_LAYER_COMPAT = 0x7C;
39     const HIGH_LAYER_COMPAT = 0x7D;
40     const END_USER = 0x7E;
41     const EXTENSION_ESCAPE = 0x7F;
42     const MORE_DATA = 0xA0;
43     const SENDING_COMPLETE = 0xA1;
44
45     public $type;
46     public $length;
47     public $data;
48
49     /**
50      * Internal title of the parameter type
51      */
52     public $title;
53
54     public function __construct($type = null)
55     {
56         $this->type = $type;
57     }
58
59     public function setData($data)
60     {
61         $this->data = $data;
62     }
63
64     public function getTypeName()
65     {
66         $rc = new \ReflectionClass($this);
67         foreach ($rc->getConstants() as $name => $value) {
68             if ($value == $this->type) {
69                 return $name;
70             }
71         }
72         return '';
73     }
74
75 }
76
77 ?>