admin.php - Added without-filter output to test filter function, added server option to test call

admin_search_lead.php - Added owner field search option
vicidial.php - Do not allow AGENTDIRECT transfers without a user defined
ALL_inbound AGI - If AGENTDIRECT and no agent defined, set drop call seconds to 1

git-svn-id: svn://192.168.202.10@1867 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2012-10-26 05:52:56 +00:00
parent 2fa9b3e870
commit 98dfef5eab
6 changed files with 419 additions and 365 deletions
+23 -13
View File
@@ -176,8 +176,10 @@
# 120130-1708 - Fix for ring agent EXTERNAL protocol phone issue # 120130-1708 - Fix for ring agent EXTERNAL protocol phone issue
# 120513-0051 - Added ability to have Dial In-Group agent calls go directly to agents # 120513-0051 - Added ability to have Dial In-Group agent calls go directly to agents
# 120514-0953 - Added force checks for dial-ingroup calls # 120514-0953 - Added force checks for dial-ingroup calls
# 121025-2210 - If AGENTDIRECT and no agent defined, set drop call seconds to 1
# #
$script = 'agi-VDAD_ALL_inbound.agi'; $script = 'agi-VDAD_ALL_inbound.agi';
$dtmf_silent_prefix = '7'; $dtmf_silent_prefix = '7';
@@ -490,7 +492,7 @@ if ($call_handle_method =~ /^CLOSER/)
$fronter = $EXT_vars[6]; # user of the fronter that transferred the call $fronter = $EXT_vars[6]; # user of the fronter that transferred the call
$fronter_call_seconds = $EXT_vars[8]; # not currently used $fronter_call_seconds = $EXT_vars[8]; # not currently used
$dial_ingroup_flag = $EXT_vars[9]; # used by dial in-group feature $dial_ingroup_flag = $EXT_vars[9]; # used by dial in-group feature
if ( ($channel_group =~ /AGENTDIRECT/) || ($dial_ingroup_flag > 0) ) if ( ($channel_group =~ /AGENTDIRECT/i) || ($dial_ingroup_flag > 0) )
{ {
$agent_only = $EXT_vars[7]; # optional AGENTDIRECT user to queue call for $agent_only = $EXT_vars[7]; # optional AGENTDIRECT user to queue call for
$agent_grab_extension = $EXT_vars[10]; # used by dial in-group feature $agent_grab_extension = $EXT_vars[10]; # used by dial in-group feature
@@ -839,6 +841,14 @@ if ($ingroup_active !~ /Y/)
if ($AGILOG) {$agi_string = "IN-GROUP INACTIVE! Sending to After Hours Action: |$after_hours_action|$ingroup_active|"; &agi_output;} if ($AGILOG) {$agi_string = "IN-GROUP INACTIVE! Sending to After Hours Action: |$after_hours_action|$ingroup_active|"; &agi_output;}
} }
# set the drop time to 1 second if AGENTDIRECT without a user assigned
if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) < 1) )
{
if ($AGILOG) {$agi_string = "AGENTDIRECT with no agent defined! Setting drop seconds to 1: |$channel_group|$agent_only|"; &agi_output;}
$DROP_TIME = 1;
$drop_call_seconds = 1;
}
$AGI->stream_file('sip-silence'); $AGI->stream_file('sip-silence');
$AGI->stream_file('sip-silence'); $AGI->stream_file('sip-silence');
@@ -1332,7 +1342,7 @@ if ( ( ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $c
} }
if ($after_hours_action =~ /EXTENSION/) if ($after_hours_action =~ /EXTENSION/)
{ {
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($after_hours_exten =~ /AGENTEXT/) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && ($after_hours_exten =~ /AGENTEXT/) )
{ {
### Grab user's custom_five field from the database ### Grab user's custom_five field from the database
$stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';"; $stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';";
@@ -1357,7 +1367,7 @@ if ( ( ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $c
} }
if ($after_hours_action =~ /VOICEMAIL/) if ($after_hours_action =~ /VOICEMAIL/)
{ {
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($after_hours_voicemail =~ /AGENTVMAIL/) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && ($after_hours_voicemail =~ /AGENTVMAIL/) )
{ {
### Grab user's voicemail ID from the database ### Grab user's voicemail ID from the database
$stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';"; $stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';";
@@ -1538,7 +1548,7 @@ if ( ( ($no_agent_no_queue =~ /Y|NO_PAUSED/) || ($MCnanque_override > 0) ) && ($
$DROPexten = $EXno_agent_action_value[0]; $DROPexten = $EXno_agent_action_value[0];
$ext_context = $EXno_agent_action_value[1]; $ext_context = $EXno_agent_action_value[1];
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($DROPexten =~ /AGENTEXT/) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && ($DROPexten =~ /AGENTEXT/) )
{ {
### Grab user's custom_five field from the database ### Grab user's custom_five field from the database
$stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';"; $stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';";
@@ -1586,7 +1596,7 @@ if ( ( ($no_agent_no_queue =~ /Y|NO_PAUSED/) || ($MCnanque_override > 0) ) && ($
} }
if ($no_agent_action =~ /VOICEMAIL/) if ($no_agent_action =~ /VOICEMAIL/)
{ {
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($no_agent_action_value =~ /AGENTVMAIL/) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && ($no_agent_action_value =~ /AGENTVMAIL/) )
{ {
### Grab user's voicemail ID from the database ### Grab user's voicemail ID from the database
$stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';"; $stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';";
@@ -1837,7 +1847,7 @@ if ($enable_queuemetrics_logging > 0)
### If AGENTDIRECT set variable accordingly ### ### If AGENTDIRECT set variable accordingly ###
$adSQL=''; $adSQL='';
if ( ($channel_group =~ /AGENTDIRECT/) || ($dial_ingroup_flag > 0) ) if ( ($channel_group =~ /AGENTDIRECT/i) || ($dial_ingroup_flag > 0) )
{$adSQL = ",agent_only='$agent_only'";} {$adSQL = ",agent_only='$agent_only'";}
### check for an IVR status record in vicidial_auto_calls ### check for an IVR status record in vicidial_auto_calls
@@ -1959,7 +1969,7 @@ $ring_no_answer_agents = "'',";
########################################################## ##########################################################
### For AGENTDIRECT calls try to send call to an agent ### ### For AGENTDIRECT calls try to send call to an agent ###
if ( ( ($channel_group =~ /AGENTDIRECT/) || ($dial_ingroup_flag > 0) ) && (length($agent_only) > 1) ) if ( ( ($channel_group =~ /AGENTDIRECT/i) || ($dial_ingroup_flag > 0) ) && (length($agent_only) > 1) )
{ {
$skipLOSO=1; $skipLOSO=1;
$ADfindSQL = "and agent_only='$agent_only'"; $ADfindSQL = "and agent_only='$agent_only'";
@@ -3816,7 +3826,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
{ {
$DROPexten = "$wait_time_option_exten"; $DROPexten = "$wait_time_option_exten";
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($DROPexten =~ /AGENTEXT/) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && ($DROPexten =~ /AGENTEXT/) )
{ {
### Grab user's custom_five field from the database ### Grab user's custom_five field from the database
$stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';"; $stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';";
@@ -3842,7 +3852,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
if ($wait_time_option =~ /VOICEMAIL/) if ($wait_time_option =~ /VOICEMAIL/)
{ {
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($wait_time_option_voicemail =~ /AGENTVMAIL/) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && ($wait_time_option_voicemail =~ /AGENTVMAIL/) )
{ {
### Grab user's voicemail ID from the database ### Grab user's voicemail ID from the database
$stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';"; $stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';";
@@ -4226,7 +4236,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
{ {
$DROPexten = "$hold_time_option_exten"; $DROPexten = "$hold_time_option_exten";
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($DROPexten =~ /AGENTEXT/) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && ($DROPexten =~ /AGENTEXT/) )
{ {
### Grab user's custom_five field from the database ### Grab user's custom_five field from the database
$stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';"; $stmtA = "SELECT custom_five FROM vicidial_users where user='$agent_only';";
@@ -4252,7 +4262,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
if ($hold_time_option =~ /VOICEMAIL/) if ($hold_time_option =~ /VOICEMAIL/)
{ {
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($hold_time_option_voicemail =~ /AGENTVMAIL/) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && ($hold_time_option_voicemail =~ /AGENTVMAIL/) )
{ {
### Grab user's voicemail ID from the database ### Grab user's voicemail ID from the database
$stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';"; $stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';";
@@ -4594,7 +4604,7 @@ if ( ($drop_timer > $DROP_TIME) || ($MCdrop_override > 0) )
$drop_seconds = $DROP_TIME; $drop_seconds = $DROP_TIME;
} }
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ( (length($user_unavailable_action) > 1) || ($VDADvoicemail_ext =~ /AGENTVMAIL/) ) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && ( (length($user_unavailable_action) > 1) || ($VDADvoicemail_ext =~ /AGENTVMAIL/) ) )
{ {
if ($VDADvoicemail_ext !~ /AGENTVMAIL/) if ($VDADvoicemail_ext !~ /AGENTVMAIL/)
{ {
@@ -4627,7 +4637,7 @@ if ( ($drop_timer > $DROP_TIME) || ($MCdrop_override > 0) )
if ($drop_action =~ /MESSAGE|EXTEN/) if ($drop_action =~ /MESSAGE|EXTEN/)
{ {
if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && (length($user_unavailable_action) > 1) ) if ( ($channel_group =~ /AGENTDIRECT/i) && (length($agent_only) > 1) && (length($user_unavailable_action) > 1) )
{ {
if ($drop_exten =~ /AGENTEXT/) if ($drop_exten =~ /AGENTEXT/)
{ {
+1 -1
View File
@@ -1191,7 +1191,7 @@ $sthA->finish();
if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_server)) eq (length($server_ip))) ) if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_server)) eq (length($server_ip))) )
{ {
$THISserver_voicemail=1; $THISserver_voicemail=1;
if ($DB) {print " voicemail server configuration\n";} if ($DB) {print " voicemail server configuration: $SSallow_voicemail_greeting|$sounds_update\n";}
if ( !-e ('/etc/asterisk/voicemail.conf')) if ( !-e ('/etc/asterisk/voicemail.conf'))
{`echo -e \"; END OF FILE\n\" > /etc/asterisk/voicemail.conf`;} {`echo -e \"; END OF FILE\n\" > /etc/asterisk/voicemail.conf`;}
@@ -38,6 +38,7 @@ Phone and Post Code Time Zone Mismatch||
Last Local Call Time|| Last Local Call Time||
Called Count|| Called Count||
Unidentified Hangup Cause Code|| Unidentified Hangup Cause Code||
YOU MUST SELECT AN AGENT TO TRANSFER TO WHEN USING AGENTDIRECT||
############################################################ MANAGER Manual ############################################################ MANAGER Manual
+348 -338
View File
@@ -384,10 +384,11 @@
# 120810-0056 - Added recording api function # 120810-0056 - Added recording api function
# 120819-1747 - Added vicidial_session_data logging for webphone api function # 120819-1747 - Added vicidial_session_data logging for webphone api function
# 120914-1357 - Added group_alias to transfer_conference function # 120914-1357 - Added group_alias to transfer_conference function
# 121025-2335 - Do not allow AGENTDIRECT transfers without a user defined
# #
$version = '2.6-352c'; $version = '2.6-353c';
$build = '120914-1357'; $build = '121025-2335';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=79; $mysql_log_count=79;
$one_mysql_log=0; $one_mysql_log=0;
@@ -5077,363 +5078,372 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
// Covers the following types: XFER, VMAIL, ENTRY, CONF, PARK, FROMPARK, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL // Covers the following types: XFER, VMAIL, ENTRY, CONF, PARK, FROMPARK, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL
function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote,taskdispowindow,tasklockedquick) function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote,taskdispowindow,tasklockedquick)
{ {
blind_transfer=1; var XfeRSelecT = document.getElementById("XfeRGrouP");
var consultativexfer_checked = 0; var XfeR_GrouP = XfeRSelecT.value;
if (document.vicidial_form.consultativexfer.checked==true) var ADvalue = document.vicidial_form.xfernumber.value;
{consultativexfer_checked = 1;} if ( ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRINTERNAL') ) && (XfeR_GrouP.match(/AGENTDIRECT/i)) && (ADvalue.length < 2) )
if (taskvar == 'XfeRLOCAL')
{consultativexfer_checked = 0;}
// conf_dialed=1;
if (auto_dial_level == 0) {RedirecTxFEr = 1;}
var xmlhttpXF=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttpXF = false;
}
}
@end @*/
if (!xmlhttpXF && typeof XMLHttpRequest!='undefined')
{ {
xmlhttpXF = new XMLHttpRequest(); alert_box("YOU MUST SELECT AN AGENT TO TRANSFER TO WHEN USING AGENTDIRECT");
} }
if (xmlhttpXF) else
{ {
var redirectvalue = MDchannel; blind_transfer=1;
var redirectserverip = lastcustserverip; var consultativexfer_checked = 0;
if (redirectvalue.length < 2) if (document.vicidial_form.consultativexfer.checked==true)
{redirectvalue = lastcustchannel} {consultativexfer_checked = 1;}
if ( (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') ) if (taskvar == 'XfeRLOCAL')
{ {consultativexfer_checked = 0;}
if (tasklockedquick > 0)
{document.vicidial_form.xfernumber.value = quick_transfer_button_orig;}
var queryCID = "XBvdcW" + epoch_sec + user_abb;
var blindxferdialstring = document.vicidial_form.xfernumber.value;
var blindxferhiddendialstring = document.vicidial_form.xfernumhidden.value;
if ( (blindxferdialstring.length < 1) && (blindxferhiddendialstring.length > 0) )
{blindxferdialstring=blindxferhiddendialstring;}
var regXFvars = new RegExp("XFER","g");
if (blindxferdialstring.match(regXFvars))
{
var regAXFvars = new RegExp("AXFER","g");
if (blindxferdialstring.match(regAXFvars))
{
var Ctasknum = blindxferdialstring.replace(regAXFvars, '');
if (Ctasknum.length < 2)
{Ctasknum = '83009';}
var closerxfercamptail = '_L';
if (closerxfercamptail.length < 3)
{closerxfercamptail = 'IVR';}
blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '**' + VD_live_call_secondS + '*';
}
}
else
{
if (document.vicidial_form.xferoverride.checked==false)
{
if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';}
else {var temp_dial_prefix = three_way_dial_prefix;}
if (omit_phone_code == 'Y') {var temp_phone_code = '';}
else {var temp_phone_code = document.vicidial_form.phone_code.value;}
if (blindxferdialstring.length > 7) // conf_dialed=1;
{blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} if (auto_dial_level == 0) {RedirecTxFEr = 1;}
var xmlhttpXF=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttpXF = false;
}
}
@end @*/
if (!xmlhttpXF && typeof XMLHttpRequest!='undefined')
{
xmlhttpXF = new XMLHttpRequest();
}
if (xmlhttpXF)
{
var redirectvalue = MDchannel;
var redirectserverip = lastcustserverip;
if (redirectvalue.length < 2)
{redirectvalue = lastcustchannel}
if ( (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') )
{
if (tasklockedquick > 0)
{document.vicidial_form.xfernumber.value = quick_transfer_button_orig;}
var queryCID = "XBvdcW" + epoch_sec + user_abb;
var blindxferdialstring = document.vicidial_form.xfernumber.value;
var blindxferhiddendialstring = document.vicidial_form.xfernumhidden.value;
if ( (blindxferdialstring.length < 1) && (blindxferhiddendialstring.length > 0) )
{blindxferdialstring=blindxferhiddendialstring;}
var regXFvars = new RegExp("XFER","g");
if (blindxferdialstring.match(regXFvars))
{
var regAXFvars = new RegExp("AXFER","g");
if (blindxferdialstring.match(regAXFvars))
{
var Ctasknum = blindxferdialstring.replace(regAXFvars, '');
if (Ctasknum.length < 2)
{Ctasknum = '83009';}
var closerxfercamptail = '_L';
if (closerxfercamptail.length < 3)
{closerxfercamptail = 'IVR';}
blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '**' + VD_live_call_secondS + '*';
}
}
else
{
if (document.vicidial_form.xferoverride.checked==false)
{
if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';}
else {var temp_dial_prefix = three_way_dial_prefix;}
if (omit_phone_code == 'Y') {var temp_phone_code = '';}
else {var temp_phone_code = document.vicidial_form.phone_code.value;}
if (blindxferdialstring.length > 7)
{blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;}
}
}
if (API_selected_callmenu.length > 0)
{
var blindxferdialstring = 's';
var blindxfercontext = document.vicidial_form.xfernumber.value;
}
else
{var blindxfercontext = ext_context;}
no_delete_VDAC=0;
if (taskvar == 'XfeRVMAIL')
{
var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value;
no_delete_VDAC=1;
}
if (blindxferdialstring.length<'1')
{
xferredirect_query='';
taskvar = 'NOTHING';
alert_box("Transfer number must have at least 1 digit:" + blindxferdialstring);
}
else
{
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + blindxfercontext + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id + "&nodeletevdac=" + no_delete_VDAC + "&preset_name=" + document.vicidial_form.xfername.value;
} }
} }
if (API_selected_callmenu.length > 0) if (taskvar == 'XfeRINTERNAL')
{ {
var blindxferdialstring = 's'; var closerxferinternal = '';
var blindxfercontext = document.vicidial_form.xfernumber.value; taskvar = 'XfeRLOCAL';
} }
else else
{var blindxfercontext = ext_context;}
no_delete_VDAC=0;
if (taskvar == 'XfeRVMAIL')
{ {
var blindxferdialstring = campaign_am_message_exten + '*' + campaign + '*' + document.vicidial_form.phone_code.value + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value; var closerxferinternal = '9';
no_delete_VDAC=1;
} }
if (blindxferdialstring.length<'1') if (taskvar == 'XfeRLOCAL')
{
if (consult_custom_sent < 1)
{CustomerData_update();}
document.vicidial_form.xfername.value='';
var XfeRSelecT = document.getElementById("XfeRGrouP");
var XfeR_GrouP = XfeRSelecT.value;
if (API_selected_xfergroup.length > 1)
{var XfeR_GrouP = API_selected_xfergroup;}
if (tasklockedquick > 0)
{XfeR_GrouP = quick_transfer_button_orig;}
var queryCID = "XLvdcW" + epoch_sec + user_abb;
// "90009*$group**$lead_id**$phone_number*$user*$agent_only*";
var redirectdestination = closerxferinternal + '90009*' + XfeR_GrouP + '**' + document.vicidial_form.lead_id.value + '**' + dialed_number + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*';
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id;
}
if (taskvar == 'XfeR')
{
var queryCID = "LRvdcW" + epoch_sec + user_abb;
var redirectdestination = document.vicidial_form.extension_xfer.value;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
}
if (taskvar == 'VMAIL')
{
var queryCID = "LVvdcW" + epoch_sec + user_abb;
var redirectdestination = document.vicidial_form.extension_xfer.value;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
}
if (taskvar == 'ENTRY')
{
var queryCID = "LEvdcW" + epoch_sec + user_abb;
var redirectdestination = document.vicidial_form.extension_xfer_entry.value;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
}
if (taskvar == '3WAY')
{ {
xferredirect_query=''; xferredirect_query='';
taskvar = 'NOTHING';
alert_box("Transfer number must have at least 1 digit:" + blindxferdialstring);
}
else
{
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + blindxfercontext + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id + "&nodeletevdac=" + no_delete_VDAC + "&preset_name=" + document.vicidial_form.xfername.value;
}
}
if (taskvar == 'XfeRINTERNAL')
{
var closerxferinternal = '';
taskvar = 'XfeRLOCAL';
}
else
{
var closerxferinternal = '9';
}
if (taskvar == 'XfeRLOCAL')
{
if (consult_custom_sent < 1)
{CustomerData_update();}
document.vicidial_form.xfername.value=''; var queryCID = "VXvdcW" + epoch_sec + user_abb;
var XfeRSelecT = document.getElementById("XfeRGrouP"); var redirectdestination = "NEXTAVAILABLE";
var XfeR_GrouP = XfeRSelecT.value; var redirectXTRAvalue = XDchannel;
if (API_selected_xfergroup.length > 1) var redirecttype_test = document.vicidial_form.xfernumber.value;
{var XfeR_GrouP = API_selected_xfergroup;} var XfeRSelecT = document.getElementById("XfeRGrouP");
if (tasklockedquick > 0) var XfeR_GrouP = XfeRSelecT.value;
{XfeR_GrouP = quick_transfer_button_orig;} if (API_selected_xfergroup.length > 1)
var queryCID = "XLvdcW" + epoch_sec + user_abb; {var XfeR_GrouP = API_selected_xfergroup;}
// "90009*$group**$lead_id**$phone_number*$user*$agent_only*"; var regRXFvars = new RegExp("CXFER","g");
var redirectdestination = closerxferinternal + '90009*' + XfeR_GrouP + '**' + document.vicidial_form.lead_id.value + '**' + dialed_number + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; if ( ( (redirecttype_test.match(regRXFvars)) || (consultativexfer_checked > 0) ) && (local_consult_xfers > 0) )
{var redirecttype = 'RedirectXtraCXNeW';}
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id;
}
if (taskvar == 'XfeR')
{
var queryCID = "LRvdcW" + epoch_sec + user_abb;
var redirectdestination = document.vicidial_form.extension_xfer.value;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
}
if (taskvar == 'VMAIL')
{
var queryCID = "LVvdcW" + epoch_sec + user_abb;
var redirectdestination = document.vicidial_form.extension_xfer.value;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
}
if (taskvar == 'ENTRY')
{
var queryCID = "LEvdcW" + epoch_sec + user_abb;
var redirectdestination = document.vicidial_form.extension_xfer_entry.value;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
}
if (taskvar == '3WAY')
{
xferredirect_query='';
var queryCID = "VXvdcW" + epoch_sec + user_abb;
var redirectdestination = "NEXTAVAILABLE";
var redirectXTRAvalue = XDchannel;
var redirecttype_test = document.vicidial_form.xfernumber.value;
var XfeRSelecT = document.getElementById("XfeRGrouP");
var XfeR_GrouP = XfeRSelecT.value;
if (API_selected_xfergroup.length > 1)
{var XfeR_GrouP = API_selected_xfergroup;}
var regRXFvars = new RegExp("CXFER","g");
if ( ( (redirecttype_test.match(regRXFvars)) || (consultativexfer_checked > 0) ) && (local_consult_xfers > 0) )
{var redirecttype = 'RedirectXtraCXNeW';}
else
{var redirecttype = 'RedirectXtraNeW';}
DispO3waychannel = redirectvalue;
DispO3wayXtrAchannel = redirectXTRAvalue;
DispO3wayCalLserverip = redirectserverip;
DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value;
DispO3wayCalLcamptail = '';
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 + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeR_GrouP + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level;
if (taskdebugnote == 'FIRST')
{
document.getElementById("DispoSelectHAspan").innerHTML = "<a href=\"#\" onclick=\"DispoLeavE3wayAgaiN()\">Leave 3Way Call Again</a>";
}
}
if (taskvar == 'ParK')
{
if (CalLCID.length < 1)
{
CalLCID = MDnextCID;
}
blind_transfer=0;
var queryCID = "LPvdcW" + epoch_sec + user_abb;
var redirectdestination = taskxferconf;
var redirectdestserverip = taskserverip;
var parkedby = protocol + "/" + extension;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign;
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_grabparkedcall.gif\" border=\"0\" alt=\"Grab Parked Call\" /></a>";
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
{
document.getElementById("ivrParkControl").innerHTML ="<img src=\"./images/vdc_LB_grabivrparkcall_OFF.gif\" border=\"0\" alt=\"Grab IVR Parked Call\" />";
}
customerparked=1;
customerparkedcounter=0;
}
if (taskvar == 'FROMParK')
{
blind_transfer=0;
var queryCID = "FPvdcW" + epoch_sec + user_abb;
var redirectdestination = taskxferconf;
var redirectdestserverip = taskserverip;
if( (server_ip == taskserverip) && (taskserverip.length > 6) )
{var dest_dialstring = session_id;}
else
{
if(taskserverip.length > 6)
{var dest_dialstring = server_ip_dialstring + "" + session_id;}
else else
{var dest_dialstring = session_id;} {var redirecttype = 'RedirectXtraNeW';}
} DispO3waychannel = redirectvalue;
DispO3wayXtrAchannel = redirectXTRAvalue;
DispO3wayCalLserverip = redirectserverip;
DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value;
DispO3wayCalLcamptail = '';
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign; 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 + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeR_GrouP + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level;
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_parkcall.gif\" border=\"0\" alt=\"Park Call\" /></a>"; if (taskdebugnote == 'FIRST')
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
{
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParKivr','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_ivrparkcall.gif\" border=\"0\" alt=\"IVR Park Call\" /></a>";
}
customerparked=0;
customerparkedcounter=0;
}
if (taskvar == 'ParKivr')
{
if (CalLCID.length < 1)
{
CalLCID = MDnextCID;
}
blind_transfer=0;
var queryCID = "LPvdcW" + epoch_sec + user_abb;
var redirectdestination = taskxferconf;
var redirectdestserverip = taskserverip;
var parkedby = protocol + "/" + extension;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToParkIVR&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign;
document.getElementById("ParkControl").innerHTML ="<img src=\"./images/vdc_LB_parkcall_OFF.gif\" border=\"0\" alt=\"Grab Parked Call\" />";
if (ivr_park_call=='ENABLED_PARK_ONLY')
{
document.getElementById("ivrParkControl").innerHTML ="<img src=\"./images/vdc_LB_grabivrparkcall_OFF.gif\" border=\"0\" alt=\"Grab IVR Parked Call\" />";
}
if (ivr_park_call=='ENABLED')
{
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParKivr','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_grabivrparkcall.gif\" border=\"0\" alt=\"Grab IVR Parked Call\" /></a>";
}
customerparked=1;
customerparkedcounter=0;
}
if (taskvar == 'FROMParKivr')
{
blind_transfer=0;
var queryCID = "FPvdcW" + epoch_sec + user_abb;
var redirectdestination = taskxferconf;
var redirectdestserverip = taskserverip;
if( (server_ip == taskserverip) && (taskserverip.length > 6) )
{var dest_dialstring = session_id;}
else
{
if(taskserverip.length > 6)
{var dest_dialstring = server_ip_dialstring + "" + session_id;}
else
{var dest_dialstring = session_id;}
}
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromParkIVR&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign;
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_parkcall.gif\" border=\"0\" alt=\"Park Call\" /></a>";
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
{
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParKivr','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_ivrparkcall.gif\" border=\"0\" alt=\"IVR Park Call\" /></a>";
}
customerparked=0;
customerparkedcounter=0;
}
var XFRDop = '';
xmlhttpXF.open('POST', 'manager_send.php');
xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttpXF.send(xferredirect_query);
xmlhttpXF.onreadystatechange = function()
{
if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200)
{
var XfeRRedirecToutput = null;
XfeRRedirecToutput = xmlhttpXF.responseText;
var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|");
var XFRDop = XfeRRedirecToutput_array[0];
if (XFRDop == "NeWSessioN")
{ {
threeway_end=1; document.getElementById("DispoSelectHAspan").innerHTML = "<a href=\"#\" onclick=\"DispoLeavE3wayAgaiN()\">Leave 3Way Call Again</a>";
document.getElementById("callchannel").innerHTML = '';
document.vicidial_form.callserverip.value = '';
dialedcall_send_hangup();
document.vicidial_form.xferchannel.value = '';
xfercall_send_hangup();
session_id = XfeRRedirecToutput_array[1];
document.getElementById("sessionIDspan").innerHTML = session_id;
// alert("session_id changed to: " + session_id);
} }
// alert(xferredirect_query + "\n" + xmlhttpXF.responseText); }
// document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText; if (taskvar == 'ParK')
{
if (CalLCID.length < 1)
{
CalLCID = MDnextCID;
}
blind_transfer=0;
var queryCID = "LPvdcW" + epoch_sec + user_abb;
var redirectdestination = taskxferconf;
var redirectdestserverip = taskserverip;
var parkedby = protocol + "/" + extension;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign;
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_grabparkedcall.gif\" border=\"0\" alt=\"Grab Parked Call\" /></a>";
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
{
document.getElementById("ivrParkControl").innerHTML ="<img src=\"./images/vdc_LB_grabivrparkcall_OFF.gif\" border=\"0\" alt=\"Grab IVR Parked Call\" />";
}
customerparked=1;
customerparkedcounter=0;
}
if (taskvar == 'FROMParK')
{
blind_transfer=0;
var queryCID = "FPvdcW" + epoch_sec + user_abb;
var redirectdestination = taskxferconf;
var redirectdestserverip = taskserverip;
if( (server_ip == taskserverip) && (taskserverip.length > 6) )
{var dest_dialstring = session_id;}
else
{
if(taskserverip.length > 6)
{var dest_dialstring = server_ip_dialstring + "" + session_id;}
else
{var dest_dialstring = session_id;}
}
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign;
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_parkcall.gif\" border=\"0\" alt=\"Park Call\" /></a>";
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
{
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParKivr','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_ivrparkcall.gif\" border=\"0\" alt=\"IVR Park Call\" /></a>";
}
customerparked=0;
customerparkedcounter=0;
}
if (taskvar == 'ParKivr')
{
if (CalLCID.length < 1)
{
CalLCID = MDnextCID;
}
blind_transfer=0;
var queryCID = "LPvdcW" + epoch_sec + user_abb;
var redirectdestination = taskxferconf;
var redirectdestserverip = taskserverip;
var parkedby = protocol + "/" + extension;
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToParkIVR&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign;
document.getElementById("ParkControl").innerHTML ="<img src=\"./images/vdc_LB_parkcall_OFF.gif\" border=\"0\" alt=\"Grab Parked Call\" />";
if (ivr_park_call=='ENABLED_PARK_ONLY')
{
document.getElementById("ivrParkControl").innerHTML ="<img src=\"./images/vdc_LB_grabivrparkcall_OFF.gif\" border=\"0\" alt=\"Grab IVR Parked Call\" />";
}
if (ivr_park_call=='ENABLED')
{
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParKivr','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_grabivrparkcall.gif\" border=\"0\" alt=\"Grab IVR Parked Call\" /></a>";
}
customerparked=1;
customerparkedcounter=0;
}
if (taskvar == 'FROMParKivr')
{
blind_transfer=0;
var queryCID = "FPvdcW" + epoch_sec + user_abb;
var redirectdestination = taskxferconf;
var redirectdestserverip = taskserverip;
if( (server_ip == taskserverip) && (taskserverip.length > 6) )
{var dest_dialstring = session_id;}
else
{
if(taskserverip.length > 6)
{var dest_dialstring = server_ip_dialstring + "" + session_id;}
else
{var dest_dialstring = session_id;}
}
xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromParkIVR&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id + "&CalLCID=" + CalLCID + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign;
document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_parkcall.gif\" border=\"0\" alt=\"Park Call\" /></a>";
if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') )
{
document.getElementById("ivrParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParKivr','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><img src=\"./images/vdc_LB_ivrparkcall.gif\" border=\"0\" alt=\"IVR Park Call\" /></a>";
}
customerparked=0;
customerparkedcounter=0;
}
var XFRDop = '';
xmlhttpXF.open('POST', 'manager_send.php');
xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttpXF.send(xferredirect_query);
xmlhttpXF.onreadystatechange = function()
{
if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200)
{
var XfeRRedirecToutput = null;
XfeRRedirecToutput = xmlhttpXF.responseText;
var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|");
var XFRDop = XfeRRedirecToutput_array[0];
if (XFRDop == "NeWSessioN")
{
threeway_end=1;
document.getElementById("callchannel").innerHTML = '';
document.vicidial_form.callserverip.value = '';
dialedcall_send_hangup();
document.vicidial_form.xferchannel.value = '';
xfercall_send_hangup();
session_id = XfeRRedirecToutput_array[1];
document.getElementById("sessionIDspan").innerHTML = session_id;
// alert("session_id changed to: " + session_id);
}
// alert(xferredirect_query + "\n" + xmlhttpXF.responseText);
// document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText;
}
}
delete xmlhttpXF;
}
// used to send second Redirect for manual dial calls
if ( (auto_dial_level == 0) && (taskvar != '3WAY') )
{
RedirecTxFEr = 1;
var xmlhttpXF2=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttpXF2 = false;
}
}
@end @*/
if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined')
{
xmlhttpXF2 = new XMLHttpRequest();
}
if (xmlhttpXF2)
{
xmlhttpXF2.open('POST', 'manager_send.php');
xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR");
xmlhttpXF2.onreadystatechange = function()
{
if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200)
{
Nactiveext = null;
Nactiveext = xmlhttpXF2.responseText;
// alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText);
}
}
delete xmlhttpXF2;
} }
} }
delete xmlhttpXF;
}
// used to send second Redirect for manual dial calls if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') )
if ( (auto_dial_level == 0) && (taskvar != '3WAY') )
{
RedirecTxFEr = 1;
var xmlhttpXF2=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttpXF2 = false;
}
}
@end @*/
if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined')
{ {
xmlhttpXF2 = new XMLHttpRequest(); if (auto_dial_level == 0) {RedirecTxFEr = 1;}
} document.getElementById("callchannel").innerHTML = '';
if (xmlhttpXF2) document.vicidial_form.callserverip.value = '';
{ if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
xmlhttpXF2.open('POST', 'manager_send.php'); // alert(RedirecTxFEr + "|" + auto_dial_level);
xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); dialedcall_send_hangup(taskdispowindow,'','',no_delete_VDAC);
xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR");
xmlhttpXF2.onreadystatechange = function()
{
if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200)
{
Nactiveext = null;
Nactiveext = xmlhttpXF2.responseText;
// alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText);
}
}
delete xmlhttpXF2;
} }
} }
if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') )
{
if (auto_dial_level == 0) {RedirecTxFEr = 1;}
document.getElementById("callchannel").innerHTML = '';
document.vicidial_form.callserverip.value = '';
if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
// alert(RedirecTxFEr + "|" + auto_dial_level);
dialedcall_send_hangup(taskdispowindow,'','',no_delete_VDAC);
}
} }
// ################################################################################ // ################################################################################
@@ -11177,7 +11187,7 @@ function phone_number_format(formatphone) {
{ {
var XfeRSelecT = document.getElementById("XfeRGrouP"); var XfeRSelecT = document.getElementById("XfeRGrouP");
var XScheck = XfeRSelecT.value var XScheck = XfeRSelecT.value
if (XScheck.match(/AGENTDIRECT/)) if (XScheck.match(/AGENTDIRECT/i))
{ {
showDiv('agentdirectlink'); showDiv('agentdirectlink');
} }
@@ -11194,7 +11204,7 @@ function phone_number_format(formatphone) {
{ {
var XfeRSelecT = document.getElementById("XfeRGrouP"); var XfeRSelecT = document.getElementById("XfeRGrouP");
var XScheck = XfeRSelecT.value var XScheck = XfeRSelecT.value
if (XScheck.match(/AGENTDIRECT/)) if (XScheck.match(/AGENTDIRECT/i))
{ {
showDiv('AgentXferViewSpan'); showDiv('AgentXferViewSpan');
AgentsViewOpen('AgentXferViewSelect','open'); AgentsViewOpen('AgentXferViewSelect','open');
+29 -7
View File
@@ -3151,12 +3151,13 @@ else
# 120831-1523 - Added vicidial_dial_log outbound call logging # 120831-1523 - Added vicidial_dial_log outbound call logging
# 121018-2321 - Added blank option to owner only dialing # 121018-2321 - Added blank option to owner only dialing
# 121019-0520 - Added voicemail greeting audio chooser options to phones and voicemail boxes # 121019-0520 - Added voicemail greeting audio chooser options to phones and voicemail boxes
# 121025-2339 - Added without-filter output to test filter function, added server option to test call
# #
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$admin_version = '2.6-377a'; $admin_version = '2.6-378a';
$build = '121019-0520'; $build = '121025-2339';
$STARTtime = date("U"); $STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s"); $SQLdate = date("Y-m-d H:i:s");
@@ -3976,7 +3977,7 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
##### BEGIN get inbound groups listing for checkboxes ##### ##### BEGIN get inbound groups listing for checkboxes #####
$xfer_groupsSQL=''; $xfer_groupsSQL='';
if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and (eregi('list_activation', $stage))) ) if ( (($ADD>20) and ($ADD<70)) and ($ADD!=41) or ( ($ADD==41) and ( (eregi('list_activation', $stage)) or (ereg('test_call',$stage)) ) ) )
{ {
$stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $stmt="SELECT closer_campaigns,xfer_groups from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -8752,11 +8753,19 @@ if ($ADD==73)
echo "<B>FILTER:</B> $lead_filter_id<BR>\n"; echo "<B>FILTER:</B> $lead_filter_id<BR>\n";
echo "<B>CALL LIMIT:</B> $call_count_limit\n"; echo "<B>CALL LIMIT:</B> $call_count_limit\n";
echo "<B>CALL TIME:</B> $local_call_time<BR><BR>\n"; echo "<B>CALL TIME:</B> $local_call_time<BR><BR>\n";
echo "<B>With Filter:</B>\n";
echo "<BR><BR>\n";
### call function to calculate and print dialable leads ### call function to calculate and print dialable leads
$single_status=0; $single_status=0;
dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL);
echo "<BR><BR>\n";
echo "<B>Without Filter:</B>\n";
echo "<BR><BR>\n";
dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,'');
echo "<BR><BR>\n"; echo "<BR><BR>\n";
echo "</BODY></HTML>\n"; echo "</BODY></HTML>\n";
@@ -14842,15 +14851,15 @@ if ($ADD==41)
else {$CIDstring = "$VqueryCID";} else {$CIDstring = "$VqueryCID";}
### insert a NEW record to the vicidial_manager table to be processed ### insert a NEW record to the vicidial_manager table to be processed
$stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$SSactive_voicemail_server','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')"; $stmtB = "INSERT INTO vicidial_manager values('','','$SQLdate','NEW','N','$old_server_ip','','Originate','$VqueryCID','Exten: $VDAD_dial_exten','Context: $ext_context','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $CIDstring','Timeout: $Local_dial_timeout','','','','VDACnote: $campaign_id|$lead_id|$phone_code|$phone_number|OUT|MAIN|99')";
$rslt=mysql_query($stmtB, $link); $rslt=mysql_query($stmtB, $link);
### insert a SENT record to the vicidial_auto_calls table ### insert a SENT record to the vicidial_auto_calls table
$stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$SSactive_voicemail_server','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')"; $stmtC = "INSERT INTO vicidial_auto_calls (server_ip,campaign_id,status,lead_id,callerid,phone_code,phone_number,call_time,call_type,alt_dial,queue_priority) values('$old_server_ip','$campaign_id','SENT','$lead_id','$VqueryCID','$phone_code','$phone_number','$SQLdate','OUT','MAIN','99')";
$rslt=mysql_query($stmtC, $link); $rslt=mysql_query($stmtC, $link);
### insert a record in the vicidial_dial_log table ### insert a record in the vicidial_dial_log table
$stmtD = "INSERT INTO vicidial_dial_log SET caller_code='$VqueryCID',lead_id='$lead_id',server_ip='$SSactive_voicemail_server',call_date='$SQLdate',extension='$VDAD_dial_exten',channel='$local_DEF$Ndialstring$local_AMP$ext_context',timeout='$Local_dial_timeout',outbound_cid='$CIDstring',context='$ext_context';"; $stmtD = "INSERT INTO vicidial_dial_log SET caller_code='$VqueryCID',lead_id='$lead_id',server_ip='$old_server_ip',call_date='$SQLdate',extension='$VDAD_dial_exten',channel='$local_DEF$Ndialstring$local_AMP$ext_context',timeout='$Local_dial_timeout',outbound_cid='$CIDstring',context='$ext_context';";
$rslt=mysql_query($stmtD, $link); $rslt=mysql_query($stmtD, $link);
### LOG INSERTION Admin Log Table, for campaign ### ### LOG INSERTION Admin Log Table, for campaign ###
@@ -22142,6 +22151,18 @@ if ($ADD==31)
{ {
if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') ) if ( ($SStest_campaign_calls > 0) and ($campaign_active == 'Y') )
{ {
##### get list of active asterisk server for dynamic pulldown list menu
$stmt="SELECT server_id,server_ip from servers where active='Y' and active_asterisk_server='Y' $LOGadmin_viewable_groupsSQL order by server_id;";
$rslt=mysql_query($stmt, $link);
$servers_to_print = mysql_num_rows($rslt);
$servers_menu="<option SELECTED value=\"$SSactive_voicemail_server\">DEFAULT - $SSactive_voicemail_server</option>\n";
$os=0;
while ($servers_to_print > $os)
{
$rowx=mysql_fetch_row($rslt);
$servers_menu .= "<option value=\"$rowx[1]\">$rowx[0] - $rowx[1]</option>\n";
$os++;
}
echo "<form action=$PHP_SELF method=POST>\n"; echo "<form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=41>\n"; echo "<input type=hidden name=ADD value=41>\n";
echo "<input type=hidden name=DB value=$DB>\n"; echo "<input type=hidden name=DB value=$DB>\n";
@@ -22154,8 +22175,9 @@ if ($ADD==31)
echo "<input type=hidden name=campaign_vdad_exten value=\"$campaign_vdad_exten\">\n"; echo "<input type=hidden name=campaign_vdad_exten value=\"$campaign_vdad_exten\">\n";
echo "<input type=hidden name=omit_phone_code value=\"$omit_phone_code\">\n"; echo "<input type=hidden name=omit_phone_code value=\"$omit_phone_code\">\n";
echo "Test Outbound Call: "; echo "Test Outbound Call: ";
echo "code: <input type=text name=phone_code id=phone_code size=4 maxlength=10 value=\"\"> &nbsp; "; echo "code: <input type=text name=phone_code id=phone_code size=2 maxlength=10 value=\"\"> &nbsp; ";
echo "number: <input type=text name=phone_number id=phone_number size=14 maxlength=20 value=\"\"> &nbsp; "; echo "number: <input type=text name=phone_number id=phone_number size=14 maxlength=20 value=\"\"> &nbsp; ";
echo "server: <select size=1 name=old_server_ip>$servers_menu</select> &nbsp; ";
echo "<input type=submit value=\"PLACE TEST CALL\"> &nbsp; $NWB#settings-test_campaign_calls$NWE</form><br><br>\n"; echo "<input type=submit value=\"PLACE TEST CALL\"> &nbsp; $NWB#settings-test_campaign_calls$NWE</form><br><br>\n";
} }
else else
+17 -6
View File
@@ -1,5 +1,5 @@
<?php <?php
# admin_search_lead.php version 2.4 # admin_search_lead.php version 2.6
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
@@ -29,6 +29,7 @@
# 120221-0118 - Added User Group campaign list restrictions to search queries # 120221-0118 - Added User Group campaign list restrictions to search queries
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
# 120409-1131 - Added option for log searches done through slave DB server # 120409-1131 - Added option for log searches done through slave DB server
# 121025-1732 - Added owner field search option
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -60,6 +61,8 @@ if (isset($_GET["status"])) {$status=$_GET["status"];}
elseif (isset($_POST["status"])) {$status=$_POST["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];}
if (isset($_GET["user"])) {$user=$_GET["user"];} if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["owner"])) {$owner=$_GET["owner"];}
elseif (isset($_POST["owner"])) {$owner=$_POST["owner"];}
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];} if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];}
@@ -268,7 +271,7 @@ echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n";
echo date("l F j, Y G:i:s A"); echo date("l F j, Y G:i:s A");
echo "<BR>\n"; echo "<BR>\n";
if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) and (strlen($owner)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) ))
{ {
### Lead search ### Lead search
echo "<br><center>\n"; echo "<br><center>\n";
@@ -300,11 +303,13 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_
echo "</TR><TR bgcolor=#B9CBFD>"; echo "</TR><TR bgcolor=#B9CBFD>";
echo "<TD ALIGN=right>Status: &nbsp; </TD><TD ALIGN=left><input type=text name=status size=7 maxlength=6></TD>"; echo "<TD ALIGN=right>Status: &nbsp; </TD><TD ALIGN=left><input type=text name=status size=7 maxlength=6></TD>";
echo "<TD rowspan=3><input type=submit name=submit value=SUBMIT></TD>\n"; echo "<TD rowspan=4><input type=submit name=submit value=SUBMIT></TD>\n";
echo "</TR><TR bgcolor=#B9CBFD>"; echo "</TR><TR bgcolor=#B9CBFD>";
echo "<TD ALIGN=right>List ID: &nbsp; </TD><TD ALIGN=left><input type=text name=list_id size=15 maxlength=14></TD>"; echo "<TD ALIGN=right>List ID: &nbsp; </TD><TD ALIGN=left><input type=text name=list_id size=15 maxlength=14></TD>";
echo "</TR><TR bgcolor=#B9CBFD>"; echo "</TR><TR bgcolor=#B9CBFD>";
echo "<TD ALIGN=right>User: &nbsp; </TD><TD ALIGN=left><input type=text name=user size=15 maxlength=20></TD>"; echo "<TD ALIGN=right>User: &nbsp; </TD><TD ALIGN=left><input type=text name=user size=15 maxlength=20></TD>";
echo "</TR><TR bgcolor=#B9CBFD>";
echo "<TD ALIGN=right>Owner: &nbsp; </TD><TD ALIGN=left><input type=text name=owner size=15 maxlength=50></TD>";
echo "</TR><TR>"; echo "</TR><TR>";
echo "<TD colspan=3 align=center> &nbsp; </TD>"; echo "<TD colspan=3 align=center> &nbsp; </TD>";
echo "</TR><TR bgcolor=#B9CBFD>"; echo "</TR><TR bgcolor=#B9CBFD>";
@@ -609,11 +614,12 @@ else
} }
else else
{ {
if ( (strlen($status)>0) or (strlen($list_id)>0) or (strlen($user)>0) ) if ( (strlen($status)>0) or (strlen($list_id)>0) or (strlen($user)>0) or (strlen($owner)>0) )
{ {
$statusSQL = ''; $statusSQL = '';
$list_idSQL = ''; $list_idSQL = '';
$userSQL = ''; $userSQL = '';
$ownerSQL = '';
if (strlen($status)>0) if (strlen($status)>0)
{ {
$statusSQL = "status='" . mysql_real_escape_string($status) . "'"; $SQLctA++; $statusSQL = "status='" . mysql_real_escape_string($status) . "'"; $SQLctA++;
@@ -626,9 +632,14 @@ else
if (strlen($user)>0) if (strlen($user)>0)
{ {
if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';} if ( ($SQLctA > 0) or ($SQLctB > 0) ) {$andB = 'and';}
$userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; $userSQL = "$andB user='" . mysql_real_escape_string($user) . "'"; $SQLctC++;
} }
$stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL $LOGallowed_listsSQL"; if (strlen($owner)>0)
{
if ( ($SQLctA > 0) or ($SQLctB > 0) or ($SQLctC > 0) ) {$andC = 'and';}
$ownerSQL = "$andC owner='" . mysql_real_escape_string($owner) . "'";
}
$stmt="SELECT $vicidial_list_fields from vicidial_list where $statusSQL $list_idSQL $userSQL $ownerSQL $LOGallowed_listsSQL";
} }
else else
{ {