3d22a8206594b0ed14c5e1cf3e920791cfcf1d25
[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      * @var integer
18      */
19     public $type;
20     public $parameters = array();
21
22
23     public function getTypeName()
24     {
25         $rc = new \ReflectionClass($this);
26         foreach ($rc->getConstants() as $name => $value) {
27             if (ord($value) == $this->type) {
28                 return $name;
29             }
30         }
31         return '';
32     }
33 }
34
35 ?>