Fix for last commit

git-svn-id: svn://192.168.202.10@3830 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2024-04-26 02:22:30 +00:00
parent e210febaeb
commit 249d8de958
2 changed files with 10 additions and 6 deletions
+6 -4
View File
@@ -50,6 +50,7 @@ $MT[0]='';
$timeout=100; $timeout=100;
$Local_dial_timeout=80; $Local_dial_timeout=80;
$conf_engine=''; $conf_engine='';
$conf_table = 'vicidial_conferences';
$now_date_epoch = time(); $now_date_epoch = time();
@@ -139,6 +140,7 @@ while ($sthArows > $rec_count)
$rec_count++; $rec_count++;
} }
$sthA->finish(); $sthA->finish();
if ($conf_engine eq "CONFBRIDGE") {$conf_table = 'vicidial_confbridges';}
############################################# #############################################
##### START SYSTEM SETTINGS LOOKUP ##### ##### START SYSTEM SETTINGS LOOKUP #####
@@ -533,7 +535,7 @@ while ($wait_loop < $timeout)
{ {
#grab open session #grab open session
$free_session_count=0; $free_session_count=0;
$stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$CALLserver_ip' and ((extension='') or (extension is null)) and conf_exten != '$CALLsession_id';"; $stmtA="SELECT count(*) FROM $conf_table where server_ip='$CALLserver_ip' and ((extension='') or (extension is null)) and conf_exten != '$CALLsession_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows; $sthArows=$sthA->rows;
@@ -552,14 +554,14 @@ while ($wait_loop < $timeout)
else else
{ {
### Update vicidial_conferences to grab available session ### Update vicidial_conferences to grab available session
$stmtA="UPDATE vicidial_conferences set extension='Local/8300$CALLuser$tsSQLdate', leave_3way='0' where server_ip='$CALLserver_ip' and ((extension='') or (extension is null)) and conf_exten != '$CALLsession_id' limit 1;"; $stmtA="UPDATE $conf_table set extension='Local/8300$CALLuser$tsSQLdate', leave_3way='0' where server_ip='$CALLserver_ip' and ((extension='') or (extension is null)) and conf_exten != '$CALLsession_id' limit 1;";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rowsC = $dbhA->do($stmtA); $affected_rowsC = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- vicidial_conferences UPDATE: |$affected_rowsC|$stmtA|"; &agi_output;} if ($AGILOG) {$agi_string = "-- $conf_table UPDATE: |$affected_rowsC|$stmtA|"; &agi_output;}
# Grab the session_id that was reserved # Grab the session_id that was reserved
$CALLconf_exten=''; $CALLconf_exten='';
$stmtA="SELECT conf_exten from vicidial_conferences where server_ip='$CALLserver_ip' and extension='Local/8300$CALLuser$tsSQLdate' and conf_exten != '$CALLsession_id';"; $stmtA="SELECT conf_exten from $conf_table where server_ip='$CALLserver_ip' and extension='Local/8300$CALLuser$tsSQLdate' and conf_exten != '$CALLsession_id';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows; $sthArows=$sthA->rows;
+4 -2
View File
@@ -69,6 +69,7 @@ $one_mysql_log=0;
$MT[0]=''; $MT[0]='';
$timeout=100; $timeout=100;
$conf_engine=''; $conf_engine='';
$conf_table = 'vicidial_conferences';
$now_date_epoch = time(); $now_date_epoch = time();
@@ -157,6 +158,7 @@ while ($sthArows > $rec_count)
$rec_count++; $rec_count++;
} }
$sthA->finish(); $sthA->finish();
if ($conf_engine eq "CONFBRIDGE") {$conf_table = 'vicidial_confbridges';}
############################################# #############################################
##### START SYSTEM SETTINGS LOOKUP ##### ##### START SYSTEM SETTINGS LOOKUP #####
@@ -555,10 +557,10 @@ if ($stage =~ /accepted/i)
### Update vicidial_conferences to leave_3way=1 ### Update vicidial_conferences to leave_3way=1
# $Ttimeout='Xtimeout9'; # $Ttimeout='Xtimeout9';
# $stmtA="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime=NOW(), extension='3WAY_$CALLuser$Ttimeout' where server_ip='$CALLserver_ip' and conf_exten='$CALLconf_exten';"; # $stmtA="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime=NOW(), extension='3WAY_$CALLuser$Ttimeout' where server_ip='$CALLserver_ip' and conf_exten='$CALLconf_exten';";
$stmtA="UPDATE vicidial_conferences set leave_3way='1', leave_3way_datetime=NOW(), extension='3WAY_$CALLuser' where server_ip='$CALLserver_ip' and conf_exten='$CALLconf_exten';"; $stmtA="UPDATE $conf_table set leave_3way='1', leave_3way_datetime=NOW(), extension='3WAY_$CALLuser' where server_ip='$CALLserver_ip' and conf_exten='$CALLconf_exten';";
if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;}
$affected_rowsD = $dbhA->do($stmtA); $affected_rowsD = $dbhA->do($stmtA);
if ($AGILOG) {$agi_string = "-- vicidial_conferences UPDATE: |$affected_rowsD|$stmtA|"; &agi_output;} if ($AGILOG) {$agi_string = "-- $conf_table UPDATE: |$affected_rowsD|$stmtA|"; &agi_output;}
### Delete the call in vicidial_3way_press_live ### Delete the call in vicidial_3way_press_live
$stmtA="DELETE from vicidial_3way_press_live where call_3way_id='$calleridname';"; $stmtA="DELETE from vicidial_3way_press_live where call_3way_id='$calleridname';";