Fork of FusionPBX but with LDAP kinda working
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

122 lines
4.0 KiB

2 years ago
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <markjcrane@fusionpbx.com>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2019
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <markjcrane@fusionpbx.com>
  20. */
  21. //includes
  22. include "root.php";
  23. require_once "resources/require.php";
  24. require_once "resources/check_auth.php";
  25. //check permissions
  26. if (permission_exists('call_active_view')) {
  27. //access granted
  28. }
  29. else {
  30. echo "access denied";
  31. exit;
  32. }
  33. //add multi-lingual support
  34. $language = new text;
  35. $text = $language->get();
  36. //get the HTTP values and set as variables
  37. $show = trim($_REQUEST["show"]);
  38. if ($show != "all") { $show = ''; }
  39. //show the header
  40. $document['title'] = $text['title'];
  41. require_once "resources/header.php";
  42. //load gateways into a session variable
  43. $sql = "select gateway_uuid, domain_uuid, gateway from v_gateways where enabled = 'true' ";
  44. $database = new database;
  45. $gateways = $database->select($sql, $parameters, 'all');
  46. foreach ($gateways as $row) {
  47. $_SESSION['gateways'][$row['gateway_uuid']] = $row['gateway'];
  48. }
  49. //ajax for refresh
  50. ?>
  51. <script type="text/javascript">
  52. //define refresh function, initial start
  53. var refresh = 1980;
  54. var source_url = 'calls_active_inc.php?';
  55. var timer_id;
  56. <?php
  57. if ($show == 'all') {
  58. echo "source_url = source_url + '&show=all';";
  59. }
  60. if (isset($_REQUEST["debug"])) {
  61. echo "source_url = source_url + '&debug';";
  62. }
  63. ?>
  64. var ajax_get = function () {
  65. $.ajax({
  66. url: source_url, success: function(response){
  67. $("#ajax_reponse").html(response);
  68. }
  69. });
  70. timer_id = setTimeout(ajax_get, refresh);
  71. };
  72. refresh_start();
  73. //refresh controls
  74. function refresh_stop() {
  75. clearTimeout(timer_id);
  76. //document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_paused.png' style='width: 16px; height: 16px; border: none; margin-top: 1px; margin-right: 20px; cursor: pointer;' onclick='refresh_start();' alt=\"<?php echo $text['label-refresh_enable']?>\" title=\"<?php echo $text['label-refresh_enable']?>\">";
  77. document.getElementById('refresh_state').innerHTML = "<?php echo button::create(['type'=>'button','title'=>$text['label-refresh_pause'],'icon'=>'pause','onclick'=>'refresh_start()']); ?>";
  78. }
  79. function refresh_start() {
  80. //if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<img src='resources/images/refresh_active.gif' style='width: 16px; height: 16px; border: none; margin-top: 2px; margin-right: 20px; cursor: pointer;' alt=\"<?php echo $text['label-refresh_pause']?>\" title=\"<?php echo $text['label-refresh_pause']?>\">"; }
  81. if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "<?php echo button::create(['type'=>'button','title'=>$text['label-refresh_pause'],'icon'=>'sync-alt fa-spin','onclick'=>'refresh_stop()']); ?>"; }
  82. ajax_get();
  83. }
  84. </script>
  85. <?php
  86. echo "<div id='ajax_reponse'></div>\n";
  87. echo "<div id='time_stamp' style='visibility:hidden'>".date('Y-m-d-s')."</div>\n";
  88. echo "<br><br><br>";
  89. require_once "resources/footer.php";
  90. /*
  91. // deprecated functions for this page
  92. function get_park_cmd(uuid, context) {
  93. cmd = \"uuid_transfer \"+uuid+\" -bleg *6000 xml \"+context;
  94. return escape(cmd);
  95. }
  96. function get_record_cmd(uuid, prefix, name) {
  97. cmd = \"uuid_record \"+uuid+\" start ".$_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d")."/\"+uuid+\".wav\";
  98. return escape(cmd);
  99. }
  100. */
  101. ?>