Added ConfBridge code and applied ConfBridge patches by default

git-svn-id: svn://192.168.202.10@3826 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2024-04-21 03:03:49 +00:00
parent eb82802361
commit 5a9c00deae
13 changed files with 1206 additions and 109 deletions
+25 -1
View File
@@ -260,6 +260,7 @@
# 240219-1527 - Added daily_limit in-group user parameter
# 240223-0847 - Added INBOUND_DID populate option
# 240227-1154 - Added holiday_method option
# 240420-2242 - Added ConfBridge code
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -405,6 +406,7 @@ $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02001'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$rec_count=0;
$conf_engine='';
while ($sthArows > $rec_count)
{
$AGILOG = '0';
@@ -3887,6 +3889,21 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$dbhP=$dbhA; $mysql_count='02067'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
if ($AGILOG) {$agi_string = "-- closer log : |$affected_rows|update of vcl table: $insert_lead_id\n|$stmtA|"; &agi_output;}
### Grab Server values from the database for the server the agent is on
$stmtA = "SELECT conf_engine 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;
$conf_engine='';
while ($sthArows > $rec_count)
{
@aryA = $sthA->fetchrow_array;
$conf_engine = $aryA[0];
$rec_count++;
}
$sthA->finish();
### format the remote server dialstring to get the call to the overflow agent meetme room
if( $VDADserver_ip =~ m/(\S+)\.(\S+)\.(\S+)\.(\S+)/ )
{
@@ -3898,7 +3915,14 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
$RAredDIALstr = "$a$S$b$S$c$S$d$S";
}
$alertVDADremDIALstr = "$VDADremDIALstr";
$alertVDADremDIALstr .= "$dtmf_silent_prefix$VDADconf_exten";
if ($conf_engine == "CONFBRIDGE")
{
$alertVDADremDIALstr .= "8$VDADconf_exten";
}
else
{
$alertVDADremDIALstr .= "$dtmf_silent_prefix$VDADconf_exten";
}
$VDADremDIALstr .= "$VDADconf_exten";
+12 -8
View File
@@ -1,6 +1,6 @@
#!/usr/bin/perl
#
# agi-VDAD_RINGALL.agi version 2.8
# agi-VDAD_RINGALL.agi version 2.14
#
# NOTE: this script is used for on-hook agents to be connected to customer calls
# when they answer their ringing phones
@@ -12,7 +12,7 @@
# exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
# exten => _8331*.,n,Hangup
#
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# changes:
# 110303-2325 - First build
@@ -22,6 +22,7 @@
# 130108-1808 - Changes for Asterisk 1.8 compatibility
# 140312-2112 - Added CALLID as recording filename variable
# 140421-1448 - Added code to halt ringing of other channels in ring_all NAC method
# 240420-2241 - Added ConfBridge code
#
$script = 'agi-VDAD_RINGALL.agi';
@@ -90,7 +91,7 @@ $dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VA
or die "Couldn't connect to database: " . DBI->errstr;
### Grab Server values from the database
$stmtA = "SELECT agi_output,ext_context,asterisk_version FROM servers where server_ip = '$VARserver_ip';";
$stmtA = "SELECT agi_output,ext_context,asterisk_version,conf_engine 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;
@@ -101,6 +102,7 @@ if ($sthArows > 0)
$DBagi_output = $aryA[0];
$ext_context = $aryA[1];
$asterisk_version = $aryA[2];
$conf_engine = $aryA[3];
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
if ($DBagi_output =~ /BOTH/) {$AGILOG = '3';}
@@ -273,7 +275,9 @@ if ($NAGcount > 0)
if ($VLAextension =~ /^R\//)
{
### BEGIN If remote agent, then reserve a vicidial_conferences session on their server to send the calls to ###
$stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$VLAserver_ip' and ((extension='') or (extension is null)) and conf_exten != '$VLAconf_exten';";
$conf_table = "vicidial_conferences";
if ($conf_engine == "CONFBRIDGE") {$conf_table = "vicidial_confbridges";}
$stmtA="SELECT count(*) FROM $conf_table where server_ip='$VLAserver_ip' and ((extension='') or (extension is null)) and conf_exten != '$VLAconf_exten';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$AVCcount=$sthA->rows;
@@ -284,11 +288,11 @@ if ($NAGcount > 0)
$sthA->finish();
if ($available_sessions > 0)
{
$stmtA="UPDATE vicidial_conferences set extension='3WAY_$dial_user', leave_3way='1', leave_3way_datetime='$now_date' where server_ip='$VLAserver_ip' and ((extension='') or (extension is null)) and conf_exten != '$VLAconf_exten' limit 1;";
$stmtA="UPDATE $conf_table set extension='3WAY_$dial_user', leave_3way='1', leave_3way_datetime='$now_date' where server_ip='$VLAserver_ip' and ((extension='') or (extension is null)) and conf_exten != '$VLAconf_exten' limit 1;";
$AVCaffected_rows = $dbhA->do($stmtA);
if ($AVCaffected_rows > 0)
{
$stmtA="SELECT conf_exten from vicidial_conferences where server_ip='$VLAserver_ip' and extension='3WAY_$dial_user' and leave_3way_datetime='$now_date' and conf_exten != '$VLAconf_exten';";
$stmtA="SELECT conf_exten from $conf_table where server_ip='$VLAserver_ip' and extension='3WAY_$dial_user' and leave_3way_datetime='$now_date' and conf_exten != '$VLAconf_exten';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$SVCcount=$sthA->rows;
@@ -560,8 +564,8 @@ if ($NAGcount > 0)
$d = leading_zero($4);
$VLA_DIALstr = "$a$S$b$S$c$S$d$S";
}
$VLA_DIALstr .= "7$VLAconf_exten";
if ($conf_engine == "CONFBRIDGE") {$VLA_DIALstrPrefix = "1";} else {$VLA_DIALstrPrefix = "7";}
$VLA_DIALstr .= "$VLA_DIALstrPrefix$VLAconf_exten";
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence');