Added group aliases to allow selecting of callerID for manual and 3way calls

Added agent-specific in-group and campaign web variables

git-svn-id: svn://192.168.202.10@1067 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-03-06 16:14:14 +00:00
parent 2d4b4edd1b
commit 6463253fab
16 changed files with 2561 additions and 361 deletions
+6
View File
@@ -256,6 +256,12 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom
conf files so that you can fully configure them using only the admin.php
web interface. See the ASTERISK_CONF-GEN.txt file for more information
60. Added group alias option for selecting callerID on manual and 3rd-party
calls
61. Added options for custom web variables for each agent per in-group and
camaign. This is definable in the user modification page
+261
View File
@@ -0,0 +1,261 @@
#!/usr/bin/perl
#
# agi-CANADA_PRI_CIDname.agi version 0.1
#
# Runs after call goes through IAX loop to send out custom CallerIDname on
# Canadian PRIs that allow dynamic setting of CIDname with call initiation
#
# You need to have lines similar to those below in your extensions.conf file:
#
# ;outbound VICIDIAL calls:
#exten => _91NXXNXXXXXX,1,AGI(call_log.agi,${EXTEN})
#exten => _91NXXNXXXXXX,2,AGI(agi-CANADA_PRI_CIDname.agi,${EXTEN})
#exten => _91NXXNXXXXXX,3,Dial(${TRUNKX}/${EXTEN:1},55,tTo)
#exten => _91NXXNXXXXXX,4,Hangup
#
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# changes:
# 90305-2136 - First build
#
$script = 'agi-CANADA_PRI_CIDname.agi';
$AGILOG=0;
$FD=0; # force debug for testing
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$year = ($year + 1900);
$mon++;
if ($mon < 10) {$mon = "0$mon";}
if ($mday < 10) {$mday = "0$mday";}
if ($hour < 10) {$Fhour = "0$hour";}
if ($min < 10) {$min = "0$min";}
if ($sec < 10) {$sec = "0$sec";}
$now_date_epoch = time();
$now_date = "$year-$mon-$mday $hour:$min:$sec";
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
### begin parsing run-time options ###
if (length($ARGV[0])>1)
{
if ($AGILOG) {$agi_string = "Perl Environment Dump:"; &agi_output;}
$i=0;
while ($#ARGV >= $i)
{
$args = "$args $ARGV[$i]";
if ($AGILOG) {$agi_string = "$i|$ARGV[$i]"; &agi_output;}
$i++;
}
}
# default path to astguiclient configuration file:
$PATHconf = '/etc/astguiclient.conf';
open(conf, "$PATHconf") || die "can't open $PATHconf: $!\n";
@conf = <conf>;
close(conf);
$i=0;
foreach(@conf)
{
$line = $conf[$i];
$line =~ s/ |>|\n|\r|\t|\#.*|;.*//gi;
if ( ($line =~ /^PATHhome/) && ($CLIhome < 1) )
{$PATHhome = $line; $PATHhome =~ s/.*=//gi;}
if ( ($line =~ /^PATHlogs/) && ($CLIlogs < 1) )
{$PATHlogs = $line; $PATHlogs =~ s/.*=//gi;}
if ( ($line =~ /^PATHagi/) && ($CLIagi < 1) )
{$PATHagi = $line; $PATHagi =~ s/.*=//gi;}
if ( ($line =~ /^PATHweb/) && ($CLIweb < 1) )
{$PATHweb = $line; $PATHweb =~ s/.*=//gi;}
if ( ($line =~ /^PATHsounds/) && ($CLIsounds < 1) )
{$PATHsounds = $line; $PATHsounds =~ s/.*=//gi;}
if ( ($line =~ /^PATHmonitor/) && ($CLImonitor < 1) )
{$PATHmonitor = $line; $PATHmonitor =~ s/.*=//gi;}
if ( ($line =~ /^VARserver_ip/) && ($CLIserver_ip < 1) )
{$VARserver_ip = $line; $VARserver_ip =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_server/) && ($CLIDB_server < 1) )
{$VARDB_server = $line; $VARDB_server =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_database/) && ($CLIDB_database < 1) )
{$VARDB_database = $line; $VARDB_database =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_user/) && ($CLIDB_user < 1) )
{$VARDB_user = $line; $VARDB_user =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_pass/) && ($CLIDB_pass < 1) )
{$VARDB_pass = $line; $VARDB_pass =~ s/.*=//gi;}
if ( ($line =~ /^VARDB_port/) && ($CLIDB_port < 1) )
{$VARDB_port = $line; $VARDB_port =~ s/.*=//gi;}
$i++;
}
if (!$VARDB_port) {$VARDB_port='3306';}
if (!$AGILOGfile) {$AGILOGfile = "$PATHlogs/agiout.$year-$mon-$mday";}
if (!$DIDLOGfile) {$DIDLOGfile = "$PATHlogs/didin.$year-$mon-$mday";}
$|=1;
while(<STDIN>)
{
chomp;
last unless length($_);
if ($AGILOG)
{
if (/^agi_(\w+)\:\s+(.*)$/)
{
$AGI{$1} = $2;
}
}
if (/^agi_extension\:\s+(.*)$/) {$extension = $1;}
if (/^agi_callerid\:\s+(.*)$/) {$callerid = $1;}
if (/^agi_calleridname\:\s+(.*)$/) {$calleridname = $1;}
}
if ( ($callerid =~ /\".*\"/) && ( (!$calleridname) or ($calleridname =~ /unknown/) ) )
{
$calleridname = $callerid;
$calleridname =~ s/\<\d\d\d\d\d\d\d\d\d\d\>//gi;
$calleridname =~ s/\"|\" //gi;
}
$callerid =~ s/\D//gi;
$calleridname =~ s/unknown//gi;
if ( (!$callerid) or ($callerid =~ /unknown/) )
{$callerid = $calleridname;}
if (length($callerid)>0) {$phone_number = $callerid;}
else {$phone_number = '';}
if (length($calleridname)>0) {$VLcomments = $calleridname;}
else {$VLcomments = '';}
foreach $i (sort keys %AGI)
{
if ($AGILOG) {$agi_string = " -- $i = $AGI{$i}"; &agi_output;}
}
if ( (length($callerid)>20) && ($callerid =~ /\"\S\S\S\S\S\S\S\S\S\S\S\S\S\S\S\S\S\S/) )
{
$calleridname =~ s/^\"//gi;
$calleridname =~ s/\".*$//gi;
}
use DBI;
use Time::HiRes ('gettimeofday','usleep','sleep'); # necessary to have perl sleep command of less than one second
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
or die "Couldn't connect to database: " . DBI->errstr;
### Grab Server values from the database
$stmtA = "SELECT agi_output,local_gmt FROM servers where server_ip = '$VARserver_ip';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$rec_count=0;
while ($sthArows > $rec_count)
{
$AGILOG = '0';
@aryA = $sthA->fetchrow_array;
$DBagi_output = "$aryA[0]";
$local_gmt = "$aryA[1]";
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
$rec_count++;
}
$sthA->finish();
### Grab Server values from the database
$stmtA = "SELECT cmd_line_g,cmd_line_h,cmd_line_i,cmd_line_j FROM vicidial_manager where callerid = '$calleridname' limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$sthA->finish();
$account_check = "|$aryA[0]|$aryA[1]|$aryA[2]|$aryA[3]";
if ($account_check =~ /usegroupalias=1/)
{
@data = split(/Account: /,$account_check);
$data[1] =~ s/\|.*//gi;
$account = $data[1];
### Grab callerIDname and number from the database
$stmtA = "SELECT caller_id_name,caller_id_number FROM groups_alias where group_alias_id = '$account' limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$sthA->finish();
$caller_id_name = "$aryA[0]";
$caller_id_number = "$aryA[1]";
### set the callerid to the ACQS value(calleridname)
## use these two lines for Asterisk 1.2 tree
$newcallerid = "\"$caller_id_name <$caller_id_number>\"";
$AGI->set_callerid($newcallerid);
## use these two lines for Asterisk 1.0 tree
# print "SET CALLERID \"$calleridname\" <0000000000>\n";
# print "SET CALLERIDNAME \"$calleridname\"\n";
print STDERR "Setting CID \"$newcallerid\"\n";
checkresult($result);
if ($AGILOG) {$agi_string = "callerID changed: newcallerid; &agi_output";}
if ($FD > 0) {print STDERR "callerID changed: newcallerid\n";}
if ($AGILOG) {$agi_string = "AGI Variables: |$extension|$areacode|$callerid|$calleridname|newcallerid|"; &agi_output;}
}
}
}
exit;
sub checkresult {
my ($res) = @_;
my $retval;
$tests++;
chomp $res;
if ($res =~ /^200/) {
$res =~ /result=(-?\d+)/;
if (!length($1)) {
# print STDERR "FAIL ($res)\n";
$fail++;
} else {
# print STDERR "PASS ($1)\n";
$pass++;
}
} else {
# print STDERR "FAIL (unexpected result '$res')\n";
$fail++;
}
}
sub agi_output
{
if ($AGILOG >=2)
{
### open the log file for writing ###
open(Lout, ">>$AGILOGfile")
|| die "Can't open $AGILOGfile: $!\n";
print Lout "$now_date|$script|$agi_string\n";
close(Lout);
}
### send to STDERR writing ###
if ( ($AGILOG == '1') || ($AGILOG == '3') )
{print STDERR "$now_date|$script|$agi_string\n";}
$agi_string='';
}
+1 -1
View File
@@ -107,7 +107,7 @@ while ($sthArows > $rec_count)
$AGILOG = '0';
@aryA = $sthA->fetchrow_array;
$DBagi_output = "$aryA[0]";
$local_gmt = "$aryA[0]";
$local_gmt = "$aryA[1]";
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
+7
View File
@@ -36,6 +36,7 @@ http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&functi
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:
@@ -136,11 +137,17 @@ focus -
NO - do not change focus
vendor_id -
Any valid Vendor lead code
dial_prefix -
OPTIONAL, any dial prefix that you want to add to the beginning of the dial string for this call
group_alias -
OPTIONAL, the outbound callerID(from an existing group-alias) that you want to use for this call
RESPONSES:
ERROR: external_dial not valid - 7275551212|1|YES|6666
ERROR: agent_user is not allowed to place manual dial calls - 6666
ERROR: agent_user is not logged in - 6666
ERROR: caller_id_number from group_alias is not valid - 6666|TESTING|123
ERROR: group_alias is not valid - 6666|TESTING
SUCCESS: external_dial function set - 7275551212|1|YES|1232020456|6666
+7
View File
@@ -5,6 +5,7 @@ Current VICIDIAL integration with Vtiger is for the 5.0.4 release version of Vti
Current integration features:
- vicidial.php WEBFORM search for lead/account/vendor
- User synchronization of VICIDIAL users to Vtiger user database
- User Group synchronization of VICIDIAL user groups to Vtiger Groups
- Added activity event option(call logging in Vtiger) when going from VICIDIAL to Vtiger
- Ability to click-to-dial a phone number from a record in Vtiger screen to the vicidial.php screen
- Optional script to bulk load leads into Vtiger from a CSV file since Vtiger only seems to want to load 500 at a time:
@@ -39,6 +40,12 @@ Here are the procedures to load leads into Vtiger, then output them from Vtiger
Then to keep the two systems in sync you would run the last two steps every day or at some other interval.
For VICIDIAL users that are synchronized to Vtiger, the following user_level to roles repationships are used:
- user_level 9 - H2, CEO
- user_level 8 - H3, Vice President
- user_level 7 - H4, Sales Manager
- user_level 6 and lower - H5, Sales Man
Here are the SQL queries used by the vtiger_search.php script to find records in the vtiger system:
+33 -4
View File
@@ -609,14 +609,16 @@ manual_dial_filter VARCHAR(50) default 'NONE',
agent_clipboard_copy VARCHAR(50) default 'NONE',
agent_extended_alt_dial ENUM('Y','N') default 'N',
use_campaign_dnc ENUM('Y','N') default 'N',
three_way_call_cid ENUM('CAMPAIGN','CUSTOMER','AGENT_PHONE') default 'CAMPAIGN',
three_way_call_cid ENUM('CAMPAIGN','CUSTOMER','AGENT_PHONE','AGENT_CHOOSE') default 'CAMPAIGN',
three_way_dial_prefix VARCHAR(20) default '',
web_form_target VARCHAR(100) NOT NULL default 'vdcwebform',
vtiger_search_category VARCHAR(100) default 'LEAD',
vtiger_create_call_record ENUM('Y','N') default 'Y',
vtiger_create_lead_record ENUM('Y','N') default 'Y',
vtiger_screen_login ENUM('Y','N') default 'Y',
cpd_amd_action ENUM('DISABLED','DISPO','MESSAGE') default 'DISABLED'
cpd_amd_action ENUM('DISABLED','DISPO','MESSAGE') default 'DISABLED',
agent_allow_group_alias ENUM('Y','N') default 'N',
default_group_alias VARCHAR(30) default ''
);
CREATE TABLE vicidial_lists (
@@ -732,7 +734,8 @@ hold_recall_xfer_group VARCHAR(20) default '---NONE---',
no_delay_call_route ENUM('Y','N') default 'N',
play_welcome_message ENUM('ALWAYS','NEVER','IF_WAIT_ONLY','YES_UNLESS_NODELAY') default 'ALWAYS',
answer_sec_pct_rt_stat_one SMALLINT(5) UNSIGNED default '20',
answer_sec_pct_rt_stat_two SMALLINT(5) UNSIGNED default '30'
answer_sec_pct_rt_stat_two SMALLINT(5) UNSIGNED default '30',
default_group_alias VARCHAR(30) default ''
);
CREATE TABLE vicidial_stations (
@@ -1142,6 +1145,7 @@ group_id VARCHAR(20),
group_rank TINYINT(1) default '0',
group_weight TINYINT(1) default '0',
calls_today SMALLINT(5) UNSIGNED default '0',
group_web_vars VARCHAR(255) default '',
index (group_id),
index (user)
);
@@ -1163,6 +1167,7 @@ campaign_id VARCHAR(20),
campaign_rank TINYINT(1) default '0',
campaign_weight TINYINT(1) default '0',
calls_today SMALLINT(5) UNSIGNED default '0',
group_web_vars VARCHAR(255) default '',
index (campaign_id),
index (user)
);
@@ -1396,6 +1401,30 @@ unique index(carrier_id),
index (server_ip)
);
CREATE TABLE groups_alias (
group_alias_id VARCHAR(30) NOT NULL UNIQUE PRIMARY KEY,
group_alias_name VARCHAR(50),
caller_id_number VARCHAR(20),
caller_id_name VARCHAR(20),
active ENUM('Y','N') default 'N'
);
CREATE TABLE user_call_log (
user_call_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
user VARCHAR(20),
call_date DATETIME,
call_type VARCHAR(20),
server_ip VARCHAR(15) NOT NULL,
phone_number VARCHAR(20),
number_dialed VARCHAR(30),
lead_id INT(9) UNSIGNED,
callerid VARCHAR(20),
group_alias_id VARCHAR(30),
index (user),
index (call_date)
);
ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP;
ALTER TABLE live_channels ENGINE=HEAP;
@@ -1491,7 +1520,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='1131';
UPDATE system_settings SET db_schema_version='1132';
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+35
View File
@@ -728,3 +728,38 @@ UPDATE system_settings SET db_schema_version='1130';
INSERT INTO vicidial_inbound_dids SET did_pattern='default', did_description='Default DID', did_active='Y', did_route='EXTEN', extension='9998811112', exten_context='default';
UPDATE system_settings SET db_schema_version='1131';
ALTER TABLE vicidial_campaign_agents ADD group_web_vars VARCHAR(255) default '';
ALTER TABLE vicidial_inbound_group_agents ADD group_web_vars VARCHAR(255) default '';
CREATE TABLE groups_alias (
group_alias_id VARCHAR(30) NOT NULL UNIQUE PRIMARY KEY,
group_alias_name VARCHAR(50),
caller_id_number VARCHAR(20),
caller_id_name VARCHAR(20),
active ENUM('Y','N') default 'N'
);
CREATE TABLE user_call_log (
user_call_log_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
user VARCHAR(20),
call_date DATETIME,
call_type VARCHAR(20),
server_ip VARCHAR(15) NOT NULL,
phone_number VARCHAR(20),
number_dialed VARCHAR(30),
lead_id INT(9) UNSIGNED,
callerid VARCHAR(20),
group_alias_id VARCHAR(30),
index (user),
index (call_date)
);
ALTER TABLE vicidial_campaigns ADD agent_allow_group_alias ENUM('Y','N') default 'N';
ALTER TABLE vicidial_campaigns ADD default_group_alias VARCHAR(30) default '';
ALTER TABLE vicidial_campaigns MODIFY three_way_call_cid ENUM('CAMPAIGN','CUSTOMER','AGENT_PHONE','AGENT_CHOOSE') default 'CAMPAIGN';
ALTER TABLE vicidial_inbound_groups ADD default_group_alias VARCHAR(30) default '';
UPDATE system_settings SET db_schema_version='1132';
@@ -471,6 +471,42 @@ This field allows for a custom VDAD transfer extension. This allows you to use d
- 8368 - DEFAULT Will send the call to the next available agent no matter what server they are on||
- 8369 - Used for Answering Machine Detection after that, same behavior as 8368||
- 8373 - Used for Answering Machine Detection after that same behavior as 8366||
Also in this section are the WEB VARs for each campaign. These allow each agent to have a different variable string that can be added to the WEB FORM or SCRIPT tab URLs by simply putting --A--web_vars--B-- as you would put any other field.||
Group Alias List||
Add A New Group Alias||
ADD NEW GROUP ALIAS||
ADDING NEW GROUP ALIAS||
MODIFY GROUP ALIAS||
DELETE GROUP ALIAS||
GROUP ALIAS LIST||
GROUP ALIAS LISTINGS||
MODIFY A GROUP ALIAS RECORD||
Group Alias ID||
Group Alias Name||
CallerID Number||
CallerID Name||
DELETE THIS GROUP ALIAS||
GROUP ALIAS NOT MODIFIED||
GROUP ALIAS MODIFIED||
ADD A NEW GROUP ALIAS||
MODIFY A GROUP ALIAS RECORD||
GROUP ALIAS NOT ADDED||
GROUP ALIAS ADDED||
GROUP ALIAS NOT DELETED||
GROUP ALIAS DELETION CONFIRMATION||
Click here to delete group alias||
GROUP ALIAS DELETION COMPLETED||
Group Alias ID -<\/B> The ID of the group alias used by agents to dial out calls from the VICIDIAL agent interface with different Caller IDs. no spaces or other special characters allowed. Must be between 2 and 20 characters in length||
Group Alias Name -<\/B> The name used to describe a group alias, Must be between 2 and 50 characters in length||
Caller ID Number -<\/B> The Caller ID number used in this Group Alias. Must be digits only||
Caller ID Name -<\/B> The Caller ID name that can be sent out with this Group Alias. As far as we know this will only work in Canada on PRI circuits and using an IAX loop trunk through Asterisk||
Group Alias Allowed -<\/B> If you want to allow your agents to use group aliases then you need to set this to Y. Group Aliases are explained more in the Admin section, they allow agents to select different callerIDs for outbound manual calls that they may place. Default is N||
Default Group Alias -<\/B> If you have allowed Group Aliases then this is the group alias that is selected first by default when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty||
Default Group Alias -<\/B> If you have allowed Group Aliases for the campaign that the agent is logged into then this is the group alias that is selected first by default on a call coming in from this inbound group when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty||
Group Alias Allowed||
Default Group Alias||
AGENT_CHOOSE allows the agent to choose which callerID to use for 3-way calls from a list of choices.||
you cannot use reserved words in group aliases||
############################################################ CLIENT
@@ -510,6 +546,10 @@ Change this phone number to ACTIVE||
YOU MUST LOG IN TO THE TIMECLOCK FIRST||
There is a time synchronization problem with your system, please tell your system administrator||
Preview Call||
SELECT A GROUP ALIAS||
Group Alias Selection||
Click Here to Choose a Group Alias||
Group Alias||
############################################################ MANAGER Manual
+32 -2
View File
@@ -409,12 +409,42 @@ if ($function == 'external_dial')
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
$stmt="UPDATE vicidial_live_agents set external_dial='$value!$phone_code!$search!$preview!$focus!$vendor_id!$epoch!$dial_prefix!$group_alias' where user='$agent_user';";
if (strlen($group_alias)>1)
{
$stmt = "select caller_id_number from groups_alias where group_alias_id='$group_alias';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$VDIG_cidnum_ct = mysql_num_rows($rslt);
if ($VDIG_cidnum_ct > 0)
{
$row=mysql_fetch_row($rslt);
$caller_id_number = $row[0];
if ($caller_id_number < 4)
{
$result = 'ERROR';
$result_reason = "caller_id_number from group_alias is not valid";
$data = "$group_alias|$caller_id_number";
echo "$result: $result_reason - $agent_user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
}
else
{
$result = 'ERROR';
$result_reason = "group_alias is not valid";
$data = "$group_alias";
echo "$result: $result_reason - $agent_user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit;
}
}
$stmt="UPDATE vicidial_live_agents set external_dial='$value!$phone_code!$search!$preview!$focus!$vendor_id!$epoch!$dial_prefix!$group_alias!$caller_id_number' where user='$agent_user';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
$result = 'SUCCESS';
$result_reason = "external_dial function set";
$data = "$phone_code|$search|$preview|$focus|$vendor_id|$epoch|$dial_prefix|$group_alias";
$data = "$phone_code|$search|$preview|$focus|$vendor_id|$epoch|$dial_prefix|$group_alias|$caller_id_number";
echo "$result: $result_reason - $value|$agent_user|$data\n";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
+36 -5
View File
@@ -36,7 +36,11 @@
# - $session_id - ('8600051')
# - $FROMvdc - ('YES','NO')
# - $agentchannel - ('SIP/cc101-g7yr','Zap/1-1',...)
# - $usegroupalias - ('0','1')
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
#
# CHANGELOG:
# 50401-1002 - First build of script, Hangup function only
# 50404-1045 - Redirect basic function enabled
@@ -79,10 +83,12 @@
# 81020-1459 - Fixed bugs in queue_log logging
# 81104-0203 - Added mysql error logging capability
# 90303-1144 - Fixed manual dial live hangup bug
# 90304-1334 - Added account and usegroupalias and user campaign/in-group specific variables
# 90305-1040 - Added agent_dialed_number and type for user_call_log feature
#
$version = '2.0.5-36';
$build = '90303-1144';
$version = '2.0.5-38';
$build = '90305-1040';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=83;
$one_mysql_log=0;
@@ -160,6 +166,15 @@ if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];}
elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];}
if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];}
elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];}
if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];}
elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];}
if (isset($_GET["account"])) {$account=$_GET["account"];}
elseif (isset($_POST["account"])) {$account=$_POST["account"];}
if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];}
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -372,11 +387,27 @@ if ($ACTION=="Originate")
{$outCID = "\"$queryCID\" <$outbound_cid>";}
else
{$outCID = "$queryCID";}
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','','','','','');";
if ( ($usegroupalias > 0) and (strlen($account)>1) )
{
$RAWaccount = $account;
$account = "Account: $account";
$variable = "Variable: usegroupalias=1";
}
else
{$account=''; $variable='';}
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $channel','Context: $ext_context','Exten: $exten','Priority: $ext_priority','Callerid: $outCID','$account','$variable','','','');";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02007',$user,$server_ip,$session_name,$one_mysql_log);}
echo "Originate command sent for Exten $exten Channel $channel on $server_ip\n";
echo "Originate command sent for Exten $exten Channel $channel on $server_ip |$account|$variable|\n";
if ($agent_dialed_number > 0)
{
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$exten','$channel','0','$outbound_cid','$RAWaccount')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);}
}
}
}
+116 -11
View File
@@ -78,6 +78,10 @@
# - $conf_dialed = ('0','1')
# - $leaving_threeway = ('0','1')
# - $blind_transfer = ('0','1')
# - $usegroupalias - ('0','1')
# - $account - ('DEFAULT',...)
# - $agent_dialed_number - ('1','')
# - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...)
#
# CHANGELOG:
# 50629-1044 - First build of script
@@ -182,13 +186,15 @@
# 81211-0420 - Fixed Manual dial agent_log bug
# 90120-1718 - Added external pause and dial option
# 90126-1759 - Fixed QM section that wasn't qualified and added agent alert option
# 90128-0231 - Aded vendor_lead_code to manual dial lead lookup
# 90128-0231 - Added vendor_lead_code to manual dial lead lookup
# 90304-1335 - Added support for group aliases and agent-specific variables for campaigns and in-groups
# 90305-1041 - Added agent_dialed_number and type for user_call_log feature
#
$version = '2.0.5-100';
$build = '90128-0231';
$version = '2.0.5-102';
$build = '90305-1041';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=186;
$mysql_log_count=192;
$one_mysql_log=0;
require("dbconnect.php");
@@ -344,6 +350,14 @@ if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["
elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];}
if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];}
elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];}
if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];}
elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];}
if (isset($_GET["account"])) {$account=$_GET["account"];}
elseif (isset($_POST["account"])) {$account=$_POST["account"];}
if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];}
elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];}
if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];}
elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@@ -986,9 +1000,19 @@ if ($ACTION == 'manDiaLnextCaLL')
{$Ndialstring = "$Local_out_prefix$phone_number";}
else
{$Ndialstring = "$Local_out_prefix$phone_code$phone_number";}
if ( ($usegroupalias > 0) and (strlen($account)>1) )
{
$RAWaccount = $account;
$account = "Account: $account";
$variable = "Variable: usegroupalias=1";
}
else
{$account=''; $variable='';}
### insert the call action into the vicidial_manager table to initiate the call
# $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');";
$stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');";
$stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00033',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -1010,6 +1034,14 @@ if ($ACTION == 'manDiaLnextCaLL')
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);}
if ($agent_dialed_number > 0)
{
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00191',$user,$server_ip,$session_name,$one_mysql_log);}
}
#############################################
##### START QUEUEMETRICS LOGGING LOOKUP #####
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;";
@@ -1253,6 +1285,15 @@ if ($ACTION == 'manDiaLonly')
if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";}
else {$CIDstring = "$MqueryCID";}
if ( ($usegroupalias > 0) and (strlen($account)>1) )
{
$RAWaccount = $account;
$account = "Account: $account";
$variable = "Variable: usegroupalias=1";
}
else
{$account=''; $variable='';}
### whether to omit phone_code or not
if (eregi('Y',$omit_phone_code))
{$Ndialstring = "$Local_out_prefix$phone_number";}
@@ -1260,7 +1301,7 @@ if ($ACTION == 'manDiaLonly')
{$Ndialstring = "$Local_out_prefix$phone_code$phone_number";}
### insert the call action into the vicidial_manager table to initiate the call
# $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $conf_exten','Context: $ext_context','Channel: $local_DEF$Local_out_prefix$phone_code$phone_number$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');";
$stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','');";
$stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$MqueryCID','Exten: $Ndialstring','Context: $ext_context','Channel: $local_DEF$conf_exten$local_AMP$ext_context$Local_persist','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','$account','$variable','','');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00044',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -1292,6 +1333,15 @@ if ($ACTION == 'manDiaLonly')
echo "$MqueryCID\n";
if ($agent_dialed_number > 0)
{
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);}
}
#############################################
##### START QUEUEMETRICS LOGGING LOOKUP #####
$stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;";
@@ -2696,7 +2746,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$VDCL_front_VDlog =$row[0];
}
$stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename from vicidial_inbound_groups where group_id='$VDADchannel_group';";
$stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias from vicidial_inbound_groups where group_id='$VDADchannel_group';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -2717,9 +2767,10 @@ if ($ACTION == 'VDADcheckINCOMING')
$VDCL_default_xfer_group = $row[10];
$VDCL_ingroup_recording_override = $row[11];
$VDCL_ingroup_rec_filename = $row[12];
$VDCL_default_group_alias = $row[13];
$stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$campaign';";
$stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$campaign';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -2737,6 +2788,33 @@ if ($ACTION == 'VDADcheckINCOMING')
{$VDCL_xferconf_b_dtmf = $row[3];}
if (strlen($VDCL_xferconf_b_number) < 1)
{$VDCL_xferconf_b_number = $row[4];}
if (strlen($VDCL_default_group_alias) < 1)
{$VDCL_default_group_alias = $row[5];}
}
$stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);}
$VDIG_cidgwv_ct = mysql_num_rows($rslt);
if ($VDIG_cidgwv_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VDCL_group_web_vars = $row[0];
}
if (strlen($VDCL_group_web_vars) < 1)
{
$stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);}
$VDIG_cidogwv = mysql_num_rows($rslt);
if ($VDIG_cidogwv > 0)
{
$row=mysql_fetch_row($rslt);
$VDCL_group_web_vars = $row[0];
}
}
### update the comments in vicidial_live_agents record
@@ -2749,7 +2827,7 @@ if ($ACTION == 'VDADcheckINCOMING')
}
else
{
$stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number from vicidial_campaigns where campaign_id='$VDADchannel_group';";
$stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias from vicidial_campaigns where campaign_id='$VDADchannel_group';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -2763,12 +2841,39 @@ if ($ACTION == 'VDADcheckINCOMING')
$VDCL_xferconf_a_number = $row[3];
$VDCL_xferconf_b_dtmf = $row[4];
$VDCL_xferconf_b_number = $row[5];
$VDCL_default_group_alias = $row[6];
}
$stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);}
$VDIG_cidogwv = mysql_num_rows($rslt);
if ($VDIG_cidogwv > 0)
{
$row=mysql_fetch_row($rslt);
$VDCL_group_web_vars = $row[0];
}
}
$VDCL_caller_id_number='';
if (strlen($VDCL_default_group_alias)>1)
{
$stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);}
$VDIG_cidnum_ct = mysql_num_rows($rslt);
if ($VDIG_cidnum_ct > 0)
{
$row=mysql_fetch_row($rslt);
$VDCL_caller_id_number = $row[0];
}
}
### if web form is set then send on to vicidial.php for override of WEB_FORM address
if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|\n";}
else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|\n";}
if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";}
else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|\n";}
$stmt = "SELECT full_name from vicidial_users where user='$tsr';";
if ($DB) {echo "$stmt\n";}
+309 -39
View File
@@ -219,12 +219,14 @@
# 90202-0148 - Added option to disable BLENDED checkbox
# 90209-0132 - Changed tab images and color scheme
# 90303-1145 - Fixed rare manual dial live hangup bug
# 90304-1333 - Added user-specific web vars option
# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
#
$version = '2.0.5-198';
$build = '90303-1145';
$version = '2.0.5-200';
$build = '90305-0917';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=53;
$mysql_log_count=55;
$one_mysql_log=0;
require("dbconnect.php");
@@ -899,7 +901,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 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 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";}
@@ -947,6 +949,34 @@ $VDloginDISPLAY=0;
$three_way_dial_prefix = $row[40];
$web_form_target = $row[41];
$vtiger_screen_login = $row[42];
$agent_allow_group_alias = $row[43];
$default_group_alias = $row[44];
$default_group_alias_cid='';
if (strlen($default_group_alias)>1)
{
$stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$VDIG_cidnum_ct = mysql_num_rows($rslt);
if ($VDIG_cidnum_ct > 0)
{
$row=mysql_fetch_row($rslt);
$default_group_alias_cid = $row[0];
}
}
$stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$VDIG_cidogwv = mysql_num_rows($rslt);
if ($VDIG_cidogwv > 0)
{
$row=mysql_fetch_row($rslt);
$default_web_vars = $row[0];
}
if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) )
{
@@ -1048,6 +1078,33 @@ $VDloginDISPLAY=0;
$VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1);
}
if (ereg('Y',$agent_allow_group_alias))
{
##### grab the active group aliases
$stmt="SELECT group_alias_id,group_alias_name,caller_id_number FROM groups_alias WHERE active='Y' order by group_alias_id limit 1000;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$VD_group_aliases = mysql_num_rows($rslt);
$j=0;
while ($j < $VD_group_aliases)
{
$row=mysql_fetch_row($rslt);
$group_alias_id[$i] = $row[0];
$group_alias_name[$i] = $row[1];
$caller_id_number[$i] = $row[2];
$VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',";
$VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',";
$VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',";
$i++;
$j++;
}
$VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases);
$VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1);
$VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1);
$VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1);
}
##### grab the number of leads in the hopper for this campaign
$stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';";
$rslt=mysql_query($stmt, $link);
@@ -1902,6 +1959,14 @@ $CCAL_OUT .= "</table>";
var scheduled_callbacks = '<? echo $scheduled_callbacks ?>';
var dispo_check_all_pause = '<? echo $dispo_check_all_pause ?>';
var api_check_all_pause = '<? echo $api_check_all_pause ?>';
VARgroup_alias_ids = new Array(<? echo $VARgroup_alias_ids ?>);
VARgroup_alias_names = new Array(<? echo $VARgroup_alias_names ?>);
VARcaller_id_numbers = new Array(<? echo $VARcaller_id_numbers ?>);
var VD_group_aliases_ct = '<? echo $VD_group_aliases_ct ?>';
var agent_allow_group_alias = '<? echo $agent_allow_group_alias ?>';
var default_group_alias = '<? echo $default_group_alias ?>';
var default_group_alias_cid = '<? echo $default_group_alias_cid ?>';
var active_group_alias = '';
var agent_pause_codes_active = '<? echo $agent_pause_codes_active ?>';
VARpause_codes = new Array(<? echo $VARpause_codes ?>);
VARpause_code_names = new Array(<? echo $VARpause_code_names ?>);
@@ -2028,6 +2093,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var campaign_rec_filename = '<? echo $campaign_rec_filename ?>';
var LIVE_campaign_recording = '<? echo $campaign_recording ?>';
var LIVE_campaign_rec_filename = '<? echo $campaign_rec_filename ?>';
var LIVE_default_group_alias = '<? echo $default_group_alias ?>';
var LIVE_caller_id_number = '<? echo $default_group_alias_cid ?>';
var LIVE_web_vars = '<? echo $default_web_vars ?>';
var default_web_vars = '<? echo $default_web_vars ?>';
var campaign_script = '<? echo $campaign_script ?>';
var get_call_launch = '<? echo $get_call_launch ?>';
var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
@@ -2118,6 +2187,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var three_way_call_cid = '<? echo $three_way_call_cid ?>';
var outbound_cid = '<? echo $outbound_cid ?>';
var threeway_cid = '';
var cid_choice = '';
var prefix_choice = '';
var agent_dialed_number='';
var agent_dialed_type='';
var allcalls_delay = '<? echo $allcalls_delay ?>';
var omit_phone_code = '<? echo $omit_phone_code ?>';
var no_delete_sessions = '<? echo $no_delete_sessions ?>';
@@ -2175,7 +2248,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
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\">";
var DiaLControl_manual_HTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
var DiaLControl_manual_HTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
var image_blank = new Image();
image_blank.src="./images/blank.gif";
var image_livecall_OFF = new Image();
@@ -2426,8 +2499,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
function SendManualDial(taskFromConf)
{
conf_dialed=1;
var sending_group_alias = 0;
if (taskFromConf == 'YES')
{
agent_dialed_number='1';
agent_dialed_type='XFER_3WAY';
document.getElementById("DialWithCustomer").innerHTML ="<IMG SRC=\"./images/vdc_XB_dialwithcustomer_OFF.gif\" border=0 alt=\"Dial With Customer\"></a>";
document.getElementById("ParkCustomerDial").innerHTML ="<IMG SRC=\"./images/vdc_XB_parkcustomerdial_OFF.gif\" border=0 alt=\"Park Customer Dial\"></a>";
@@ -2442,6 +2519,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
{threeway_cid = outbound_cid;}
if (three_way_call_cid == 'CUSTOMER')
{threeway_cid = document.vicidial_form.phone_number.value;}
if (three_way_call_cid == 'AGENT_CHOOSE')
{
threeway_cid = cid_choice;
if (active_group_alias.length > 1)
{var sending_group_alias = 1;}
}
}
else
{
@@ -2465,19 +2548,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (manual_string.length > 7)
{manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;}
}
else
{agent_dialed_type='XFER_OVERRIDE';}
}
if (taskFromConf == 'YES')
{basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid);}
{basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);}
else
{basic_originate_call(manual_string,'NO','NO','','','','1');}
{basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);}
MD_ring_secondS=0;
}
// ################################################################################
// Send Originate command to manager to place a phone call
function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid)
function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias)
{
var usegroupalias=0;
var regCXFvars = new RegExp("CXFER","g");
var tasknum_string = tasknum.toString();
if (tasknum_string.match(regCXFvars))
@@ -2528,14 +2614,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
if (taskprefix == 'NO') {var orig_prefix = '';}
else {var orig_prefix = agc_dial_prefix;}
if (taskprefix == 'NO') {var call_prefix = '';}
else {var call_prefix = agc_dial_prefix;}
if (prefix_choice.length > 0)
{var call_prefix = prefix_choice;}
if (taskreverse == 'YES')
{
if (taskdialvalue.length < 2)
{var dialnum = dialplan_number;}
else
{var dialnum = taskdialvalue;}
var call_prefix = '';
var originatevalue = "Local/" + tasknum + "@" + ext_context;
}
else
@@ -2558,12 +2649,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
{var queryCID = "DCagcW" + epoch_sec + user_abb;}
else
{var queryCID = "DVagcW" + epoch_sec + user_abb;}
if (taskcid.length > 3)
{var call_cid = taskcid;}
else
{var call_cid = campaign_cid;}
VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + orig_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid;
if (cid_choice.length > 3)
{
var call_cid = cid_choice;
usegroupalias=1;
}
else
{
if (taskcid.length > 3)
{var call_cid = taskcid;}
else
{var call_cid = campaign_cid;}
}
VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type;
xmlhttp.open('POST', 'manager_send.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(VMCoriginate_query);
@@ -2571,6 +2671,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
// alert(VMCoriginate_query);
// alert(xmlhttp.responseText);
if ((taskdialvalue.length > 0) && (tasknowait != 'YES'))
@@ -2584,6 +2685,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
}
delete xmlhttp;
active_group_alias='';
cid_choice='';
prefix_choice='';
agent_dialed_number='';
agent_dialed_type='';
}
}
@@ -2820,6 +2926,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
document.vicidial_form.phone_code.value = APIDiaL_array_detail[1];
document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0];
document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5];
prefix_choice = APIDiaL_array_detail[7];
active_group_alias = APIDiaL_array_detail[8];
cid_choice = APIDiaL_array_detail[9];
// alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value);
@@ -3626,7 +3735,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
document.vicidial_form.LeadPreview.checked=true;
document.vicidial_form.DiaLAltPhonE.checked=true;
hideDiv('CallBacKsLisTBox');
ManualDialNext(taskCBid,taskLEADid,'','','');
ManualDialNext(taskCBid,taskLEADid,'','','','0');
}
@@ -3658,6 +3767,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
else
{
if (agent_allow_group_alias == 'Y')
{
document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "<font size=2 face=\"Arial,Helvetica\">Group Alias: " + active_group_alias + "</font>";
document.getElementById("ManuaLDiaLGrouP").innerHTML = "<a href=\"#\" onclick=\"GroupAliasSelectContent_create('0');\"><font size=1 face=\"Arial,Helvetica\">Click Here to Choose a Group Alias</font></a>";
}
showDiv('NeWManuaLDiaLBox');
}
}
@@ -3669,6 +3783,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
function NeWManuaLDiaLCalLSubmiT(tempDiaLnow)
{
hideDiv('NeWManuaLDiaLBox');
document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias;
var sending_group_alias = 0;
var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value;
var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value;
var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value;
@@ -3682,22 +3799,36 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (MDDiaLOverridEform.length > 0)
{
basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1');
agent_dialed_number=1;
agent_dialed_type='MANUAL_OVERRIDE';
basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0');
}
else
{
alt_phone_dialing=1;
auto_dial_level=0;
manual_dial_in_progress=1;
agent_dialed_number=1;
MainPanelToFront();
if (tempDiaLnow == 'PREVIEW')
{
agent_dialed_type='MANUAL_PREVIEW';
buildDiv('DiaLLeaDPrevieW');
buildDiv('DiaLDiaLAltPhonE');
document.vicidial_form.LeadPreview.checked=true;
document.vicidial_form.DiaLAltPhonE.checked=true;
}
ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode);
else
{
agent_dialed_type='MANUAL_DIALNOW';
document.vicidial_form.LeadPreview.checked=false;
document.vicidial_form.DiaLAltPhonE.checked=false;
}
if (active_group_alias.length > 1)
{var sending_group_alias = 1;}
ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias);
}
document.vicidial_form.MDPhonENumbeR.value = '';
@@ -3722,6 +3853,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (document.vicidial_form.LeadLookuP.checked==true)
{MDLookuPLeaD = 'lookup';}
agent_dialed_number=1;
agent_dialed_type='MANUAL_DIALFAST';
alt_phone_dialing=1;
auto_dial_level=0;
manual_dial_in_progress=1;
@@ -3730,7 +3863,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
buildDiv('DiaLDiaLAltPhonE');
document.vicidial_form.LeadPreview.checked=false;
document.vicidial_form.DiaLAltPhonE.checked=true;
ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode);
ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0');
}
}
@@ -3901,7 +4034,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
// ################################################################################
// Send the Manual Dial Next Number request
function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid)
function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias)
{
inOUT = 'OUT';
all_record = 'NO';
@@ -3952,7 +4085,16 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid;
if (cid_choice.length > 3)
{var call_cid = cid_choice;}
else
{var call_cid = campaign_cid;}
if (prefix_choice.length > 0)
{var call_prefix = prefix_choice;}
else
{var call_prefix = dial_prefix;}
manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type;
// alert(manual_dial_filter + "\n" +manDiaLnext_query);
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
@@ -3990,7 +4132,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (starting_dial_level == 0)
{
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
}
else
{
@@ -3998,7 +4140,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
{
auto_dial_level=starting_dial_level;
document.getElementById("DiaLControl").innerHTML = "<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><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("DiaLControl").innerHTML = "<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><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
}
else
{
@@ -4202,6 +4344,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
}
delete xmlhttp;
if (document.vicidial_form.LeadPreview.checked==false)
{
active_group_alias='';
cid_choice='';
prefix_choice='';
agent_dialed_number='';
agent_dialed_type='';
}
}
}
@@ -4309,16 +4460,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (dial_method == "INBOUND_MAN")
{
document.getElementById("DiaLControl").innerHTML = "<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><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("DiaLControl").innerHTML = "<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><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
}
else
{
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
}
}
}
}
delete xmlhttp;
active_group_alias='';
cid_choice='';
prefix_choice='';
agent_dialed_number='';
agent_dialed_type='';
}
}
}
@@ -4332,6 +4488,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
alt_dial_status_display = 0;
all_record = 'NO';
all_record_count=0;
var usegroupalias=0;
if (taskaltnum == 'ALTPhoneE')
{
var manDiaLonly_num = document.vicidial_form.alt_phone.value;
@@ -4402,7 +4559,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
if (xmlhttp)
{
manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + dial_prefix + "&campaign_cid=" + campaign_cid + "&omit_phone_code=" + omit_phone_code;
if (cid_choice.length > 3)
{
var call_cid = cid_choice;
usegroupalias=1;
}
else
{var call_cid = campaign_cid;}
if (prefix_choice.length > 0)
{var call_prefix = prefix_choice;}
else
{var call_prefix = dial_prefix;}
manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type;
xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(manDiaLonly_query);
@@ -4411,6 +4580,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var MDOnextResponse = null;
// alert(manDiaLonly_query);
// alert(xmlhttp.responseText);
MDOnextResponse = xmlhttp.responseText;
@@ -4466,6 +4636,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
}
delete xmlhttp;
active_group_alias='';
cid_choice='';
prefix_choice='';
agent_dialed_number='';
agent_dialed_type='';
}
}
@@ -4491,7 +4666,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
{
auto_dial_level=starting_dial_level;
document.getElementById("DiaLControl").innerHTML = "<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\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("DiaLControl").innerHTML = "<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\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
}
else
{
@@ -4507,7 +4682,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
{
auto_dial_level=starting_dial_level;
document.getElementById("DiaLControl").innerHTML = "<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><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("DiaLControl").innerHTML = "<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><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
}
else
{
@@ -4721,7 +4896,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
var check_VDIC_array=check_incoming.split("\n");
if (check_VDIC_array[0] == '1')
{
// alert(xmlhttprequestcheckauto.responseText);
// alert(xmlhttprequestcheckauto.responseText);
AutoDialWaiting = 0;
var VDIC_data_VDAC=check_VDIC_array[1].split("|");
@@ -4756,6 +4931,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
else
{LIVE_campaign_rec_filename = campaign_rec_filename;}
if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') )
{LIVE_default_group_alias = VDIC_data_VDIG[14];}
else
{LIVE_default_group_alias = default_group_alias;}
if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') )
{LIVE_caller_id_number = VDIC_data_VDIG[15];}
else
{LIVE_caller_id_number = default_group_alias_cid;}
if (VDIC_data_VDIG[16].length > 0)
{LIVE_web_vars = VDIC_data_VDIG[16];}
else
{LIVE_web_vars = default_web_vars;}
var VDIC_data_VDFR=check_VDIC_array[3].split("|");
if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') )
{VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];}
@@ -5375,7 +5565,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
else
{
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
}
reselect_alt_dial = 0;
}
@@ -5706,6 +5896,38 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
}
// ################################################################################
// Generate the Group Alias Chooser panel
function GroupAliasSelectContent_create(task3way)
{
showDiv('GroupAliasSelectBox');
WaitingForNextStep=1;
GroupAlias_HTML = '';
document.vicidial_form.GroupAliasSelection.value = '';
var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2);
GroupAlias_HTML = "<table cellpadding=5 cellspacing=5 width=500><tr><td colspan=2><B> GROUP ALIAS</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=GroupAliasSelectA>";
if (task3way > 0)
{
VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1);
GroupAlias_HTML = GroupAlias_HTML + "<font size=2 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('CAMPAIGN','" + campaign_cid + "','0');return false;\">CAMPAIGN - " + campaign_cid + "</a></b></font><BR><BR>";
GroupAlias_HTML = GroupAlias_HTML + "<font size=2 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('CUSTOMER','" + document.vicidial_form.phone_number.value + "','0');return false;\">CUSTOMER - " + document.vicidial_form.phone_number.value + "</a></b></font><BR><BR>";
GroupAlias_HTML = GroupAlias_HTML + "<font size=2 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('AGENT_PHONE','" + outbound_cid + "','0');return false;\">AGENT_PHONE - " + outbound_cid + "</a></b></font><BR><BR>";
}
var loop_ct = 0;
while (loop_ct < VD_group_aliases_ct)
{
GroupAlias_HTML = GroupAlias_HTML + "<font size=2 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('" + VARgroup_alias_ids[loop_ct] + "','" + VARcaller_id_numbers[loop_ct] + "','1');return false;\">" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "</a></b></font><BR><BR>";
loop_ct++;
if (loop_ct == VD_group_aliases_ct_half)
{GroupAlias_HTML = GroupAlias_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=GroupAliasSelectB>";}
}
var Go_BacK_LinK = "<font size=3 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('');return false;\">Go Back</a>";
GroupAlias_HTML = GroupAlias_HTML + "</span></font></td></tr></table><BR><BR>" + Go_BacK_LinK;
document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML;
}
// ################################################################################
// open web form, then submit disposition
function WeBForMDispoSelect_submit()
@@ -5893,7 +6115,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
if (manual_auto_hotkey == '1')
{
manual_auto_hotkey = 0;
ManualDialNext('','','','','');
ManualDialNext('','','','','','0');
}
}
}
@@ -5948,6 +6170,22 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
}
// ################################################################################
// Submit the Group Alias
function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup)
{
hideDiv('GroupAliasSelectBox');
WaitingForNextStep=0;
if (newusegroup > 0)
{
active_group_alias = newgroupalias;
document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "<font size=2 face=\"Arial,Helvetica\">Group Alias: " + active_group_alias + "</font>";
document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "<font size=1 face=\"Arial,Helvetica\">Group Alias: " + active_group_alias + "</font>";
}
cid_choice = newgroupcid;
}
// ################################################################################
// Populate the dtmf and xfer number for each preset link in xfer-conf frame
@@ -5966,13 +6204,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
{
document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf;
document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber;
basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1');
basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0');
}
function DtMf_PreSet_b_DiaL()
{
document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf;
document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber;
basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1');
basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0');
}
// ################################################################################
@@ -6461,6 +6699,7 @@ encoded=utf8_decode(xtest);
var SCserver_ip = server_ip;
var SCSIPexten = extension;
var SCsession_id = session_id;
var SCweb_vars = LIVE_web_vars;
if (encoded.match(RGiframe))
{
@@ -6503,6 +6742,7 @@ encoded=utf8_decode(xtest);
SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+');
SCserver_ip = SCserver_ip.replace(RGplus,'+');
SCSIPexten = SCSIPexten.replace(RGplus,'+');
SCweb_vars = SCweb_vars.replace(RGplus,'+');
}
var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g");
@@ -6546,6 +6786,7 @@ encoded=utf8_decode(xtest);
var RGserver_ip = new RegExp("--A--server_ip--B--","g");
var RGSIPexten = new RegExp("--A--SIPexten--B--","g");
var RGsession_id = new RegExp("--A--session_id--B--","g");
var RGweb_vars = new RegExp("--A--web_vars--B--","g");
encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code);
encoded = encoded.replace(RGsource_id, SCsource_id);
@@ -6588,6 +6829,7 @@ encoded=utf8_decode(xtest);
encoded = encoded.replace(RGserver_ip, SCserver_ip);
encoded = encoded.replace(RGSIPexten, SCSIPexten);
encoded = encoded.replace(RGsession_id, SCsession_id);
encoded = encoded.replace(RGweb_vars, SCweb_vars);
}
decoded=encoded; // simple no ?
decoded = decoded.replace(RGnl, "<BR>");
@@ -6914,6 +7156,7 @@ else
hideDiv('CallBacKsLisTBox');
hideDiv('NeWManuaLDiaLBox');
hideDiv('PauseCodeSelectBox');
hideDiv('GroupAliasSelectBox');
if (agentonly_callbacks != '1')
{hideDiv('CallbacksButtons');}
// if ( (agentcall_manual != '1') && (starting_dial_level > 0) )
@@ -7005,7 +7248,7 @@ else
if (document.vicidial_form.DiaLAltPhonE.checked==true)
{
reselect_alt_dial = 1;
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call";
}
@@ -7484,6 +7727,21 @@ else
document.getElementById("XferControl").innerHTML = "<a href=\"#\" onclick=\"ShoWTransferMain('ON');\"><IMG SRC=\"./images/vdc_LB_transferconf.gif\" border=0 alt=\"Transfer - Conference\"></a>";
}
}
if (three_way_call_cid == 'AGENT_CHOOSE')
{
if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) )
{
active_group_alias = LIVE_default_group_alias;
cid_choice = LIVE_caller_id_number;
}
document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "<font size=1 face=\"Arial,Helvetica\">Group Alias: " + active_group_alias + "</font>";
document.getElementById("XfeRCID").innerHTML = "<a href=\"#\" onclick=\"GroupAliasSelectContent_create('1');\"><font size=1 face=\"Arial,Helvetica\">Click Here to Choose a Group Alias</font></a>";
}
else
{
document.getElementById("XfeRCID").innerHTML = "";
document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "";
}
}
else
{
@@ -7524,7 +7782,7 @@ else
{
if (dial_method == "INBOUND_MAN")
{
document.getElementById("DiaLControl").innerHTML = "<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><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
document.getElementById("DiaLControl").innerHTML = "<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><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"./images/vdc_LB_dialnextnumber.gif\" border=0 alt=\"Dial Next Number\"></a>";
if (manual_dial_preview == 1)
{buildDiv('DiaLLeaDPrevieW');}
}
@@ -7679,7 +7937,11 @@ echo "</head>\n";
<td align=left><font class="body_text"><input type=checkbox name=LeadLookuP size=1 value="0">&nbsp; (This option if checked will attempt to find the phone number in the system before inserting it as a new lead)</td>
</tr><tr>
<td align=right colspan=2><BR><BR>If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Dial Override field below. To hangup this call you will have to open the CALLS IN THIS SESSION link at the bottom of the screen and hang it up by clicking on its channel link there.<BR> &nbsp; </td>
<td align=left colspan=2>
<BR><BR><CENTER>
<span id="ManuaLDiaLGrouPSelecteD"></span> &nbsp; &nbsp; <span id="ManuaLDiaLGrouP"></span>
</CENTER>
<BR><BR>If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Dial Override field below. To hangup this call you will have to open the CALLS IN THIS SESSION link at the bottom of the screen and hang it up by clicking on its channel link there.<BR> &nbsp; </td>
</tr><tr>
<td align=right><font class="body_text"> Dial Override: </td>
<td align=left><font class="body_text"><input type=text size=24 maxlength=20 name=MDDiaLOverridE class="cust_form" value="">&nbsp; (digits only please)
@@ -7712,7 +7974,7 @@ Your Status: <span id="AgentStatusStatus"></span> <BR>Calls Dialing: <span id="A
<td align=left>
<div class="text_input" id="TransferMaindiv">
<font class="body_text">
<IMG SRC="./images/vdc_XB_header.gif" border=0 alt="Transfer - Conference"><BR>
<IMG SRC="./images/vdc_XB_header.gif" border=0 alt="Transfer - Conference"> &nbsp; &nbsp; &nbsp; &nbsp; <span id="XfeRDiaLGrouPSelecteD"></span> &nbsp; &nbsp; <span id="XfeRCID"></span><BR>
<span id="XfeRGrouPLisT"><select size=1 name=XfeRGrouP class="cust_form"><option>-- SELECT A GROUP TO SEND YOUR CALL TO --</option></select></span>
<span STYLE="background-color: #CCCCCC" id="LocalCloser"><IMG SRC="./images/vdc_XB_localcloser_OFF.gif" border=0 alt="LOCAL CLOSER"></span>
@@ -7881,7 +8143,15 @@ Your Status: <span id="AgentStatusStatus"></span> <BR>Calls Dialing: <span id="A
</TD></TR></TABLE>
</span>
<span style="position:absolute;left:0px;top:1000px;z-index:44;" id="GENDERhideFORieALT"></span>
<span style="position:absolute;left:0px;top:0px;z-index:44;" id="GroupAliasSelectBox">
<table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=460><TR><TD align=center VALIGN=top> SELECT A GROUP ALIAS :<BR>
<span id="GroupAliasSelectContent"> Group Alias Selection </span>
<input type=hidden name=GroupAliasSelection>
<BR><BR> &nbsp;
</TD></TR></TABLE>
</span>
<span style="position:absolute;left:0px;top:1000px;z-index:45;" id="GENDERhideFORieALT"></span>
<span style="position:absolute;left:0px;top:0px;z-index:38;" id="CallBackSelectBox">
@@ -8008,7 +8278,7 @@ else
<tr><td colspan=3><span id="busycallsdebug"></span></td></tr>
<tr><td width=150 align=left valign=top>
<font class="body_text"><center>
<span STYLE="background-color: #CCFFCC" id="DiaLControl"><a href="#" onclick="ManualDialNext('','','','','');"><IMG SRC="./images/vdc_LB_dialnextnumber_OFF.gif" border=0 alt="Dial Next Number"></a></span><BR>
<span STYLE="background-color: #CCFFCC" id="DiaLControl"><a href="#" onclick="ManualDialNext('','','','','','0');"><IMG SRC="./images/vdc_LB_dialnextnumber_OFF.gif" border=0 alt="Dial Next Number"></a></span><BR>
<span id="DiaLLeaDPrevieW"><font class="preview_text"> <input type=checkbox name=LeadPreview size=1 value="0"> LEAD PREVIEW<BR></font></span>
<span id="DiaLDiaLAltPhonE"><font class="preview_text"> <input type=checkbox name=DiaLAltPhonE size=1 value="0"> ALT PHONE DIAL<BR></font></span>
+1495 -207
View File
File diff suppressed because it is too large Load Diff
+41 -2
View File
@@ -15,6 +15,7 @@
# 80617-1402 - Fixed timeclock total logged-in time
# 81210-1634 - Added server recording display options
# 90208-0504 - Added link to multi-day report and fixed call status summary section
# 90305-1226 - Added user_call_log manual dial logs
#
header ("Content-type: text/html; charset=utf-8");
@@ -103,7 +104,7 @@ echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"
</head>
<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>
<CENTER>
<TABLE WIDTH=680 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> &nbsp; VICIDIAL ADMIN</a>: User Stats for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?> &nbsp; </TD></TR>
<TABLE WIDTH=770 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><? echo "<a href=\"./admin.php\">" ?><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> &nbsp; VICIDIAL ADMIN</a>: User Stats for <? echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B><? echo date("l F j, Y G:i:s A") ?> &nbsp; </TD></TR>
@@ -590,7 +591,45 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon
}
echo "</TABLE></center>\n";
echo "</TABLE><BR><BR>\n";
##### vicidial agent outbound user manual calls for this time period #####
echo "<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n";
echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n";
echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td></tr>\n";
$stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;";
$rslt=mysql_query($stmt, $link);
$logs_to_print = mysql_num_rows($rslt);
$u=0;
while ($logs_to_print > $u) {
$row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $u))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
$u++;
echo "<tr $bgcolor>";
echo "<td><font size=1>$u</td>";
echo "<td><font size=2>$row[0]</td>";
echo "<td align=left><font size=2> $row[1]</td>\n";
echo "<td align=left><font size=2> $row[2]</td>\n";
echo "<td align=left><font size=2> $row[3] </td>\n";
echo "<td align=right><font size=2> $row[4] </td>\n";
echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n";
echo "<td align=right><font size=2> $row[6] </td>\n";
echo "<td align=right><font size=2> $row[7] </td></tr>\n";
}
echo "</TABLE><BR><BR>\n";
$ENDtime = date("U");
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

