consultative transfers Local redirect option added when fronter leaves conference
git-svn-id: svn://192.168.202.10@144 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -59,6 +59,7 @@
|
||||
# 60310-2022 - Fixed NEXTAVAILABLE bug in leave-3way-call redirect function
|
||||
# 60421-1413 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60619-1158 - Added variable filters to close security holes for login form
|
||||
# 60809-1544 - Added direct transfers to leave-3ways in consultative transfers
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -122,8 +123,8 @@ if (!isset($ACTION)) {$ACTION="Originate";}
|
||||
if (!isset($format)) {$format="alert";}
|
||||
if (!isset($ext_priority)) {$ext_priority="1";}
|
||||
|
||||
$version = '0.0.24';
|
||||
$build = '60619-1158';
|
||||
$version = '0.0.25';
|
||||
$build = '60809-1544';
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -547,6 +548,114 @@ if ($ACTION=="RedirectNameVmail")
|
||||
}
|
||||
}
|
||||
|
||||
if ($ACTION=="RedirectXtraCX")
|
||||
{
|
||||
$row=''; $rowx='';
|
||||
$channel_liveX=1;
|
||||
$channel_liveY=1;
|
||||
if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($extrachannel)<3) )
|
||||
{
|
||||
$channel_liveX=0;
|
||||
$channel_liveY=0;
|
||||
echo "One of these variables is not valid:\n";
|
||||
echo "Channel $channel must be greater than 2 characters\n";
|
||||
echo "ExtraChannel $extrachannel must be greater than 2 characters\n";
|
||||
echo "queryCID $queryCID must be greater than 14 characters\n";
|
||||
echo "exten $exten must be set\n";
|
||||
echo "ext_context $ext_context must be set\n";
|
||||
echo "ext_priority $ext_priority must be set\n";
|
||||
echo "\nRedirect Action not sent\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strlen($call_server_ip)<7) {$call_server_ip = $server_ip;}
|
||||
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$call_server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0]==0)
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
$channel_liveX=0;
|
||||
echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n";
|
||||
}
|
||||
}
|
||||
$stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
if ($row[0]==0)
|
||||
{
|
||||
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0]==0)
|
||||
{
|
||||
$channel_liveY=0;
|
||||
echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n";
|
||||
}
|
||||
}
|
||||
if ( ($channel_liveX==1) && ($channel_liveY==1) )
|
||||
{
|
||||
$stmt="SELECT count(*) FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
if ($rowx[0] < 1)
|
||||
{
|
||||
$channel_liveY=0;
|
||||
echo "No Local agent to send call to, Redirect command not inserted\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="SELECT server_ip,conf_exten FROM vicidial_live_agents where lead_id='$lead_id' and user!='$user';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$dest_server_ip = $rowx[0];
|
||||
$dest_session_id = $rowx[1];
|
||||
|
||||
$S='*';
|
||||
$D_s_ip = explode('.', $dest_server_ip);
|
||||
if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
$dest_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$dest_session_id";
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$call_server_ip','','Redirect','$queryCID','Channel: $channel','Context: $ext_context','Exten: $dest_dialstring','Priority: $ext_priority','CallerID: $queryCID','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','$queryCID','Channel: $extrachannel','','','','','','','','','');";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "RedirectXtraCX command sent for Channel $channel on $call_server_ip and \nHungup $extrachannel on $server_ip\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($channel_liveX==1)
|
||||
{$ACTION="Redirect"; $server_ip = $call_server_ip;}
|
||||
if ($channel_liveY==1)
|
||||
{$ACTION="Redirect"; $channel=$extrachannel;}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($ACTION=="RedirectXtra")
|
||||
{
|
||||
if ($channel=="$extrachannel")
|
||||
|
||||
@@ -114,6 +114,7 @@
|
||||
# 60804-1710 - fixed scheduled CALLBK for other languages build
|
||||
# 60808-1145 - Added consultative transfers with customer data
|
||||
# 60808-2232 - Added campaign name to pulldown for login screen
|
||||
# 60809-1603 - Added option to locally transfer consult xfers
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -159,8 +160,8 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];}
|
||||
|
||||
$forever_stop=0;
|
||||
|
||||
$version = '2.0.88';
|
||||
$build = '60808-2232';
|
||||
$version = '2.0.89';
|
||||
$build = '60809-1603';
|
||||
|
||||
if ($force_logout)
|
||||
{
|
||||
@@ -190,6 +191,7 @@ $agentcallsstatus = '0'; # set to 1 to show agent status and call count
|
||||
$campagentstatctmax = '0'; # Number of seconds for campaign call and agent stats
|
||||
$show_campname_pulldown = '1'; # set to 1 to show campaign name on login pulldown
|
||||
$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL
|
||||
$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server
|
||||
|
||||
$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen
|
||||
|
||||
@@ -1354,6 +1356,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var wrapup_waiting = 0;
|
||||
var use_internal_dnc = '<? echo $use_internal_dnc ?>';
|
||||
var webform_session = '<? echo $webform_sessionname ?>';
|
||||
var local_consult_xfers = '<? echo $local_consult_xfers ?>';
|
||||
var DiaLControl_auto_HTML = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pause\"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"./images/vdc_LB_resume.gif\" border=0 alt=\"Resume\"></a>";
|
||||
var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"./images/vdc_LB_pause.gif\" border=0 alt=\"Pause\"></a><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
||||
var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"./images/vdc_LB_pause_OFF.gif\" border=0 alt=\"Pause\"><IMG SRC=\"./images/vdc_LB_resume_OFF.gif\" border=0 alt=\"Resume\">";
|
||||
@@ -2056,7 +2059,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
|
||||
var queryCID = "VXvdcW" + epoch_sec + user_abb;
|
||||
var redirectdestination = "NEXTAVAILABLE";
|
||||
var redirectXTRAvalue = XDchannel;
|
||||
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectXtra&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue;
|
||||
var redirecttype_test = document.vicidial_form.xfernumber.value;
|
||||
var regRXFvars = new RegExp("CXFER","g");
|
||||
if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) )
|
||||
{var redirecttype = 'RedirectXtraCX';}
|
||||
else
|
||||
{var redirecttype = 'RedirectXtra';}
|
||||
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value;
|
||||
}
|
||||
if (taskvar == 'ParK')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user