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 -19
View File
@@ -1,12 +1,12 @@
#!/usr/bin/perl
#
# agi-VDADcloser_inbound.agi version 0.2
# agi-VDADcloser_inbound.agi version 0.3
#
# runs when a call comes in from an inbound call. This script will
# 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 hangup the call and mark it as dropped
# if at the end of 360 seconds(default) it has not found an agent it will hangup the call and mark it as dropped
#
# This version asks for a 4-digit pin number to be entered and passed on as the fronter value to the closer
#
@@ -27,6 +27,9 @@
#
# Copyright (C) 2006 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2
#
# changes:
# 60504-1224 - 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
@@ -270,6 +273,25 @@ if($M){print STDERR "\n|$stmtA|$new_lead_id|\n";}
checkresult($result);
print STDERR "callerID changed: $YqueryCID\n";
### 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','$new_lead_id','$uniqueid','$callerid','$channel','$phone_code','$phone_number','$SQLdate')";
$dbhA->query($stmtA);
@@ -458,35 +480,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);