read TEI and call reference
[auerswald-callnotifier.git] / src / callnotifier / EDSS1 / Message.php
1 <?php
2 namespace callnotifier;
3
4 class EDSS1_Message
5 {
6     const ALERTING = "\x01";
7     const CALL_PROCEEDING = "\x02";
8     const SETUP = "\x05";
9     const CONNECT = "\x07";
10     const SETUP_ACKNOWLEDGE = "\x0D";
11     const DISCONNECT = "\x45";
12     const RELEASE = "\x4D";
13     const RELEASE_COMPLETE = "\x5A";
14     const INFORMATION = "\x7B";
15
16     /**
17      * Message type, see the class constants
18      * @var integer
19      */
20     public $type;
21
22     /**
23      * Call reference number to distinguish concurrent calls
24      *
25      * @var integer
26      */
27     public $callRef;
28
29     /**
30      * Terminal Endpoint Identifier (internal Telephone ID)
31      *
32      * @var integer
33      */
34     public $tei;
35
36     /**
37      * Array of EDSS1_Parameter objects
38      *
39      * @var array
40      */
41     public $parameters = array();
42
43
44     public function getTypeName()
45     {
46         $rc = new \ReflectionClass($this);
47         foreach ($rc->getConstants() as $name => $value) {
48             if (ord($value) == $this->type) {
49                 return $name;
50             }
51         }
52         return '';
53     }
54 }
55
56 ?>