From 70fe6994cdb3120096de31b5cc99db2e5a0a46e3 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 26 Oct 2012 05:52:56 +0000 Subject: [PATCH] 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 --- agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi | 36 +- agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl | 2 +- .../TO_BE_TRANSLATED_2.6.txt | 1 + agc_2-X/trunk/www/agc/vicidial.php | 686 +++++++++--------- agc_2-X/trunk/www/vicidial/admin.php | 36 +- .../trunk/www/vicidial/admin_search_lead.php | 23 +- 6 files changed, 419 insertions(+), 365 deletions(-) diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index f4e96fac..7f4044b0 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -176,8 +176,10 @@ # 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 # 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'; $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_call_seconds = $EXT_vars[8]; # not currently used $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_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;} } +# 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'); @@ -1332,7 +1342,7 @@ if ( ( ( ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) && ($hm >= $c } 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 $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 ( ($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 $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]; $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 $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 ( ($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 $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 ### $adSQL=''; -if ( ($channel_group =~ /AGENTDIRECT/) || ($dial_ingroup_flag > 0) ) +if ( ($channel_group =~ /AGENTDIRECT/i) || ($dial_ingroup_flag > 0) ) {$adSQL = ",agent_only='$agent_only'";} ### 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 ### -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; $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"; - 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 $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 ( ($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 $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"; - 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 $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 ( ($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 $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; } - 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/) { @@ -4627,7 +4637,7 @@ if ( ($drop_timer > $DROP_TIME) || ($MCdrop_override > 0) ) 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/) { diff --git a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl index 1d2c1ee6..d7f9be11 100644 --- a/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl +++ b/agc_2-X/trunk/bin/ADMIN_keepalive_ALL.pl @@ -1191,7 +1191,7 @@ $sthA->finish(); if ( ($active_voicemail_server =~ /$server_ip/) && ((length($active_voicemail_server)) eq (length($server_ip))) ) { $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')) {`echo -e \"; END OF FILE\n\" > /etc/asterisk/voicemail.conf`;} diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt index c6da4e55..30f2666e 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt @@ -38,6 +38,7 @@ Phone and Post Code Time Zone Mismatch|| Last Local Call Time|| Called Count|| Unidentified Hangup Cause Code|| +YOU MUST SELECT AN AGENT TO TRANSFER TO WHEN USING AGENTDIRECT|| ############################################################ MANAGER Manual diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index cc2707f2..cae4a644 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -384,10 +384,11 @@ # 120810-0056 - Added recording api function # 120819-1747 - Added vicidial_session_data logging for webphone api 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'; -$build = '120914-1357'; +$version = '2.6-353c'; +$build = '121025-2335'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=79; $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 function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote,taskdispowindow,tasklockedquick) { - blind_transfer=1; - var consultativexfer_checked = 0; - if (document.vicidial_form.consultativexfer.checked==true) - {consultativexfer_checked = 1;} - 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') + var XfeRSelecT = document.getElementById("XfeRGrouP"); + var XfeR_GrouP = XfeRSelecT.value; + var ADvalue = document.vicidial_form.xfernumber.value; + if ( ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRINTERNAL') ) && (XfeR_GrouP.match(/AGENTDIRECT/i)) && (ADvalue.length < 2) ) { - xmlhttpXF = new XMLHttpRequest(); + alert_box("YOU MUST SELECT AN AGENT TO TRANSFER TO WHEN USING AGENTDIRECT"); } - 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;} + else + { + blind_transfer=1; + var consultativexfer_checked = 0; + if (document.vicidial_form.consultativexfer.checked==true) + {consultativexfer_checked = 1;} + if (taskvar == 'XfeRLOCAL') + {consultativexfer_checked = 0;} - if (blindxferdialstring.length > 7) - {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;} + // 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(); + } + 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 blindxfercontext = document.vicidial_form.xfernumber.value; + var closerxferinternal = ''; + taskvar = 'XfeRLOCAL'; } - else - {var blindxfercontext = ext_context;} - no_delete_VDAC=0; - if (taskvar == 'XfeRVMAIL') + else { - 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; + var closerxferinternal = '9'; } - 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=''; - 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 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=''; - - 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 = "Leave 3Way Call Again"; - } - } - 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 ="\"Grab"; - if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') ) - { - document.getElementById("ivrParkControl").innerHTML ="\"Grab"; - } - 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;} + 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 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 ="\"Park"; - if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') ) - { - document.getElementById("ivrParkControl").innerHTML ="\"IVR"; - } - 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 ="\"Grab"; - if (ivr_park_call=='ENABLED_PARK_ONLY') - { - document.getElementById("ivrParkControl").innerHTML ="\"Grab"; - } - if (ivr_park_call=='ENABLED') - { - document.getElementById("ivrParkControl").innerHTML ="\"Grab"; - } - 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 ="\"Park"; - if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') ) - { - document.getElementById("ivrParkControl").innerHTML ="\"IVR"; - } - 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") + if (taskdebugnote == 'FIRST') { - 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); + document.getElementById("DispoSelectHAspan").innerHTML = "Leave 3Way Call Again"; } - // 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 ="\"Grab"; + if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') ) + { + document.getElementById("ivrParkControl").innerHTML ="\"Grab"; + } + 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 ="\"Park"; + if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') ) + { + document.getElementById("ivrParkControl").innerHTML ="\"IVR"; + } + 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 ="\"Grab"; + if (ivr_park_call=='ENABLED_PARK_ONLY') + { + document.getElementById("ivrParkControl").innerHTML ="\"Grab"; + } + if (ivr_park_call=='ENABLED') + { + document.getElementById("ivrParkControl").innerHTML ="\"Grab"; + } + 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 ="\"Park"; + if ( (ivr_park_call=='ENABLED') || (ivr_park_call=='ENABLED_PARK_ONLY') ) + { + document.getElementById("ivrParkControl").innerHTML ="\"IVR"; + } + 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 ( (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') + if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') ) { - 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; + 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); } } - - 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 XScheck = XfeRSelecT.value - if (XScheck.match(/AGENTDIRECT/)) + if (XScheck.match(/AGENTDIRECT/i)) { showDiv('agentdirectlink'); } @@ -11194,7 +11204,7 @@ function phone_number_format(formatphone) { { var XfeRSelecT = document.getElementById("XfeRGrouP"); var XScheck = XfeRSelecT.value - if (XScheck.match(/AGENTDIRECT/)) + if (XScheck.match(/AGENTDIRECT/i)) { showDiv('AgentXferViewSpan'); AgentsViewOpen('AgentXferViewSelect','open'); diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index e3da7f48..d8d33ac3 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -3151,12 +3151,13 @@ else # 120831-1523 - Added vicidial_dial_log outbound call logging # 121018-2321 - Added blank option to owner only dialing # 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 -$admin_version = '2.6-377a'; -$build = '121019-0520'; +$admin_version = '2.6-378a'; +$build = '121025-2339'; $STARTtime = date("U"); $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 ##### $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;"; $rslt=mysql_query($stmt, $link); @@ -8752,11 +8753,19 @@ if ($ADD==73) echo "FILTER: $lead_filter_id
\n"; echo "CALL LIMIT: $call_count_limit\n"; echo "CALL TIME: $local_call_time

