<?php require_once 'preload.inc'; $Json = array(); $Json['Extensions'] = MustacheReformatExtensions(getExtensions()); $Json['NoExtensionErrorMessage'] = getNoExtensionErrorMessage(); $Json['RingGroups'] = getRingGroups(); $Json['Queues'] = getQueues(); $Json['DeletedExtensions'] = getDeletedExtensions(); $Json['License'] = $fonb->getTotalUsersAllowed(); echo json_encode($Json);
header("access-control-allow-origin: *"); include_once 'api/api.php'; global $conn, $body, $joined, $api; session_start(); if (isset($_REQUEST['Body'])) { $body = $_REQUEST['Body']; $token = strtok($body, " "); if (strtolower($token) == 'join') { $token = strtok(" "); $user = new User(intval($token)); $user->setTel($_REQUEST['From']); $joined = addUserDB($conn, $user); } } ?> <Response> <Message> <?php if (empty($joined)) { echo "Hello, Welcome to Deeque! Please select a Queue: \n"; $queues = getQueues($conn); foreach ($queues as $queue) { echo $queue->id . " --> " . $queue->name . "\n"; } } else { echo "You joined : " . $joined['queue'] . ". You are number: " . $joined['position'] . ". Now serving: " . $joined['serving']; } ?> </Message> </Response>
<?php require_once 'preload.inc'; $data = getExtensions() + getRingGroups() + getQueues() + getDeletedExtensions(); // Save the file $data = removeNonIntSections($data); $data = removeEmptyPasswords($data); prepareContext(); //print_r($data);exit; $fonb->write_users($data); // Exit with a seccess exit(DONE);