forked from goautodial/ce-v3-www
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
root
authored and
root
committed
Feb 26, 2014
0 parents
commit 0e2fa9e
Showing
7,613 changed files
with
2,359,899 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> 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"; | ||
} | ||
|
||
?> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <[email protected]> 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> |
Oops, something went wrong.