Operator Panel: Updates for PHP 8.1

This commit is contained in:
fusionate
2023-06-08 19:32:39 +00:00
parent 1b3af9fb36
commit 4ac06a9194
5 changed files with 38 additions and 27 deletions

View File

@@ -2,7 +2,7 @@
/* $Id$ */
/*
v_exec.php
Copyright (C) 2008-2019 Mark J Crane
Copyright (C) 2008-2023 Mark J Crane
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -55,10 +55,10 @@
//process the requests
if (count($_GET) > 0) {
//set the variables
$switch_cmd = trim($_GET["cmd"]);
$action = trim($_GET["action"]);
$data = trim($_GET["data"]);
$direction = trim($_GET["direction"]);
$switch_cmd = trim($_GET["cmd"] ?? '');
$action = trim($_GET["action"] ?? '');
$data = trim($_GET["data"] ?? '');
$direction = trim($_GET["direction"] ?? '');
//setup the event socket connection
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
@@ -73,14 +73,17 @@ if (count($_GET) > 0) {
$source = preg_replace($num_pattern,'',$_GET['source']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
$api_cmd = 'bgapi originate {sip_auto_answer=true,origination_caller_id_number=' . $source . ',sip_h_Call-Info=_undef_}user/' . $source . '@' . $_SESSION['domain_name'] . ' ' . $destination . ' XML ' . trim($_SESSION['user_context']);
} elseif ($switch_cmd == 'uuid_record') {
}
else if ($switch_cmd == 'uuid_record') {
$uuid = preg_replace($uuid_pattern,'',$_GET['uuid']);
$api_cmd = 'uuid_record ' . $uuid . ' start ' . $_SESSION['switch']['recordings']['dir'] . '/' . $_SESSION['domain_name'] . '/archive/' . date('Y/M/d') . '/' . $uuid . '.wav';
} elseif ($switch_cmd == 'uuid_transfer') {
}
else if ($switch_cmd == 'uuid_transfer') {
$uuid = preg_replace($uuid_pattern,'',$_GET['uuid']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
$api_cmd = 'uuid_transfer ' . $uuid . ' ' . $destination . ' XML ' . trim($_SESSION['user_context']);
} elseif ($switch_cmd == 'uuid_eavesdrop') {
}
else if ($switch_cmd == 'uuid_eavesdrop') {
$chan_uuid = preg_replace($uuid_pattern,'',$_GET['chan_uuid']);
$ext = preg_replace($num_pattern,'',$_GET['ext']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
@@ -89,10 +92,12 @@ if (count($_GET) > 0) {
$text = $language->get();
$api_cmd = 'bgapi originate {origination_caller_id_name=' . $text['label-eavesdrop'] . ',origination_caller_id_number=' . $ext . '}user/' . $destination . '@' . $_SESSION['domain_name'] . ' &eavesdrop(' . $chan_uuid . ')';
} elseif ($switch_cmd == 'uuid_kill') {
}
else if ($switch_cmd == 'uuid_kill') {
$call_id = preg_replace($uuid_pattern,'',$_GET['call_id']);
$api_cmd = 'uuid_kill ' . $call_id;
} else {
}
else {
echo 'access denied';
return;
}
@@ -124,4 +129,4 @@ if (count($_GET) > 0) {
}
}
?>
?>