$result = $db->executeMultiple($compiled, $aa); if (DB::IsError($result)) { die($result->getMessage() . '<br>context=' . $context); } $ivr_num_options = $_REQUEST['ivr_num_options']; for ($i = 0; $i < $ivr_num_options; $i++) { $extension = $_REQUEST['ivr_option' . $i]; if ($extension == 't') { $sql = "DELETE FROM extensions WHERE context = '" . $context . "' AND extension = 't'"; $result = $db->query($sql); if (DB::IsError($result)) { die('oops: ' . $delres->getMessage()); } } $goto = $_REQUEST['goto' . $i]; setGoto($extension, $context, '1', $goto, $i); } exec($wScript); if (!is_dir('/var/lib/asterisk/sounds/custom')) { if (!mkdir('/var/lib/asterisk/sounds/custom', 0775)) { echo 'could not create /var/lib/asterisk/sounds/custom'; } } if (!copy('/var/lib/asterisk/sounds/' . $_REQUEST['cidnum'] . 'ivrrecording.wav', '/var/lib/asterisk/sounds/custom/' . $context . '.wav')) { echo 'error: could not copy or rename the voice recording - please contact support'; } needreload(); break; } if (!isset($_REQUEST['map_display']) || $_REQUEST['map_display'] != 'no') { include 'ivrmap.php';
function addgroup($account, $grplist, $grpstrategy, $grptime, $grppre, $goto, $callerannounce, $alertinfo, $ringing, $description) { global $db; $devices = group_list(); if (is_array($devices)) { foreach ($devices as $device) { if ($device[0] === $account) { echo "<script>javascript:alert('" . _("This RingGroup [") . $device[0] . "] is already in use" . "');</script>"; return false; } } } if ($ringing == 'Ring' || empty($ringing)) { $ringing = '${DIAL_OPTIONS}'; } else { // We need the DIAL_OPTIONS variable $sops = sql("SELECT value from globals where variable='DIAL_OPTIONS'", "getRow"); $ringing = "m(" . $ringing . ")" . str_replace('r', '', $sops[0]); } $addarray = array('ext-group', $account, '1', 'Macro', 'rg-group,' . $grpstrategy . ',' . $grptime . ',' . $grppre . ',' . $grplist . ',' . $callerannounce . ',' . $alertinfo . ',' . $ringing, '' . $description . '', '0'); addextensions($addarray); setGoto($account, 'ext-group', '2', $goto, 0); return true; }