fix copied error message
[auerswald-callnotifier.git] / src / callnotifier / EDSS1 / Message.php
1 <?php
2 namespace callnotifier;
3
4 class EDSS1_Message
5 {
6     const ALERTING = 0x01;
7     const CALL_PROCEEDING = 0x02;
8     const SETUP = 0x05;
9     const CONNECT = 0x07;
10     const SETUP_ACKNOWLEDGE = 0x0D;
11     const DISCONNECT = 0x45;
12     const RELEASE = 0x4D;
13     const RELEASE_COMPLETE = 0x5A;
14     const FACILITY = 0x62;
15     const INFORMATION = 0x7B;
16
17     /**
18      * Message type, see the class constants
19      * @var integer
20      */
21     public $type;
22
23     /**
24      * Call reference number to distinguish concurrent calls
25      *
26      * @var integer
27      */
28     public $callRef;
29
30     /**
31      * If the message is from the call originating device, or the
32      * other side.
33      *
34      * - 0 = device that originated the call
35      * - 1 = device that answers to orignator requests
36      *
37      * @var integer
38      */
39     public $callRefType;
40
41     /**
42      * Service AccessPoint Identifier
43      *
44      * @var integer
45      */
46     public $sapi;
47
48     /**
49      * Call/Response bit
50      *
51      * Is 1 when the message contains a command to the TE or
52      * the answer to a command from the TE.
53      *
54      * 0 when it it is a request from the TE to the network,
55      * or the answer to a TE request.
56      *
57      * @var integer
58      */
59     public $callResponse;
60
61     /**
62      * Terminal Endpoint Identifier (internal Telephone ID)
63      * TEI=127 means broadcast
64      *
65      * @var integer
66      */
67     public $tei;
68
69     /**
70      * Type of the block
71      * 0 - information block
72      * 1 - control block
73      * @var integer
74      */
75     public $blockType;
76
77     /**
78      * Array of EDSS1_Parameter objects
79      *
80      * @var array
81      */
82     public $parameters = array();
83
84
85     public function getTypeName()
86     {
87         $rc = new \ReflectionClass($this);
88         foreach ($rc->getConstants() as $name => $value) {
89             if ($value == $this->type) {
90                 return $name;
91             }
92         }
93         return '';
94     }
95 }
96
97 ?>