Changed the PARK CUSTOMER option in campaigns to use a true Music-on-Hold context
Added new IVR PARK CUSTOMER feature to campaigns allowing an agent to park a customer to an IVR, collect data, then go back to the agent git-svn-id: svn://192.168.202.10@1533 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -347,6 +347,15 @@ OTHER CHANGES:
|
||||
process. There is a more limited set of variables available for use with
|
||||
this option, see the admin.php help for more details
|
||||
|
||||
76. Changed the PARK CUSTOMER option in campaigns to use a Music-on-Hold context
|
||||
instead of a difficult-to-configure filename and extension as before
|
||||
|
||||
77. Added new IVR PARK CUSTOMER feature to campaigns allowing an agent to park
|
||||
a customer to an AGI script as an IVR and have the customer enter in
|
||||
digits unassisted and then be redirected back to the agent who parked
|
||||
them when they are finished. Optional in-group redirect if customer
|
||||
does not enter valid input. See example park_call_IVR_example.agi script
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+185
-54
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# park_CID.agi version 2.2.0 *DBI-version*
|
||||
# park_CID.agi version 2.4
|
||||
#
|
||||
# runs before the park extension to populate the parked_channels entry with the channel's callerid
|
||||
#
|
||||
@@ -12,13 +12,14 @@
|
||||
# exten => 8301,3,Playback(park)
|
||||
# exten => 8301,4,Hangup
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# changes:
|
||||
# 60731-1423 - changed to use DBI-DBD::mysql
|
||||
# - changed to use /etc/astguiclient.conf for configs
|
||||
# 60815-1256 - added output options check from database
|
||||
# 90909-0922 - Fixed calleridname issue
|
||||
# 101004-1012 - Changed park to Music On Hold, added option for park on AGI
|
||||
#
|
||||
|
||||
$script = 'park_CID.agi';
|
||||
@@ -77,6 +78,8 @@ if (!$VARDB_port) {$VARDB_port='3306';}
|
||||
if (!$AGILOGfile) {$AGILOGfile = "$PATHlogs/agiout.$year-$mon-$mday";}
|
||||
|
||||
use DBI;
|
||||
use Asterisk::AGI;
|
||||
$AGI = new Asterisk::AGI;
|
||||
|
||||
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||
or die "Couldn't connect to database: " . DBI->errstr;
|
||||
@@ -90,27 +93,27 @@ $rec_count=0;
|
||||
while ($sthArows > $rec_count)
|
||||
{
|
||||
$AGILOG = '0';
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$DBagi_output = "$aryA[0]";
|
||||
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
|
||||
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
|
||||
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
|
||||
$rec_count++;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$DBagi_output = $aryA[0];
|
||||
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
|
||||
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
|
||||
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
|
||||
### 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++;
|
||||
}
|
||||
{
|
||||
$args = "$args $ARGV[$i]";
|
||||
if ($AGILOG) {$agi_string = "$i|$ARGV[$i]"; &agi_output;}
|
||||
$i++;
|
||||
}
|
||||
if ($args =~ />| |\"/i)
|
||||
{
|
||||
@CID = split(/-----/, $args);
|
||||
@@ -120,48 +123,49 @@ if (length($ARGV[0])>1)
|
||||
}
|
||||
|
||||
if ($args =~ /--help/i)
|
||||
{
|
||||
print "allowed run time options:\n [-q] = quiet\n [-t] = test\n [-debug] = verbose debug messages\n\n";
|
||||
}
|
||||
{
|
||||
print "allowed run time options:\n [-q] = quiet\n [-t] = test\n [-debug] = verbose debug messages\n\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
if ($args =~ /-V/i)
|
||||
{
|
||||
$V=1;
|
||||
}
|
||||
{
|
||||
$V=1;
|
||||
}
|
||||
if ($args =~ /-debug/i)
|
||||
{
|
||||
$DG=1;
|
||||
}
|
||||
{
|
||||
$DG=1;
|
||||
}
|
||||
if ($args =~ /-dbAVS/i)
|
||||
{
|
||||
$DGA=1;
|
||||
}
|
||||
{
|
||||
$DGA=1;
|
||||
}
|
||||
if ($args =~ /-q/i)
|
||||
{
|
||||
$q=1;
|
||||
$Q=1;
|
||||
}
|
||||
{
|
||||
$q=1;
|
||||
$Q=1;
|
||||
}
|
||||
if ($args =~ /-t/i)
|
||||
{
|
||||
$TEST=1;
|
||||
$T=1;
|
||||
{
|
||||
$TEST=1;
|
||||
$T=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$|=1;
|
||||
while(<STDIN>) {
|
||||
while(<STDIN>)
|
||||
{
|
||||
chomp;
|
||||
last unless length($_);
|
||||
if ($AGILOG)
|
||||
{
|
||||
if (/^agi_(\w+)\:\s+(.*)$/)
|
||||
{
|
||||
if (/^agi_(\w+)\:\s+(.*)$/)
|
||||
{
|
||||
$AGI{$1} = $2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (/^agi_uniqueid\:\s+(.*)$/) {$unique_id = $1;}
|
||||
if (/^agi_channel\:\s+(.*)$/) {$channel = $1;}
|
||||
@@ -174,6 +178,8 @@ while(<STDIN>) {
|
||||
if ( $calleridname =~ /\"/) {$calleridname =~ s/\"//gi;}
|
||||
if ( (!$callerid) or ($callerid =~ /unknown/) or ( ($calleridname =~ /\d\d\d\d\d\d\d\d\d/) && (length($calleridname) > 16) ) )
|
||||
{$callerid = $calleridname;}
|
||||
if ( ($callerid =~ / /) && (length($callerid) > 20) )
|
||||
{$callerid =~ s/ .*//gi;}
|
||||
|
||||
### allow for ANI being sent with the DNIS "*3125551212*9999*"
|
||||
if ($extension =~ /^\*\d\d\d\d\d\d\d\d\d\d\*/)
|
||||
@@ -186,14 +192,14 @@ while(<STDIN>) {
|
||||
}
|
||||
$calleridname = $callerid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($AGILOG) {$agi_string = "AGI Environment Dump:"; &agi_output;}
|
||||
|
||||
foreach $i (sort keys %AGI)
|
||||
{
|
||||
{
|
||||
if ($AGILOG) {$agi_string = " -- $i = $AGI{$i}"; &agi_output;}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($AGILOG) {$agi_string = "AGI Variables: |$unique_id|$channel|$extension|$type|$callerid|"; &agi_output;}
|
||||
@@ -206,25 +212,150 @@ $stmtA = "UPDATE parked_channels set channel_group='$callerid' where server_ip='
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- Park record updated: |$affected_rows| |$callerid|$channel|$VARserver_ip"; &agi_output;}
|
||||
|
||||
$VACcount=0;
|
||||
$VAC_campaign_id='';
|
||||
$VAC_call_type='';
|
||||
$VAC_extension='';
|
||||
$VLAcount=0;
|
||||
$VLA_user='';
|
||||
$VLA_campaign_id='';
|
||||
$VCcount=0;
|
||||
$park_context='default';
|
||||
$MOHfiles=0;
|
||||
|
||||
$stmtA = "SELECT campaign_id,call_type,extension FROM vicidial_auto_calls where callerid='$callerid';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$VACcount=$sthA->rows;
|
||||
if ($VACcount > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VAC_campaign_id = $aryA[0];
|
||||
$VAC_call_type = $aryA[1];
|
||||
$VAC_extension = $aryA[2];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
if ($VACcount > 0)
|
||||
{
|
||||
$stmtA = "SELECT user,campaign_id FROM vicidial_live_agents where callerid='$callerid';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$VLAcount=$sthA->rows;
|
||||
if ($VLAcount > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VLA_user = $aryA[0];
|
||||
$VLA_campaign_id = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($VLAcount > 0)
|
||||
{
|
||||
$stmtA = "SELECT park_file_name,ivr_park_call_agi FROM vicidial_campaigns where campaign_id='$VLA_campaign_id';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$VCcount=$sthA->rows;
|
||||
if ($VCcount > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$park_context = $aryA[0];
|
||||
$VC_ivr_park_call_agi = $aryA[1];
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
$stmtA = "SELECT count(*) FROM vicidial_music_on_hold_files where moh_id='$park_context';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$MOHcount=$sthA->rows;
|
||||
if ($MOHcount > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$MOHfiles = $aryA[0];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($MOHfiles< 1)
|
||||
{
|
||||
if ($AGILOG) {$agi_string = "-- Context empty, switching to default: |$park_context|$MOHcount|$MOHfiles| |$callerid|"; &agi_output;}
|
||||
|
||||
$park_context = 'default';
|
||||
}
|
||||
|
||||
### call was parked to an IVR, launch the AGI script
|
||||
if ( ($VCcount > 0) && ($VAC_extension =~ /PARK_IVR/) && (length($VC_ivr_park_call_agi)>2) )
|
||||
{
|
||||
if ($AGILOG) {$agi_string = "-- Starting AGI: |$VC_ivr_park_call_agi| |$callerid|"; &agi_output;}
|
||||
|
||||
print "EXEC AGI $VC_ivr_park_call_agi\n";
|
||||
checkresult($result);
|
||||
|
||||
if ($AGILOG) {$agi_string = "-- AGI Done: |$callerid|"; &agi_output;}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$dbhA->disconnect();
|
||||
|
||||
|
||||
$AGI->stream_file('sip-silence');
|
||||
$AGI->stream_file('sip-silence');
|
||||
$AGI->stream_file('sip-silence');
|
||||
$AGI->stream_file('sip-silence');
|
||||
|
||||
if ($AGILOG) {$agi_string = "-- Starting MoH: |$park_context| |$callerid|"; &agi_output;}
|
||||
|
||||
print "SET MUSIC ON $park_context\n";
|
||||
checkresult($result);
|
||||
|
||||
sleep(360);
|
||||
|
||||
if ($AGILOG) {$agi_string = "-- MoH Done: |$callerid|"; &agi_output;}
|
||||
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
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);
|
||||
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='';
|
||||
}
|
||||
|
||||
|
||||
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++;
|
||||
}
|
||||
}
|
||||
### send to STDERR writing ###
|
||||
if ( ($AGILOG == '1') || ($AGILOG == '3') )
|
||||
{print STDERR "$now_date|$script|$agi_string\n";}
|
||||
$agi_string='';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,611 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# park_call_IVR_example.agi version 2.4
|
||||
#
|
||||
# NOTE: this script is an example of how you can use a custom AGI script with
|
||||
# the new Park Call IVR feature in campaigns. You will most likely need to
|
||||
# significantly alter this script to suit your specific needs
|
||||
#
|
||||
# Defined in the Park Call AGI IVR field of a campaign, this script will ask
|
||||
# customer for their ID and then populate it in the vicidial_list table and then
|
||||
# send the call back to the agent. If the customer enters nothing X number of
|
||||
# times then the call can be kicked out to a separate in-group
|
||||
#
|
||||
# Here is a list of the variables that you can set:
|
||||
# 1. Language - default: en (English), other options are es-Spanish, fr-French
|
||||
# 2. First prompt - default: please_enter_id_number
|
||||
# 3. You-Entered prompt - default: you-entered
|
||||
# 4. Confirmation prompt - default: confirm_id_number
|
||||
# 5. Thank you prompt - default: auth-thankyou
|
||||
# 6. Invalid prompt - default: buzz
|
||||
# 7. Attempts before kick-out - default: 2
|
||||
# 8. Kick-out prompt - default: outside-transfer
|
||||
# 9. Kick-out In-Group
|
||||
#
|
||||
# Example Park Call AGI IVR field:
|
||||
# park_call_IVR_example.agi|en---please_enter_id_number---you-entered---confirm_id_number---auth-thankyou---buzz---2---outside-transfer---TEST_IN
|
||||
#
|
||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# changes:
|
||||
# 101004-1132 - First build
|
||||
#
|
||||
|
||||
$script = 'park_call_IVR_example.agi';
|
||||
|
||||
($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) {$hour = "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";
|
||||
$S='*';
|
||||
|
||||
# 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";}
|
||||
|
||||
use DBI;
|
||||
use Asterisk::AGI;
|
||||
$AGI = new Asterisk::AGI;
|
||||
|
||||
$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,ext_context 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];
|
||||
$ext_context = $aryA[1];
|
||||
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
|
||||
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
|
||||
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
|
||||
$rec_count++;
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
|
||||
### 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++;
|
||||
}
|
||||
|
||||
### list of command-line array arguments:
|
||||
@ARGV_vars = split(/---/, $ARGV[0]);
|
||||
|
||||
$language = $ARGV_vars[0];
|
||||
$first_prompt = $ARGV_vars[1];
|
||||
$you_entered_prompt = $ARGV_vars[2];
|
||||
$confirmation_prompt = $ARGV_vars[3];
|
||||
$thank_you_prompt = $ARGV_vars[4];
|
||||
$invalid_prompt = $ARGV_vars[5];
|
||||
$kickout_attempts = $ARGV_vars[6];
|
||||
$kickout_prompt = $ARGV_vars[7];
|
||||
$kickout_ingroup = $ARGV_vars[8];
|
||||
}
|
||||
|
||||
if (length($language)<1) {$language='en';}
|
||||
if (length($first_prompt)<1) {$first_prompt='please_enter_id_number';}
|
||||
if (length($you_entered_prompt)<1) {$you_entered_prompt='you-entered';}
|
||||
if (length($confirmation_prompt)<1) {$confirmation_prompt='confirm_id_number';}
|
||||
if (length($thank_you_prompt)<1) {$thank_you_prompt='auth-thankyou';}
|
||||
if (length($invalid_prompt)<1) {$invalid_prompt='buzz';}
|
||||
if (length($kickout_attempts)<1) {$kickout_attempts='2';}
|
||||
if (length($kickout_prompt)<1) {$kickout_prompt='outside-transfer';}
|
||||
|
||||
$|=1;
|
||||
while(<STDIN>)
|
||||
{
|
||||
chomp;
|
||||
last unless length($_);
|
||||
if ($AGILOG)
|
||||
{
|
||||
if (/^agi_(\w+)\:\s+(.*)$/)
|
||||
{
|
||||
$AGI{$1} = $2;
|
||||
}
|
||||
}
|
||||
|
||||
if (/^agi_uniqueid\:\s+(.*)$/) {$unique_id = $1;}
|
||||
if (/^agi_channel\:\s+(.*)$/) {$channel = $1;}
|
||||
if (/^agi_extension\:\s+(.*)$/) {$extension = $1;}
|
||||
if (/^agi_type\:\s+(.*)$/) {$type = $1;}
|
||||
if (!$fullCID) # if no fullCID sent
|
||||
{
|
||||
if (/^agi_callerid\:\s+(.*)$/) {$callerid = $1;}
|
||||
if (/^agi_calleridname\:\s+(.*)$/) {$calleridname = $1;}
|
||||
if ( $calleridname =~ /\"/) {$calleridname =~ s/\"//gi;}
|
||||
if ( (!$callerid) or ($callerid =~ /unknown/) or ( ($calleridname =~ /\d\d\d\d\d\d\d\d\d/) && (length($calleridname) > 16) ) )
|
||||
{$callerid = $calleridname;}
|
||||
if ( ($callerid =~ / /) && (length($callerid) > 20) )
|
||||
{$callerid =~ s/ .*//gi;}
|
||||
|
||||
### allow for ANI being sent with the DNIS "*3125551212*9999*"
|
||||
if ($extension =~ /^\*\d\d\d\d\d\d\d\d\d\d\*/)
|
||||
{
|
||||
$callerid = $extension;
|
||||
$callerid =~ s/\*\d\d\d\d\*$//gi;
|
||||
$callerid =~ s/^\*//gi;
|
||||
$extension =~ s/^\*\d\d\d\d\d\d\d\d\d\d\*//gi;
|
||||
$extension =~ s/\*$//gi;
|
||||
}
|
||||
$calleridname = $callerid;
|
||||
}
|
||||
}
|
||||
|
||||
if ($AGILOG) {$agi_string = "AGI Environment Dump:"; &agi_output;}
|
||||
|
||||
foreach $i (sort keys %AGI)
|
||||
{
|
||||
if ($AGILOG) {$agi_string = " -- $i = $AGI{$i}"; &agi_output;}
|
||||
}
|
||||
|
||||
|
||||
if ($AGILOG) {$agi_string = "AGI Variables: |$unique_id|$channel|$extension|$type|$callerid|"; &agi_output;}
|
||||
|
||||
if ($AGILOG) {$agi_string = "PARKED CALL IVR STARTED"; &agi_output;}
|
||||
|
||||
|
||||
$stmtA = "UPDATE parked_channels set channel_group='$callerid' where server_ip='$VARserver_ip' and channel='$channel';";
|
||||
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- Park record updated: |$affected_rows| |$callerid|$channel|$VARserver_ip"; &agi_output;}
|
||||
|
||||
$VACcount=0;
|
||||
$VAC_campaign_id='';
|
||||
$VAC_call_type='';
|
||||
$VAC_extension='';
|
||||
$VLAcount=0;
|
||||
$VLA_user='';
|
||||
$VLA_campaign_id='';
|
||||
$VCcount=0;
|
||||
$MOHfiles=0;
|
||||
|
||||
$stmtA = "SELECT campaign_id,call_type,extension,phone_number,lead_id FROM vicidial_auto_calls where callerid='$callerid';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$VACcount=$sthA->rows;
|
||||
if ($VACcount > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VAC_campaign_id = $aryA[0];
|
||||
$VAC_call_type = $aryA[1];
|
||||
$VAC_extension = $aryA[2];
|
||||
$VAC_phone_number = $aryA[3];
|
||||
$VAC_lead_id = $aryA[4];
|
||||
if ($AGILOG) {$agi_string = "-- VAC Call Found: |$callerid|$VAC_campaign_id|$VAC_call_type|$VAC_extension|$VAC_phone_number|$VAC_lead_id|"; &agi_output;}
|
||||
}
|
||||
$sthA->finish();
|
||||
|
||||
|
||||
if ($VACcount > 0)
|
||||
{
|
||||
$stmtA = "SELECT user,campaign_id,server_ip,conf_exten FROM vicidial_live_agents where callerid='$callerid';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$VLAcount=$sthA->rows;
|
||||
if ($VLAcount > 0)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$VLA_user = $aryA[0];
|
||||
$VLA_campaign_id = $aryA[1];
|
||||
$VLA_server_ip = $aryA[2];
|
||||
$VLA_conf_exten = $aryA[3];
|
||||
}
|
||||
$sthA->finish();
|
||||
if ($VLAcount > 0)
|
||||
{
|
||||
if ($AGILOG) {$agi_string = "-- Starting Gather Data: |$VLA_user|$VLA_campaign_id|$kickout_attempts| |$callerid|"; &agi_output;}
|
||||
|
||||
|
||||
### BEGIN prompt for customer ID number ($customer_id_number) ###
|
||||
$customer_id_number='';
|
||||
$variable='';
|
||||
$confirmation=0;
|
||||
$confirmation_chances=0;
|
||||
$collect_digits='20';
|
||||
$ms_delay='8000';
|
||||
$variable_entry_prompt = $first_prompt;
|
||||
$confirm_entry_prompt = $you_entered_prompt;
|
||||
while ( ($confirmation_chances < $kickout_attempts) && ($confirmation < 1) )
|
||||
{
|
||||
$entry_chances=0;
|
||||
while ( ($entry_chances < $kickout_attempts) && (length($variable) < 1) )
|
||||
{
|
||||
$entry_chances++;
|
||||
|
||||
&customer_variable_gather;
|
||||
|
||||
$customer_id_number = $variable;
|
||||
|
||||
if ( (length($customer_id_number) < 1) || (length($customer_id_number) > 20) )
|
||||
{
|
||||
if ($AGILOG) {$agi_string = "-- CUSTOMER ID GATHER FAIL : |$customer_id_number|"; &agi_output;}
|
||||
$audio_file = $invalid_prompt; &play_audio;
|
||||
$variable='';
|
||||
}
|
||||
}
|
||||
$confirmation_chances++;
|
||||
|
||||
if ( (length($customer_id_number) > 0) || (length($customer_id_number) <= 20) )
|
||||
{
|
||||
$audio_file = $confirm_entry_prompt; &play_audio;
|
||||
$AGI->say_digits("$variable");
|
||||
|
||||
&confirm_entry;
|
||||
|
||||
if ($ANSWER_confirm > 1)
|
||||
{$variable='';}
|
||||
if ( ($ANSWER_confirm > 0) && ($ANSWER_confirm < 2) )
|
||||
{$confirmation=1;}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($entry_chances >= $kickout_attempts)
|
||||
{$confirmation_chances=$kickout_attempts;}
|
||||
}
|
||||
}
|
||||
|
||||
### customer ID confirmed, update in vicidial_list and tag agent for update
|
||||
if ($confirmation > 0)
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_list set vendor_lead_code='$customer_id_number' where lead_id='$VAC_lead_id';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- Lead record updated: |$affected_rows| |$callerid|$stmtA|"; &agi_output;}
|
||||
|
||||
$stmtA = "UPDATE vicidial_live_agents set external_update_fields='1',external_update_fields_data='vendor_lead_code' where user='$VLA_user';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- Agent data update triggered: |$affected_rows| |$callerid|$stmtA|"; &agi_output;}
|
||||
}
|
||||
|
||||
### no valid customer ID received, send customer to kickout in-group if defined
|
||||
if ( ($confirmation < 1) && (length($kickout_ingroup)>0) )
|
||||
{
|
||||
$audio_file = $kickout_prompt; &play_audio;
|
||||
sleep(1);
|
||||
|
||||
$stmtA = "UPDATE vicidial_live_agents set external_transferconf='LOCAL_CLOSER---$kickout_ingroup' where user='$VLA_user';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- AGI Done, kick-out, sending call to kickout ingroup: |$affected_rows| |$callerid|$kickout_ingroup|$stmtA"; &agi_output;}
|
||||
}
|
||||
### END prompt for customer ID number ($customer_id_number) ###
|
||||
else
|
||||
{
|
||||
### send API command to have agent grab call back
|
||||
|
||||
$AGI->stream_file('sip-silence');
|
||||
$AGI->stream_file('sip-silence');
|
||||
$AGI->stream_file('sip-silence');
|
||||
$AGI->stream_file('sip-silence');
|
||||
|
||||
$stmtA = "UPDATE vicidial_live_agents set external_park='GRAB_IVR_CUSTOMER' where user='$VLA_user';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ($AGILOG) {$agi_string = "-- AGI Done, sending call back to agent: |$affected_rows| |$callerid|$stmtA|$VLA_user|"; &agi_output;}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($AGILOG) {$agi_string = "-- Call Not Found in vicidial_auto_calls: |$callerid|"; &agi_output;}
|
||||
}
|
||||
|
||||
|
||||
$dbhA->disconnect();
|
||||
|
||||
|
||||
$AGI->stream_file('sip-silence');
|
||||
|
||||
if ($AGILOG) {$agi_string = "-- Exiting Park Call IVR: |$callerid|"; &agi_output;}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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='';
|
||||
}
|
||||
|
||||
|
||||
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 leading_zero($)
|
||||
{
|
||||
$_ = $_[0];
|
||||
s/^(\d)$/0$1/;
|
||||
s/^(\d\d)$/0$1/;
|
||||
return $_;
|
||||
} # End of the leading_zero() routine.
|
||||
|
||||
|
||||
### play audio, check for existing other language if defined ###
|
||||
sub play_audio
|
||||
{
|
||||
if ($language =~ /es/)
|
||||
{
|
||||
$file_extension_gsm='.gsm';
|
||||
$file_extension_wav='.wav';
|
||||
$audio_suffix='_es';
|
||||
if ( (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_gsm")) || (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_wav")) )
|
||||
{$donothing=1;}
|
||||
else
|
||||
{$audio_suffix='';}
|
||||
}
|
||||
elsif ($language =~ /fr/)
|
||||
{
|
||||
$file_extension_gsm='.gsm';
|
||||
$file_extension_wav='.wav';
|
||||
$audio_suffix='_fr';
|
||||
if ( (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_gsm")) || (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_wav")) )
|
||||
{$donothing=1;}
|
||||
else
|
||||
{$audio_suffix='';}
|
||||
}
|
||||
else
|
||||
{$audio_suffix='';}
|
||||
|
||||
$AGI->stream_file("$audio_file$audio_suffix");
|
||||
}
|
||||
|
||||
|
||||
|
||||
##### BEGIN collect the customer variable ###############################################
|
||||
sub customer_variable_gather
|
||||
{
|
||||
$interrupt_digit='';
|
||||
$audio_file = "$variable_entry_prompt";
|
||||
|
||||
if ($language =~ /es/)
|
||||
{
|
||||
$file_extension_gsm='.gsm';
|
||||
$file_extension_wav='.wav';
|
||||
$audio_suffix='_es';
|
||||
if ( (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_gsm")) || (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_wav")) )
|
||||
{$donothing=1;}
|
||||
else
|
||||
{$audio_suffix='';}
|
||||
}
|
||||
elsif ($language =~ /fr/)
|
||||
{
|
||||
$file_extension_gsm='.gsm';
|
||||
$file_extension_wav='.wav';
|
||||
$audio_suffix='_fr';
|
||||
if ( (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_gsm")) || (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_wav")) )
|
||||
{$donothing=1;}
|
||||
else
|
||||
{$audio_suffix='';}
|
||||
}
|
||||
else
|
||||
{$audio_suffix='';}
|
||||
|
||||
$interrupt_digit = $AGI->stream_file("$audio_file$audio_suffix",'0123456789');
|
||||
|
||||
print STDERR "interrupt_digit |$interrupt_digit|\n";
|
||||
|
||||
$digits_being_entered=1;
|
||||
$PASS_word='';
|
||||
if ($interrupt_digit > 0)
|
||||
{
|
||||
# if ($interrupt_digit == 35) {$interrupt_digit='#';}
|
||||
# if ($interrupt_digit == 42) {$interrupt_digit='*';}
|
||||
if ($interrupt_digit == 48) {$interrupt_digit=0;}
|
||||
if ($interrupt_digit == 49) {$interrupt_digit=1;}
|
||||
if ($interrupt_digit == 50) {$interrupt_digit=2;}
|
||||
if ($interrupt_digit == 51) {$interrupt_digit=3;}
|
||||
if ($interrupt_digit == 52) {$interrupt_digit=4;}
|
||||
if ($interrupt_digit == 53) {$interrupt_digit=5;}
|
||||
if ($interrupt_digit == 54) {$interrupt_digit=6;}
|
||||
if ($interrupt_digit == 55) {$interrupt_digit=7;}
|
||||
if ($interrupt_digit == 56) {$interrupt_digit=8;}
|
||||
if ($interrupt_digit == 57) {$interrupt_digit=9;}
|
||||
|
||||
$PASS_word=$interrupt_digit;
|
||||
}
|
||||
|
||||
$digit_loop_counter=0;
|
||||
while ($digits_being_entered > 0)
|
||||
{
|
||||
$digit = chr($AGI->wait_for_digit('8000')); # wait 8 seconds for input or until the pound key is pressed
|
||||
if ($digit =~ /\d/)
|
||||
{
|
||||
$PASS_word = "$PASS_word$digit";
|
||||
print STDERR "digit |$digit| PASS_word |$PASS_word|\n";
|
||||
# $AGI->say_digits("$digit");
|
||||
undef $digit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$digits_being_entered=0;
|
||||
}
|
||||
if ( (length($PASS_word)) >= $collect_digits)
|
||||
{
|
||||
$digits_being_entered=0;
|
||||
}
|
||||
|
||||
$digit_loop_counter++;
|
||||
}
|
||||
|
||||
$PASS_word =~ s/\D//gi;
|
||||
$variable = $PASS_word;
|
||||
if ($PASS_word) {print STDERR "digit |$digit| PASS_word |$PASS_word| variable |$variable|\n";}
|
||||
$collect_digits='99';
|
||||
}
|
||||
##### END collect the customer variable ###############################################
|
||||
|
||||
|
||||
|
||||
|
||||
##### BEGIN confirm entry ######################################
|
||||
sub confirm_entry
|
||||
{
|
||||
$interrupt_digit='';
|
||||
$audio_file = "$confirmation_prompt";
|
||||
|
||||
if ($language =~ /es/)
|
||||
{
|
||||
$file_extension_gsm='.gsm';
|
||||
$file_extension_wav='.wav';
|
||||
$audio_suffix='_es';
|
||||
if ( (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_gsm")) || (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_wav")) )
|
||||
{$donothing=1;}
|
||||
else
|
||||
{$audio_suffix='';}
|
||||
}
|
||||
elsif ($language =~ /fr/)
|
||||
{
|
||||
$file_extension_gsm='.gsm';
|
||||
$file_extension_wav='.wav';
|
||||
$audio_suffix='_fr';
|
||||
if ( (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_gsm")) || (-e ("$PATHsounds/$audio_file$audio_suffix$file_extension_wav")) )
|
||||
{$donothing=1;}
|
||||
else
|
||||
{$audio_suffix='';}
|
||||
}
|
||||
else
|
||||
{$audio_suffix='';}
|
||||
|
||||
$interrupt_digit = $AGI->stream_file("$audio_file$audio_suffix",'12');
|
||||
|
||||
print STDERR "interrupt_digit |$interrupt_digit|\n";
|
||||
|
||||
$digits_being_entered=1;
|
||||
$ANSWER_confirm='';
|
||||
if ($interrupt_digit > 0)
|
||||
{
|
||||
# if ($interrupt_digit == 35) {$interrupt_digit='#';}
|
||||
# if ($interrupt_digit == 42) {$interrupt_digit='*';}
|
||||
if ($interrupt_digit == 48) {$interrupt_digit=0;}
|
||||
if ($interrupt_digit == 49) {$interrupt_digit=1;}
|
||||
if ($interrupt_digit == 50) {$interrupt_digit=2;}
|
||||
if ($interrupt_digit == 51) {$interrupt_digit=3;}
|
||||
if ($interrupt_digit == 52) {$interrupt_digit=4;}
|
||||
if ($interrupt_digit == 53) {$interrupt_digit=5;}
|
||||
if ($interrupt_digit == 54) {$interrupt_digit=6;}
|
||||
if ($interrupt_digit == 55) {$interrupt_digit=7;}
|
||||
if ($interrupt_digit == 56) {$interrupt_digit=8;}
|
||||
if ($interrupt_digit == 57) {$interrupt_digit=9;}
|
||||
|
||||
$ANSWER_confirm=$interrupt_digit;
|
||||
}
|
||||
|
||||
if (length($ANSWER_confirm) < 1)
|
||||
{
|
||||
$digit_loop_counter=0;
|
||||
while ( ($digits_being_entered > 0) && ($digit_loop_counter < 1) )
|
||||
{
|
||||
$digit = chr($AGI->wait_for_digit("$ms_delay")); # wait 10 seconds for input or until the pound key is pressed
|
||||
if ($digit =~ /\d/)
|
||||
{
|
||||
$ANSWER_confirm = "$ANSWER_confirm$digit";
|
||||
print STDERR "digit |$digit| ANSWER_confirm |$ANSWER_confirm|\n";
|
||||
# $AGI->say_digits("$digit");
|
||||
undef $digit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$digits_being_entered=0;
|
||||
}
|
||||
|
||||
$digit_loop_counter++;
|
||||
}
|
||||
}
|
||||
|
||||
$ANSWER_confirm =~ s/\D//gi;
|
||||
if ($ANSWER_confirm) {print STDERR "digit |$digit| ANSWER_confirm |$ANSWER_confirm|\n";}
|
||||
}
|
||||
##### END confirm entry ######################################
|
||||
+19
-9
@@ -59,9 +59,10 @@
|
||||
# 90307-1932 - Added servers table stats updating, reformatted code to match standard
|
||||
# 90604-1127 - Added support for DAHDI channels
|
||||
# 100625-1220 - Added waitfors after logout to fix broken pipe errors in asterisk <MikeC>
|
||||
# 101004-1042 - Updated parked_channels checking for changes to parked calls functions
|
||||
#
|
||||
|
||||
$build = '100625-1220';
|
||||
$build = '101004-1042';
|
||||
|
||||
# constants
|
||||
$SYSPERF=0; # system performance logging to MySQL server_performance table every 5 seconds
|
||||
@@ -1013,7 +1014,9 @@ while($one_day_interval > 0)
|
||||
else
|
||||
{
|
||||
$no_channels_12_counter++;
|
||||
$event_string="NO CHANNELS HERE|COUNTER: $no_channels_12_counter|$endless_loop|ONE DAY INTERVAL:$one_day_interval|$list_channels[1]";
|
||||
$channel_response = $list_channels[1];
|
||||
chomp($channel_response);
|
||||
$event_string="NO CHANNELS HERE|COUNTER: $no_channels_12_counter|$endless_loop|ONE DAY INTERVAL:$one_day_interval|$channel_response";
|
||||
&event_logger;
|
||||
|
||||
if($DBX) {print "*|EMPTY CHANNELS: $no_channels_12_counter|$#list_channels|$list_channels[1]";}
|
||||
@@ -1024,7 +1027,7 @@ while($one_day_interval > 0)
|
||||
if ($no_channels_12_counter == 3)
|
||||
{
|
||||
### there are no channels, delete all from live_channels, live_sip_channels
|
||||
$event_string="NO CHANNELS HERE|COUNTER: $no_channels_12_counter|$endless_loop|ONE DAY INTERVAL:$one_day_interval|$list_channels[1]";
|
||||
$event_string="NO CHANNELS HERE|COUNTER: $no_channels_12_counter|$endless_loop|ONE DAY INTERVAL:$one_day_interval|$channel_response";
|
||||
&event_logger;
|
||||
$stmtB = "DELETE FROM $live_sip_channels where server_ip='$server_ip'";
|
||||
if( ($DB) or ($UD_bad_grab) ){print STDERR "\n|$stmtB|\n";}
|
||||
@@ -1147,7 +1150,7 @@ sub validate_parked_channels
|
||||
{
|
||||
$parked_counter=0;
|
||||
@ARchannel=@MT; @ARextension=@MT; @ARparked_time=@MT; @ARparked_time_UNIX=@MT;
|
||||
$stmtA = "SELECT channel,extension,parked_time,UNIX_TIMESTAMP(parked_time) FROM $parked_channels where server_ip = '$server_ip' order by channel desc, parked_time desc;";
|
||||
$stmtA = "SELECT channel,extension,parked_time,UNIX_TIMESTAMP(parked_time),channel_group FROM $parked_channels where server_ip = '$server_ip' order by channel desc, parked_time desc;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@@ -1159,6 +1162,7 @@ sub validate_parked_channels
|
||||
$PQextension = $aryA[1];
|
||||
$PQparked_time = $aryA[2];
|
||||
$PQparked_time_UNIX = $aryA[3];
|
||||
$PQchannel_group = $aryA[4];
|
||||
if($DB){print STDERR "\n|$PQchannel|$PQextension|$PQparked_time|$PQparked_time_UNIX|\n";}
|
||||
|
||||
$dbhC = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||
@@ -1202,11 +1206,12 @@ sub validate_parked_channels
|
||||
$event_string='LOGGED INTO MYSQL SERVER ON 2 CONNECTIONS TO VALIDATE PARKED CALLS|';
|
||||
&event_logger;
|
||||
|
||||
$stmtB = "SELECT count(*) FROM $live_channels where server_ip='$server_ip' and channel='$PQchannel' and extension='$PQextension';";
|
||||
$stmtB = "SELECT count(*) FROM $live_channels where server_ip='$server_ip' and channel='$PQchannel' and ( (extension='$PQextension') or (extension LIKE \"%.agi\") );";
|
||||
$sthB = $dbhB->prepare($stmtB) or die "preparing: ",$dbhB->errstr;
|
||||
$sthB->execute or die "executing: $stmtB ", $dbhB->errstr;
|
||||
$sthBrows=$sthB->rows;
|
||||
$rec_countB=0;
|
||||
$PQcount=0;
|
||||
while ($sthBrows > $rec_countB)
|
||||
{
|
||||
@aryB = $sthB->fetchrow_array;
|
||||
@@ -1226,10 +1231,15 @@ sub validate_parked_channels
|
||||
### if the parked channel doesn't exist 6 times then delete it from table
|
||||
if ($$DEL_chan_park_counter > 5)
|
||||
{
|
||||
if($DBX){print " parked channel delete: |$PQchannel|$PQparked_time|\n";}
|
||||
$stmtPQ = "DELETE FROM $parked_channels where server_ip='$server_ip' and channel='$PQchannel' and extension='$PQextension' limit 1";
|
||||
if($DB){print STDERR "\n|$stmtPQ|$$DEL_chan_park_counter|$DEL_chan_park_counter|\n\n";}
|
||||
$affected_rows = $dbhC->do($stmtPQ);
|
||||
if($DBX){print " parked channel delete: |$PQchannel|$PQparked_time|$PQchannel_group|\n";}
|
||||
$stmtPQ = "DELETE FROM $parked_channels where server_ip='$server_ip' and channel='$PQchannel' and extension='$PQextension' limit 1;";
|
||||
$affected_rowsPQ = $dbhC->do($stmtPQ);
|
||||
|
||||
$stmtACQ = "DELETE FROM vicidial_auto_calls where callerid='$PQchannel_group' limit 1;";
|
||||
$affected_rowsACQ = $dbhC->do($stmtACQ);
|
||||
|
||||
$event_string="PARKED CHANNEL GONE, LOGGING: |$affected_rowsPQ|$affected_rowsACQ|$stmtPQ|$stmtACQ|$$DEL_chan_park_counter|$DEL_chan_park_counter|\n\n";
|
||||
&event_logger;
|
||||
|
||||
$ARchannel[$rec_count] = '';
|
||||
$ARextension[$rec_count] = '';
|
||||
|
||||
+5
-1
@@ -24,7 +24,7 @@ st_get_agent_active_lead - looks up active lead info for an agent and outputs le
|
||||
ra_call_control - remote agent call control: hangup/transfer calls being handled by remote agents
|
||||
send_dtmf - sends dtmf signal string to agent's session
|
||||
transfer_conference - sends several commands related to the agent transfer-conf frame
|
||||
park_call - sends command to park customer or grab customer from park
|
||||
park_call - sends command to park customer or grab customer from park or ivr
|
||||
|
||||
|
||||
New scripts:
|
||||
@@ -482,10 +482,14 @@ VALUES:
|
||||
REQUIRED, choices are below
|
||||
PARK_CUSTOMER - send customer to the park extension as defined in the campaign the agent is logged into
|
||||
GRAB_CUSTOMER - grab customer from the park extension and send them to the agent session
|
||||
PARK_IVR_CUSTOMER - send customer to the park ivr as defined in the campaign the agent is logged into, customer will come back after finishing IVR
|
||||
GRAB_IVR_CUSTOMER - grab customer from the park ivr and send them to the agent session
|
||||
|
||||
EXAMPLE URLS:
|
||||
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=park_call&value=PARK_CUSTOMER
|
||||
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=park_call&value=GRAB_CUSTOMER
|
||||
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=park_call&value=PARK_IVR_CUSTOMER
|
||||
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=park_call&value=GRAB_IVR_CUSTOMER
|
||||
|
||||
RESPONSES:
|
||||
ERROR: park_call not valid - PARK_CUSTOMER|6666
|
||||
|
||||
@@ -617,7 +617,7 @@ dial_status_d VARCHAR(6),
|
||||
dial_status_e VARCHAR(6),
|
||||
lead_order VARCHAR(30),
|
||||
park_ext VARCHAR(10),
|
||||
park_file_name VARCHAR(10),
|
||||
park_file_name VARCHAR(100) default 'default',
|
||||
web_form_address TEXT,
|
||||
allow_closers ENUM('Y','N'),
|
||||
hopper_level INT(8) UNSIGNED default '1',
|
||||
@@ -765,7 +765,9 @@ hide_xfer_number_to_dial ENUM('DISABLED','ENABLED') default 'DISABLED',
|
||||
manual_dial_prefix VARCHAR(20) default '',
|
||||
customer_3way_hangup_logging ENUM('DISABLED','ENABLED') default 'ENABLED',
|
||||
customer_3way_hangup_seconds SMALLINT(5) UNSIGNED default '5',
|
||||
customer_3way_hangup_action ENUM('NONE','DISPO') default 'NONE'
|
||||
customer_3way_hangup_action ENUM('NONE','DISPO') default 'NONE',
|
||||
ivr_park_call ENUM('DISABLED','ENABLED','ENABLED_PARK_ONLY','ENABLED_BUTTON_HIDDEN') default 'DISABLED',
|
||||
ivr_park_call_agi TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_lists (
|
||||
@@ -2368,7 +2370,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N
|
||||
|
||||
CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1247',db_schema_update_date=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1248',db_schema_update_date=NOW();
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -558,3 +558,9 @@ UPDATE system_settings SET db_schema_version='1246',db_schema_update_date=NOW();
|
||||
ALTER TABLE vicidial_inbound_groups ADD add_lead_url TEXT;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1247',db_schema_update_date=NOW();
|
||||
|
||||
ALTER TABLE vicidial_campaigns MODIFY park_file_name VARCHAR(100) default 'default';
|
||||
ALTER TABLE vicidial_campaigns ADD ivr_park_call ENUM('DISABLED','ENABLED','ENABLED_PARK_ONLY','ENABLED_BUTTON_HIDDEN') default 'DISABLED';
|
||||
ALTER TABLE vicidial_campaigns ADD ivr_park_call_agi TEXT;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1248',db_schema_update_date=NOW();
|
||||
|
||||
@@ -443,6 +443,14 @@ Inbound Report by DID||
|
||||
Lists Campaign Status Stats||
|
||||
Add Lead URL||
|
||||
This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function||
|
||||
This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here||
|
||||
We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files||
|
||||
Park Music-on-Hold||
|
||||
This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default||
|
||||
Park Call IVR||
|
||||
This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED||
|
||||
Park Call IVR AGI||
|
||||
If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible||
|
||||
|
||||
|
||||
AST_LISTS_campaign_stats.php
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1018 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
+88
-12
@@ -100,12 +100,13 @@
|
||||
# 100423-2304 - Added alertCID
|
||||
# 100527-1014 - Added SysCIDdtmfOriginate function
|
||||
# 100813-0833 - Added preset_name variable and logging
|
||||
# 101004-1345 - Added Ivr park functions
|
||||
#
|
||||
|
||||
$version = '2.4-50';
|
||||
$build = '100813-0833';
|
||||
$version = '2.4-51';
|
||||
$build = '101004-1345';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=85;
|
||||
$mysql_log_count=97;
|
||||
$one_mysql_log=0;
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -308,7 +309,7 @@ if ($ACTION=="SysCIDdtmfOriginate")
|
||||
$stmt="UPDATE vicidial_live_agents SET external_dtmf='' where user='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02092',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$ACTION="SysCIDOriginate";
|
||||
}
|
||||
@@ -461,7 +462,7 @@ if ($ACTION=="Originate")
|
||||
$stmt = "SELECT count(*) from vicidial_xfer_stats where campaign_id='$campaign' and preset_name='$preset_name';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02093',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
@@ -473,7 +474,7 @@ if ($ACTION=="Originate")
|
||||
}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02094',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -789,12 +790,12 @@ if ($ACTION=="RedirectVD")
|
||||
$stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,preset_name,campaign_id) values('$user','$NOW_TIME','BLIND_XFER','$server_ip','$exten','$channel','$lead_id','$preset_name','$campaign')";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02095',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$stmt = "SELECT count(*) from vicidial_xfer_stats where campaign_id='$campaign' and preset_name='$preset_name';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02096',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
@@ -806,7 +807,7 @@ if ($ACTION=="RedirectVD")
|
||||
}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02097',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
$ACTION="Redirect";
|
||||
@@ -845,7 +846,7 @@ if ($ACTION=="RedirectToPark")
|
||||
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02086',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
if ($ACTION=="RedirectFromPark")
|
||||
@@ -874,9 +875,84 @@ if ($ACTION=="RedirectFromPark")
|
||||
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02087',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
if ($ACTION=="RedirectToParkIVR")
|
||||
{
|
||||
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "One of these variables is not valid:\n";
|
||||
echo "Channel $channel must be greater than 2 characters\n";
|
||||
echo "queryCID $queryCID must be greater than 14 characters\n";
|
||||
echo "exten $exten must be set\n";
|
||||
echo "extenName $extenName must be set\n";
|
||||
echo "ext_context $ext_context must be set\n";
|
||||
echo "ext_priority $ext_priority must be set\n";
|
||||
echo "parkedby $parkedby must be set\n";
|
||||
echo "\nRedirectToPark Action not sent\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;}
|
||||
$stmt = "INSERT INTO parked_channels values('$channel','$server_ip','$CalLCID','$extenName','$parkedby','$NOW_TIME');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$ACTION="Redirect";
|
||||
|
||||
$stmt = "UPDATE vicidial_auto_calls SET extension='PARK_IVR' where callerid='$CalLCID' limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02088',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
# $fp = fopen ("./vicidial_debug.txt", "a");
|
||||
# fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n");
|
||||
# fclose($fp);
|
||||
}
|
||||
|
||||
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02089',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
if ($ACTION=="RedirectFromParkIVR")
|
||||
{
|
||||
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) )
|
||||
{
|
||||
$channel_live=0;
|
||||
echo "One of these variables is not valid:\n";
|
||||
echo "Channel $channel must be greater than 2 characters\n";
|
||||
echo "queryCID $queryCID must be greater than 14 characters\n";
|
||||
echo "exten $exten must be set\n";
|
||||
echo "ext_context $ext_context must be set\n";
|
||||
echo "ext_priority $ext_priority must be set\n";
|
||||
echo "\nRedirectFromPark Action not sent\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;}
|
||||
$stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$ACTION="Redirect";
|
||||
|
||||
$stmt = "UPDATE vicidial_auto_calls SET extension='' where callerid='$CalLCID' limit 1;";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02090',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
$stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02091',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
|
||||
|
||||
if ($ACTION=="RedirectName")
|
||||
{
|
||||
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) )
|
||||
@@ -1735,7 +1811,7 @@ exit;
|
||||
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
|
||||
{
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);
|
||||
$errno=''; $error='';
|
||||
if ( ($mel > 0) or ($one_mysql_log > 0) )
|
||||
{
|
||||
|
||||
+98
-5
@@ -314,10 +314,11 @@
|
||||
# 100908-0955 - Added customer 3way hangup
|
||||
# 100912-1304 - Changed Dispo screen phone number display to dialed_number
|
||||
# 100927-1616 - Added custom fields ability to web forms and optimized related code
|
||||
# 101004-1322 - Added "IVR Park Call" button in agent interface
|
||||
#
|
||||
|
||||
$version = '2.4-292';
|
||||
$build = '100927-1616';
|
||||
$version = '2.4-293';
|
||||
$build = '101004-1322';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=68;
|
||||
$one_mysql_log=0;
|
||||
@@ -1263,7 +1264,7 @@ else
|
||||
$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,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action 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,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call 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";}
|
||||
@@ -1348,6 +1349,7 @@ else
|
||||
$customer_3way_hangup_logging = $row[77];
|
||||
$customer_3way_hangup_seconds = $row[78];
|
||||
$customer_3way_hangup_action = $row[79];
|
||||
$ivr_park_call = $row[80];
|
||||
|
||||
|
||||
if ($manual_dial_override == 'ALLOW_ALL')
|
||||
@@ -3108,6 +3110,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var customer_3way_hangup_counter=0;
|
||||
var customer_3way_hangup_counter_trigger=0;
|
||||
var customer_3way_hangup_dispo_message='';
|
||||
var ivr_park_call='<?php echo $ivr_park_call ?>';
|
||||
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\">";
|
||||
@@ -3166,6 +3169,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
image_LB_resume_OFF.src="./images/vdc_LB_resume_OFF.gif";
|
||||
var image_LB_senddtmf_OFF = new Image();
|
||||
image_LB_senddtmf_OFF.src="./images/vdc_LB_senddtmf_OFF.gif";
|
||||
var image_LB_ivrgrabparkedcall = new Image();
|
||||
image_LB_ivrgrabparkedcall.src="./images/vdc_LB_grabivrparkcall.gif";
|
||||
var image_LB_ivrparkcall = new Image();
|
||||
image_LB_ivrparkcall.src="./images/vdc_LB_ivrparkcall.gif";
|
||||
|
||||
|
||||
|
||||
@@ -3864,6 +3871,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip);}
|
||||
if (api_parkcustomer == 'GRAB_CUSTOMER')
|
||||
{mainxfer_send_redirect('FROMParK',lastcustchannel,lastcustserverip);}
|
||||
if (api_parkcustomer == 'PARK_IVR_CUSTOMER')
|
||||
{mainxfer_send_redirect('ParKivr',lastcustchannel,lastcustserverip);}
|
||||
if (api_parkcustomer == 'GRAB_IVR_CUSTOMER')
|
||||
{mainxfer_send_redirect('FROMParKivr',lastcustchannel,lastcustserverip);}
|
||||
if (api_dtmf.length > 0)
|
||||
{
|
||||
var REGdtmfPOUND = new RegExp("P","g");
|
||||
@@ -4513,6 +4524,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID;
|
||||
|
||||
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_grabparkedcall.gif\" border=0 alt=\"Grab Parked Call\"></a>";
|
||||
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
|
||||
{
|
||||
document.getElementById("ivrParkControl").innerHTML ="<IMG SRC=\"./images/vdc_LB_grabivrparkcall_OFF.gif\" border=0 alt=\"Grab IVR Parked Call\">";
|
||||
}
|
||||
customerparked=1;
|
||||
}
|
||||
if (taskvar == 'FROMParK')
|
||||
@@ -4532,9 +4547,63 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
{var dest_dialstring = session_id;}
|
||||
}
|
||||
|
||||
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
|
||||
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id + "&CalLCID=" + CalLCID;
|
||||
|
||||
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_parkcall.gif\" border=0 alt=\"Park Call\"></a>";
|
||||
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
|
||||
{
|
||||
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParKivr','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_ivrparkcall.gif\" border=0 alt=\"IVR Park Call\"></a>";
|
||||
}
|
||||
customerparked=0;
|
||||
}
|
||||
if (taskvar == 'ParKivr')
|
||||
{
|
||||
if (CalLCID.length < 1)
|
||||
{
|
||||
CalLCID = MDnextCID;
|
||||
}
|
||||
blind_transfer=0;
|
||||
var queryCID = "LPvdcW" + epoch_sec + user_abb;
|
||||
var redirectdestination = taskxferconf;
|
||||
var redirectdestserverip = taskserverip;
|
||||
var parkedby = protocol + "/" + extension;
|
||||
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToParkIVR&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID;
|
||||
|
||||
document.getElementById("ParkControl").innerHTML ="<IMG SRC=\"./images/vdc_LB_parkcall_OFF.gif\" border=0 alt=\"Grab Parked Call\">";
|
||||
if (ivr_park_call=='ENABLED_PARK_ONLY')
|
||||
{
|
||||
document.getElementById("ivrParkControl").innerHTML ="<IMG SRC=\"./images/vdc_LB_grabivrparkcall_OFF.gif\" border=0 alt=\"Grab IVR Parked Call\">";
|
||||
}
|
||||
if (ivr_park_call=='ENABLED')
|
||||
{
|
||||
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParKivr','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_grabivrparkcall.gif\" border=0 alt=\"Grab IVR Parked Call\"></a>";
|
||||
}
|
||||
customerparked=1;
|
||||
}
|
||||
if (taskvar == 'FROMParKivr')
|
||||
{
|
||||
blind_transfer=0;
|
||||
var queryCID = "FPvdcW" + epoch_sec + user_abb;
|
||||
var redirectdestination = taskxferconf;
|
||||
var redirectdestserverip = taskserverip;
|
||||
|
||||
if( (server_ip == taskserverip) && (taskserverip.length > 6) )
|
||||
{var dest_dialstring = session_id;}
|
||||
else
|
||||
{
|
||||
if(taskserverip.length > 6)
|
||||
{var dest_dialstring = server_ip_dialstring + "" + session_id;}
|
||||
else
|
||||
{var dest_dialstring = session_id;}
|
||||
}
|
||||
|
||||
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromParkIVR&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id + "&CalLCID=" + CalLCID;
|
||||
|
||||
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_parkcall.gif\" border=0 alt=\"Park Call\"></a>";
|
||||
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
|
||||
{
|
||||
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParKivr','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_ivrparkcall.gif\" border=0 alt=\"IVR Park Call\"></a>";
|
||||
}
|
||||
customerparked=0;
|
||||
}
|
||||
|
||||
@@ -5251,6 +5320,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
document.getElementById("MainStatuSSpan").innerHTML = " Called: " + status_display_number + " UID: " + CIDcheck + " ";
|
||||
|
||||
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_parkcall.gif\" border=0 alt=\"Park Call\"></a>";
|
||||
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
|
||||
{
|
||||
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParKivr','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_ivrparkcall.gif\" border=0 alt=\"IVR Park Call\"></a>";
|
||||
}
|
||||
|
||||
document.getElementById("HangupControl").innerHTML = "<a href=\"#\" onclick=\"dialedcall_send_hangup();\"><IMG SRC=\"./images/vdc_LB_hangupcustomer.gif\" border=0 alt=\"Hangup Customer\"></a>";
|
||||
|
||||
@@ -6707,6 +6780,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
}
|
||||
|
||||
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_parkcall.gif\" border=0 alt=\"Park Call\"></a>";
|
||||
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
|
||||
{
|
||||
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParKivr','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"./images/vdc_LB_ivrparkcall.gif\" border=0 alt=\"IVR Park Call\"></a>";
|
||||
}
|
||||
|
||||
document.getElementById("HangupControl").innerHTML = "<a href=\"#\" onclick=\"dialedcall_send_hangup();\"><IMG SRC=\"./images/vdc_LB_hangupcustomer.gif\" border=0 alt=\"Hangup Customer\"></a>";
|
||||
|
||||
@@ -7198,6 +7275,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
document.getElementById("WebFormSpanTwo").innerHTML = "<IMG SRC=\"./images/vdc_LB_webform_two_OFF.gif\" border=0 alt=\"Web Form 2\">";
|
||||
}
|
||||
document.getElementById("ParkControl").innerHTML = "<IMG SRC=\"./images/vdc_LB_parkcall_OFF.gif\" border=0 alt=\"Park Call\">";
|
||||
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
|
||||
{
|
||||
document.getElementById("ivrParkControl").innerHTML = "<IMG SRC=\"./images/vdc_LB_ivrparkcall_OFF.gif\" border=0 alt=\"IVR Park Call\">";
|
||||
}
|
||||
document.getElementById("HangupControl").innerHTML = "<IMG SRC=\"./images/vdc_LB_hangupcustomer_OFF.gif\" border=0 alt=\"Hangup Customer\">";
|
||||
document.getElementById("XferControl").innerHTML = "<IMG SRC=\"./images/vdc_LB_transferconf_OFF.gif\" border=0 alt=\"Transfer - Conference\">";
|
||||
document.getElementById("LocalCloser").innerHTML = "<IMG SRC=\"./images/vdc_XB_localcloser_OFF.gif\" border=0 alt=\"LOCAL CLOSER\" style=\"vertical-align:middle\">";
|
||||
@@ -10219,6 +10300,7 @@ else
|
||||
hideDiv('LeaDInfOBox');
|
||||
hideDiv('agentdirectlink');
|
||||
hideDiv('blind_monitor_notice_span');
|
||||
hideDiv('ivrParkControl');
|
||||
if (is_webphone!='Y')
|
||||
{hideDiv('webphoneSpan');}
|
||||
if (view_calls_in_queue_launch != '1')
|
||||
@@ -10348,6 +10430,11 @@ else
|
||||
// WebPhonEwin.blur();
|
||||
}
|
||||
|
||||
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
|
||||
{
|
||||
showDiv('ivrParkControl');
|
||||
}
|
||||
|
||||
VICIDiaL_closer_login_checked = 1;
|
||||
}
|
||||
else
|
||||
@@ -10583,7 +10670,7 @@ else
|
||||
if (dispo_check_all_pause != '1')
|
||||
{
|
||||
document.vicidial_form.DispoSelectStop.checked=false;
|
||||
alert("unchecking PAUSE");
|
||||
// alert("unchecking PAUSE");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -11202,6 +11289,12 @@ $zi=1;
|
||||
?>
|
||||
<span id="SpacerSpanB"><IMG SRC="./images/blank.gif" width=145 height=16 border=0></span><BR>
|
||||
<span STYLE="background-color: <?php echo $MAIN_COLOR ?>" id="ParkControl"><IMG SRC="./images/vdc_LB_parkcall_OFF.gif" border=0 alt="Park Call"></span><BR>
|
||||
<?php
|
||||
if ( ($ivr_park_call=='ENABLED') or ($ivr_park_call=='ENABLED_PARK_ONLY') )
|
||||
{echo "<span STYLE=\"background-color: $MAIN_COLOR\" id=\"ivrParkControl\"><IMG SRC=\"./images/vdc_LB_ivrparkcall_OFF.gif\" border=0 alt=\"IVR Park Call\"></span><BR>\n";}
|
||||
else
|
||||
{echo "<span STYLE=\"background-color: $MAIN_COLOR\" id=\"ivrParkControl\"></span>\n";}
|
||||
?>
|
||||
<span STYLE="background-color: <?php echo $MAIN_COLOR ?>" id="XferControl"><IMG SRC="./images/vdc_LB_transferconf_OFF.gif" border=0 alt="Transfer - Conference"></span><BR>
|
||||
|
||||
<?php
|
||||
|
||||
+35
-10
File diff suppressed because one or more lines are too long
@@ -842,7 +842,7 @@ else
|
||||
{$locat = substr($location,0,27); $locat = "$locat...";}
|
||||
else
|
||||
{$locat = $location;}
|
||||
if (eregi("http",$location))
|
||||
if ( (eregi("ftp",$location)) or (eregi("http",$location)) )
|
||||
{$location = "<a href=\"$location\">$locat</a>";}
|
||||
else
|
||||
{$location = $locat;}
|
||||
|
||||
@@ -326,7 +326,7 @@ if ($action == "MANUALUPLOAD")
|
||||
<tr><td align=left><font size=1> </font></td><td align=right><font size=1>Audio Store- VERSION: <?php echo $version ?> BUILD: <?php echo $build ?> </td></tr>
|
||||
</table>
|
||||
<BR><BR>
|
||||
<CENTER><B>We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav)</B>
|
||||
<CENTER><B>We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files(.wav)</B>
|
||||
<BR><BR><font size=1>All spaces will be stripped from uploaded audio file names</font><BR><BR>
|
||||
<B><a href="javascript:launch_chooser('sample_prompt','date',30);">audio file list</a></CENTER>
|
||||
|
||||
|
||||
@@ -852,7 +852,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon
|
||||
{$locat = substr($location,0,27); $locat = "$locat...";}
|
||||
else
|
||||
{$locat = $location;}
|
||||
if (eregi("http",$location))
|
||||
if ( (eregi("ftp",$location)) or (eregi("http",$location)) )
|
||||
{$location = "<a href=\"$location\">$locat</a>";}
|
||||
else
|
||||
{$location = $locat;}
|
||||
|
||||
Reference in New Issue
Block a user