\n"; + echo "With Filter:\n"; + echo "

\n"; ### call function to calculate and print dialable leads $single_status=0; dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,$fSQL); + echo "

\n"; + echo "Without Filter:\n"; + echo "

\n"; + + dialable_leads($DB,$link,$local_call_time,$dial_statuses,$camp_lists,$drop_lockout_time,$call_count_limit,$single_status,''); + echo "

\n"; echo "\n"; @@ -14842,15 +14851,15 @@ if ($ADD==41) else {$CIDstring = "$VqueryCID";} ### 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); ### 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); ### 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); ### LOG INSERTION Admin Log Table, for campaign ### @@ -22142,6 +22151,18 @@ if ($ADD==31) { 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="\n"; + $os=0; + while ($servers_to_print > $os) + { + $rowx=mysql_fetch_row($rslt); + $servers_menu .= "\n"; + $os++; + } echo "
\n"; echo "\n"; echo "\n"; @@ -22154,8 +22175,9 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "Test Outbound Call: "; - echo "code:   "; + echo "code:   "; echo "number:   "; + echo "server:   "; echo "   $NWB#settings-test_campaign_calls$NWE


\n"; } else diff --git a/agc_2-X/trunk/www/vicidial/admin_search_lead.php b/agc_2-X/trunk/www/vicidial/admin_search_lead.php index 3bc0c26f..c36b9083 100644 --- a/agc_2-X/trunk/www/vicidial/admin_search_lead.php +++ b/agc_2-X/trunk/www/vicidial/admin_search_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 # @@ -29,6 +29,7 @@ # 120221-0118 - Added User Group campaign list restrictions to search queries # 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 +# 121025-1732 - Added owner field search option # require("dbconnect.php"); @@ -60,6 +61,8 @@ if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} if (isset($_GET["user"])) {$user=$_GET["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"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} 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 "
\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 echo "
\n"; @@ -300,11 +303,13 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_ echo ""; echo "Status:   "; - echo "\n"; + echo "\n"; echo ""; echo "List ID:   "; echo ""; echo "User:   "; + echo ""; + echo "Owner:   "; echo ""; echo "   "; echo ""; @@ -609,11 +614,12 @@ 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 = ''; $list_idSQL = ''; $userSQL = ''; + $ownerSQL = ''; if (strlen($status)>0) { $statusSQL = "status='" . mysql_real_escape_string($status) . "'"; $SQLctA++; @@ -626,9 +632,14 @@ else if (strlen($user)>0) { 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 {