forked from Cynjut/SCCP_Manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.sccp_keyset.php
269 lines (251 loc) · 9.94 KB
/
page.sccp_keyset.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<?php
//if (!defined('FREEPBX_IS_AUTH')) { die('No direct script access allowed'); }
/** SCCP MANAGER Module for FreePBX 2.5 or later.
* Copyright 2015 David Burgess, Cynjut Consulting Services, LLC
* Copyright 2012 Javier de la Fuente, GT-TOIP CSIC
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
//global $astman;
$version = sccp_get_asterisk_version();
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$name = isset($_REQUEST['name']) ? $_REQUEST['name'] : 'softkeyset';
$keysetData = isset($_REQUEST['keysetData']) ? $_REQUEST['keysetData'] : '';
$keysetData['file_context'] = $name;
?>
<div class="rnav">
<ul>
<li><a href="config.php?display=sccp_keyset&name=setup">Add New Keyset</a></li>
<li><a href="config.php?display=sccp_keyset&name=default">default keyset</a></li>
<?php
$keysets = sccp_list_keysets();
foreach ($keysets as $row => $value) {
echo "<li><a href=config.php?display=sccp_keyset&name=" . "$row" . ">" . "$row" . "</a></li>";
}
?>
</ul>
</div>
<div class="content">
<?php
if ($action == 'edit') {
echo "<h2> Edit SCCP Soft Keyset</h2>";
$keysetData = sccp_edit_keyset($keysetData);
// needreload();
// redirect_standard();
} else {
echo "<h2> View SCCP Soft Keyset</h2>";
}
$confData = sccp_get_confData('server');
$keysetData = sccp_get_keysetdata($name);
$name = strtolower($name);
$keysetData['name'] = strtolower($keysetData['name']);
if ($keysetData['name'] == 'default') {
$keysetData['name'] = $name;
}
?>
<form name="edit_sccp_keyset" action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<input type="hidden" name="action" value="edit" >
<input type="hidden" name="type" value="softkeyset" >
<table>
<tr><td colspan="5"><h5><br><br><br>Keyset Configuration<hr></h5></td></tr>
<tr>
<td> </td>
<td><a href="#" class="info">Keyset Name:<span>This is the name of the keyset. The 'default' keyset is read-only, so you will not be able to update the default keyset.</span></a></td>
<td><input size="12" type="text" name="keysetData[name]" id='name' value="<?php echo $keysetData['name'] ?>" maxlength="12" ></td>
</tr>
<tr>
<td></td>
<td><h5><a href="#" class="info">Call Phase<span>This is the name of the phase of the call. Different phases have different soft button configurations.</span></a><hr></h5></td>
<td colspan=3><h5><a href="#" class="info">Options<span>These are the options for each phase. Select as many or as few as you want. For example, if you've globally disabled Call Forward, setting soft buttons that interact with that could be confusing.</span></a><hr></h5></td>
<tr>
<td></td>
<td><a href="#" class="info">Onhook:<span>Displayed when we are on hook the name of the keyset in question.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'onhook','redial');
echo sccp_display_keyset($keysetData,'onhook','newcall');
echo sccp_display_keyset($keysetData,'onhook','cfwdall');
echo sccp_display_keyset($keysetData,'onhook','dnd');
echo sccp_display_keyset($keysetData,'onhook','pickup');
echo sccp_display_keyset($keysetData,'onhook','gpickup');
echo sccp_display_keyset($keysetData,'onhook','private');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">Connected:<span>Displayed when we have a connected call.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'connected','hold');
echo sccp_display_keyset($keysetData,'connected','endcall');
echo sccp_display_keyset($keysetData,'connected','park');
echo sccp_display_keyset($keysetData,'connected','select');
echo sccp_display_keyset($keysetData,'connected','cfwdall');
echo sccp_display_keyset($keysetData,'connected','cfwdbusy');
echo sccp_display_keyset($keysetData,'connected','idivert');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">On Hold:<span>Displayed when we have a call on hold.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'onhold','resume');
echo sccp_display_keyset($keysetData,'onhold','newcall');
echo sccp_display_keyset($keysetData,'onhold','endcall');
echo sccp_display_keyset($keysetData,'onhold','transfer');
echo sccp_display_keyset($keysetData,'onhold','confrn');
echo sccp_display_keyset($keysetData,'onhold','select');
echo sccp_display_keyset($keysetData,'onhold','dirtrfr');
echo sccp_display_keyset($keysetData,'onhold','idivert');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">Ringin:<span>Displayed when we have an incoming call.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'ringin','answer');
echo sccp_display_keyset($keysetData,'ringin','endcall');
echo sccp_display_keyset($keysetData,'ringin','transvm');
echo sccp_display_keyset($keysetData,'ringin','idivert');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">Offhook:<span>Displayed when the phone is taken off hook.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'offhook','redial');
echo sccp_display_keyset($keysetData,'offhook','endcall');
echo sccp_display_keyset($keysetData,'offhook','private');
echo sccp_display_keyset($keysetData,'offhook','cfwdall');
echo sccp_display_keyset($keysetData,'offhook','cfwdbusy');
echo sccp_display_keyset($keysetData,'offhook','pickup');
echo sccp_display_keyset($keysetData,'offhook','gpickup');
echo sccp_display_keyset($keysetData,'offhook','meetme');
echo sccp_display_keyset($keysetData,'offhook','barge');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">Conntrans:<span>Displayed when we are connected and could transfer a call.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'conntrans','hold');
echo sccp_display_keyset($keysetData,'conntrans','endcall');
echo sccp_display_keyset($keysetData,'conntrans','transfer');
echo sccp_display_keyset($keysetData,'conntrans','conf');
echo sccp_display_keyset($keysetData,'conntrans','park');
echo sccp_display_keyset($keysetData,'conntrans','select');
echo sccp_display_keyset($keysetData,'conntrans','dirtrfr');
echo sccp_display_keyset($keysetData,'conntrans','meetme');
echo sccp_display_keyset($keysetData,'conntrans','cfwdall');
echo sccp_display_keyset($keysetData,'conntrans','cfwdbusy');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">Digitsfoll:<span>Displayed when one or more digits have been entered, more are expected.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'digitsfoll','back');
echo sccp_display_keyset($keysetData,'digitsfoll','endcall');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info"> Connconf:<span>Displayed when we are in a conference.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'connconf','conflist');
echo sccp_display_keyset($keysetData,'connconf','endcall');
echo sccp_display_keyset($keysetData,'connconf','join');
echo sccp_display_keyset($keysetData,'connconf','hold');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">Ringout:<span>Displayed when we are calling someone.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'ringout','endcall');
echo sccp_display_keyset($keysetData,'ringout','transfer');
echo sccp_display_keyset($keysetData,'ringout','cfwdall');
echo sccp_display_keyset($keysetData,'ringout','idivert');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">Offhookfeat:<span>Displayed wenn we went offhook using a feature.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'offhookfeat','redial');
echo sccp_display_keyset($keysetData,'offhookfeat','endcall');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">Onhint:<span>Displayed when a hint is activated.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'onhint','redial');
echo sccp_display_keyset($keysetData,'onhint','newcall');
echo sccp_display_keyset($keysetData,'onhint','pickup');
echo sccp_display_keyset($keysetData,'onhint','gpickup');
echo sccp_display_keyset($keysetData,'onhint','barge');
?>
</td>
</tr>
<tr>
<td></td>
<td><a href="#" class="info">Onstealable:<span>Displayed when there is a call we could steal on one of the neighboring phones.</span></a></td>
<td>
<?php
echo sccp_display_keyset($keysetData,'onstealable','redial');
echo sccp_display_keyset($keysetData,'onstealable','newcall');
echo sccp_display_keyset($keysetData,'onstealable','cfwdall');
echo sccp_display_keyset($keysetData,'onstealable','pickup');
echo sccp_display_keyset($keysetData,'onstealable','gpickup');
echo sccp_display_keyset($keysetData,'onstealable','dnd');
echo sccp_display_keyset($keysetData,'onstealable','intrcpt');
?>
</td>
</tr>
<?php
if ($keysetData['name'] == 'default') {
echo "<!--";
}
?>
<tr>
<td></td>
<td> </td>
<td colspan="4"><br /><input name="Submit" type="submit" value="Submit Changes">
</td>
</tr>
<?php
if ($keysetData['name'] == 'default') {
echo "-->";
}
?>
</table>
</form>
<?php echo add_free_space(7); ?>
</div>