1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* Copyright 2014 Brian Smith <[email protected]>. |
5
|
|
|
* |
6
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
7
|
|
|
* you may not use this file except in compliance with the License. |
8
|
|
|
* You may obtain a copy of the License at |
9
|
|
|
* |
10
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0 |
11
|
|
|
* |
12
|
|
|
* Unless required by applicable law or agreed to in writing, software |
13
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
14
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
15
|
|
|
* See the License for the specific language governing permissions and |
16
|
|
|
* limitations under the License. |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
namespace phparia\Resources; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Info about Asterisk configuration |
23
|
|
|
* |
24
|
|
|
* @author Brian Smith <[email protected]> |
25
|
|
|
*/ |
26
|
|
|
class ConfigInfo extends Response |
27
|
|
|
{ |
28
|
|
|
/** |
29
|
|
|
* @var string Default language for media playback. |
30
|
|
|
*/ |
31
|
|
|
private $default_language; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var int (optional) - Maximum number of simultaneous channels. |
35
|
|
|
*/ |
36
|
|
|
private $max_channels; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var float (optional) - Maximum load avg on system. |
40
|
|
|
*/ |
41
|
|
|
private $max_load; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var int (optional) - Maximum number of open file handles (files, sockets). |
45
|
|
|
*/ |
46
|
|
|
private $max_open_files; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @var string Asterisk system name. |
50
|
|
|
*/ |
51
|
|
|
private $name; |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @var SetId Effective user/group id for running Asterisk. |
55
|
|
|
*/ |
56
|
|
|
private $setid; |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* @return string Default language for media playback. |
60
|
|
|
*/ |
61
|
|
|
public function getDefaultLanguage() |
62
|
|
|
{ |
63
|
|
|
return $this->default_language; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return int (optional) - Maximum number of simultaneous channels. |
68
|
|
|
*/ |
69
|
|
|
public function getMaxChannels() |
70
|
|
|
{ |
71
|
|
|
return $this->max_channels; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @return float (optional) - Maximum load avg on system. |
76
|
|
|
*/ |
77
|
|
|
public function getMaxLoad() |
78
|
|
|
{ |
79
|
|
|
return $this->max_load; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return int (optional) - Maximum number of open file handles (files, sockets). |
84
|
|
|
*/ |
85
|
|
|
public function getMaxOpenFiles() |
86
|
|
|
{ |
87
|
|
|
return $this->max_open_files; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return string Asterisk system name. |
92
|
|
|
*/ |
93
|
|
|
public function getName() |
94
|
|
|
{ |
95
|
|
|
return $this->name; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return SetId Effective user/group id for running Asterisk. |
100
|
|
|
*/ |
101
|
|
|
public function getSetid() |
102
|
|
|
{ |
103
|
|
|
return $this->setid; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @param string $response |
108
|
|
|
*/ |
109
|
|
|
public function __construct($response) |
110
|
|
|
{ |
111
|
|
|
parent::__construct($response); |
112
|
|
|
|
113
|
|
|
$this->default_language = $this->getResponseValue('default_language'); |
114
|
|
|
$this->max_channels = $this->getResponseValue('max_channels'); |
115
|
|
|
$this->max_load = $this->getResponseValue('max_load'); |
116
|
|
|
$this->max_open_files =$this->getResponseValue('max_open_files'); |
117
|
|
|
$this->name = $this->getResponseValue('name'); |
118
|
|
|
$this->setid = $this->getResponseValue('setid', '\phparia\Resources\SetId'); |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
} |
122
|
|
|
|