2006-05-12 snapshot

git-svn-id: svn://192.168.202.10@7 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2006-07-07 15:21:52 +00:00
parent 2598ae9ec2
commit 487f7108d4
74 changed files with 10930 additions and 1055 deletions
+50 -18
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# agi-VDAD_LO_closer.agi version 0.1
# agi-VDAD_LO_closer.agi version 0.2
# Overflow Balanced - when a call comes in on this server the script looks for an agent
# on this server to send call to. If none available it looks for the next available
# agent on any other server on the network on the same campaign to send call to.
@@ -9,7 +9,7 @@
# send the calls out to the closers that are logged in.
#
# if there are no available agents, then it will check every second until an agent becomes available,
# if at the end of 360 seconds it has not found an agent it will send the call to the specified Vmail
# if at the end of 360 seconds(default) it has not found an agent it will send the call to the specified Vmail
# box or hangup the call and mark it as dropped
#
# You need to put lines similar to those below in your extensions.conf file:
@@ -20,6 +20,9 @@
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
# changes:
# 60504-1150 - Added drop second/message/exten options from inbound_group
#
$V = 1; # set to 1 for verbose mode
$M = 1; # set to 1 for 2 line messages mode
@@ -215,6 +218,7 @@ if ($dbhA->has_selected_record)
}
}
### Grab call parameters from vicidial_list table
$stmtA = "SELECT phone_number,phone_code,user FROM vicidial_list where lead_id='$CIDlead_id' limit 1;";
$dbhA->query("$stmtA");
if ($dbhA->has_selected_record)
@@ -231,6 +235,25 @@ if ($dbhA->has_selected_record)
}
}
### Grab inbound_group values from the database
$stmtA = "SELECT drop_call_seconds,drop_message,drop_exten FROM vicidial_inbound_groups where group_id = '$channel_group';";
$dbhA->query("$stmtA");
if ($dbhA->has_selected_record)
{
$iter=$dbhA->create_record_iterator;
while ( $record = $iter->each)
{
$DBdrop_call_seconds = "$record->[0]";
$DBdrop_message = "$record->[1]";
$DBdrop_exten = "$record->[2]";
if ($DBdrop_call_seconds) {$DROP_TIME = $DBdrop_call_seconds;}
if ($DBdrop_message) {$drop_message = $DBdrop_message;}
if ($DBdrop_exten) {$drop_exten = $DBdrop_exten;}
}
}
### insert a LIVE record to the vicidial_auto_calls table
$stmtA = "INSERT INTO vicidial_auto_calls values('','$server_ip','$channel_group','LIVE','$CIDlead_id','$uniqueid','$callerid','$channel','$VDADphone_code','$VDADphone','$SQLdate')";
$dbhA->query($stmtA);
@@ -508,35 +531,44 @@ $now_date = "$year-$mon-$mday $hour:$min:$sec";
$SQLdate = "$year-$mon-$mday $hour:$min:$sec";
$VDADvoicemail_ext = '';
$DROPexten = '';
if ($drop_seconds < 1)
{
$drop_seconds = '360';
$drop_seconds = $DROP_TIME;
$stmtA = "SELECT voicemail_ext FROM vicidial_inbound_groups where group_id = '$channel_group' limit 1;";
if($M){print STDERR "\n\n|$stmtA|\n";}
$dbhA->query("$stmtA");
if ($dbhA->has_selected_record)
if ($drop_message=='Y')
{
$iter=$dbhA->create_record_iterator;
$rec_countCUSTDATA=0;
while ( $record = $iter->each)
$DROPexten = "$drop_exten";
}
else
{
$stmtA = "SELECT voicemail_ext FROM vicidial_inbound_groups where group_id = '$channel_group' limit 1;";
if($M){print STDERR "\n\n|$stmtA|\n";}
$dbhA->query("$stmtA");
if ($dbhA->has_selected_record)
{
$VDADvoicemail_ext = "$record->[0]";
$VDADvoicemail_ext =~ s/\D//gi;
}
$iter=$dbhA->create_record_iterator;
$rec_countCUSTDATA=0;
while ( $record = $iter->each)
{
$VDADvoicemail_ext = "$record->[0]";
$VDADvoicemail_ext =~ s/\D//gi;
$DROPexten = "$voicemail_dump_exten$VDADvoicemail_ext";
}
}
}
}
### get ready to hangup dropped call
### use STDOUT to send call to proper DROP location
$VHqueryCID = "VH$CIDdate$VDADconf_exten";
if (length($VDADvoicemail_ext)>0)
{ ### if there is a voicemailbox defined then send the dropped call there instead of dropping it
print STDERR "\nexiting the VDAD app, transferring call to VMAIL $VDADconf_exten\n";
if (length($DROPexten)>0)
{ ### if DROP extension is defined then send the dropped call there instead of hangup
print STDERR "\nexiting the VDAD app, transferring call to $DROPexten\n";
print "SET CONTEXT $ext_context\n";
checkresult($result);
print "SET EXTENSION $voicemail_dump_exten$VDADvoicemail_ext\n";
print "SET EXTENSION $DROPexten\n";
checkresult($result);
print "SET PRIORITY 1\n";
checkresult($result);