48 |
49 | help)) {
54 | $child->help = 'Help is not available.';
55 | $child->meta_help = '1';
56 | }
57 | echo "";
58 | switch ($child['type']) {
59 | case 'IE':
60 | \FreePbx::sccp_manager()->formcreate->addElementIE($child, $fvalues, $sccp_defaults,$npref);
61 | break;
62 | case 'IED':
63 | \FreePbx::sccp_manager()->formcreate->addElementIED($child, $fvalues, $sccp_defaults,$npref, $napref);
64 | break;
65 | case 'ISC':
66 | // This is a special case for Provision mode. Set some parameters here and fall through to IS.
67 | $disabledButtons = array('pro' => 'Provision');
68 | if ($sccp_defaults['tftp_rewrite']['data'] == 'pro') {
69 | $disabledButtons = array('off' => 'Off');
70 | }
71 | case 'IS':
72 | \FreePbx::sccp_manager()->formcreate->addElementIS($child, $fvalues, $sccp_defaults,$npref, $disabledButtons);
73 | break;
74 | case 'SLD':
75 | case 'SLM':
76 | case 'SLK':
77 | case 'SLP':
78 | case 'SLS':
79 | case 'SLTD':
80 | case 'SLTN':
81 | case 'SLA':
82 | case 'SLZ':
83 | case 'SL':
84 | \FreePbx::sccp_manager()->formcreate->addElementSL($child, $fvalues, $sccp_defaults,$npref, $installedLangs);
85 | break;
86 | case 'SLDA':
87 | case 'SLNA':
88 | \FreePbx::sccp_manager()->formcreate->addElementSLNA($child, $fvalues, $sccp_defaults,$npref, $installedLangs);
89 | break;
90 | case 'SDM':
91 | case 'SDMS':
92 | case 'SDML':
93 | case 'SDMF':
94 | case 'SDE':
95 | case 'SDD':
96 | \FreePbx::sccp_manager()->formcreate->addElementSD($child, $fvalues, $sccp_defaults,$npref);
97 | break;
98 | case 'ITED':
99 | \FreePbx::sccp_manager()->formcreate->addElementITED($child, $fvalues, $sccp_defaults, $npref, $napref);
100 | break;
101 | case 'HLP':
102 | \FreePbx::sccp_manager()->formcreate->addElementHLP($child, $fvalues, $sccp_defaults,$npref);
103 | break;
104 | case 'SLTZN':
105 | \FreePbx::sccp_manager()->formcreate->addElementSLTZN($child, $fvalues, $sccp_defaults,$npref);
106 | break;
107 | }
108 | echo "";
109 | }
110 | if ($h_show==1) {
111 | echo '
';
112 | }
113 | ?>
114 |
--------------------------------------------------------------------------------
/views/form.dptemplate.php:
--------------------------------------------------------------------------------
1 | getDialPlan('dialplan');
10 | //print_r($list_data);
11 | //$dialFelds = array('match','timeout','line','rewrite','tone');
12 | //$dialFelds = array('match','timeout','User','rewrite','tone');
13 | $dialFelds = array('match','timeout','rewrite','tone');
14 | $dev_id = '*new*';
15 | if (!empty($_REQUEST['extdisplay'])) {
16 | $dev_id = $_REQUEST['extdisplay'];
17 | }
18 | if ($dev_id != '*new*') {
19 | $list_data= $this->getDialPlan($dev_id);
20 | $data_s= '';
21 | foreach ($list_data['template'] as $key => $value) {
22 | foreach ($dialFelds as $fld) {
23 | if (isset($value[$fld])) {
24 | $data_s .=(string)$value[$fld];
25 | }
26 | $data_s .= '/';
27 | }
28 | $data_s = substr($data_s, 0, -1);
29 | $data_s .= ';';
30 | }
31 | $data_s = substr($data_s, 0, -1);
32 | $def_val['dialtemplate'] = array("keyword" => 'dialtemplate', "data" => $data_s, "seq" => "99");
33 | }
34 |
35 | ?>
36 |
37 |
38 |
84 |
85 |
86 |
90 |
91 |
94 |
95 |
106 |
107 |
108 | Max length 15 letters or numbers without spaces
109 |
110 |
111 |
112 |
113 |
114 | $value) {
117 | if ($i == 0) {
118 | echo '- ';
119 | } else {
120 | echo '
- ';
121 | }
122 | echo ''._($key);
123 | echo '
';
124 | $i ++;
125 | }
126 | ?>
127 |
128 |
129 | $value) {
132 | if ($i == 0) {
133 | echo '
';
134 | } else {
135 | echo '
';
136 | }
137 | echo '
';
151 | echo ''._($keynamearray[$key]['help']).'';
152 | echo '
';
153 | $i ++;
154 | }
155 | ?>
156 |
157 |
158 |
159 |
163 |
164 |
165 |
166 |
167 |
177 |
--------------------------------------------------------------------------------
/views/server.info.php:
--------------------------------------------------------------------------------
1 | FreePBX->Core->getAllDriversInfo();
13 | $core = $this->aminterface->getSCCPVersion();
14 | $ast_realtime = $this->aminterface->getRealTimeStatus();
15 |
16 | //$ast_realm = (empty($ast_realtime['sccp']) ? '' : 'sccp');
17 |
18 | // if there are multiple connections, this will only return the first.
19 | foreach ($ast_realtime as $key => $value) {
20 | if (empty($ast_realm)) {
21 | if ($value['status'] === 'OK') {
22 | $ast_realm = $key;
23 | }
24 | }
25 | }
26 |
27 | $conf_realtime = $this->extconfigs->validate_RealTime($ast_realm);
28 | $db_Schema = $this->dbinterface->validate();
29 | $mysql_info = $this->dbinterface->get_db_sysvalues();
30 | $compatible = $this->aminterface->get_compatible_sccp();
31 | $info = array();
32 |
33 | //$info['srvinterface'] = $this->srvinterface->info();
34 | $moduleXml = simplexml_load_file("{$amp_conf['AMPWEBROOT']}/admin/modules/sccp_manager/module.xml");
35 | $info['extconfigs'] = $this->extconfigs->info();
36 | $info['dbinterface'] = $this->dbinterface->info();
37 | $info['aminterface'] = $this->aminterface->info();
38 | $info['XML'] = $this->xmlinterface->info();
39 | $info['sccp_class'] = $driver['sccp'];
40 | $info['Core_sccp'] = array('Version' => $core['Version'],
41 | 'about' => "Sccp ver: {$core['Version']} r{$core['vCode']} Revision: {$core['RevisionNum']} Hash: {$core['RevisionHash']}");
42 | $capabilityArray = array( "park", "pickup", "realtime", "video", "conference", "dirtrfr", "feature_monitor", "functions", "manager_events",
43 | "devicestate", "devstate_feature", "dynamic_speeddial", "dynamic_speeddial_cid", "experimental", "debug");
44 |
45 | $info['chan-sccp build info'] = array('Version' => $core['Version'], 'about' => 'Following options NOT built: ' . implode('; ',array_diff($capabilityArray, $core['buildInfo'])));
46 | $info['Asterisk'] = array('Version' => FreePBX::Config()->get('ASTVERSION'), 'about' => 'Asterisk.');
47 |
48 | if (!empty($this->sccpvalues['SccpDBmodel'])) {
49 | $info['DB Model'] = array('Version' => $this->sccpvalues['SccpDBmodel']['data'], 'about' => 'SCCP DB Configure');
50 | }
51 |
52 | exec('in.tftpd -V', $tftpInfo);
53 | $info['TFTP Server'] = array('Version' => 'Not Found', 'about' => 'Mapping not available');
54 |
55 | if (isset($tftpInfo[0])) {
56 | $tftpInfo = explode(',',$tftpInfo[0]);
57 | $info['TFTP Server'] = array('Version' => $tftpInfo[0], 'about' => 'Mapping not available');
58 | $tftpInfo[1] = trim($tftpInfo[1]);
59 | if ($tftpInfo[1] == 'with remap') {
60 | $info['TFTP Server'] = array('Version' => $tftpInfo[0], 'about' => $tftpInfo[1]);
61 | }
62 | }
63 |
64 | if (!empty($this->sccpvalues['tftp_rewrite']['data'])) {
65 | switch ($this->sccpvalues['tftp_rewrite']['data']) {
66 | case 'custom':
67 | case 'pro':
68 | $info['Provision_SCCP'] = array('Version' => 'base', 'about' => 'Provision Sccp enabled');
69 | break;
70 | default:
71 | if ($tftpInfo[1] == 'with remap') {
72 | $info['TFTP_Mapping'] = array('Version' => 'off', 'about' => "TFTP mapping is available but the mapping file is not included in tftpd-hpa default settings.
73 | To enable Provision mode, add option
74 | -m /etc/asterisk/sccpManagerRewrite.rules
75 | to the tftpd defaults, (location dependant on the system), and restart the tftpd server");
76 |
77 | } else {
78 | $info['TFTP_Mapping'] = array('Version' => 'off', 'about' => "Mapping capability is not built into the TFTP server. To enable Provision, upgrade the TFTP server.");
79 | }
80 | break;
81 | }
82 | }
83 |
84 | // Finished testing tftp server options
85 | $info['Сompatible'] = array('Version' => $compatible, 'about' => 'Ok');
86 | if (!empty($this->sccpvalues['SccpDBmodel'])) {
87 | if ($compatible > $this->sccpvalues['SccpDBmodel']['data']) {
88 | $info['Сompatible']['about'] = '
Reinstall SCCP manager required
';
89 | }
90 | }
91 | if ($db_Schema == 0) {
92 | $info['DB_Schema'] = array('Version' => 'Error', 'about' => '
ERROR DB Version
');
93 | } else {
94 | $info['DB_Schema'] = array('Version' => $db_Schema, 'about' => (($compatible == $db_Schema ) ? 'Ok' : 'Incompatible Version'));
95 | }
96 |
97 | if (empty($ast_realtime)) {
98 | $info['RealTime'] = array('Version' => 'Error', 'about' => '
No RealTime connections found
');
99 | } else {
100 | $rt_info = '';
101 | $rt_sccp = 'Failed';
102 | foreach ($ast_realtime as $key => $value) {
103 | if ($key == $ast_realm) {
104 | if ($value['status'] == 'OK') {
105 | $rt_sccp = 'TEST OK';
106 | $rt_info .= '
Using SCCP connection found to database: '.$value['realm'] . ' with connector: ['. $key .']
';
107 | } else {
108 | $rt_sccp = 'SCCP ERROR';
109 | $rt_info .= '
Error : ' . $value['message'] . '
';
110 | }
111 | } elseif ($value['status'] == 'ERROR') {
112 | $rt_info .= '
No connector found for [' . $key . '] : ' . $value['message'] . '
';
113 | } elseif ($value['status'] == 'OK') {
114 | $rt_info .= '
Alternative connector found to database '.$value['realm'] . ' with connector: ['. $key . ']
';
115 | }
116 | }
117 | $info['RealTime'] = array('Version' => $rt_sccp, 'about' => $rt_info);
118 | }
119 | // There are potential issues with string Type Declarations in PHP 5.
120 | $info['PHP'] = array('Version' => phpversion(), 'about' => version_compare(phpversion(), '7.0.0', '>' ) ? 'OK' : 'PHP 7 Preferred - Please upgrade if possible');
121 | $mariaDbInfo = exec('mysql -V');
122 | $info['MariaDb'] = array('Version' => explode(" ",$mariaDbInfo)[3], 'about' => $mariaDbInfo);
123 |
124 | if (empty($conf_realtime)) {
125 | $info['ConfigsRealTime'] = array('Version' => 'Error', 'about' => '
Realtime configuration was not found
');
126 | } else {
127 | $rt_info = '';
128 | foreach ($conf_realtime as $key => $value) {
129 | if (($value != 'OK') && ($key != 'extconfigfile')) {
130 | $rt_info .= '
Found error in section ' . $key . ' :' . $value . '
';
131 | }
132 | }
133 | if (!empty($rt_info)) {
134 | $info['ConfigsRealTime'] = array('Version' => 'Error', 'about' => $rt_info);
135 | }
136 | }
137 | // $mysql_info
138 | if ($mysql_info['Value'] <= '2000') {
139 | $this->info_warning['MySql'] = array('Increase Mysql Group Concat Max. Length', 'Step 1: Go to mysql path
nano /etc/my.cnf',
140 | 'Step 2: And add the following line below [mysqld] as shown below
[mysqld]
group_concat_max_len = 4096 or more',
141 | 'Step 3: Save and restart
systemctl restart mariadb.service
Or
service mysqld restart');
142 | }
143 |
144 |
145 | // Check Time Zone compatibility
146 | $conf_tz = $this->sccpvalues['ntp_timezone']['data'];
147 | $cisco_tz = $this->extconfigs->getExtConfig('sccp_timezone', $conf_tz);
148 | if ($cisco_tz['offset'] == 0) {
149 | if (!empty($conf_tz)) {
150 | $tmp_dt = new DateTime(null, new DateTimeZone($conf_tz));
151 | $tmp_ofset = $tmp_dt->getOffset();
152 | if (($cisco_tz['offset'] != ($tmp_ofset / 60) )) {
153 | $this->info_warning['NTP'] = array('The selected NTP time zone is not supported by cisco devices.', 'We will use the Greenwich Time zone');
154 | }
155 | }
156 | }
157 |
158 | if (!empty($this->info_warning)) {
159 | ?>
160 |
161 |
162 |
163 |
Sccp Manager Warning
164 |
165 |
There are Warning in the SCCP Module:
166 | info_warning as $key => $value) {
168 | echo '' . $key . '
';
169 | if (is_array($value)) {
170 | echo '' . _(implode('', $value)) . '';
171 | } else {
172 | echo '
' . _($value) . '';
173 | }
174 | echo '
';
175 | }
176 | ?>
177 |
178 |
Check these problems before continuing to work.
179 |
180 |
181 |
182 |
183 |
184 | class_error)) {
188 | ?>
189 |
190 |
191 |
192 |
Diagnostic information about SCCP Manager errors
193 |
194 |
There is an error in the :
195 | class_error); ?>
196 |
197 |
Correct these problems before continuing to work.
198 |
Open 'SCCP Connectivity' -> Server Config' to change global settings
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
Sccp Manager vversion); ?> Info
209 |
210 |
211 |
212 |
213 | | Module |
214 | Version |
215 | Info |
216 |
217 |
218 |
219 | $value) {
221 | echo '| ' . $key . ' | ' . $value['Version'] . ' | ' . $value['about'] . ' |
';
222 | }
223 | ?>
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 | showGroup('sccp_info', 0); ?>
233 |
--------------------------------------------------------------------------------