Added md_check option for transfer_conference function for Agent API

Added ConfBridge support for 3-way press-1 features

git-svn-id: svn://192.168.202.10@3829 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2024-04-26 02:13:22 +00:00
parent 7effda83b2
commit e210febaeb
5 changed files with 63 additions and 12 deletions
+10 -2
View File
@@ -35,6 +35,7 @@
# 231227-1428 - Added multi-phone ability
# 240114-0942 - Added agent_heartbeat
# 240116-2110 - Added CLI flags for timeout and outside-agent dial timeout
# 240425-2207 - Added ConfBridge support
#
$script = 'agi-3way_press_agent.agi';
@@ -48,6 +49,7 @@ $one_mysql_log=0;
$MT[0]='';
$timeout=100;
$Local_dial_timeout=80;
$conf_engine='';
$now_date_epoch = time();
@@ -117,7 +119,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,local_gmt FROM servers where server_ip = '$VARserver_ip';";
$stmtA = "SELECT agi_output,local_gmt,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;
@@ -129,6 +131,7 @@ while ($sthArows > $rec_count)
@aryA = $sthA->fetchrow_array;
$DBagi_output = $aryA[0];
$local_gmt = $aryA[1];
$conf_engine = $aryA[2];
if ($isdst) {$local_gmt++;}
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
@@ -593,11 +596,16 @@ while ($wait_loop < $timeout)
# $affected_rowsD = $dbhA->do($stmtA);
# if ($AGILOG) {$agi_string = "-- vicidial_conferences UPDATE: |$affected_rowsD|$stmtA|"; &agi_output;}
if ($conf_engine eq "CONFBRIDGE")
{$XFERstr = "8$CALLconf_exten";}
else
{$XFERstr = "7$CALLconf_exten";}
if ($AGILOG) {$agi_string = "3-WAY AGENT TRANSFER: |$CALLuser|$CALLserver_ip|$CALLconf_exten|$calleridname|$VIDqueryCID|"; &agi_output;}
print "SET CONTEXT $ext_context\n";
$result = <STDIN>;
checkresult($result);
print "SET EXTENSION 7$CALLconf_exten\n";
print "SET EXTENSION $XFERstr\n";
$result = <STDIN>;
checkresult($result);
print "SET PRIORITY 1\n";
+10 -2
View File
@@ -55,6 +55,7 @@
# 240108-1503 - Added call_channel and call_transfer logging
# 240114-0946 - Added check of agent_heartbeat
# 240116-2109 - Added CLI flag for timeout
# 240425-2208 - Added ConfBridge support
#
$script = 'agi-3way_press_outside.agi';
@@ -67,6 +68,7 @@ $mysql_log_count=272;
$one_mysql_log=0;
$MT[0]='';
$timeout=100;
$conf_engine='';
$now_date_epoch = time();
@@ -135,7 +137,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,local_gmt FROM servers where server_ip = '$VARserver_ip';";
$stmtA = "SELECT agi_output,local_gmt,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;
@@ -147,6 +149,7 @@ while ($sthArows > $rec_count)
@aryA = $sthA->fetchrow_array;
$DBagi_output = $aryA[0];
$local_gmt = $aryA[1];
$conf_engine = $aryA[2];
if ($isdst) {$local_gmt++;}
if ($DBagi_output =~ /STDERR/) {$AGILOG = '1';}
if ($DBagi_output =~ /FILE/) {$AGILOG = '2';}
@@ -563,11 +566,16 @@ if ($stage =~ /accepted/i)
$affected_rowsE = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- vicidial_3way_press_live transfer DELETE: |$affected_rowsE|$stmtA|"; &agi_output;}
if ($conf_engine eq "CONFBRIDGE")
{$XFERstr = "8$CALLconf_exten";}
else
{$XFERstr = "7$CALLconf_exten";}
if ($AGILOG) {$agi_string = "3-WAY AGENT TRANSFER: |$CALLuser|$CALLserver_ip|$CALLconf_exten|$calleridname|"; &agi_output;}
print "SET CONTEXT $ext_context\n";
$result = <STDIN>;
checkresult($result);
print "SET EXTENSION 7$CALLconf_exten\n";
print "SET EXTENSION $XFERstr\n";
$result = <STDIN>;
checkresult($result);
print "SET PRIORITY 1\n";