+142 -90
View File
@@ -1,95 +1,15 @@
<?
### vtiger web api for user administration
/**
* @return -- returns a list of all users in the system.
function verify_data()
{
$usr_name = $this->column_fields["user_name"];
global $mod_strings;
$query = "SELECT user_name from vtiger_users where user_name=? AND id<>? AND deleted=0";
$result =$this->db->pquery($query, array($usr_name, $this->id), true, "Error selecting possible duplicate users: ");
$dup_users = $this->db->fetchByAssoc($result);
$query = "SELECT user_name from vtiger_users where is_admin = 'on' AND deleted=0";
$result =$this->db->pquery($query, array(), true, "Error selecting possible duplicate vtiger_users: ");
$last_admin = $this->db->fetchByAssoc($result);
$this->log->debug("last admin length: ".count($last_admin));
$this->log->debug($last_admin['user_name']." == ".$usr_name);
$verified = true;
if($dup_users != null)
{
$this->error_string .= $mod_strings['ERR_USER_NAME_EXISTS_1'].$usr_name.''.$mod_strings['ERR_USER_NAME_EXISTS_2'];
$verified = false;
}
if(!isset($_REQUEST['is_admin']) &&
count($last_admin) == 1 &&
$last_admin['user_name'] == $usr_name) {
$this->log->debug("last admin length: ".count($last_admin));
$this->error_string .= $mod_strings['ERR_LAST_ADMIN_1'].$usr_name.$mod_strings['ERR_LAST_ADMIN_2'];
$verified = false;
}
return $verified;
}
*/
# require("../vtigercrm/modules/Calendar/Activity.php");
# $verified = verify_data();
/*
* @return string encrypted password for storage in DB and comparison against DB password.
* @param string $user_name - Must be non null and at least 2 characters
* @param string $user_password - Must be non null and at least 1 character.
* @desc Take an unencrypted username and password and return the encrypted password
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc..
* All Rights Reserved..
* Contributor(s): ______________________________________..
function encrypt_password($user_password, $crypt_type='')
{
// encrypt the password.
$salt = substr($this->column_fields["user_name"], 0, 2);
// Fix for: http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/4923
if($crypt_type == '') {
// Try to get the crypt_type which is in database for the user
$crypt_type = $this->get_user_crypt_type();
}
// For more details on salt format look at: http://in.php.net/crypt
if($crypt_type == 'MD5') {
$salt = '$1$' . $salt . '$';
} else if($crypt_type == 'BLOWFISH') {
$salt = '$2$' . $salt . '$';
}
$encrypted_password = crypt($user_password, $salt);
return $encrypted_password;
}
*/
##### vtiger_user.php - script used to synchronize the users from the VICIDIAL
##### vicidial_users table into the Vtiger system
# vtiger_user.php - script used to synchronize the users from the VICIDIAL
# vicidial_users table into the Vtiger system as well as
# the groups from VICIDIAL to Vtiger
#
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 81231-1307 - First build
# 90228-2152 - Added Groups support
#
header ("Content-type: text/html; charset=utf-8");
require("dbconnect.php");
@@ -138,8 +58,22 @@ if ($enable_vtiger_integration < 1)
exit;
}
##### grab the existing user_groups in the vicidial_user_groups table
$stmt="SELECT user_group,group_name FROM vicidial_user_groups;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VD_groups_ct = mysql_num_rows($rslt);
$i=0;
while ($i < $VD_groups_ct)
{
$row=mysql_fetch_row($rslt);
$UGid[$i] = $row[0];
$UGname[$i] = $row[1];
$i++;
}
##### grab the existing users in the vicidial_users table
$stmt="SELECT user,pass,full_name,user_level,active FROM vicidial_users;";
$stmt="SELECT user,pass,full_name,user_level,active,user_group FROM vicidial_users;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$VD_users_ct = mysql_num_rows($rslt);
@@ -152,6 +86,7 @@ while ($i < $VD_users_ct)
$full_name[$i] = $row[2]; while (strlen($full_name[$i])>30) {$full_name[$i] = eregi_replace(".$",'',$full_name[$i]);}
$user_level[$i] = $row[3];
$active[$i] = $row[4];
$user_group[$i] = $row[5];
$i++;
}
@@ -159,21 +94,96 @@ while ($i < $VD_users_ct)
### connect to your vtiger database
$linkV=mysql_connect("$vtiger_server_ip", "$vtiger_login","$vtiger_pass");
if (!$linkV) {die("Could not connect: $vtiger_server_ip|$vtiger_dbname|$vtiger_login|$vtiger_pass" . mysql_error());}
echo 'Connected successfully';
echo "Connected successfully\n<BR>\n";
mysql_select_db("$vtiger_dbname", $linkV);
##########################
### BEGIN Group export
$i=0;
while ($i < $VD_groups_ct)
{
$VTgroup_name = $UGid[$i];
$VTgroup_description = $UGname[$i];
$stmt="SELECT count(*) from vtiger_groups where groupname='$VTgroup_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$group_found_count = $row[0];
### group exists in vtiger, grab groupid, update description
if ($group_found_count > 0)
{
$stmt="SELECT groupid from vtiger_groups where groupname='$VTgroup_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$groupid = $row[0];
$VTugID[$i] = $groupid;
$stmtA = "UPDATE vtiger_groups SET description='$VTgroup_description' where groupid='$groupid';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
echo "GROUP- $VTgroup_name: $groupid<BR>\n";
echo "<BR>\n";
}
### group doesn't exist in vtiger, insert it
else
{
#### BEGIN CREATE NEW GROUP RECORD IN VTIGER
# Get next available id from vtiger_groups_seq to use as groupid
$stmt="SELECT id from vtiger_groups_seq;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
$row=mysql_fetch_row($rslt);
$groupid = ($row[0] + 1);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$VTugID[$i] = $groupid;
# Increase next available groupid with 1 so next record gets proper id
$stmt="UPDATE vtiger_groups_seq SET id = '$groupid';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtA = "INSERT INTO vtiger_groups SET groupid='$groupid',groupname='$VTgroup_name',description='$VTgroup_description';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
echo "GROUP- $VTgroup_name: $groupid<BR>\n";
echo "<BR>\n";
#### END CREATE NEW GROUP RECORD IN VTIGER
}
$i++;
}
### END Group export
##########################
##########################
### BEGIN User export
$i=0;
while ($i < $VD_users_ct)
{
$user_name = $user[$i];
$VUgroup = $user_group[$i];
$user_password = $pass[$i];
$last_name = $full_name[$i];
$is_admin = 'off';
$roleid = 'H5';
$status = 'Active';
$groupid = '1';
if ($user_level[$i] >= 8) {$roleid = 'H4';}
if ($user_level[$i] >= 7) {$roleid = 'H4';}
if ($user_level[$i] >= 8) {$roleid = 'H3';}
if ($user_level[$i] >= 9) {$roleid = 'H2';}
if ($user_level[$i] >= 9) {$is_admin = 'on';}
if (ereg('N',$active[$i])) {$status = 'Inactive';}
@@ -182,6 +192,22 @@ while ($i < $VD_users_ct)
$encrypted_password = crypt($user_password, $salt);
$i++;
$j=0;
$all_VICIDIAL_groups_SQL='';
while ($j < $VD_groups_ct)
{
if ( (eregi("$UGid[$j]",$VUgroup)) and ( (strlen($UGid[$j]))==(strlen($VUgroup)) ) )
{
$groupid = $VTugID[$j];
$VTgroup_name = $UGid[$j];
$VTgroup_description = $UGname[$j];
}
else
{$all_VICIDIAL_groups_SQL .= "'$VTugID[$j]',";}
$j++;
}
$all_VICIDIAL_groups_SQL = preg_replace("/.$/",'',$all_VICIDIAL_groups_SQL);
$stmt="SELECT count(*) from vtiger_users where user_name='$user_name';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
@@ -199,6 +225,13 @@ while ($i < $VD_users_ct)
$row=mysql_fetch_row($rslt);
$userid = $row[0];
$stmt="SELECT count(*) from vtiger_users2group WHERE userid='$userid' and groupid='$groupid';";
$rslt=mysql_query($stmt, $linkV);
if ($DB) {echo "$stmt\n";}
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$row=mysql_fetch_row($rslt);
$usergroupcount = $row[0];
$stmtA = "UPDATE vtiger_users SET user_password='$encrypted_password',last_name='$last_name',is_admin='$is_admin',status='$status' where id='$userid';";
if ($DB) {echo "|$stmtA|\n";}
$rslt=mysql_query($stmtA, $linkV);
@@ -209,9 +242,26 @@ while ($i < $VD_users_ct)
$rslt=mysql_query($stmtB, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
if ($usergroupcount < 1)
{
$stmtC = "DELETE FROM vtiger_users2group WHERE userid='$userid' and groupid IN($all_VICIDIAL_groups_SQL);";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtC, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
$stmtD = "INSERT INTO vtiger_users2group SET userid='$userid',groupid='$groupid';";
if ($DB) {echo "|$stmtC|\n";}
$rslt=mysql_query($stmtD, $linkV);
if (!$rslt) {die('Could not execute: ' . mysql_error());}
}
else
{$stmtC='';}
echo "$user_name: $userid<BR>\n";
echo "$stmtA<BR>\n";
echo "$stmtB<BR>\n";
echo "$stmtC<BR>\n";
echo "$stmtD<BR>\n";
echo "<BR>\n";
}
@@ -252,6 +302,8 @@ while ($i < $VD_users_ct)
}
### END User export
##########################