-
Notifications
You must be signed in to change notification settings - Fork 10
/
functions.inc.php
459 lines (405 loc) · 20.5 KB
/
functions.inc.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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
<?php /* $Id$ */
if (!defined('FREEPBX_IS_AUTH')) {
die('No direct script access allowed');
}
// License for all code of this FreePBX module can be found in the license file inside the module directory
// Copyright 2013 Schmooze Com Inc.
//
// The destinations this module provides
// returns a associative arrays with keys 'destination' and 'description'
function ringgroups_destinations() {
//get the list of ringgroups
$results = ringgroups_list();
// return an associative array with destination and description
if (isset($results)) {
foreach ($results as $result) {
$extens[] = [ 'destination' => 'ext-group,' . $result['grpnum'] . ',1', 'description' => $result['grpnum'] . ' ' . $result['description'] ];
}
}
if (isset($extens))
return $extens;
else
return null;
}
function ringgroups_getdest($exten) {
return [ "ext-group,$exten,1" ];
}
function ringgroups_getdestinfo($dest) {
if (str_starts_with(trim((string) $dest), 'ext-group,')) {
$grp = explode(',', (string) $dest);
$grp = $grp[1];
$thisgrp = ringgroups_get($grp);
if (empty($thisgrp)) {
return [];
}
else {
return [ 'description' => sprintf(_("Ring Group %s: "), $grp) . $thisgrp['description'], 'edit_url' => 'config.php?display=ringgroups&view=form&extdisplay=GRP-' . urlencode($grp) ];
}
}
else {
return false;
}
}
function ringgroups_recordings_usage($recording_id) {
$usage_arr = [];
global $active_modules;
$results = sql("SELECT `grpnum`, `description` FROM `ringgroups` WHERE `annmsg_id` = '$recording_id' OR `remotealert_id` = '$recording_id' OR `toolate_id` = '$recording_id'", "getAll", DB_FETCHMODE_ASSOC);
if (empty($results)) {
return [];
}
else {
//$type = isset($active_modules['ivr']['type'])?$active_modules['ivr']['type']:'setup';
foreach ($results as $result) {
$usage_arr[] = [ 'url_query' => 'config.php?display=ringgroups&view=form&extdisplay=GRP-' . urlencode((string) $result['grpnum']), 'description' => sprintf(_("Ring Group: %s"), $result['description']) ];
}
return $usage_arr;
}
}
/* Generates dialplan for ringgroups
We call this with retrieve_conf
*/
function ringgroups_get_config($engine) {
global $ext; // is this the best way to pass this?
global $amp_conf;
switch ($engine) {
case "asterisk":
$ext->addInclude('from-internal-additional', 'ext-group');
$ext->addInclude('from-internal-additional', 'grps');
$contextname = 'ext-group';
$ringlist = ringgroups_list(true);
if (is_array($ringlist)) {
foreach ($ringlist as $item) {
$grpnum = ltrim((string) $item['0']);
$grp = ringgroups_get($grpnum);
$ae = match ($grp['elsewhere']) {
'yes' => 'Q(ANSWERED_ELSEWHERE)',
'always' => 'c',
default => 'Q(NO_ANSWER)',
};
$strategy = $grp['strategy'];
$grptime = $grp['grptime'];
$grplist = $grp['grplist'];
$postdest = $grp['postdest'];
$grppre = ($grp['grppre'] ?? '');
$progress = ($grp['progress'] ?? 'yes');
$annmsg_id = ($grp['annmsg_id'] ?? '');
$alertinfo = $grp['alertinfo'];
$rvolume = $grp['rvolume'];
$needsconf = $grp['needsconf'];
$cwignore = $grp['cwignore'];
$cpickup = $grp['cpickup'];
$cfignore = $grp['cfignore'];
$remotealert_id = $grp['remotealert_id'];
$toolate_id = $grp['toolate_id'];
$ringing = $grp['ringing'];
$recording = $grp['recording'] == '' ? 'dontcare' : $grp['recording'];
// TODO: this looks potentially problematic given the new per-user DIAL_OPTIONS. Need to further
// evaluate/understand if there are implications. The issue may be that we are trying to
// avoid getting a 'polluted' version of the DIAL_OPTIONS in which case we may need to modify
// macro-user-callerid (where it is set) to preserve the version we should be using.
//
if ($ringing == 'Ring' || empty($ringing)) {
$dialopts = '${DIAL_OPTIONS}' . $ae;
}
elseif ($ringing == "inherit") {
$dialopts = 'm(${CHANNEL(musicclass)})${REPLACE(DIAL_OPTIONS,r' . $ae . ')}';
}
else {
$dialopts = 'm(' . $ringing . ')${REPLACE(DIAL_OPTIONS,r' . $ae . ')}';
}
if ($progress == 'yes') {
$ext->add($contextname, $grpnum, '', new ext_gotoif('$["${__RINGINGSENT}" = "TRUE"]', 'cid'));
if ($ringing == 'Ring' || empty($ringing)) {
$ext->add($contextname, $grpnum, '', new ext_playtones("ring"));
}
$ext->add($contextname, $grpnum, '', new ext_progress());
}
$ext->add($contextname, $grpnum, 'cid', new ext_macro('user-callerid'));
// block voicemail until phone is answered at which point a macro should be called on the answering
// line to clear this flag so that subsequent transfers can occur, if already set by a the caller
// then don't change.
//
$ext->add($contextname, $grpnum, '', new ext_macro('blkvm-setifempty'));
$ext->add($contextname, $grpnum, '', new ext_gotoif('$["${GOSUB_RETVAL}" = "TRUE"]', 'skipov'));
$ext->add($contextname, $grpnum, '', new ext_macro('blkvm-set', 'reset'));
$ext->add($contextname, $grpnum, '', new ext_setvar('__NODEST', ''));
// Remember if NODEST was set later, but clear it in case the call is answered so that subsequent
// transfers work.
//
$ext->add($contextname, $grpnum, 'skipov', new ext_setvar('RRNODEST', '${NODEST}'));
$ext->add($contextname, $grpnum, 'skipvmblk', new ext_setvar('__NODEST', '${EXTEN}'));
$ext->add($contextname, $grpnum, '', new ext_gosubif('$[${DB_EXISTS(RINGGROUP/' . $grpnum . '/changecid)} = 1 & "${DB(RINGGROUP/' . $grpnum . '/changecid)}" != "default" & "${DB(RINGGROUP/' . $grpnum . '/changecid)}" != ""]', 'sub-rgsetcid,s,1'));
// deal with group CID prefix
if ($grppre != '') {
$ext->add($contextname, $grpnum, '', new ext_macro('prepend-cid', $grppre));
}
// Set Alert_Info
if ($alertinfo != '') {
$ext->add($contextname, $grpnum, '', new ext_setvar('__ALERT_INFO', str_replace(';', '\;', (string) $alertinfo)));
}
if (!empty($rvolume)) {
$ext->add($contextname, $grpnum, '', new ext_setvar('__RVOL', $rvolume));
}
if ($cwignore != '') {
$ext->add($contextname, $grpnum, '', new ext_setvar('__CWIGNORE', 'TRUE'));
}
if ($cfignore != '') {
$ext->add($contextname, $grpnum, '', new ext_setvar('_CFIGNORE', 'TRUE'));
$ext->add($contextname, $grpnum, '', new ext_setvar('_FORWARD_CONTEXT', 'block-cf'));
}
if ($cpickup != '') {
$ext->add($contextname, $grpnum, '', new ext_set('__PICKUPMARK', '${EXTEN}'));
}
else {
//need to add **grpnum in context pickup to allow this
$pickupcont = 'app-pickup';
$fcc = new featurecode('core', 'pickup');
$fc_code = $fcc->getCodeActive();
$pickup_code = $fc_code . $grpnum;
$ext->add($pickupcont, $pickup_code, '', new ext_set('ALLOWEDMEM', $grplist));
$ext->add($pickupcont, $pickup_code, '', new ext_macro('user-callerid'));
$ext->add($pickupcont, $pickup_code, '', new ext_setvar('EXTENS', '${FIELDQTY(ALLOWEDMEM,-)}'));
$ext->add($pickupcont, $pickup_code, '', new ext_setvar('ITER', '1'));
$ext->add($pickupcont, $pickup_code, '', new ext_noop('$["${AMPUSER}" == "${CUT(ALLOWEDMEM,-,${ITER})}"]', 'pickup'));
$ext->add($pickupcont, $pickup_code, 'extloop', new ext_gotoif('$["${AMPUSER}" == "${CUT(ALLOWEDMEM,-,${ITER})}"]', 'pickup'));
$ext->add($pickupcont, $pickup_code, '', new ext_set('ITER', '$[${ITER}+1]'));
$ext->add($pickupcont, $pickup_code, '', new ext_gotoif('$["${ITER}" <= "${EXTENS}"]', 'extloop'));
$ext->add($pickupcont, $pickup_code, '', new ext_playback('im-sorry&access-denied'));
$ext->add($pickupcont, $pickup_code, '', new ext_hangup());
$ext->add($pickupcont, $pickup_code, 'pickup', new ext_setvar('PICKUP_EXTEN', '${AMPUSER}'));
$ext->add($pickupcont, $pickup_code, '', new ext_pickup('${EXTEN:2}&${EXTEN:2}@PICKUPMARK'));
$ext->add($pickupcont, $pickup_code, '', new ext_hangup());
}
// recording stuff
//$ext->add($contextname, $grpnum, '', new ext_setvar('RecordMethod','Group'));
//$ext->add($contextname, $grpnum, '', new ext_macro('record-enable',$grplist.',${RecordMethod}'));
//TODO: hardcoded needs to be configurable in the ringgroup
$ext->add($contextname, $grpnum, '', new ext_gosub('1', 's', 'sub-record-check', "rg,$grpnum,$recording"));
// group dial
$ext->add($contextname, $grpnum, '', new ext_setvar('RingGroupMethod', $strategy));
if ($annmsg_id) {
$annmsg = recordings_get_file($annmsg_id);
$ext->add($contextname, $grpnum, '', new ext_gotoif('$["foo${RRNODEST}" != "foo"]', 'DIALGRP'));
$ext->add($contextname, $grpnum, '', new ext_answer(''));
$ext->add($contextname, $grpnum, '', new ext_wait(1));
$ext->add($contextname, $grpnum, '', new ext_playback($annmsg));
}
//FREPBX-14945 Call Confirm Announcement under Virtual Queue module is broken.
if ($needsconf == "CHECKED") {
$ext->add($contextname, $grpnum, '', new ext_set('__RG_CONFIRM', 1));
}
//set the VQ varible to ALT_CONFIRM_MSG
$ext->add($contextname, $grpnum, '', new ext_set('__ALT_CONFIRM_MSG', '${IF($[${LEN(${VQ_CONFIRMMSG})}>1]?${IF($["${VQ_CONFIRMMSG}"!="0"]?${VQ_CONFIRMMSG}: )}:)}'));
$remotealert = recordings_get_file($remotealert_id);
$toolate = recordings_get_file($toolate_id);
$len = strlen($grpnum) + 4;
$ext->add("grps", "_RG-{$grpnum}-.", '', new ext_nocdr(''));
$ext->add("grps", "_RG-{$grpnum}-.", '', new ext_macro('dial', "$grptime,$dialopts" . "U(macro-confirm^{$remotealert}^{$toolate}^{$grpnum})" . ',${EXTEN:' . $len . '}'));
$ext->add($contextname, $grpnum, '', new ext_gotoif('$[$["${RG_CONFIRM}"="1"] | $[${LEN(${VQ_CONFIRMMSG})}>1]]', 'RGVQANNOUNCE', 'NORGVQANNOUNCE'));
$ext->add($contextname, $grpnum, 'RGVQANNOUNCE', new ext_macro('dial-confirm', "$grptime,$dialopts,$grplist,$grpnum"));
//FREEPBX-15547 ring groups - timeout with external number ignores call confirmation on second attempt
$ext->add($contextname, $grpnum, '', new ext_goto('gosubhere'));
$ext->add($contextname, $grpnum, 'NORGVQANNOUNCE', new ext_macro('dial', $grptime . ",$dialopts," . $grplist));
$ext->add($contextname, $grpnum, 'gosubhere', new ext_gosub('1', 's', 'sub-record-cancel'));
$ext->add($contextname, $grpnum, '', new ext_setvar('RingGroupMethod', ''));
// Now if we were told to skip the destination, do so now. Otherwise reset NODEST and proceed to our destination.
//
$ext->add($contextname, $grpnum, '', new ext_gotoif('$["foo${RRNODEST}" != "foo"]', 'nodest'));
if ($cwignore != '') {
$ext->add($contextname, $grpnum, '', new ext_setvar('__CWIGNORE', ''));
}
if ($cpickup != '') {
$ext->add($contextname, $grpnum, '', new ext_set('__PICKUPMARK', ''));
}
// TODO: Asterisk uses a blank FORWARD_CONTEXT as a literal at the time of this change. A better solution would be
// if it would ignore blank, since it is possible in a customcontext setup you would not want this set to
// from-internal
//
if ($cfignore != '') {
$ext->add($contextname, $grpnum, '', new ext_setvar('_CFIGNORE', ''));
$ext->add($contextname, $grpnum, '', new ext_setvar('_FORWARD_CONTEXT', 'from-internal'));
}
$ext->add($contextname, $grpnum, '', new ext_setvar('__NODEST', ''));
$ext->add($contextname, $grpnum, '', new ext_macro('blkvm-clr'));
// where next?
if (($postdest ?? '') != '') {
$ext->add($contextname, $grpnum, '', new ext_goto($postdest));
}
else {
$ext->add($contextname, $grpnum, '', new ext_hangup(''));
}
$ext->add($contextname, $grpnum, 'nodest', new ext_noop('SKIPPING DEST, CALL CAME FROM Q/RG: ${RRNODEST}'));
}
// We need to have a hangup here, if call is ended by the caller during Playback it will end in the
// h context and do a proper hangup and clean the blkvm keys if set, see #4671
$ext->add($contextname, 'h', '', new ext_macro('hangupcall'));
/*
ASTDB Settings:
RINGGROUP/nnn/changecid default | did | fixed | extern
RINGGROUP/nnn/fixedcid XXXXXXXX
changecid:
default - works as always, same as if not present
fixed - set to the fixedcid
extern - set to the fixedcid if the call is from the outside only
did - set to the DID that the call came in on or leave alone, treated as foreign
forcedid - set to the DID that the call came in on or leave alone, not treated as foreign
NODEST - has the exten num called, hoaky if that goes away but for now use it
*/
if (count($ringlist)) {
$contextname = 'sub-rgsetcid';
$exten = 's';
$ext->add($contextname, $exten, '', new ext_goto('1', 's-${DB(RINGGROUP/${NODEST}/changecid)}'));
$exten = 's-fixed';
$ext->add($contextname, $exten, '', new ext_execif('$["${REGEX("^[\+]?[0-9]+$" ${DB(RINGGROUP/${NODEST}/fixedcid)})}" = "1"]', 'Set', '__TRUNKCIDOVERRIDE=${DB(RINGGROUP/${NODEST}/fixedcid)}'));
$ext->add($contextname, $exten, '', new ext_return(''));
$exten = 's-extern';
$ext->add($contextname, $exten, '', new ext_execif('$["${REGEX("^[\+]?[0-9]+$" ${DB(RINGGROUP/${NODEST}/fixedcid)})}" == "1" & "${FROM_DID}" != ""]', 'Set', '__TRUNKCIDOVERRIDE=${DB(RINGGROUP/${NODEST}/fixedcid)}'));
$ext->add($contextname, $exten, '', new ext_return(''));
$exten = 's-did';
$ext->add($contextname, $exten, '', new ext_execif('$["${REGEX("^[\+]?[0-9]+$" ${FROM_DID})}" = "1"]', 'Set', '__REALCALLERIDNUM=${FROM_DID}'));
$ext->add($contextname, $exten, '', new ext_return(''));
$exten = 's-forcedid';
$ext->add($contextname, $exten, '', new ext_execif('$["${REGEX("^[\+]?[0-9]+$" ${FROM_DID})}" = "1"]', 'Set', '__TRUNKCIDOVERRIDE=${FROM_DID}'));
$ext->add($contextname, $exten, '', new ext_return(''));
$exten = '_s-.';
$ext->add($contextname, $exten, '', new ext_noop('Unknown value for RINGGROUP/${NODEST}/changecid of ${DB(RINGGROUP/${NODEST}/changecid)} set to "default"'));
$ext->add($contextname, $exten, '', new ext_setvar('DB(RINGGROUP/${NODEST}/changecid)', 'default'));
$ext->add($contextname, $exten, '', new ext_return(''));
}
}
break;
}
}
function ringgroups_add($grpnum = '', $strategy = '', $grptime = '', $grplist = '', $postdest = '', $desc = '', $grppre = '', $annmsg_id = '0', $alertinfo = '', $needsconf = '', $remotealert_id = '', $toolate_id = '', $ringing = '', $cwignore = '', $cfignore = '', $changecid = 'default', $fixedcid = '', $cpickup = '', $recording = 'dontcare', $progress = 'yes', $elsewhere = '', $rvolume = '') {
_ringgroups_backtrace();
return \FreePBX::Ringgroups()->add($grpnum, $strategy, $grptime, $grplist, $postdest, $desc, $grppre, $annmsg_id, $alertinfo, $needsconf, $remotealert_id, $toolate_id, $ringing, $cwignore, $cfignore, $changecid, $fixedcid, $cpickup, $recording, $progress, $elsewhere, $rvolume);
}
function ringgroups_del($grpnum) {
_ringgroups_backtrace();
return FreePBX::Ringgroups()->delete($grpnum);
}
function ringgroups_list($get_all = false) {
_ringgroups_backtrace();
return \FreePBX::Ringgroups()->listRinggroups($get_all);
}
function ringgroups_check_extensions($exten = true) {
$extenlist = [];
if (is_array($exten) && empty($exten)) {
return $extenlist;
}
$sql = "SELECT grpnum ,description FROM ringgroups ";
if (is_array($exten)) {
$sql .= "WHERE grpnum in ('" . implode("','", $exten) . "')";
}
$sql .= " ORDER BY CAST(grpnum AS UNSIGNED)";
$results = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
foreach ($results as $result) {
$thisexten = $result['grpnum'];
$extenlist[$thisexten]['description'] = sprintf(_("Ring Group: %s"), $result['description']);
$extenlist[$thisexten]['status'] = _('INUSE');
$extenlist[$thisexten]['edit_url'] = 'config.php?display=ringgroups&view=form&extdisplay=GRP-' . urlencode((string) $thisexten);
}
return $extenlist;
}
function ringgroups_check_destinations($dest = true) {
global $active_modules;
$destlist = [];
if (is_array($dest) && empty($dest)) {
return $destlist;
}
$sql = "SELECT grpnum, postdest, description FROM ringgroups ";
if ($dest !== true) {
$sql .= "WHERE postdest in ('" . implode("','", $dest) . "')";
}
$results = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
//$type = isset($active_modules['announcement']['type'])?$active_modules['announcement']['type']:'setup';
foreach ($results as $result) {
$thisdest = $result['postdest'];
$thisid = $result['grpnum'];
$destlist[] = [ 'dest' => $thisdest, 'description' => sprintf(_("Ring Group: %s (%s)"), $result['description'], $thisid), 'edit_url' => 'config.php?display=ringgroups&view=form&extdisplay=GRP-' . urlencode((string) $thisid) ];
}
return $destlist;
}
function ringgroups_change_destination($old_dest, $new_dest) {
$sql = 'UPDATE ringgroups SET postdest = "' . $new_dest . '" WHERE postdest = "' . $old_dest . '"';
sql($sql, "query");
}
function ringgroups_get($grpnum) {
return FreePBX::Ringgroups()->get($grpnum);
}
/* Get a list of all extensions that belongs to a ringgroup */
function ringgroups_get_extensions($grpnum) {
global $db;
$results = sql("SELECT grplist FROM ringgroups WHERE grpnum = '" . $db->escapeSimple($grpnum) . "'", "getRow", DB_FETCHMODE_ASSOC);
return $results;
}
/* Update the list of extensions for the specific ringgroup */
function ringgroups_update_extensions($grpnum, $extensions) {
global $db;
$sql = 'UPDATE ringgroups SET grplist = "' . $extensions . '" WHERE grpnum = "' . $grpnum . '"';
sql($sql, "query");
}
function ringgroups_hook_core($viewing_itemid, $request) {
// This is empty. Need to be here for the ringgroups_hookProcess_core function to work
}
function ringgroups_hookProcess_core($viewing_itemid, $request) {
if (!isset($request['action']))
return;
switch ($request['action']) {
case 'del':
// Get all ringgroups
$grouplist = ringgroups_list();
if (isset($grouplist)) {
foreach ($grouplist as $list => $group) {
// Get the extension list for the ringgroup
$extensionlist = ringgroups_get_extensions($group['grpnum']);
$extensions = explode('-', (string) $extensionlist['grplist']);
$key = array_search($viewing_itemid, $extensions);
if ($key !== FALSE) {
unset($extensions[$key]);
$new_grplist = implode('-', $extensions);
ringgroups_update_extensions($group['grpnum'], $new_grplist);
}
}
}
break;
}
}
global $amp_conf;
if (isset($amp_conf['EXTENSION_LIST_RINGGROUPS']) && $amp_conf['EXTENSION_LIST_RINGGROUPS']) {
function ringgroups_configpageinit($pagename) {
global $currentcomponent;
// On a 'new' user, 'tech_hardware' is set, and there's no extension.
if (isset($_REQUEST['display']) && ($_REQUEST['display'] == 'users' || $_REQUEST['display'] == 'extensions') && isset($_REQUEST['extdisplay']) && $_REQUEST['extdisplay'] != '') {
$currentcomponent->addprocessfunc('ringgroups_configpageload', 1);
}
}
// This is called before the page is actually displayed, so we can use addguielem(). draws hook on the extensions/users page
function ringgroups_configpageload() {
global $currentcomponent;
global $display;
$extdisplay = $_REQUEST['extdisplay'] ?? '';
if ($display == 'extensions' || $display == 'users') {
$section = _('Ring Group Membership');
$sql = "SELECT grpnum, description FROM ringgroups WHERE grplist LIKE '$extdisplay-%' OR grplist LIKE '%-$extdisplay-%' OR grplist LIKE '%-$extdisplay' OR grplist = '$extdisplay'";
$results = sql($sql, "getAll", DB_FETCHMODE_ASSOC);
$ringgroup_count = 0;
foreach ($results as $result) {
$addURL = '?display=ringgroups&view=form&extdisplay=' . $result['grpnum'];
$ringgroup_icon = 'images/email_edit.png';
$ringgroup_label = $result['grpnum'] . " " . $result['description'];
$ringgroup_label = ' <span>
<img width="16" height="16" border="0" title="' . $ringgroup_label . '" alt="" src="' . $ringgroup_icon . '"/> ' . $ringgroup_label .
'</span> ';
$currentcomponent->addguielem($section, new gui_link('ringgroup_' . $ringgroup_count++, $ringgroup_label, $addURL, true, false), 9);
}
}
}
} // only included if feature enabled
function _ringgroups_backtrace() {
$trace = debug_backtrace();
$function = $trace[1]['function'];
$line = $trace[1]['line'];
$file = $trace[1]['file'];
freepbx_log(FPBX_LOG_WARNING, 'Depreciated Function ' . $function . ' detected in ' . $file . ' on line ' . $line);
}