Update click_to_call.php

This commit is contained in:
FusionPBX 2018-06-10 21:31:45 -06:00 committed by GitHub
parent b1674362d3
commit fff7b78ab3
1 changed files with 155 additions and 134 deletions

View File

@ -1,7 +1,7 @@
<?php
/* $Id$ */
/*
call.php
click_to_call.php
Copyright (C) 2008, 2018 Mark J Crane
All rights reserved.
@ -28,8 +28,8 @@
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
James Rose <james.o.rose@gmail.com>
*/
//includes
include "root.php";
require_once "resources/require.php";
@ -51,6 +51,7 @@
//include the header
require_once "resources/header.php";
//send the call
if (is_array($_REQUEST) && !empty($_REQUEST['src']) && !empty($_REQUEST['dest'])) {
//retrieve submitted variables
$src = check_str($_REQUEST['src']);
@ -104,7 +105,27 @@ if (is_array($_REQUEST) && !empty($_REQUEST['src']) && !empty($_REQUEST['dest'])
//add record path and name
if ($rec == "true") {
$record_path = $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/archive/".date("Y")."/".date("M")."/".date("d");
$record_name = $origination_uuid.".wav";
if (isset($_SESSION['recordings']['extension']['text'])) {
$record_extension = $_SESSION['recordings']['extension']['text'];
}
else {
$record_extension = 'wav';
}
if (isset($_SESSION['recordings']['template']['text'])) {
//${year}${month}${day}-${caller_id_number}-${caller_destination}-${uuid}.${record_extension}
$record_name = $_SESSION['recordings']['template']['text'];
$record_name = str_replace('${year}', date("Y"), $record_name);
$record_name = str_replace('${month}', date("M"), $record_name);
$record_name = str_replace('${day}', date("d"), $record_name);
$record_name = str_replace('${caller_id_name}', $src_cid_name, $record_name);
$record_name = str_replace('${caller_id_number}', $src_cid_number, $record_name);
$record_name = str_replace('${caller_destination}', $dest, $record_name);
$record_name = str_replace('${uuid}', $origination_uuid, $record_name);
$record_name = str_replace('${record_extension}', $record_extension, $record_name);
}
else {
$record_name = $origination_uuid.'.'.$record_extension;
}
}
//determine call direction