moving example scripts from agc to extras
git-svn-id: svn://192.168.202.10@1987 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
### SCRIPT_busy_button.php - logging of a button click
|
||||
#
|
||||
# To be inserted into a SCRIPT in VICIDIAL with the following code:
|
||||
#
|
||||
# <iframe src="/agc/SCRIPT_busy_button.php?lead_id=--A--lead_id--B--&list_id=--A--list_id--B--&user=--A--user--B--&campaign_id=--A--campaign_id--B--&phone_number=--A--phone_number--B--&vendor_id=--A--vendor_lead_code--B--" style="width:400;height:40;background-color:transparent;" scrolling="no" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="400" height="30" STYLE="z-index:17"> </iframe>
|
||||
#
|
||||
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
########## DB SCHEMA
|
||||
# CREATE TABLE qr_busy_button_log (
|
||||
# button_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
# lead_id INT(9) UNSIGNED,
|
||||
# event_time DATETIME,
|
||||
# user VARCHAR(20),
|
||||
# stage ENUM('DISPLAY','CLICK'),
|
||||
# campaign_id VARCHAR(8),
|
||||
# phone_number VARCHAR(18),
|
||||
# vendor_lead_code VARCHAR(20),
|
||||
# list_id BIGINT(14) UNSIGNED,
|
||||
# click_seconds INT(5) UNSIGNED,
|
||||
# index (lead_id)
|
||||
# );
|
||||
#
|
||||
# CHANGES:
|
||||
# 90408-0618 - First Build
|
||||
# 90508-0727 - Changed to PHP long tags
|
||||
# 130328-0026 - Converted ereg to preg functions
|
||||
#
|
||||
|
||||
if (isset($_GET["button_id"])) {$button_id=$_GET["button_id"];}
|
||||
elseif (isset($_POST["button_id"])) {$button_id=$_POST["button_id"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
|
||||
elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
|
||||
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
|
||||
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
||||
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
||||
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
|
||||
elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
|
||||
|
||||
### security strip all non-alphanumeric characters out of the variables ###
|
||||
$button_id=preg_replace("/[^0-9]/","",$button_id);
|
||||
$lead_id=preg_replace("/[^0-9]/","",$lead_id);
|
||||
$list_id=preg_replace("/[^0-9]/","",$list_id);
|
||||
$phone_number=preg_replace("/[^0-9]/","",$phone_number);
|
||||
$vendor_id = preg_replace("/[^- \:\/\_0-9a-zA-Z]/","",$vendor_id);
|
||||
$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
|
||||
$campaign = preg_replace("/[^-\_0-9a-zA-Z]/","",$campaign);
|
||||
$stage = preg_replace("/[^-\_0-9a-zA-Z]/","",$stage);
|
||||
$epoch = preg_replace("/[^0-9]/","",$epoch);
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
if (preg_match("/CLICK/i",$stage))
|
||||
{
|
||||
$epochNOW = date("U");
|
||||
$click_seconds = ($epochNOW - $epoch);
|
||||
if ( ($click_seconds < 0) or ($click_seconds > 3600) )
|
||||
{$click_seconds=0;}
|
||||
|
||||
$stmt="UPDATE qr_busy_button_log SET stage='$stage',click_seconds='$click_seconds' where button_id='$button_id';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "Thank you for clicking the button\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$CL=':';
|
||||
$script_name = getenv("SCRIPT_NAME");
|
||||
$server_name = getenv("SERVER_NAME");
|
||||
$server_port = getenv("SERVER_PORT");
|
||||
if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
|
||||
else {$HTTPprotocol = 'http://';}
|
||||
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
|
||||
else {$server_port = "$CL$server_port";}
|
||||
$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name";
|
||||
|
||||
$epoch = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
|
||||
$stmt="INSERT INTO qr_busy_button_log SET lead_id='$lead_id',list_id='$list_id',phone_number='$phone_number',vendor_lead_code='$vendor_id',user='$user',campaign_id='$campaign',stage='DISPLAY',event_time='$SQLdate';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$button_id = mysql_insert_id($link);
|
||||
|
||||
echo "<FORM NAME=button_form ID=button_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=button_id VALUE=\"$button_id\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=stage VALUE=\"CLICK\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=epoch VALUE=\"$epoch\">\n";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"PLEASE CLICK THIS TEST BUTTON\">\n";
|
||||
echo "</FORM>\n\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
# SCRIPT_multirecording.php - script page that stops/starts recordings being made over a forced-recording (ALLFORCE) call
|
||||
#
|
||||
# Copyright (C) 2012 Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
|
||||
# - works in conjunction with SCRIPT_multirecording_AJAX.php to allow reps the ability to make their own recordings over the course of a call while the entire call is being recorded into its own file, as in ALLFORCE recording.
|
||||
#
|
||||
# Implementation is done by creating a script in the Scripts section that calls this page within an <iframe> tag which passes several essential dialer variables to the page
|
||||
#
|
||||
# SAMPLE SCRIPT TEXT:
|
||||
# <iframe src="http://<your-domain.com>/agc/SCRIPT_multirecording.php?campaign=--A--campaign--B--&lead_id=--A--lead_id--B--&phone_number=--A--phone_number--B--&session_id=--A--session_id--B--&server_ip=--A--server_ip--B--&user=--A--user--B--&vendor_lead_code=--A--vendor_lead_code--B--&uniqueid=--A--uniqueid--B--" style="width:570;height:275;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="570" height="270"></iframe>
|
||||
#
|
||||
# All style parameters may be adjusted to suit your needs, but all variables listed in the above example MUST be passed to the VICI_multirecording.php page if this is implemented.
|
||||
# Variables are: campaign, lead_id, phone_number, session_id, server_ip, user, vendor_lead_code, uniqueid
|
||||
#
|
||||
# CHANGELOG
|
||||
# 120227-1512 - First Build
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
||||
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
|
||||
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
|
||||
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
|
||||
if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];}
|
||||
elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];}
|
||||
?>
|
||||
<html>
|
||||
<style type="text/css">
|
||||
input.red_btn{
|
||||
color:#FFFFFF;
|
||||
font-size:84%;
|
||||
font-weight:bold;
|
||||
background-color:#990000;
|
||||
border:2px solid;
|
||||
border-top-color:#FFCCCC;
|
||||
border-left-color:#FFCCCC;
|
||||
border-right-color:#660000;
|
||||
border-bottom-color:#660000;
|
||||
}
|
||||
|
||||
input.green_btn{
|
||||
color:#FFFFFF;
|
||||
font-size:84%;
|
||||
font-weight:bold;
|
||||
background-color:#009900;
|
||||
border:2px solid;
|
||||
border-top-color:#CCFFCC;
|
||||
border-left-color:#CCFFCC;
|
||||
border-right-color:#006600;
|
||||
border-bottom-color:#006600;
|
||||
}
|
||||
</style>
|
||||
<script language="Javascript">
|
||||
function RecordingAction(campaign, lead_id, phone_number, user, session_id, server_ip, vendor_lead_code, uniqueid, rec_action, recording_channel) {
|
||||
document.getElementById("recording_button_span").innerHTML = "<b><font color='red'><blink>Please wait...</blink></font></b>";
|
||||
var xmlhttp=false;
|
||||
/*@cc_on @*/
|
||||
/*@if (@_jscript_version >= 5)
|
||||
// JScript gives us Conditional compilation, we can cope with old IE versions.
|
||||
// and security blocked creation of the objects.
|
||||
try {
|
||||
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (E) {
|
||||
xmlhttp = false;
|
||||
}
|
||||
}
|
||||
@end @*/
|
||||
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
|
||||
{
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
}
|
||||
if (xmlhttp)
|
||||
{
|
||||
if (rec_action=="START")
|
||||
{
|
||||
recording_query = "&campaign=" + campaign + "&lead_id=" + lead_id + "&phone_number=" + phone_number + "&user=" + user + "&session_id=" + session_id + "&server_ip=" + server_ip + "&vendor_lead_code=" + vendor_lead_code + "&uniqueid=" + uniqueid + "&rec_action=" + rec_action;
|
||||
}
|
||||
else
|
||||
{
|
||||
recording_query = "&campaign=" + campaign + "&lead_id=" + lead_id + "&phone_number=" + phone_number + "&user=" + user + "&session_id=" + session_id + "&server_ip=" + server_ip + "&vendor_lead_code=" + vendor_lead_code + "&uniqueid=" + uniqueid + "&rec_action=" + rec_action + "&recording_channel=" + recording_channel;
|
||||
}
|
||||
xmlhttp.open('POST', 'SCRIPT_multirecording_AJAX.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
xmlhttp.send(recording_query);
|
||||
xmlhttp.onreadystatechange = function()
|
||||
{
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
|
||||
{
|
||||
recording_response = null;
|
||||
recording_response = xmlhttp.responseText;
|
||||
// alert(recording_query);
|
||||
// alert(xmlhttp.responseText);
|
||||
if (recording_response.length>0 && rec_action=="START")
|
||||
{
|
||||
var recording_response_array=recording_response.split("|");
|
||||
var recording_id=recording_response_array[0];
|
||||
var recording_channel=recording_response_array[1];
|
||||
document.getElementById("recording_button_span").innerHTML = "<input type=\"button\" class=\"red_btn\" value=\"STOP RECORDING\" onclick=\"RecordingAction(<?php echo "'$campaign', '$lead_id', '$phone_number', '$user', '$session_id', '$server_ip', '$vendor_lead_code', '$uniqueid'"; ?>, '"+recording_id+"', '"+recording_channel+"')\" />";
|
||||
}
|
||||
else if (recording_response=="HANGUP SUCCESSFUL")
|
||||
{
|
||||
document.getElementById("recording_button_span").innerHTML = "<input type=\"button\" class=\"green_btn\" onClick=\"RecordingAction(<?php echo "'$campaign', '$lead_id', '$phone_number', '$user', '$session_id', '$server_ip', '$vendor_lead_code', '$uniqueid'"; ?>, 'START')\" value=\"START RECORDING\">";
|
||||
}
|
||||
}
|
||||
}
|
||||
delete xmlhttp;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<form action="<?php echo $PHP_SELF; ?>" method="post" target="_self">
|
||||
<center>
|
||||
<!-- You may put script text here //-->
|
||||
<span id="recording_button_span">
|
||||
<input type="button" class="green_btn" onClick="RecordingAction(<?php echo "'$campaign', '$lead_id', '$phone_number', '$user', '$session_id', '$server_ip', '$vendor_lead_code', '$uniqueid'"; ?>, 'START')" value="START RECORDING">
|
||||
</span>
|
||||
<!-- You may also put script text here //-->
|
||||
</center>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
</iframe>
|
||||
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
# SCRIPT_multirecording_AJAX.php - script that stops/starts recordings being made over a forced-recording (ALLFORCE) call
|
||||
#
|
||||
# Copyright (C) 2013 Joe Johnson, Matt Florell <mattf@vicidial.com> LICENSE: AGPLv2
|
||||
#
|
||||
# Other scripts that this application depends on:
|
||||
# - SCRIPT_multirecording.php: Gives agents ability to stop and start recordings over a forced-recording (ALLFORCE) call
|
||||
#
|
||||
# CHANGELOG
|
||||
# 120224-2240 - First Build
|
||||
# 130328-0009 - Converted ereg to preg functions
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
||||
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
|
||||
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
|
||||
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
|
||||
if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];}
|
||||
elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];}
|
||||
if (isset($_GET["rec_action"])) {$rec_action=$_GET["rec_action"];}
|
||||
elseif (isset($_POST["rec_action"])) {$rec_action=$_POST["rec_action"];}
|
||||
if (isset($_GET["recording_channel"])) {$recording_channel=$_GET["recording_channel"];}
|
||||
elseif (isset($_POST["recording_channel"])) {$recording_channel=$_POST["recording_channel"];}
|
||||
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$NOWnum = date("YmdHis");
|
||||
$exten="8309";
|
||||
$ext_context="default";
|
||||
#if (eregi("^10.10.", $server_ip)) {$ext_context="demo";} else {$ext_content="default";}
|
||||
|
||||
$stmt="select campaign_rec_filename from vicidial_campaigns where campaign_id='$campaign'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_array($rslt);
|
||||
$filename=$row["campaign_rec_filename"];
|
||||
$filename=preg_replace("/CAMPAIGN/i", $campaign, $filename);
|
||||
$filename=preg_replace("/INGROUP/i", $campaign, $filename);
|
||||
$filename=preg_replace("/CUSTPHONE/i", $phone_number, $filename);
|
||||
$filename=preg_replace("/FULLDATE/i", date("Ymd-His"), $filename);
|
||||
$filename=preg_replace("/TINYDATE/i", (date("Y")-2000).date("mdHis"), $filename);
|
||||
$filename=preg_replace("/AGENT/i", $user, $filename);
|
||||
$filename=preg_replace("/EPOCH/i", $StarTtime, $filename);
|
||||
$filename=preg_replace("/VENDORLEADCODE/i", $vendor_lead_code, $filename);
|
||||
$filename=preg_replace("/LEADID/i", $lead_id, $filename);
|
||||
|
||||
$channel="Local/5".$session_id."@".$ext_context;
|
||||
$ext_priority=1;
|
||||
$one_mysql_log=0;
|
||||
$row=''; $rowx='';
|
||||
$channel_live=1;
|
||||
|
||||
if ($rec_action=="START")
|
||||
{
|
||||
|
||||
if ( (strlen($exten)<3) or (strlen($channel)<4) or (strlen($filename)<15)) {
|
||||
$channel_live=0;
|
||||
echo "ERROR 1";
|
||||
} else {
|
||||
######################## START RECORDING ##########################
|
||||
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\";";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$channel_SQL=" and channel not in (";
|
||||
while($row=mysql_fetch_array($rslt))
|
||||
{
|
||||
$channel_SQL.="'$row[channel]',";
|
||||
}
|
||||
$channel_SQL=substr($channel_SQL,0,-1);
|
||||
$channel_SQL.=")";
|
||||
|
||||
|
||||
|
||||
$VDvicidial_id='';
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$filename','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $filename','','','','','');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
$stmt = "INSERT INTO recording_log (channel,server_ip,extension,start_time,start_epoch,filename,lead_id,user) values('$channel','$server_ip','$exten','$NOW_TIME','$StarTtime','$filename','$lead_id','$user')";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$RLaffected_rows = mysql_affected_rows($link);
|
||||
if ($RLaffected_rows > 0) {
|
||||
usleep(2000000);
|
||||
$recording_id = mysql_insert_id($link);
|
||||
$current_rec_filename=$filename;
|
||||
$channel_stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$channel%\" and channel LIKE \"%,1\" $channel_SQL;";
|
||||
$channel_rslt=mysql_query($channel_stmt, $link);
|
||||
if (mysql_num_rows($channel_rslt)==1)
|
||||
{
|
||||
$channel_row=mysql_fetch_row($channel_rslt);
|
||||
echo "$recording_id|$channel_row[0]";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Error 2\n$channel_stmt\n".mysql_num_rows($channel_rslt);
|
||||
}
|
||||
} else {
|
||||
echo "Error 3";
|
||||
}
|
||||
|
||||
##### get call type from vicidial_live_agents table
|
||||
$VLA_inOUT='NONE';
|
||||
$stmt="SELECT comments FROM vicidial_live_agents where user='$user' order by last_update_time desc limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$VLA_inOUT_ct = mysql_num_rows($rslt);
|
||||
if ($VLA_inOUT_ct > 0) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VLA_inOUT = $row[0];
|
||||
}
|
||||
if ($VLA_inOUT == 'INBOUND') {
|
||||
$four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y")));
|
||||
|
||||
##### look for the vicidial ID in the vicidial_closer_log table
|
||||
$stmt="SELECT closecallid FROM vicidial_closer_log where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;";
|
||||
} else {
|
||||
##### look for the vicidial ID in the vicidial_log table
|
||||
$stmt="SELECT uniqueid FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id';";
|
||||
}
|
||||
/*
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$VM_mancall_ct = mysql_num_rows($rslt);
|
||||
if ($VM_mancall_ct > 0) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$VDvicidial_id = $row[0];
|
||||
$stmt = "UPDATE recording_log SET vicidial_id='$VDvicidial_id' where recording_id='$recording_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
############### STOP RECORDING ########
|
||||
$stmt="SELECT recording_id,start_epoch FROM recording_log where recording_id='$rec_action' and end_epoch is null";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rec_count = mysql_num_rows($rslt);
|
||||
if ($rec_count>0) {
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$recording_id = $row[0];
|
||||
$start_time = $row[1];
|
||||
$length_in_sec = ($StarTtime - $start_time);
|
||||
$length_in_min = ($length_in_sec / 60);
|
||||
$length_in_min = sprintf("%8.2f", $length_in_min);
|
||||
|
||||
$stmt = "UPDATE recording_log set end_time='$NOW_TIME',end_epoch='$StarTtime',length_in_sec=$length_in_sec,length_in_min='$length_in_min' where recording_id='$rec_action'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
}
|
||||
|
||||
# find and hang up the recording
|
||||
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$recording_channel%\" and channel LIKE \"%,1\";";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rec_count = mysql_num_rows($rslt);
|
||||
$h=0;
|
||||
while ($rec_count>$h) {
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$HUchannel[$h] = $rowx[0];
|
||||
$h++;
|
||||
}
|
||||
$i=0;
|
||||
while ($h>$i) {
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$i','Channel: $HUchannel[$i]','','','','','','','','','');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$i++;
|
||||
echo "HANGUP SUCCESSFUL";
|
||||
}
|
||||
|
||||
}
|
||||
######################################
|
||||
?>
|
||||
@@ -0,0 +1,113 @@
|
||||
<?php
|
||||
### SCRIPT_virido_crm_call.php - button to post to virido to initiate call in CRM
|
||||
#
|
||||
# To be inserted into a SCRIPT in VICIDIAL with the following code:
|
||||
#
|
||||
# <iframe src="/agc/SCRIPT_virido_crm_call.php?lead_id=--A--lead_id--B--&list_id=--A--list_id--B--&user=--A--user--B--&campaign_id=--A--campaign_id--B--&phone_number=--A--phone_number--B--&vendor_id=--A--vendor_lead_code--B--&user_custom_five=--A--user_custom_five--B--" style="width:600;height:400;background-color:transparent;" scrolling="no" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="600" height="400" STYLE="z-index:17"> </iframe>
|
||||
#
|
||||
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# CHANGES:
|
||||
# 120223-1156 - First Build
|
||||
# 130328-0014 - Converted ereg to preg functions
|
||||
#
|
||||
|
||||
if (isset($_GET["button_id"])) {$button_id=$_GET["button_id"];}
|
||||
elseif (isset($_POST["button_id"])) {$button_id=$_POST["button_id"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
|
||||
elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
|
||||
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
|
||||
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];}
|
||||
elseif (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];}
|
||||
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
||||
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
||||
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
|
||||
elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
|
||||
|
||||
### security strip all non-alphanumeric characters out of the variables ###
|
||||
$button_id=preg_replace("/[^0-9]/","",$button_id);
|
||||
$lead_id=preg_replace("/[^0-9]/","",$lead_id);
|
||||
$list_id=preg_replace("/[^0-9]/","",$list_id);
|
||||
$phone_number=preg_replace("/[^0-9]/","",$phone_number);
|
||||
$vendor_id = preg_replace("/[^- \:\/\_0-9a-zA-Z]/","",$vendor_id);
|
||||
$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
|
||||
$campaign = preg_replace("/[^-\_0-9a-zA-Z]/","",$campaign);
|
||||
$stage = preg_replace("/[^-\_0-9a-zA-Z]/","",$stage);
|
||||
$epoch = preg_replace("/[^0-9]/","",$epoch);
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
if (preg_match("/CLICK/i",$stage))
|
||||
{
|
||||
$epochNOW = date("U");
|
||||
$click_seconds = ($epochNOW - $epoch);
|
||||
if ( ($click_seconds < 0) or ($click_seconds > 3600) )
|
||||
{$click_seconds=0;}
|
||||
|
||||
$stmt="UPDATE qr_busy_button_log SET stage='$stage',click_seconds='$click_seconds' where button_id='$button_id';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "Thank you for clicking the button\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$CL=':';
|
||||
$script_name = getenv("SCRIPT_NAME");
|
||||
$server_name = getenv("SERVER_NAME");
|
||||
$server_port = getenv("SERVER_PORT");
|
||||
if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
|
||||
else {$HTTPprotocol = 'http://';}
|
||||
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
|
||||
else {$server_port = "$CL$server_port";}
|
||||
$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name";
|
||||
|
||||
$epoch = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
|
||||
# $stmt="INSERT INTO qr_busy_button_log SET lead_id='$lead_id',list_id='$list_id',phone_number='$phone_number',vendor_lead_code='$vendor_id',user='$user',campaign_id='$campaign',stage='DISPLAY',event_time='$SQLdate';";
|
||||
# if ($DB) {echo "|$stmt|\n";}
|
||||
# $rslt=mysql_query($stmt, $link);
|
||||
# $button_id = mysql_insert_id($link);
|
||||
|
||||
|
||||
# Client_Code: XYZ (Default)
|
||||
# Vendor_Code: ABC (Default)
|
||||
# Campaign_Code: XX12 (Default)
|
||||
# BTN: Outbound Dialed Phone number as specified in the lead file (This number will be used to identify the record from the lead file)
|
||||
# User_Name: This is the Agent Id of the CSR which are used in the daily files sent to us for import. These Ids will also be used by the agent to log into the scripting application
|
||||
|
||||
$virido_url = 'http://iconnect1.intellicomsoftware.com/script/dialercall.aspx';
|
||||
|
||||
echo "<B>Client_Code: </B>XYZ<BR>\n";
|
||||
echo "<B>Vendor_Code: </B>ABC<BR>\n";
|
||||
echo "<B>Campaign_Code: </B>XX12<BR>\n";
|
||||
echo "<B>User_Name: </B>$user_custom_five<BR>\n";
|
||||
echo "<B>BTN: </B>$phone_number<BR>\n";
|
||||
echo "<BR>\n";
|
||||
|
||||
echo "<FORM NAME=button_form ID=button_form ACTION=\"$virido_url\" METHOD=POST>\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=Client_Code VALUE=\"XYZ\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=Vendor_Code VALUE=\"ABC\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=Campaign_Code VALUE=\"XX12\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=User_Name VALUE=\"$user_custom_five\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=BTN VALUE=\"$phone_number\">\n";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"Initiate Phone Call\">\n";
|
||||
echo "</FORM>\n\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,296 @@
|
||||
<?php
|
||||
# vdc_call_url_test.php
|
||||
#
|
||||
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed display and log the start_call_url and dispo_call_url
|
||||
# queries if activated
|
||||
#
|
||||
# CHANGELOG:
|
||||
# 100103-1317 - First build of script
|
||||
# 100113-2023 - Added dispo_name
|
||||
# 130328-0023 - Converted ereg to preg functions
|
||||
#
|
||||
|
||||
$version = '2.6-3';
|
||||
$build = '130328-0023';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
$query_string = getenv("QUERY_STRING");
|
||||
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
|
||||
elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
|
||||
$vendor_lead_code = $vendor_id;
|
||||
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
|
||||
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
|
||||
if (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];}
|
||||
elseif (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];}
|
||||
if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];}
|
||||
elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["title"])) {$title=$_GET["title"];}
|
||||
elseif (isset($_POST["title"])) {$title=$_POST["title"];}
|
||||
if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];}
|
||||
elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];}
|
||||
if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];}
|
||||
elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];}
|
||||
if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];}
|
||||
elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];}
|
||||
if (isset($_GET["address1"])) {$address1=$_GET["address1"];}
|
||||
elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];}
|
||||
if (isset($_GET["address2"])) {$address2=$_GET["address2"];}
|
||||
elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];}
|
||||
if (isset($_GET["address3"])) {$address3=$_GET["address3"];}
|
||||
elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];}
|
||||
if (isset($_GET["city"])) {$city=$_GET["city"];}
|
||||
elseif (isset($_POST["city"])) {$city=$_POST["city"];}
|
||||
if (isset($_GET["state"])) {$state=$_GET["state"];}
|
||||
elseif (isset($_POST["state"])) {$state=$_POST["state"];}
|
||||
if (isset($_GET["province"])) {$province=$_GET["province"];}
|
||||
elseif (isset($_POST["province"])) {$province=$_POST["province"];}
|
||||
if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];}
|
||||
elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];}
|
||||
if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];}
|
||||
elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];}
|
||||
if (isset($_GET["gender"])) {$gender=$_GET["gender"];}
|
||||
elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];}
|
||||
if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];}
|
||||
elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];}
|
||||
if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];}
|
||||
elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];}
|
||||
if (isset($_GET["email"])) {$email=$_GET["email"];}
|
||||
elseif (isset($_POST["email"])) {$email=$_POST["email"];}
|
||||
if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];}
|
||||
elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];}
|
||||
if (isset($_GET["comments"])) {$comments=$_GET["comments"];}
|
||||
elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
|
||||
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
|
||||
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
||||
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
||||
if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];}
|
||||
elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];}
|
||||
if (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];}
|
||||
elseif (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];}
|
||||
if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];}
|
||||
elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];}
|
||||
if (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];}
|
||||
elseif (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];}
|
||||
if (isset($_GET["closer"])) {$closer=$_GET["closer"];}
|
||||
elseif (isset($_POST["closer"])) {$closer=$_POST["closer"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||
if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];}
|
||||
elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];}
|
||||
if (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];}
|
||||
elseif (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];}
|
||||
if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
|
||||
elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
|
||||
if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];}
|
||||
elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];}
|
||||
if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];}
|
||||
elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];}
|
||||
if (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];}
|
||||
elseif (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];}
|
||||
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
|
||||
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
|
||||
if (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];}
|
||||
elseif (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];}
|
||||
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
|
||||
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
|
||||
if (isset($_GET["phone"])) {$phone=$_GET["phone"];}
|
||||
elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];}
|
||||
if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];}
|
||||
elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];}
|
||||
if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];}
|
||||
elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];}
|
||||
if (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];}
|
||||
elseif (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];}
|
||||
if (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];}
|
||||
elseif (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];}
|
||||
if (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];}
|
||||
elseif (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];}
|
||||
if (isset($_GET["rank"])) {$rank=$_GET["rank"];}
|
||||
elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];}
|
||||
if (isset($_GET["owner"])) {$owner=$_GET["owner"];}
|
||||
elseif (isset($_POST["owner"])) {$owner=$_POST["owner"];}
|
||||
if (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];}
|
||||
elseif (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];}
|
||||
if (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];}
|
||||
elseif (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];}
|
||||
if (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];}
|
||||
elseif (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];}
|
||||
if (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];}
|
||||
elseif (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];}
|
||||
if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];}
|
||||
elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];}
|
||||
if (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];}
|
||||
elseif (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];}
|
||||
if (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];}
|
||||
elseif (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];}
|
||||
if (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];}
|
||||
elseif (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];}
|
||||
if (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];}
|
||||
elseif (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];}
|
||||
if (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];}
|
||||
elseif (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];}
|
||||
if (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];}
|
||||
elseif (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];}
|
||||
if (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];}
|
||||
elseif (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];}
|
||||
if (isset($_GET["talk_time"])) {$talk_time=$_GET["talk_time"];}
|
||||
elseif (isset($_POST["talk_time"])) {$talk_time=$_POST["talk_time"];}
|
||||
if (isset($_GET["talk_time_min"])) {$talk_time_min=$_GET["talk_time_min"];}
|
||||
elseif (isset($_POST["talk_time_min"])) {$talk_time_min=$_POST["talk_time_min"];}
|
||||
if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];}
|
||||
elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];}
|
||||
if (isset($_GET["dispo_name"])) {$dispo_name=$_GET["dispo_name"];}
|
||||
elseif (isset($_POST["dispo_name"])) {$dispo_name=$_POST["dispo_name"];}
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
|
||||
header ("Pragma: no-cache"); // HTTP/1.0
|
||||
|
||||
$txt = '.txt';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$CIDdate = date("mdHis");
|
||||
$ENTRYdate = date("YmdHis");
|
||||
$MT[0]='';
|
||||
$agents='@agents';
|
||||
|
||||
$IFRAME=0;
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
if ($qm_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$timeclock_end_of_day = $row[1];
|
||||
$agentonly_callback_campaign_lock = $row[2];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
|
||||
$pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass);
|
||||
$length_in_sec = preg_replace("/[^0-9]/","",$length_in_sec);
|
||||
$phone_code = preg_replace("/[^0-9]/","",$phone_code);
|
||||
$phone_number = preg_replace("/[^0-9]/","",$phone_number);
|
||||
}
|
||||
else
|
||||
{
|
||||
$user = preg_replace("/\'|\"|\\\\|;/","",$user);
|
||||
$pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
|
||||
}
|
||||
|
||||
|
||||
# default optional vars if not set
|
||||
if (!isset($format)) {$format="text";}
|
||||
if ($format == 'debug') {$DB=1;}
|
||||
if (!isset($ACTION)) {$ACTION="refresh";}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
if ($format=='debug')
|
||||
{
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSION: $version BUILD: $build USER: $user server_ip: $server_ip-->\n";
|
||||
echo "<title>VICIDiaL Script Display Script";
|
||||
echo "</title>\n";
|
||||
echo "</head>\n";
|
||||
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
}
|
||||
|
||||
$output = '';
|
||||
$output .= "$lead_id|";
|
||||
$output .= "$vendor_id|";
|
||||
$output .= "$vendor_lead_code|";
|
||||
$output .= "$list_id|";
|
||||
$output .= "$gmt_offset_now|";
|
||||
$output .= "$phone_code|";
|
||||
$output .= "$phone_number|";
|
||||
$output .= "$title|";
|
||||
$output .= "$first_name|";
|
||||
$output .= "$middle_initial|";
|
||||
$output .= "$last_name|";
|
||||
$output .= "$address1|";
|
||||
$output .= "$address2|";
|
||||
$output .= "$address3|";
|
||||
$output .= "$city|";
|
||||
$output .= "$state|";
|
||||
$output .= "$province|";
|
||||
$output .= "$postal_code|";
|
||||
$output .= "$country_code|";
|
||||
$output .= "$gender|";
|
||||
$output .= "$date_of_birth|";
|
||||
$output .= "$alt_phone|";
|
||||
$output .= "$email|";
|
||||
$output .= "$security_phrase|";
|
||||
$output .= "$comments|";
|
||||
$output .= "$user|";
|
||||
$output .= "$pass|";
|
||||
$output .= "$campaign|";
|
||||
$output .= "$phone_login|";
|
||||
$output .= "$original_phone_login|";
|
||||
$output .= "$phone_pass|";
|
||||
$output .= "$fronter|";
|
||||
$output .= "$closer|";
|
||||
$output .= "$group|";
|
||||
$output .= "$channel_group|";
|
||||
$output .= "$SQLdate|";
|
||||
$output .= "$epoch|";
|
||||
$output .= "$uniqueid|";
|
||||
$output .= "$customer_zap_channel|";
|
||||
$output .= "$customer_server_ip|";
|
||||
$output .= "$server_ip|";
|
||||
$output .= "$SIPexten|";
|
||||
$output .= "$session_id|";
|
||||
$output .= "$phone|";
|
||||
$output .= "$parked_by|";
|
||||
$output .= "$dispo|";
|
||||
$output .= "$dialed_number|";
|
||||
$output .= "$dialed_label|";
|
||||
$output .= "$source_id|";
|
||||
$output .= "$rank|";
|
||||
$output .= "$owner|";
|
||||
$output .= "$camp_script|";
|
||||
$output .= "$in_script|";
|
||||
$output .= "$script_width|";
|
||||
$output .= "$script_height|";
|
||||
$output .= "$fullname|";
|
||||
$output .= "$recording_filename|";
|
||||
$output .= "$recording_id|";
|
||||
$output .= "$user_custom_one|";
|
||||
$output .= "$user_custom_two|";
|
||||
$output .= "$user_custom_three|";
|
||||
$output .= "$user_custom_four|";
|
||||
$output .= "$user_custom_five|";
|
||||
$output .= "$talk_time|";
|
||||
$output .= "$talk_time_min|";
|
||||
$output .= "$agent_log_id|";
|
||||
$output .= "$dispo_name|";
|
||||
|
||||
echo "$output\n$query_string\n";
|
||||
|
||||
$fp = fopen ("./call_url_log.txt", "a");
|
||||
fwrite ($fp, "$output|$query_string\n");
|
||||
fclose($fp);
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user