Added CRM Login Popup to campaign settings to allow for a custom window to be opened on agent login, optionally using agent and campaign variables

Added 5 custom fields to the user settings
Added st* functions to agent api

git-svn-id: svn://192.168.202.10@1276 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-12-13 01:03:54 +00:00
parent d42daae737
commit c3aae778e0
10 changed files with 621 additions and 113 deletions
+5
View File
@@ -330,6 +330,11 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
77. Added "Delete Voicemail After Email" options to delete messages on the
server after they have been emailed
78. Added CRM Login Popup to campaign settings to allow for a custom window to
be opened on agent login, optionally using agent and campaign variables
79. Added 5 custom fields to the user settings
+74 -10
View File
@@ -1,4 +1,4 @@
AGENT API DOCUMENT 2008-07-03
AGENT API DOCUMENT Started: 2008-07-03
This document describes the functions of an API(Application Programming Interface)
for the VICIDIAL Agent screen. This functionality will be rather limited at first
@@ -16,6 +16,9 @@ external_status - sends command to set the disposition for one specific agent an
external_pause - sends command to pause/resume an agent now if not on a call, or pause after their next call if on call
external_dial - sends command to manually dial a number on the agent's screen
change_ingroups - changes the selected in-groups for a logged-in agent
st_login_log - looks up the vicidial_users.custom_three field and logs event from CRM
st_get_agent_active_lead - looks up active lead info for an agent and outputs lead information
New scripts:
@@ -29,14 +32,6 @@ Required variables for API calls:
# agent_user - is the vicidial agent user whose session that you want to affect
# source - description of what originated the API call (maximum 20 characters)
Example URL strings for API calls:
http://server/agc/api.php?function=version
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_hangup&value=1
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_status&value=A
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_pause&value=PAUSE
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_pause&value=RESUME
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_dial&value=7275551212&phone_code=1&search=YES&preview=NO&focus=YES
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_dial&value=7275551212&phone_code=1&search=YES&preview=NO&focus=YES&dial_prefix=88&group_alias=DEFAULT
To hangup the call, disposition it and then pause the agent, do the following in order:
@@ -65,6 +60,9 @@ shows version and build of the API, along with the date/time
VALUES: NONE
EXAMPLE URL:
http://server/agc/api.php?function=version
RESPONSES:
VERSION: 2.0.5-2|BUILD: 90116-1229|DATE: 2009-01-15 14:59:33|EPOCH: 1222020803
@@ -79,8 +77,12 @@ Hangs up the current customer call on the agent screen
VALUES: (value)
1 - the only valid value for this function
EXAMPLE URL:
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_hangup&value=1
RESPONSES:
ERROR: external_hangup not valid - 1|6666
ERROR: no user found - 6666
ERROR: agent_user is not logged in - 6666
SUCCESS: external_hangup function set - 1|6666
@@ -95,8 +97,12 @@ Sets the status of the current customer call on the agent dispotion screen
VALUES: (value)
Any valid status in the VICIDIAL system will work for this function
EXAMPLE URL:
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_status&value=A
RESPONSES:
ERROR: external_status not valid - A|6666
ERROR: no user found - 6666
ERROR: agent_user is not logged in - 6666
SUCCESS: external_status function set - A|6666
@@ -112,8 +118,13 @@ VALUES: (value)
PAUSE - Pauses the agent session
RESUME - Resumes the agent session
EXAMPLE URLS:
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_pause&value=PAUSE
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_pause&value=RESUME
RESPONSES:
ERROR: external_pause not valid - PAUSE|6666
ERROR: no user found - 6666
ERROR: agent_user is not logged in - 6666
SUCCESS: external_pause function set - PAUSE|1232020456|6666
@@ -147,15 +158,22 @@ group_alias -
OPTIONAL, the outbound callerID(from an existing group-alias) that you want to use for this call
vtiger_callback -
OPTIONAL, YES or NO, will lookup the phone number and Vtiger account ID from the provided Event ID
alt_user -
OPTIONAL, instead of agent_user, this is to lookup the agent_user using the vicidial_users.custom_three field
EXAMPLE URLS:
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_dial&value=7275551212&phone_code=1&search=YES&preview=NO&focus=YES
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=external_dial&value=7275551212&phone_code=1&search=YES&preview=NO&focus=YES&dial_prefix=88&group_alias=DEFAULT
RESPONSES:
ERROR: external_dial not valid - 7275551212|1|YES|6666
ERROR: no user found - 6666
ERROR: agent_user is not logged in - 6666
ERROR: agent_user is not allowed to place manual dial calls - 6666
ERROR: caller_id_number from group_alias is not valid - 6666|TESTING|123
ERROR: group_alias is not valid - 6666|TESTING
ERROR: vtiger callback activity does not exist in vtiger system - 12345
SUCCESS: external_dial function set - 7275551212|1|YES|1232020456|6666
SUCCESS: external_dial function set - 7275551212|6666|1|YES|NO|YES|123456|1232020456|9|TESTING|7275551211
@@ -195,6 +213,52 @@ SUCCESS: change_ingroups function set - YES| TEST_IN SALESLINE -|6666
--------------------------------------------------------------------------------
st_login_log -
DESCRIPTION:
Looks up the vicidial_users.custom_three field(as "agentId") to associate with a vicidial user ID. If found it will populate the custom_four field with a "teamId" value, then output the vicidial user ID
VALUES:
value -
REQUIRED alphanumeric string for CRM AgentID
vendor_id -
REQUIRED alphanumeric string for CRM TeamID
EXAMPLE URLS:
http://server/agc/api.php?source=test&user=6666&pass=1234&function=st_login_log&value=876543&vendor_id=207
RESPONSES:
ERROR: st_login_log not valid - 6666|207
ERROR: no user found - 6666
SUCCESS: st_login_log user found - 6666
--------------------------------------------------------------------------------
st_get_agent_active_lead -
DESCRIPTION:
Looks up the vicidial_users.custom_three field(as "agentId") to associate with a vicidial user ID. If found it will output the active lead_id and phone number, vendor_lead_code, province, security_phrase and source_id fields.
VALUES:
value -
REQUIRED alphanumeric string for CRM AgentID
vendor_id -
REQUIRED alphanumeric string for CRM TeamID
EXAMPLE URLS:
http://server/agc/api.php?source=test&user=6666&pass=1234&function=st_get_agent_active_lead&value=876543&vendor_id=207
RESPONSES:
ERROR: st_get_agent_active_lead not valid - 6666|207
ERROR: no user found - 6666
ERROR: user not logged in - 6666
ERROR: no active lead found - 6666
SUCCESS: st_get_agent_active_lead lead found - 6666|7275551212|123456|9987-1234765|SK|WILLIAMS|JUH764AJJJ9
+3 -1
View File
@@ -343,7 +343,7 @@ How to install Queue Metrics on OpenSuSE v.11.1 (32 or 64 bit) with a system tha
- Say yes to install, and say yes to license
3) cd /usr/src
4) wget http://queuemetrics.com/download/QueueMetrics-1.5.3-trial.tar.gz
4) wget http://queuemetrics.com/download/QueueMetrics-1.5.5-trial.tar.gz
5) mkdir tars (incase it doesn't exist)
6) tar -xzf QueueMetrics-1.5.5-trial.tar.gz
7) mv QueueMetrics-1.5.5-trial.tar.gz ./tars/
@@ -370,6 +370,8 @@ How to install Queue Metrics on OpenSuSE v.11.1 (32 or 64 bit) with a system tha
23) Go to http://<ip-addr>:8080/QM and it should tell you the schema is old, just click next or yes to everything and have fun
24) If nothing shows up, you may need to go into 'yast' and change the firewall settings:
Security --> Firewall settings, go to allowed services, type "alt-d" and add 8080 as a new port, then save and exit
@@ -525,7 +525,12 @@ email VARCHAR(100) default '',
user_code VARCHAR(100) default '',
territory VARCHAR(100) default '',
allow_alerts ENUM('0','1') default '0',
agent_choose_territories ENUM('0','1') default '1'
agent_choose_territories ENUM('0','1') default '1',
custom_one VARCHAR(100) default '',
custom_two VARCHAR(100) default '',
custom_three VARCHAR(100) default '',
custom_four VARCHAR(100) default '',
custom_five VARCHAR(100) default ''
);
@@ -687,7 +692,9 @@ agent_display_dialable_leads ENUM('Y','N') default 'N',
web_form_address_two TEXT,
waitforsilence_options VARCHAR(25) default '',
agent_select_territories ENUM('Y','N') default 'N',
campaign_calldate DATETIME
campaign_calldate DATETIME,
crm_popup_login ENUM('Y','N') default 'N',
crm_login_address TEXT
);
CREATE TABLE vicidial_lists (
@@ -1981,7 +1988,7 @@ CREATE INDEX phone_number on vicidial_closer_log (phone_number);
CREATE INDEX date_user on vicidial_closer_log (call_date,user);
CREATE INDEX comment_a on live_inbound_log (comment_a);
UPDATE system_settings SET db_schema_version='1186',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1187',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+11
View File
@@ -655,3 +655,14 @@ UPDATE system_settings SET db_schema_version='1185',db_schema_update_date=NOW();
ALTER TABLE vicidial_campaigns ADD campaign_calldate DATETIME;
UPDATE system_settings SET db_schema_version='1186',db_schema_update_date=NOW();
ALTER TABLE vicidial_users ADD custom_one VARCHAR(100) default '';
ALTER TABLE vicidial_users ADD custom_two VARCHAR(100) default '';
ALTER TABLE vicidial_users ADD custom_three VARCHAR(100) default '';
ALTER TABLE vicidial_users ADD custom_four VARCHAR(100) default '';
ALTER TABLE vicidial_users ADD custom_five VARCHAR(100) default '';
ALTER TABLE vicidial_campaigns ADD crm_popup_login ENUM('Y','N') default 'N';
ALTER TABLE vicidial_campaigns ADD crm_login_address TEXT;
UPDATE system_settings SET db_schema_version='1187',db_schema_update_date=NOW();
@@ -350,6 +350,12 @@ Delete Voicemail After Email||
This optional setting allows you to have the voicemail messages deleted from the system after they have been emailed out. Default is N||
Last Campaign Call Date||
This is the last time that a call was handled by an agent logged into this campaign||
Custom User Fields||
These five fields can be used for various purposes, and they can be populated in the web form addresses and scripts as user_custom_one and so on||
CRM Popup Login||
If set to Y, the CRM Popup Address is used to open a new window on agent login to this campaign. Default is N||
CRM Popup Address||
The web address of a CRM login page, it can have variables populated just like the web form address, with the VAR in the front and using --A--user_custom_one--B-- to define variables||
add-file: user_territories.php
+246 -11
View File
@@ -26,6 +26,7 @@
# - $blended - ('YES','NO')
# - $ingroup_choices - (' TEST_IN SALESLINE -')
# - $set_as_default - ('YES','NO')
# - $alt_user
# CHANGELOG:
# 80703-2225 - First build of script
@@ -37,10 +38,11 @@
# 90508-0727 - Changed to PHP long tags
# 90522-0506 - Security fix
# 91130-1307 - Added change_ingroups(Manager InGroup change feature)
# 91211-1805 - Added st_login_log and st_get_agent_active_lead functions, added alt_user
#
$version = '2.2.0-9';
$build = '91130-1307';
$version = '2.2.0-10';
$build = '91211-1805';
require("dbconnect.php");
@@ -83,6 +85,8 @@ if (isset($_GET["ingroup_choices"])) {$ingroup_choices=$_GET["ingroup_choices"
elseif (isset($_POST["ingroup_choices"])) {$ingroup_choices=$_POST["ingroup_choices"];}
if (isset($_GET["set_as_default"])) {$set_as_default=$_GET["set_as_default"];}
elseif (isset($_POST["set_as_default"])) {$set_as_default=$_POST["set_as_default"];}
if (isset($_GET["alt_user"])) {$alt_user=$_GET["alt_user"];}
elseif (isset($_POST["alt_user"])) {$alt_user=$_POST["alt_user"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -133,6 +137,7 @@ else
$pass = ereg_replace("'|\"|\\\\|;","",$pass);
$source = ereg_replace("'|\"|\\\\|;","",$source);
$agent_user = ereg_replace("'|\"|\\\\|;","",$agent_user);
$alt_user = ereg_replace("'|\"|\\\\|;","",$alt_user);
}
### date and fixed variables
@@ -248,7 +253,7 @@ if ($format=='debug')
################################################################################
if ($function == 'external_hangup')
{
if ( (strlen($value)<1) || (strlen($agent_user)<1) )
if ( (strlen($value)<1) or ( (strlen($agent_user)<1) and (strlen($alt_user)<2) ) )
{
$result = 'ERROR';
$result_reason = "external_hangup not valid";
@@ -258,6 +263,28 @@ if ($function == 'external_hangup')
}
else
{
if (strlen($alt_user)>1)
{
$stmt = "select count(*) from vicidial_users where custom_three='$alt_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$stmt = "select user from vicidial_users where custom_three='$alt_user' order by user;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$agent_user = $row[0];
}
else
{
$result = 'ERROR';
$result_reason = "no user found";
echo "$result: $result_reason - $alt_user\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
$stmt = "select count(*) from vicidial_live_agents where user='$agent_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -294,7 +321,7 @@ if ($function == 'external_hangup')
################################################################################
if ($function == 'external_status')
{
if ( (strlen($value)<1) || (strlen($agent_user)<1) )
if ( (strlen($value)<1) or ( (strlen($agent_user)<1) and (strlen($alt_user)<2) ) )
{
$result = 'ERROR';
$result_reason = "external_status not valid";
@@ -304,6 +331,28 @@ if ($function == 'external_status')
}
else
{
if (strlen($alt_user)>1)
{
$stmt = "select count(*) from vicidial_users where custom_three='$alt_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$stmt = "select user from vicidial_users where custom_three='$alt_user' order by user;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$agent_user = $row[0];
}
else
{
$result = 'ERROR';
$result_reason = "no user found";
echo "$result: $result_reason - $alt_user\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
$stmt = "select count(*) from vicidial_live_agents where user='$agent_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -340,7 +389,7 @@ if ($function == 'external_status')
################################################################################
if ($function == 'external_pause')
{
if ( (strlen($value)<1) || (strlen($agent_user)<1) || (!ereg("PAUSE|RESUME",$value)) )
if ( (strlen($value)<1) or ( (strlen($agent_user)<1) and (strlen($alt_user)<1) ) or (!ereg("PAUSE|RESUME",$value)) )
{
$result = 'ERROR';
$result_reason = "external_pause not valid";
@@ -350,6 +399,28 @@ if ($function == 'external_pause')
}
else
{
if (strlen($alt_user)>1)
{
$stmt = "select count(*) from vicidial_users where custom_three='$alt_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$stmt = "select user from vicidial_users where custom_three='$alt_user' order by user;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$agent_user = $row[0];
}
else
{
$result = 'ERROR';
$result_reason = "no user found";
echo "$result: $result_reason - $alt_user\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
$stmt = "select count(*) from vicidial_live_agents where user='$agent_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -404,17 +475,39 @@ if ($function == 'external_dial')
{
$value = ereg_replace("[^0-9]","",$value);
if ( (strlen($value)<2) || (strlen($agent_user)<2) || (strlen($search)<2) || (strlen($preview)<2) || (strlen($focus)<2) )
if ( (strlen($value)<2) or ( (strlen($agent_user)<2) and (strlen($alt_user)<2) ) or (strlen($search)<2) or (strlen($preview)<2) or (strlen($focus)<2) )
{
$result = 'ERROR';
$result_reason = "external_dial not valid";
$data = "$phone_code|$search|$preview|$focus";
echo "$result: $result_reason - $value|$data|$agent_user\n";
echo "$result: $result_reason - $value|$data|$agent_user|$alt_user\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
else
{
if (strlen($alt_user)>1)
{
$stmt = "select count(*) from vicidial_users where custom_three='$alt_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$stmt = "select user from vicidial_users where custom_three='$alt_user' order by user;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$agent_user = $row[0];
}
else
{
$result = 'ERROR';
$result_reason = "no user found";
echo "$result: $result_reason - $alt_user\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
$stmt = "select count(*) from vicidial_live_agents where user='$agent_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -841,6 +934,152 @@ if ($function == 'change_ingroups')
################################################################################
### BEGIN - st_login_log - looks up vicidial_users.custom_three from a CRM
################################################################################
if ($function == 'st_login_log')
{
if ( (strlen($value)<1) or (strlen($vendor_id)<1) )
{
$result = 'ERROR';
$result_reason = "st_login_log not valid";
$data = "$value|$vendor_id";
echo "$result: $result_reason - $data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
else
{
$stmt = "select count(*) from vicidial_users where custom_three='$value';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$stmt = "select user from vicidial_users where custom_three='$value' order by user;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$stmt="UPDATE vicidial_users set custom_four='$vendor_id' where user='$row[0]';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
$result = 'SUCCESS';
$result_reason = "st_login_log user found";
$data = "$row[0]";
echo "$result: $result_reason - $row[0]\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
else
{
$result = 'ERROR';
$result_reason = "no user found";
echo "$result: $result_reason - $value\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
}
################################################################################
### END - st_login_log
################################################################################
################################################################################
### BEGIN - st_get_agent_active_lead - looks up vicidial_users.custom_three and output active lead info
################################################################################
if ($function == 'st_get_agent_active_lead')
{
if ( (strlen($value)<1) or (strlen($vendor_id)<1) )
{
$result = 'ERROR';
$result_reason = "st_get_agent_active_lead not valid";
$data = "$value|$vendor_id";
echo "$result: $result_reason - $data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
else
{
$stmt = "select count(*) from vicidial_users where custom_three='$value';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$stmt = "select user from vicidial_users where custom_three='$value' order by user;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$VC_user = $row[0];
$stmt = "select count(*) from vicidial_live_agents where user='$VC_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$stmt = "select lead_id from vicidial_live_agents where user='$VC_user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$lead_id = $row[0];
if ($lead_id > 0)
{
$stmt = "select phone_number,vendor_lead_code,province,security_phrase,source_id from vicidial_list where lead_id='$lead_id';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$phone_number = $row[0];
$vendor_lead_code = $row[1];
$province = $row[2];
$security_phrase = $row[3];
$source_id = $row[4];
$result = 'SUCCESS';
$result_reason = "st_get_agent_active_lead lead found";
$data = "$VC_user|$phone_number|$lead_id|$vendor_lead_code|$province|$security_phrase|$source_id";
echo "$result: $result_reason - $data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
else
{
$result = 'ERROR';
$result_reason = "no active lead found";
echo "$result: $result_reason - $VC_user\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
else
{
$result = 'ERROR';
$result_reason = "user not logged in";
echo "$result: $result_reason - $VC_user\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
else
{
$result = 'ERROR';
$result_reason = "no user found";
echo "$result: $result_reason - $value\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
}
################################################################################
### END - st_get_agent_active_lead
################################################################################
if ($format=='debug')
{
$ENDtime = date("U");
@@ -853,9 +1092,6 @@ exit;
##### FUNCTIONS #####
##### Logging #####
@@ -864,7 +1100,6 @@ function api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$val
if ($api_logging > 0)
{
$NOW_TIME = date("Y-m-d H:i:s");
# api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
$stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$agent_user',function='$function',value='$value',result='$result',result_reason='$result_reason',source='$source',data='$data',api_date='$NOW_TIME',api_script='$api_script';";
$rslt=mysql_query($stmt, $link);
}
+24 -5
View File
@@ -9,10 +9,11 @@
# 90824-1435 - First build of script
# 90827-1548 - Added list override script option
# 91204-1913 - Added recording_filename and recording_id variables
# 91211-1103 - Added user_custom_... variables
#
$version = '2.2.0-3';
$build = '91204-1913';
$version = '2.2.0-4';
$build = '91211-1103';
require("dbconnect.php");
@@ -132,6 +133,16 @@ if (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_fi
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["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];}
elseif (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];}
@@ -159,14 +170,12 @@ $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_l
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
$i=0;
while ($i < $qm_conf_ct)
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];
$i++;
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -302,6 +311,11 @@ if (eregi("iframe src",$script_text))
$fullname = eregi_replace(' ','+',$fullname);
$recording_filename = eregi_replace(' ','+',$recording_filename);
$recording_id = eregi_replace(' ','+',$recording_id);
$user_custom_one = eregi_replace(' ','+',$user_custom_one);
$user_custom_two = eregi_replace(' ','+',$user_custom_two);
$user_custom_three = eregi_replace(' ','+',$user_custom_three);
$user_custom_four = eregi_replace(' ','+',$user_custom_four);
$user_custom_five = eregi_replace(' ','+',$user_custom_five);
}
$script_text = eregi_replace('--A--lead_id--B--',"$lead_id",$script_text);
@@ -362,6 +376,11 @@ $script_text = eregi_replace('--A--script_height--B--',"$script_height",$script_
$script_text = eregi_replace('--A--fullname--B--',"$fullname",$script_text);
$script_text = eregi_replace('--A--recording_filename--B--',"$recording_filename",$script_text);
$script_text = eregi_replace('--A--recording_id--B--',"$recording_id",$script_text);
$script_text = eregi_replace('--A--user_custom_one--B--',"$user_custom_one",$script_text);
$script_text = eregi_replace('--A--user_custom_two--B--',"$user_custom_two",$script_text);
$script_text = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$script_text);
$script_text = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$script_text);
$script_text = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$script_text);
$script_text = eregi_replace("\n","<BR>",$script_text);
$script_text = stripslashes($script_text);
+96 -5
View File
@@ -264,10 +264,11 @@
# 91204-1638 - Added recording_filename and recording_id script variables and script refresh link
# 91205-2055 - Added CONSULTATIVE checkbox in a redesigned Transfer-Conf frame
# 91206-2020 - Fixed vicidial_agent_log logging bug on logout when not paused
# 91211-1412 - Added User custom variables and CRM login popup
#
$version = '2.2.0-242';
$build = '91206-2020';
$version = '2.2.0-243';
$build = '91211-1412';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=64;
$one_mysql_log=0;
@@ -802,7 +803,7 @@ $VDloginDISPLAY=0;
$login=strtoupper($VD_login);
$password=strtoupper($VD_pass);
##### grab the full name of the agent
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories from vicidial_users where user='$VD_login' and pass='$VD_pass'";
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$VD_login' and pass='$VD_pass'";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
@@ -825,6 +826,11 @@ $VDloginDISPLAY=0;
$VU_allow_alerts = $row[16];
$VU_closer_campaigns = $row[17];
$VU_agent_choose_territories = $row[18];
$VU_custom_one = $row[19];
$VU_custom_two = $row[20];
$VU_custom_three = $row[21];
$VU_custom_four = $row[22];
$VU_custom_five = $row[23];
if ( ($VU_alert_enabled > 0) and ($VU_allow_alerts > 0) ) {$VU_alert_enabled = 'ON';}
else {$VU_alert_enabled = 'OFF';}
@@ -1091,7 +1097,7 @@ $VDloginDISPLAY=0;
$HKstatusnames = substr("$HKstatusnames", 0, -1);
##### grab the campaign settings
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1152,6 +1158,8 @@ $VDloginDISPLAY=0;
$agent_display_dialable_leads = $row[53];
$web_form_address_two = $row[54];
$agent_select_territories = $row[55];
$crm_popup_login = $row[56];
$crm_login_address = $row[57];
if ($user_territories_active < 1)
{$agent_select_territories = 0;}
@@ -2610,6 +2618,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var delayed_script_load='';
var script_recording_delay='';
var VDRP_stage='PAUSED';
var VU_custom_one = '<?php echo $VU_custom_one ?>';
var VU_custom_two = '<?php echo $VU_custom_two ?>';
var VU_custom_three = '<?php echo $VU_custom_three ?>';
var VU_custom_four = '<?php echo $VU_custom_four ?>';
var VU_custom_five = '<?php echo $VU_custom_five ?>';
var crm_popup_login = '<?php echo $crm_popup_login ?>';
var crm_login_address = '<?php echo $crm_login_address ?>';
var DiaLControl_auto_HTML = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"./images/vdc_LB_resume.gif\" border=0 alt=\"Resume\"></a>";
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"./images/vdc_LB_pause.gif\" border=0 alt=\" Pause \"></a><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\" Pause \"><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
@@ -4836,6 +4851,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
"&fullname=" + LOGfullname + '' +
"&recording_filename=" + recording_filename + '' +
"&recording_id=" + recording_id + '' +
"&user_custom_one=" + VU_custom_one + '' +
"&user_custom_two=" + VU_custom_two + '' +
"&user_custom_three=" + VU_custom_three + '' +
"&user_custom_four=" + VU_custom_four + '' +
"&user_custom_five=" + VU_custom_five + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
@@ -4919,6 +4939,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
"&fullname=" + LOGfullname + '' +
"&recording_filename=" + recording_filename + '' +
"&recording_id=" + recording_id + '' +
"&user_custom_one=" + VU_custom_one + '' +
"&user_custom_two=" + VU_custom_two + '' +
"&user_custom_three=" + VU_custom_three + '' +
"&user_custom_four=" + VU_custom_four + '' +
"&user_custom_five=" + VU_custom_five + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
@@ -5024,6 +5049,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
"&fullname=" + LOGfullname + '' +
"&recording_filename=" + recording_filename + '' +
"&recording_id=" + recording_id + '' +
"&user_custom_one=" + VU_custom_one + '' +
"&user_custom_two=" + VU_custom_two + '' +
"&user_custom_three=" + VU_custom_three + '' +
"&user_custom_four=" + VU_custom_four + '' +
"&user_custom_five=" + VU_custom_five + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
@@ -5398,6 +5428,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
"&fullname=" + LOGfullname + '' +
"&recording_filename=" + recording_filename + '' +
"&recording_id=" + recording_id + '' +
"&user_custom_one=" + VU_custom_one + '' +
"&user_custom_two=" + VU_custom_two + '' +
"&user_custom_three=" + VU_custom_three + '' +
"&user_custom_four=" + VU_custom_four + '' +
"&user_custom_five=" + VU_custom_five + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
@@ -6078,6 +6113,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
"&fullname=" + LOGfullname + '' +
"&recording_filename=" + recording_filename + '' +
"&recording_id=" + recording_id + '' +
"&user_custom_one=" + VU_custom_one + '' +
"&user_custom_two=" + VU_custom_two + '' +
"&user_custom_three=" + VU_custom_three + '' +
"&user_custom_four=" + VU_custom_four + '' +
"&user_custom_five=" + VU_custom_five + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
@@ -6161,6 +6201,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
"&fullname=" + LOGfullname + '' +
"&recording_filename=" + recording_filename + '' +
"&recording_id=" + recording_id + '' +
"&user_custom_one=" + VU_custom_one + '' +
"&user_custom_two=" + VU_custom_two + '' +
"&user_custom_three=" + VU_custom_three + '' +
"&user_custom_four=" + VU_custom_four + '' +
"&user_custom_five=" + VU_custom_five + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
@@ -6249,6 +6294,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
"&fullname=" + LOGfullname + '' +
"&recording_filename=" + recording_filename + '' +
"&recording_id=" + recording_id + '' +
"&user_custom_one=" + VU_custom_one + '' +
"&user_custom_two=" + VU_custom_two + '' +
"&user_custom_three=" + VU_custom_three + '' +
"&user_custom_four=" + VU_custom_four + '' +
"&user_custom_five=" + VU_custom_five + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
@@ -6418,6 +6468,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
"&fullname=" + LOGfullname + '' +
"&recording_filename=" + recording_filename + '' +
"&recording_id=" + recording_id + '' +
"&user_custom_one=" + VU_custom_one + '' +
"&user_custom_two=" + VU_custom_two + '' +
"&user_custom_three=" + VU_custom_three + '' +
"&user_custom_four=" + VU_custom_four + '' +
"&user_custom_five=" + VU_custom_five + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
@@ -6531,6 +6586,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
"&fullname=" + LOGfullname + '' +
"&recording_filename=" + recording_filename + '' +
"&recording_id=" + recording_id + '' +
"&user_custom_one=" + VU_custom_one + '' +
"&user_custom_two=" + VU_custom_two + '' +
"&user_custom_three=" + VU_custom_three + '' +
"&user_custom_four=" + VU_custom_four + '' +
"&user_custom_five=" + VU_custom_five + '' +
webform_session;
var regWFspace = new RegExp(" ","ig");
@@ -8072,7 +8132,7 @@ else
// ################################################################################
// decode the scripttext and scriptname so that it can be didsplayed
// decode the scripttext and scriptname so that it can be displayed
function URLDecode(encodedvar,scriptformat)
{
// Replace %ZZ with equivalent character
@@ -8144,6 +8204,11 @@ encoded=utf8_decode(xtest);
var SCscript_height = script_height;
var SCrecording_filename = recording_filename;
var SCrecording_id = recording_id;
var SCuser_custom_one = VU_custom_one;
var SCuser_custom_two = VU_custom_two;
var SCuser_custom_three = VU_custom_three;
var SCuser_custom_four = VU_custom_four;
var SCuser_custom_five = VU_custom_five;
var SCweb_vars = LIVE_web_vars;
if (encoded.match(RGiframe))
@@ -8199,6 +8264,11 @@ encoded=utf8_decode(xtest);
SCscript_height = SCscript_height.replace(RGplus,'+');
SCrecording_filename = SCrecording_filename.replace(RGplus,'+');
SCrecording_id = SCrecording_id.replace(RGplus,'+');
SCuser_custom_one = SCuser_custom_one.replace(RGplus,'+');
SCuser_custom_two = SCuser_custom_two.replace(RGplus,'+');
SCuser_custom_three = SCuser_custom_three.replace(RGplus,'+');
SCuser_custom_four = SCuser_custom_four.replace(RGplus,'+');
SCuser_custom_five = SCuser_custom_five.replace(RGplus,'+');
SCweb_vars = SCweb_vars.replace(RGplus,'+');
}
@@ -8255,6 +8325,11 @@ encoded=utf8_decode(xtest);
var RGscript_height = new RegExp("--A--script_height--B--","g");
var RGrecording_filename = new RegExp("--A--recording_filename--B--","g");
var RGrecording_id = new RegExp("--A--recording_id--B--","g");
var RGuser_custom_one = new RegExp("--A--user_custom_one--B--","g");
var RGuser_custom_two = new RegExp("--A--user_custom_two--B--","g");
var RGuser_custom_three = new RegExp("--A--user_custom_three--B--","g");
var RGuser_custom_four = new RegExp("--A--user_custom_four--B--","g");
var RGuser_custom_five = new RegExp("--A--user_custom_five--B--","g");
var RGweb_vars = new RegExp("--A--web_vars--B--","g");
encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code);
@@ -8310,6 +8385,11 @@ encoded=utf8_decode(xtest);
encoded = encoded.replace(RGscript_height, SCscript_height);
encoded = encoded.replace(RGrecording_filename, SCrecording_filename);
encoded = encoded.replace(RGrecording_id, SCrecording_id);
encoded = encoded.replace(RGuser_custom_one, SCuser_custom_one);
encoded = encoded.replace(RGuser_custom_two, SCuser_custom_two);
encoded = encoded.replace(RGuser_custom_three, SCuser_custom_three);
encoded = encoded.replace(RGuser_custom_four, SCuser_custom_four);
encoded = encoded.replace(RGuser_custom_five, SCuser_custom_five);
encoded = encoded.replace(RGweb_vars, SCweb_vars);
}
decoded=encoded; // simple no ?
@@ -9014,6 +9094,17 @@ else
VtigeRwin.blur();
}
if ( (crm_popup_login == 'Y') && (crm_login_address.length > 4) )
{
var regWFAcustom = new RegExp("^VAR","ig");
URLDecode(crm_login_address,'YES');
var TEMP_crm_login_address = decoded;
TEMP_crm_login_address = TEMP_crm_login_address.replace(regWFAcustom, '');
CRMwin = window.open(TEMP_crm_login_address, 'CRMwin,toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=700,height=480');
CRMwin.blur();
}
if (INgroupCOUNT > 0)
{
HidEGenDerPulldown();
File diff suppressed because one or more lines are too long