Update calls_exec.php

Minor updates
This commit is contained in:
FusionPBX 2024-04-02 10:34:20 -06:00 committed by GitHub
parent 92f5f4abe4
commit 71bc204417
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 8 deletions

View File

@ -58,8 +58,8 @@
exit;
}
$calls = [];
//verify submitted call uuids
$calls = [];
if (is_array($_POST['calls']) && @sizeof($_POST['calls']) != 0) {
foreach ($_POST['calls'] as $call) {
if ($call['checked'] == 'true' && is_uuid($call['uuid'])) {
@ -79,7 +79,7 @@
//execute hangup command
if ($esl->is_connected()) foreach ($calls as $call_uuid) {
event_socket::async("uuid_kill $call_uuid");
event_socket::async("uuid_kill ".$call_uuid);
}
//set message
@ -95,13 +95,13 @@
else if ($_REQUEST['action'] == 'eavesdrop' && permission_exists('call_active_eavesdrop')) {
$uuid_pattern = '/[^-A-Fa-f0-9]/';
$num_pattern = '/[^-A-Za-z0-9()*#]/';
$number_pattern = '/[^-A-Za-z0-9()*#]/';
$chan_uuid = preg_replace($uuid_pattern,'',$_GET['chan_uuid']);
$ext = preg_replace($num_pattern,'',$_GET['ext']);
$destination = preg_replace($num_pattern,'',$_GET['destination']);
$channnel_uuid = preg_replace($uuid_pattern,'',$_GET['chan_uuid']);
$extension = preg_replace($number_pattern,'',$_GET['ext']);
$destination = preg_replace($number_pattern,'',$_GET['destination']);
$api_cmd = 'bgapi originate {origination_caller_id_name='.$text['label-eavesdrop'].',origination_caller_id_number='.$ext.'}user/'.$destination.'@'.$_SESSION['domain_name'].' &eavesdrop('.$chan_uuid.')';
$api_cmd = 'bgapi originate {origination_caller_id_name='.$text['label-eavesdrop'].',origination_caller_id_number='.$extension.'}user/'.$destination.'@'.$_SESSION['domain_name'].' &eavesdrop('.$channnel_uuid.')';
//run the command
$switch_result = event_socket::api($api_cmd);
@ -112,4 +112,4 @@
exit;
}
?>
?>