From 1328d926187ed76a84e3aafaecb7c5d78139b610 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 29 Jul 2010 03:36:39 +0000 Subject: [PATCH] updated translation files for agent translations updated agent translations for Spanish(es) and Italian(it) git-svn-id: svn://192.168.202.10@1487 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../trunk/LANG_www/agc_es/astguiclient.php | 2 +- agc_2-X/trunk/LANG_www/agc_es/calendar.css | 95 ++ agc_2-X/trunk/LANG_www/agc_es/calendar_db.js | 335 +++++ .../LANG_www/agc_es/conf_exten_check.php | 18 +- agc_2-X/trunk/LANG_www/agc_es/functions.php | 504 ++++++++ .../trunk/LANG_www/agc_es/manager_send.php | 75 +- agc_2-X/trunk/LANG_www/agc_es/timeclock.php | 14 +- .../trunk/LANG_www/agc_es/vdc_db_query.php | 593 +++++++-- .../LANG_www/agc_es/vdc_form_display.php | 359 ++++++ .../LANG_www/agc_es/vdc_script_display.php | 10 + .../LANG_www/agc_es/vdc_script_notes.php | 648 ++++++++++ agc_2-X/trunk/LANG_www/agc_es/vicidial.php | 1075 +++++++++++++---- agc_2-X/trunk/LANG_www/agc_it/calendar.css | 95 ++ agc_2-X/trunk/LANG_www/agc_it/calendar_db.js | 335 +++++ .../LANG_www/agc_it/conf_exten_check.php | 18 +- agc_2-X/trunk/LANG_www/agc_it/functions.php | 504 ++++++++ .../trunk/LANG_www/agc_it/manager_send.php | 33 +- agc_2-X/trunk/LANG_www/agc_it/timeclock.php | 14 +- .../trunk/LANG_www/agc_it/vdc_db_query.php | 224 +++- .../LANG_www/agc_it/vdc_form_display.php | 359 ++++++ .../LANG_www/agc_it/vdc_script_notes.php | 648 ++++++++++ agc_2-X/trunk/LANG_www/agc_it/vicidial.php | 590 +++++++-- agc_2-X/trunk/translations/br_language.txt | 5 + agc_2-X/trunk/translations/de_language.txt | 5 + agc_2-X/trunk/translations/el_language.txt | 5 + agc_2-X/trunk/translations/es_language.txt | 5 + agc_2-X/trunk/translations/fr_language.txt | 5 + agc_2-X/trunk/translations/it_language.txt | 5 + agc_2-X/trunk/translations/nl_language.txt | 5 + agc_2-X/trunk/translations/pl_language.txt | 5 + agc_2-X/trunk/translations/pt_language.txt | 5 + agc_2-X/trunk/translations/ru_language.txt | 5 + agc_2-X/trunk/translations/se_language.txt | 5 + agc_2-X/trunk/translations/sk_language.txt | 5 + agc_2-X/trunk/translations/tw_language.txt | 5 + agc_2-X/trunk/www/agc/calendar_db.js | 18 +- 36 files changed, 6049 insertions(+), 582 deletions(-) create mode 100644 agc_2-X/trunk/LANG_www/agc_es/calendar.css create mode 100644 agc_2-X/trunk/LANG_www/agc_es/calendar_db.js create mode 100644 agc_2-X/trunk/LANG_www/agc_es/functions.php create mode 100644 agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php create mode 100644 agc_2-X/trunk/LANG_www/agc_es/vdc_script_notes.php create mode 100644 agc_2-X/trunk/LANG_www/agc_it/calendar.css create mode 100644 agc_2-X/trunk/LANG_www/agc_it/calendar_db.js create mode 100644 agc_2-X/trunk/LANG_www/agc_it/functions.php create mode 100644 agc_2-X/trunk/LANG_www/agc_it/vdc_form_display.php create mode 100644 agc_2-X/trunk/LANG_www/agc_it/vdc_script_notes.php diff --git a/agc_2-X/trunk/LANG_www/agc_es/astguiclient.php b/agc_2-X/trunk/LANG_www/agc_es/astguiclient.php index 29fb4907..7dee1758 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/astguiclient.php +++ b/agc_2-X/trunk/LANG_www/agc_es/astguiclient.php @@ -145,7 +145,7 @@ if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') ) { header ("Content-type: text/html; charset=utf-8"); - echo "web client astGUIclient: Conexión\n"; + echo "web client astGUIclient: Login\n"; echo "\n"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/agc_es/calendar.css b/agc_2-X/trunk/LANG_www/agc_es/calendar.css new file mode 100644 index 00000000..a3ddcae5 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/agc_es/calendar.css @@ -0,0 +1,95 @@ +/* calendar icon */ +img.tcalIcon { + cursor: pointer; + margin-left: 1px; + vertical-align: middle; +} +/* calendar container element */ +div#tcal { + position: absolute; + visibility: hidden; + z-index: 100; + width: 158px; + padding: 2px 0 0 0; +} +/* all tables in calendar */ +div#tcal table { + width: 100%; + border: 1px solid silver; + border-collapse: collapse; + background-color: white; +} +/* navigation table */ +div#tcal table.ctrl { + border-bottom: 0; +} +/* navigation buttons */ +div#tcal table.ctrl td { + width: 15px; + height: 20px; +} +/* month year header */ +div#tcal table.ctrl th { + background-color: white; + color: black; + border: 0; +} +/* week days header */ +div#tcal th { + border: 1px solid silver; + border-collapse: collapse; + text-align: center; + padding: 3px 0; + font-family: tahoma, verdana, arial; + font-size: 10px; + background-color: gray; + color: white; +} +/* date cells */ +div#tcal td { + border: 0; + border-collapse: collapse; + text-align: center; + padding: 2px 0; + font-family: tahoma, verdana, arial; + font-size: 11px; + width: 22px; + cursor: pointer; +} +/* date highlight + in case of conflicting settings order here determines the priority from least to most important */ +div#tcal td.othermonth { + color: silver; +} +div#tcal td.weekend { + background-color: #ACD6F5; +} +div#tcal td.today { + border: 1px solid red; +} +div#tcal td.selected { + background-color: #FFB3BE; +} +/* iframe element used to suppress windowed controls in IE5/6 */ +iframe#tcalIF { + position: absolute; + visibility: hidden; + z-index: 98; + border: 0; +} +/* transparent shadow */ +div#tcalShade { + position: absolute; + visibility: hidden; + z-index: 99; +} +div#tcalShade table { + border: 0; + border-collapse: collapse; + width: 100%; +} +div#tcalShade table td { + border: 0; + border-collapse: collapse; + padding: 0; +} diff --git a/agc_2-X/trunk/LANG_www/agc_es/calendar_db.js b/agc_2-X/trunk/LANG_www/agc_es/calendar_db.js new file mode 100644 index 00000000..a7a11136 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/agc_es/calendar_db.js @@ -0,0 +1,335 @@ +// Tigra Calendar v4.0.2 (2009-01-12) Database (yyyy-mm-dd) +// http://www.softcomplex.com/products/tigra_calendar/ +// Public Domain Software... You're welcome. + +// default settins +var A_TCALDEF = { + 'months' : ['Enero', 'February', 'Marcha', 'Abril', 'Puede', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'], + 'weekdays' : ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'], + 'yearscroll': true, // show year scroller + 'weekstart': 0, // first day of week: 0-Su or 1-Mo + 'centyear' : 70, // 2 digit years less than 'centyear' are in 20xx, othewise in 19xx. + 'imgpath' : '../agc/images/' // directory with calendar images +} +// date parsing function +function f_tcalParseDate (s_date) { + + var re_date = /^\s*(\d{2,4})\-(\d{1,2})\-(\d{1,2})\s*$/; + if (!re_date.exec(s_date)) + return alert ("Inválido date: '" + s_date + "'.\nAccepted format is yyyy-mm-dd.") + var n_day = Number(RegExp.$3), + n_month = Number(RegExp.$2), + n_year = Number(RegExp.$1); + + if (n_year < 100) + n_year += (n_year < this.a_tpl.centyear ? 2000 : 1900); + if (n_month < 1 || n_month > 12) + return alert ("Inválido month value: '" + n_month + "'.\nAllowed range is 01-12."); + var d_numdays = new Date(n_year, n_month, 0); + if (n_day > d_numdays.getDate()) + return alert("Inválido day of month value: '" + n_day + "'.\nAllowed range for selected month is 01 - " + d_numdays.getDate() + "."); + + return new Date (n_year, n_month - 1, n_day); +} +// date generating function +function f_tcalGenerDate (d_date) { + return ( + d_date.getFullYear() + "-" + + (d_date.getMonth() < 9 ? '0' : '') + (d_date.getMonth() + 1) + "-" + + (d_date.getDate() < 10 ? '0' : '') + d_date.getDate() + ); +} + +// implementation +function tcal (a_cfg, a_tpl) { + + // apply default template if not specified + if (!a_tpl) + a_tpl = A_TCALDEF; + + // register in global collections + if (!window.A_TCALS) + window.A_TCALS = []; + if (!window.A_TCALSIDX) + window.A_TCALSIDX = []; + + this.s_id = a_cfg.id ? a_cfg.id : A_TCALS.length; + window.A_TCALS[this.s_id] = this; + window.A_TCALSIDX[window.A_TCALSIDX.length] = this; + + // assign methods + this.f_show = f_tcal_show; + this.f_hide = f_tcal_hide; + this.f_toggle = f_tcalToggle; + this.f_update = f_tcalUpdate; + this.f_relDate = f_tcalRelDate; + this.f_parseDate = f_tcalParseDate; + this.f_generDate = f_tcalGenerDate; + + // create calendar icon + this.s_iconId = 'tcalico_' + this.s_id; + this.e_icon = f_getElement(this.s_iconId); + if (!this.e_icon) { + document.write('Open Calendar'); + this.e_icon = f_getElement(this.s_iconId); + } + // save received parameters + this.a_cfg = a_cfg; + this.a_tpl = a_tpl; +} + +function f_tcal_show (d_date) { + + // find input field + if (!this.a_cfg.controlname) + throw("TC: control name is not specified"); + if (this.a_cfg.formname) { + var e_form = document.forms[this.a_cfg.formname]; + if (!e_form) + throw("TC: form '" + this.a_cfg.formname + "' can not be found"); + this.e_input = e_form.elements[this.a_cfg.controlname]; + } + else + this.e_input = f_getElement(this.a_cfg.controlname); + + if (!this.e_input || !this.e_input.tagName || this.e_input.tagName != 'INPUT') + throw("TC: element '" + this.a_cfg.controlname + "' does not exist in " + + (this.a_cfg.formname ? "form '" + this.a_cfg.controlname + "'" : 'this document')); + + // dynamically create HTML elements if needed + this.e_div = f_getElement('tcal'); + if (!this.e_div) { + this.e_div = document.createElement("DIV"); + this.e_div.id = 'tcal'; + document.body.appendChild(this.e_div); + } + this.e_shade = f_getElement('tcalShade'); + if (!this.e_shade) { + this.e_shade = document.createElement("DIV"); + this.e_shade.id = 'tcalShade'; + document.body.appendChild(this.e_shade); + } + this.e_iframe = f_getElement('tcalIF') + if (b_ieFix && !this.e_iframe) { + this.e_iframe = document.createElement("IFRAME"); + this.e_iframe.style.filter = 'alpha(opacity=0)'; + this.e_iframe.id = 'tcalIF'; + this.e_iframe.src = this.a_tpl.imgpath + 'pixel.gif'; + document.body.appendChild(this.e_iframe); + } + + // hide all calendars + f_tcal_hideAll(); + + // generate HTML and show calendar + this.e_icon = f_getElement(this.s_iconId); + if (!this.f_update()) + return; + + this.e_div.style.visibility = 'visible'; + this.e_shade.style.visibility = 'visible'; + if (this.e_iframe) + this.e_iframe.style.visibility = 'visible'; + + // change icon and status + this.e_icon.src = this.a_tpl.imgpath + 'no_cal.gif'; + this.e_icon.title = 'Close Calendar'; + this.b_visible = true; +} + +function f_tcal_hide (n_date) { + if (n_date) + this.e_input.value = this.f_generDate(new Date(n_date)); + + // no action if not visible + if (!this.b_visible) + return; + + // hide elements + if (this.e_iframe) + this.e_iframe.style.visibility = 'hidden'; + if (this.e_shade) + this.e_shade.style.visibility = 'hidden'; + this.e_div.style.visibility = 'hidden'; + + // change icon and status + this.e_icon = f_getElement(this.s_iconId); + this.e_icon.src = this.a_tpl.imgpath + 'cal.gif'; + this.e_icon.title = 'Open Calendar'; + this.b_visible = false; +} + +function f_tcalToggle () { + return this.b_visible ? this.f_hide() : this.f_show(); +} + +function f_tcalUpdate (d_date) { + + var d_today = this.a_cfg.today ? this.f_parseDate(this.a_cfg.today) : f_tcalResetTime(new Date()); + var d_selected = this.e_input.value == '' + ? (this.a_cfg.selected ? this.f_parseDate(this.a_cfg.selected) : d_today) + : this.f_parseDate(this.e_input.value); + + // figure out date to display + if (!d_date) + // selected by default + d_date = d_selected; + else if (typeof(d_date) == 'number') + // get from number + d_date = f_tcalResetTime(new Date(d_date)); + else if (typeof(d_date) == 'string') + // parse from string + this.f_parseDate(d_date); + + if (!d_date) return false; + + // first date to display + var d_firstday = new Date(d_date); + d_firstday.setDate(1); + d_firstday.setDate(1 - (7 + d_firstday.getDay() - this.a_tpl.weekstart) % 7); + + var a_class, s_html = '
' + + (this.a_tpl.yearscroll ? '' : '') + + '' + + (this.a_tpl.yearscroll ? '' : '') + + '
' + + this.a_tpl.months[d_date.getMonth()] + ' ' + d_date.getFullYear() + + '
'; + + // print weekdays titles + for (var i = 0; i < 7; i++) + s_html += ''; + s_html += '' ; + + // print calendar table + var n_date, n_month, d_current = new Date(d_firstday); + while (d_current.getMonth() == d_date.getMonth() || + d_current.getMonth() == d_firstday.getMonth()) { + + // print row heder + s_html +=''; + for (var n_wday = 0; n_wday < 7; n_wday++) { + + a_class = []; + n_date = d_current.getDate(); + n_month = d_current.getMonth(); + + // other month + if (d_current.getMonth() != d_date.getMonth()) + a_class[a_class.length] = 'othermonth'; + // weekend + if (d_current.getDay() == 0 || d_current.getDay() == 6) + a_class[a_class.length] = 'weekend'; + // today + if (d_current.valueOf() == d_today.valueOf()) + a_class[a_class.length] = 'today'; + // selected + if (d_current.valueOf() == d_selected.valueOf()) + a_class[a_class.length] = 'selected'; + + s_html += '' + + d_current.setDate(++n_date); + while (d_current.getDate() != n_date && d_current.getMonth() == n_month) { + d_current.setHours(d_current.getHours + 1); + d_current = f_tcalResetTime(d_current); + } + } + // print row footer + s_html +=''; + } + s_html +='
' + this.a_tpl.weekdays[(this.a_tpl.weekstart + i) % 7] + '
' : '>') + n_date + '
'; + + // update HTML, positions and sizes + this.e_div.innerHTML = s_html; + + var n_width = this.e_div.offsetWidth; + var n_height = this.e_div.offsetHeight; + var n_top = f_getPosition (this.e_icon, 'Top') + this.e_icon.offsetHeight; + var n_left = f_getPosition (this.e_icon, 'Left') - n_width + this.e_icon.offsetWidth; + if (n_left < 0) n_left = 0; + + this.e_div.style.left = n_left + 'px'; + this.e_div.style.top = n_top + 'px'; + + this.e_shade.style.width = (n_width + 8) + 'px'; + this.e_shade.style.left = (n_left - 1) + 'px'; + this.e_shade.style.top = (n_top - 1) + 'px'; + this.e_shade.innerHTML = b_ieFix + ? '
' + : '
'; + + if (this.e_iframe) { + this.e_iframe.style.left = n_left + 'px'; + this.e_iframe.style.top = n_top + 'px'; + this.e_iframe.style.width = (n_width + 6) + 'px'; + this.e_iframe.style.height = (n_height + 6) +'px'; + } + return true; +} + +function f_getPosition (e_elemRef, s_coord) { + var n_pos = 0, n_offset, + e_elem = e_elemRef; + + while (e_elem) { + n_offset = e_elem["offset" + s_coord]; + n_pos += n_offset; + e_elem = e_elem.offsetParent; + } + // margin correction in some browsers + if (b_ieMac) + n_pos += parseInt(document.body[s_coord.toLowerCase() + 'Margin']); + else if (b_safari) + n_pos -= n_offset; + + e_elem = e_elemRef; + while (e_elem != document.body) { + n_offset = e_elem["scroll" + s_coord]; + if (n_offset && e_elem.style.overflow == 'scroll') + n_pos -= n_offset; + e_elem = e_elem.parentNode; + } + return n_pos; +} + +function f_tcalRelDate (d_date, d_diff, s_units) { + var s_units = (s_units == 'y' ? 'FullYear' : 'Month'); + var d_result = new Date(d_date); + d_result['set' + s_units](d_date['get' + s_units]() + d_diff); + if (d_result.getDate() != d_date.getDate()) + d_result.setDate(0); + return ' onclick="A_TCALS[\'' + this.s_id + '\'].f_update(' + d_result.valueOf() + ')"'; +} + +function f_tcal_hideAll () { + for (var i = 0; i < window.A_TCALSIDX.length; i++) + window.A_TCALSIDX[i].f_hide(); +} + +function f_tcalResetTime (d_date) { + d_date.setHours(0); + d_date.setMinutes(0); + d_date.setSeconds(0); + d_date.setMilliseconds(0); + return d_date; +} + +f_getElement = document.all ? + function (s_id) { return document.all[s_id] } : + function (s_id) { return document.getElementById(s_id) }; + +if (document.addEventListener) + window.addEventListener('scroll', f_tcal_hideAll, false); +if (window.attachEvent) + window.attachEvent('onscroll', f_tcal_hideAll); + +// global variables +var s_userAgent = navigator.userAgent.toLowerCase(), + re_webkit = /WebKit\/(\d+)/i; +var b_mac = s_userAgent.indexOf('mac') != -1, + b_ie5 = s_userAgent.indexOf('msie 5') != -1, + b_ie6 = s_userAgent.indexOf('msie 6') != -1 && s_userAgent.indexOf('opera') == -1; +var b_ieFix = b_ie5 || b_ie6, + b_ieMac = b_mac && b_ie5, + b_safari = b_mac && re_webkit.exec(s_userAgent) && Number(RegExp.$1) < 500; diff --git a/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php index b8b0b5bd..63f46fab 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -50,10 +50,12 @@ # 91130-2022 - Added code for manager override of in-group selection # 91228-1341 - Added API fields update functions # 100109-1337 - Fixed Manual dial live call detection +# 100527-0957 - Added send_dtmf, transfer_conference and park_call API functions +# 100727-2209 - Added timer actions for hangup, extension, callmenu and ingroup as well as destination # -$version = '2.2.0-25'; -$build = '100109-1337'; +$version = '2.4-27'; +$build = '100727-2209'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=32; $one_mysql_log=0; @@ -387,7 +389,7 @@ echo " } ### grab the API hangup and API dispo fields in vicidial_live_agents - $stmt="SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_update_fields_data,external_timer_action,external_timer_action_message,external_timer_action_seconds from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; + $stmt="SELECT external_hangup,external_status,external_pause,external_dial,external_update_fields,external_update_fields_data,external_timer_action,external_timer_action_message,external_timer_action_seconds,external_dtmf,external_transferconf,external_park,external_timer_action_destination from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03010',$user,$server_ip,$session_name,$one_mysql_log);} @@ -401,6 +403,10 @@ echo " $timer_action = $row[6]; $timer_action_message = $row[7]; $timer_action_seconds = $row[8]; + $external_dtmf = $row[9]; + $external_transferconf = $row[10]; + $external_park = $row[11]; + $timer_action_destination = $row[12]; if (strlen($external_status)<1) {$external_status = '::::::::::';} @@ -570,7 +576,7 @@ echo " if ($Ashift_logout > 0) {$Alogin='SHIFT_LOGOUT';} - echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Estado: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . '|DEADcall: ' . $DEADcustomer . '|InGroupChange: ' . $InGroupChangeDetails . '|APIFields: ' . $external_update_fields . '|APIFieldsData: ' . $external_update_fields_data . '|APITimerAction: ' . $timer_action . '|APITimerMessage: ' . $timer_action_message . '|APITimerSeconds: ' . $timer_action_seconds . "\n"; + echo 'DateTime: ' . $NOW_TIME . '|UnixTime: ' . $StarTtime . '|Logged-in: ' . $Alogin . '|CampCalls: ' . $RingCalls . '|Estado: ' . $Astatus . '|DiaLCalls: ' . $DiaLCalls . '|APIHanguP: ' . $external_hangup . '|APIStatuS: ' . $external_status . '|APIPausE: ' . $external_pause . '|APIDiaL: ' . $external_dial . '|DEADcall: ' . $DEADcustomer . '|InGroupChange: ' . $InGroupChangeDetails . '|APIFields: ' . $external_update_fields . '|APIFieldsData: ' . $external_update_fields_data . '|APITimerAction: ' . $timer_action . '|APITimerMessage: ' . $timer_action_message . '|APITimerSeconds: ' . $timer_action_seconds . '|APIdtmf: ' . $external_dtmf . '|APItransferconf: ' . $external_transferconf . '|APIpark: ' . $external_park . '|APITimerDestination: ' . $timer_action_destination . "\n"; if (strlen($timer_action) > 3) { diff --git a/agc_2-X/trunk/LANG_www/agc_es/functions.php b/agc_2-X/trunk/LANG_www/agc_es/functions.php new file mode 100644 index 00000000..376b2f01 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/agc_es/functions.php @@ -0,0 +1,504 @@ + LICENSE: AGPLv2 +# +# +# CHANGES: +# 100629-1201 - First Build +# + + + +##### BEGIN gather values for display of custom list fields for a lead ##### +function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) + { + $STARTtime = date("U"); + $TODAY = date("Y-m-d"); + $NOW_TIME = date("Y-m-d H:i:s"); + + $vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|'; + + require("dbconnect.php"); + + $CFoutput=''; + $stmt="SHOW TABLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05002',$user,$server_ip,$session_name,$one_mysql_log);} + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from custom_$list_id;"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05003',$user,$server_ip,$session_name,$one_mysql_log);} + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $select_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05004',$user,$server_ip,$session_name,$one_mysql_log);} + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_description[$o] = $rowx[3]; + $A_field_rank[$o] = $rowx[4]; + $A_field_help[$o] = $rowx[5]; + $A_field_type[$o] = $rowx[6]; + $A_field_options[$o] = $rowx[7]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_default[$o] = $rowx[10]; + $A_field_cost[$o] = $rowx[11]; + $A_field_required[$o] = $rowx[12]; + $A_multi_position[$o] = $rowx[13]; + $A_name_position[$o] = $rowx[14]; + $A_field_order[$o] = $rowx[15]; + $A_field_value[$o] = ''; + + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') ) + { + $select_SQL .= "8,"; + $A_field_select[$o]='----EMPTY----'; + } + else + { + $select_SQL .= "$A_field_label[$o],"; + $A_field_select[$o]=$A_field_label[$o]; + } + } + else + { + $select_SQL .= "8,"; + $A_field_value[$o] = '--A--' . $A_field_label[$o] . '--B--'; + } + $o++; + $rank_select .= ""; + } + $o++; + $rank_select .= ""; + $last_rank = $o; + $select_SQL = preg_replace("/.$/",'',$select_SQL); + + ##### BEGIN grab the data from custom table for the lead_id + $stmt="SELECT $select_SQL FROM custom_$list_id where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05005',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysql_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysql_fetch_row($rslt); + $o=0; + while ($fields_to_print >= $o) + { + $A_field_value[$o] = trim("$row[$o]"); + if ($A_field_select[$o]=='----EMPTY----') + {$A_field_value[$o]='';} + if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + {$A_field_value[$o] = '--A--' . $A_field_label[$o] . '--B--';} + $o++; + } + } + else + { + if ($DB) {echo "ERROR: no custom data for this lead: $lead_id\n";} + } + ##### END grab the data from custom table for the lead_id + + + $CFoutput .= "\n"; + $CFoutput .= "
\n"; + if ($fields_to_print < 1) + {$CFoutput .= "";} + + $o=0; + $last_field_rank=0; + while ($fields_to_print > $o) + { + $helpHTML=''; + if (strlen($A_field_help[$o])>0) + {$helpHTML="  help+";} + if ($last_field_rank=="$A_field_rank[$o]") + {$CFoutput .= "         ";} + else + { + $CFoutput .= "\n"; + $CFoutput .= "
There are no custom fields for this list
$helpHTML
";} + else + { + if ($last_field_rank=="$A_field_rank[$o]") + {$CFoutput .= "  ";} + else + {$CFoutput .= "
";} + } + $field_HTML=''; + + if ($A_field_type[$o]=='SELECT') + { + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + $field_options_array = explode("\n",$A_field_options[$o]); + $field_options_count = count($field_options_array); + $te=0; + while ($te < $field_options_count) + { + if (preg_match("/,/",$field_options_array[$te])) + { + $field_selected=''; + $field_options_value_array = explode(",",$field_options_array[$te]); + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + if (strlen($A_field_value[$o]) > 0) + { + if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o])) + {$field_selected = 'SELECTED';} + } + else + { + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'SELECTED';} + } + $field_HTML .= "\n"; + } + if ( ($A_field_type[$o]=='RADIO') or ($A_field_type[$o]=='CHECKBOX') ) + { + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "   ";} + if (strlen($A_field_value[$o]) > 0) + { + if (preg_match("/$field_options_value_array[0]/",$A_field_value[$o])) + {$field_selected = 'CHECKED';} + } + else + { + if ($A_field_default[$o] == "$field_options_value_array[0]") {$field_selected = 'CHECKED';} + } + $field_HTML .= " $field_options_value_array[1]\n"; + if ($A_multi_position[$o]=='VERTICAL') + {$field_HTML .= "
\n";} + } + } + $te++; + } + } + if ( ($A_field_type[$o]=='SELECT') or ($A_field_type[$o]=='MULTI') ) + { + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TEXT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];} + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='AREA') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + if (strlen($A_field_value[$o]) < 1) {$A_field_value[$o] = $A_field_default[$o];} + $field_HTML .= ""; + } + if ($A_field_type[$o]=='DISPLAY') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_default[$o]\n"; + } + if ($A_field_type[$o]=='SCRIPT') + { + if ($A_field_default[$o]=='NULL') {$A_field_default[$o]='';} + $field_HTML .= "$A_field_options[$o]\n"; + } + if ($A_field_type[$o]=='DATE') + { + if ( (strlen($A_field_default[$o])<1) or ($A_field_default[$o]=='NULL') ) {$A_field_default[$o]=0;} + $day_diff = $A_field_default[$o]; + $default_date = date("Y-m-d", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+$day_diff,date("Y"))); + if (strlen($A_field_value[$o]) > 0) {$default_date = $A_field_value[$o];} + + $field_HTML .= "\n"; + $field_HTML .= "\n"; + } + if ($A_field_type[$o]=='TIME') + { + $minute_diff = $A_field_default[$o]; + $default_time = date("H:i:s", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_hour = date("H", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + $default_minute = date("i", mktime(date("H"),date("i")+$minute_diff,date("s"),date("m"),date("d"),date("Y"))); + if (strlen($A_field_value[$o]) > 2) + { + $default_time = $A_field_value[$o]; + $time_field_value = explode(':',$default_time); + $default_hour = $time_field_value[0]; + $default_minute = $time_field_value[1]; + } + $field_HTML .= ""; + $field_HTML .= ""; + $field_HTML .= ""; + } + + if ( ($A_name_position[$o]=='LEFT') and ($A_field_type[$o]!='SCRIPT') ) + { + $CFoutput .= " $field_HTML $helpHTML"; + } + else + { + $CFoutput .= " $field_HTML\n"; + } + + $last_field_rank=$A_field_rank[$o]; + $o++; + } + $CFoutput .= "
\n"; + } + else + {$CFoutput .= "ERROR: no custom list fields\n";} + } + else + {$CFoutput .= "ERROR: no custom list fields table\n";} + + + ##### BEGIN parsing for vicidial variables ##### + if (preg_match("/--A--/",$CFoutput)) + { + if ( (eregi('--A--user_custom_',$CFoutput)) or (eregi('--A--fullname',$CFoutput)) ) + { + $stmt = "select custom_one,custom_two,custom_three,custom_four,custom_five,full_name from vicidial_users where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05006',$user,$server_ip,$session_name,$one_mysql_log);} + $VUC_ct = mysql_num_rows($rslt); + if ($VUC_ct > 0) + { + $row=mysql_fetch_row($rslt); + $user_custom_one = trim($row[0]); + $user_custom_two = trim($row[1]); + $user_custom_three = trim($row[2]); + $user_custom_four = trim($row[3]); + $user_custom_five = trim($row[4]); + $fullname = trim($row[5]); + } + } + + if (eregi('--A--dialed_',$CFoutput)) + { + $dialed_number = $phone_number; + $dialed_label = 'NONE'; + + ### find the dialed number and label for this call + $stmt = "SELECT phone_number,alt_dial from vicidial_log where uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05008',$user,$server_ip,$session_name,$one_mysql_log);} + $vl_dialed_ct = mysql_num_rows($rslt); + if ($vl_dialed_ct > 0) + { + $row=mysql_fetch_row($rslt); + $dialed_number = $row[0]; + $dialed_label = $row[1]; + } + } + + ##### grab the data from vicidial_list for the lead_id + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05007',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysql_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysql_fetch_row($rslt); + $dispo = trim($row[3]); + $tsr = trim($row[4]); + $vendor_id = trim($row[5]); + $vendor_lead_code = trim($row[5]); + $source_id = trim($row[6]); + $list_id = trim($row[7]); + $gmt_offset_now = trim($row[8]); + $phone_code = trim($row[10]); + $phone_number = trim($row[11]); + $title = trim($row[12]); + $first_name = trim($row[13]); + $middle_initial = trim($row[14]); + $last_name = trim($row[15]); + $address1 = trim($row[16]); + $address2 = trim($row[17]); + $address3 = trim($row[18]); + $city = trim($row[19]); + $state = trim($row[20]); + $province = trim($row[21]); + $postal_code = trim($row[22]); + $country_code = trim($row[23]); + $gender = trim($row[24]); + $date_of_birth = trim($row[25]); + $alt_phone = trim($row[26]); + $email = trim($row[27]); + $security = trim($row[28]); + $comments = trim($row[29]); + $called_count = trim($row[30]); + $rank = trim($row[32]); + $owner = trim($row[33]); + } + + $CFoutput = eregi_replace('--A--lead_id--B--',"$lead_id",$CFoutput); + $CFoutput = eregi_replace('--A--vendor_id--B--',"$vendor_id",$CFoutput); + $CFoutput = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$CFoutput); + $CFoutput = eregi_replace('--A--list_id--B--',"$list_id",$CFoutput); + $CFoutput = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$CFoutput); + $CFoutput = eregi_replace('--A--phone_code--B--',"$phone_code",$CFoutput); + $CFoutput = eregi_replace('--A--phone_number--B--',"$phone_number",$CFoutput); + $CFoutput = eregi_replace('--A--title--B--',"$title",$CFoutput); + $CFoutput = eregi_replace('--A--first_name--B--',"$first_name",$CFoutput); + $CFoutput = eregi_replace('--A--middle_initial--B--',"$middle_initial",$CFoutput); + $CFoutput = eregi_replace('--A--last_name--B--',"$last_name",$CFoutput); + $CFoutput = eregi_replace('--A--address1--B--',"$address1",$CFoutput); + $CFoutput = eregi_replace('--A--address2--B--',"$address2",$CFoutput); + $CFoutput = eregi_replace('--A--address3--B--',"$address3",$CFoutput); + $CFoutput = eregi_replace('--A--city--B--',"$city",$CFoutput); + $CFoutput = eregi_replace('--A--state--B--',"$state",$CFoutput); + $CFoutput = eregi_replace('--A--province--B--',"$province",$CFoutput); + $CFoutput = eregi_replace('--A--postal_code--B--',"$postal_code",$CFoutput); + $CFoutput = eregi_replace('--A--country_code--B--',"$country_code",$CFoutput); + $CFoutput = eregi_replace('--A--gender--B--',"$gender",$CFoutput); + $CFoutput = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$CFoutput); + $CFoutput = eregi_replace('--A--alt_phone--B--',"$alt_phone",$CFoutput); + $CFoutput = eregi_replace('--A--email--B--',"$email",$CFoutput); + $CFoutput = eregi_replace('--A--security_phrase--B--',"$security_phrase",$CFoutput); + $CFoutput = eregi_replace('--A--comments--B--',"$comments",$CFoutput); + $CFoutput = eregi_replace('--A--user--B--',"$user",$CFoutput); + $CFoutput = eregi_replace('--A--pass--B--',"$pass",$CFoutput); + $CFoutput = eregi_replace('--A--campaign--B--',"$campaign",$CFoutput); + $CFoutput = eregi_replace('--A--server_ip--B--',"$server_ip",$CFoutput); + $CFoutput = eregi_replace('--A--session_id--B--',"$session_id",$CFoutput); + $CFoutput = eregi_replace('--A--dialed_number--B--',"$dialed_number",$CFoutput); + $CFoutput = eregi_replace('--A--dialed_label--B--',"$dialed_label",$CFoutput); + $CFoutput = eregi_replace('--A--source_id--B--',"$source_id",$CFoutput); + $CFoutput = eregi_replace('--A--rank--B--',"$rank",$CFoutput); + $CFoutput = eregi_replace('--A--owner--B--',"$owner",$CFoutput); + $CFoutput = eregi_replace('--A--fullname--B--',"$fullname",$CFoutput); + $CFoutput = eregi_replace('--A--uniqueid--B--',"$uniqueid",$CFoutput); + $CFoutput = eregi_replace('--A--user_custom_one--B--',"$user_custom_one",$CFoutput); + $CFoutput = eregi_replace('--A--user_custom_two--B--',"$user_custom_two",$CFoutput); + $CFoutput = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$CFoutput); + $CFoutput = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$CFoutput); + $CFoutput = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$CFoutput); + + # custom fields replacement + $o=0; + while ($fields_to_print > $o) + { + $CFoutput = eregi_replace("--A--$A_field_label[$o]--B--","$A_field_value[$o]",$CFoutput); + $o++; + } + + if ($DB > 0) {echo "$CFoutput
\n";} + } + ##### END parsing for vicidial variables ##### + + + return $CFoutput; + } +##### END gather values for display of custom list fields for a lead ##### + + + + + +##### MySQL Error Logging ##### +function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) + { + $NOW_TIME = date("Y-m-d H:i:s"); + # mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); + $errno=''; $error=''; + if ( ($mel > 0) or ($one_mysql_log > 0) ) + { + $errno = mysql_errno($link); + if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) ) + { + $error = mysql_error($link); + $efp = fopen ("./vicidial_mysql_errors.txt", "a"); + fwrite ($efp, "$NOW_TIME|vdc_db_query|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n"); + fclose($efp); + } + } + $one_mysql_log=0; + return $errno; + } + + +?> \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/agc_es/manager_send.php b/agc_2-X/trunk/LANG_www/agc_es/manager_send.php index 861b3bf2..03ba1c97 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_es/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -12,7 +12,7 @@ # - $user # - $pass # optional variables: -# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial','VolumeControl','OriginateVDRelogin') +# - $ACTION - ('Originate','Redirect','Hangup','Command','Monitor','StopMonitor','SysCIDOriginate','SysCIDdtmfOriginate','RedirectName','RedirectNameVmail','MonitorConf','StopMonitorConf','RedirectXtra','RedirectXtraCX','RedirectVD','HangupConfDial','VolumeControl','OriginateVDRelogin') # - $queryCID - ('CN012345678901234567',...) # - $format - ('text','debug') # - $channel - ('Zap/41-1','SIP/test101-1jut','IAX2/iaxy@iaxy',...) @@ -41,6 +41,7 @@ # - $agent_dialed_number - ('1','') # - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) # - $nodeletevdac - ('0','1') +# - $alertCID - ('0','1') # # CHANGELOG: # 50401-1002 - First build of script, Hangup function only @@ -94,10 +95,13 @@ # 91112-1110 - Added CALLOUTBOUND value to QM entry lookup # 91205-2103 - Code cleanup # 91213-1208 - Added queue_position to queue_log COMPLETE... records +# 100327-0846 - Fix for list_id override answering machine message +# 100423-2304 - Added alertCID +# 100527-1014 - Added SysCIDdtmfOriginate function # -$version = '2.2.0-46'; -$build = '91213-1208'; +$version = '2.4-49'; +$build = '100527-1014'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=85; $one_mysql_log=0; @@ -185,6 +189,8 @@ if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_diale elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} if (isset($_GET["nodeletevdac"])) {$nodeletevdac=$_GET["nodeletevdac"];} elseif (isset($_POST["nodeletevdac"])) {$nodeletevdac=$_POST["nodeletevdac"];} +if (isset($_GET["alertCID"])) {$alertCID=$_GET["alertCID"];} + elseif (isset($_POST["alertCID"])) {$alertCID=$_POST["alertCID"];} header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -289,6 +295,20 @@ if ($format=='debug') +###################### +# ACTION=SysCIDdtmfOriginate - prep the send dtmf command +###################### +if ($ACTION=="SysCIDdtmfOriginate") + { + $stmt="UPDATE vicidial_live_agents SET external_dtmf='' where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + $ACTION="SysCIDOriginate"; + } + + ###################### # ACTION=SysCIDOriginate - insert Originate Manager statement allowing small CIDs for system calls @@ -390,7 +410,7 @@ if ($ACTION=="OriginateVDRelogin") if ($ACTION=="Originate") { - if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or (strlen($queryCID)<10) ) + if ( (strlen($exten)<1) or (strlen($channel)<1) or (strlen($ext_context)<1) or ( (strlen($queryCID)<10) && ($alertCID < 1) ) ) { echo "ERROR Exten $exten No es válido or queryCID $queryCID No es válido, Originate comando no insertado\n"; } @@ -734,39 +754,6 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } - else - { - if (strlen($lead_id) > 1) - { - $list_id=''; - $stmt = "SELECT list_id FROM vicidial_list where lead_id='$lead_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02084',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $list_id = $row[0]; - - if (strlen($list_id) > 1) - { - $stmt = "SELECT am_message_exten_override FROM vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02085',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $lio_ct = mysql_num_rows($rslt); - if ($lio_ct > 0) - { - $row=mysql_fetch_row($rslt); - $am_message_exten_override = $row[0]; - if (strlen($am_message_exten_override) > 0) {$exten = "$am_message_exten_override";} - } - } - } - } - - } $ACTION="Redirect"; } } @@ -799,6 +786,11 @@ if ($ACTION=="RedirectToPark") # fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n"); # fclose($fp); } + + $stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} } if ($ACTION=="RedirectFromPark") @@ -823,6 +815,11 @@ if ($ACTION=="RedirectFromPark") if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; } + + $stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} } if ($ACTION=="RedirectName") diff --git a/agc_2-X/trunk/LANG_www/agc_es/timeclock.php b/agc_2-X/trunk/LANG_www/agc_es/timeclock.php index a6845e7f..7edcec9e 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/timeclock.php +++ b/agc_2-X/trunk/LANG_www/agc_es/timeclock.php @@ -9,10 +9,11 @@ # 80525-2351 - Added an audit log that is not to be editable # 80602-0641 - Fixed status update bug # 90508-0727 - Changed to PHP long tags +# 100621-1023 - Added admin_web_directory variable # -$version = '2.2.0-5'; -$build = '90508-0727'; +$version = '2.2.0-6'; +$build = '100621-1023'; $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -87,7 +88,7 @@ require("dbconnect.php"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,admin_home_url FROM system_settings;"; +$stmt = "SELECT use_non_latin,admin_home_url,admin_web_directory FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -95,8 +96,9 @@ $i=0; while ($i < $qm_conf_ct) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $welcomeURL = $row[1]; + $non_latin = $row[0]; + $welcomeURL = $row[1]; + $admin_web_directory = $row[2]; $i++; } ##### END SETTINGS LOOKUP ##### @@ -338,7 +340,7 @@ if ( ($stage == 'login') or ($stage == 'logout') ) if ($referrer=='agent') {$BACKlink = "VOLVER a la pantalla de Inicio";} if ($referrer=='admin') - {$BACKlink = "VOLVER a la Administración";} + {$BACKlink = "VOLVER a la Administración";} if ($referrer=='welcome') {$BACKlink = "VOLVER a la pantalla de bienvenida";} diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php index 1d029676..1ba01e66 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php @@ -241,12 +241,21 @@ # 100301-1342 - Changed Available agents output for AGENTDIRECT selection # 100309-0535 - Added queuemetrics_loginout option # 100311-1559 - Added callcard logging to startcallurl and dispourl functions +# 100331-1217 - Added human-readable hangup codes for manual dial +# 100405-1430 - Added queuemetrics_callstatus option +# 100413-1341 - Fixes for extended alt-dial +# 100420-1006 - Added option for LIVE-only callback count +# 100424-1630 - Added uniqueid display options +# 100622-2217 - Added field labels +# 100624-1401 - Fix for dispo call url bug related to dialed number and label +# 100625-0915 - Fix for auto-dial bug for presets and timer actions +# 100712-1447 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # -$version = '2.4-148'; -$build = '100311-1559'; +$version = '2.4-157'; +$build = '100712-1447'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=321; +$mysql_log_count=333; $one_mysql_log=0; require("dbconnect.php"); @@ -444,6 +453,61 @@ $MT[0]=''; $agents='@agents'; $US='_'; + +##### Hangup Cause Dictionary ##### +$hangup_cause_dictionary = array( +0 => "Unspecified. No other cause codes applicable.", +1 => "Unallocated (unassigned) number.", +2 => "No route to specified transit network (national use).", +3 => "No route to destination.", +6 => "Channel unacceptable.", +7 => "Call awarded, being delivered in an established channel.", +16 => "Normal call clearing.", +17 => "Usuario busy.", +18 => "No user responding.", +19 => "No answer from user (user alerted).", +20 => "Subscriber absent.", +21 => "Call rejected.", +22 => "Number changed.", +23 => "Redirection to new destination.", +25 => "Exchange routing error.", +27 => "Destination out of order.", +28 => "Inválido number format (address incomplete).", +29 => "Facilities rejected.", +30 => "Response to ESTADO INQUIRY.", +31 => "Normal, unspecified.", +34 => "No circuit/channel available.", +38 => "Network out of order.", +41 => "Temporary failure.", +42 => "Switching equipment congestion.", +43 => "Access information discarded.", +44 => "Requested circuit/channel not available.", +50 => "Requested facility not subscribed.", +52 => "Outgoing calls barred.", +54 => "Entrante calls barred.", +57 => "Bearer capability not authorized.", +58 => "Bearer capability not presently available.", +63 => "Service or option not available, unspecified.", +65 => "Bearer capability not implemented.", +66 => "Channel type not implemented.", +69 => "Requested facility not implemented.", +79 => "Service or option not implemented, unspecified.", +81 => "Inválido call reference value.", +88 => "Incompatible destination.", +95 => "Inválido message, unspecified.", +96 => "Mandatory information element is missing.", +97 => "Message type non-existent or not implemented.", +98 => "Message not compatible with call state or message type non-existent or not implemented.", +99 => "Information element / parameter non-existent or not implemented.", +100 => "Inválido information element contents.", +101 => "Message not compatible with call state.", +102 => "Recovery en timer expiry.", +103 => "Parameter non-existent or not implemented - passed en (national use).", +111 => "Protocol error, unspecified.", +127 => "Interworking, unspecified." +); + + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; @@ -467,7 +531,7 @@ if ($non_latin < 1) $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass); $length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); $phone_code = ereg_replace("[^0-9]","",$phone_code); - $phone_number = ereg_replace("[^0-9]","",$phone_number); + $phone_number = ereg_replace("[^0-9a-zA-Z]","",$phone_number); } else { @@ -1018,7 +1082,8 @@ if ($ACTION == 'manDiaLnextCaLL') else { ##### grab number of calls today in this campaign and increment - $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $eac_phone=''; + $stmt="SELECT calls_today,extension FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00015',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1026,7 +1091,8 @@ if ($ACTION == 'manDiaLnextCaLL') if ($vla_cc_ct > 0) { $row=mysql_fetch_row($rslt); - $calls_today = $row[0]; + $calls_today = $row[0]; + $eac_phone = $row[1]; } else {$calls_today ='0';} @@ -1608,7 +1674,7 @@ if ($ACTION == 'manDiaLnextCaLL') if ($affected_rows > 0) { - $stmt="SELECT lead_id,list_id,gmt_offset_now,state FROM vicidial_list where status='QUEUE' and user='$user' order by modify_date desc LIMIT 1;"; + $stmt="SELECT lead_id,list_id,gmt_offset_now,state,entry_list_id FROM vicidial_list where status='QUEUE' and user='$user' order by modify_date desc LIMIT 1;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00243',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1620,6 +1686,7 @@ if ($ACTION == 'manDiaLnextCaLL') $list_id = $row[1]; $gmt_offset_now = $row[2]; $state = $row[3]; + $entry_list_id = $row[4]; $stmt = "INSERT INTO vicidial_hopper SET lead_id='$lead_id',campaign_id='$campaign',status='QUEUE',list_id='$list_id',gmt_offset_now='$gmt_offset_now',state='$state',alt_dial='MAIN',user='$user',priority='0';"; if ($DB) {echo "$stmt\n";} @@ -1654,7 +1721,7 @@ if ($ACTION == 'manDiaLnextCaLL') } ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00026',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1694,6 +1761,7 @@ if ($ACTION == 'manDiaLnextCaLL') $called_count = trim("$row[30]"); $rank = trim("$row[32]"); $owner = trim("$row[33]"); + $entry_list_id = trim("$row[34]"); } $called_count++; @@ -1842,10 +1910,29 @@ if ($ACTION == 'manDiaLnextCaLL') $PADlead_id = sprintf("%09s", $lead_id); while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + ### check for extension append in campaign + $use_eac=0; + $stmt = "SELECT count(*) FROM vicidial_campaigns where extension_appended_cidname='Y' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00322',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $eacid_ct = mysql_num_rows($rslt); + if ($eacid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $use_eac = $row[0]; + } + # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} + $EAC=''; + if ($use_eac > 0) + { + $eac_extension = preg_replace("/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\//",'',$eac_phone); + $EAC=" $eac_extension"; + } + if ($CCID_on) {$CIDstring = "\"$MqueryCID$EAC\" <$CCID>";} + else {$CIDstring = "$MqueryCID$EAC";} ### whether to omit phone_code or not if (eregi('Y',$omit_phone_code)) @@ -1886,28 +1973,49 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00036',$user,$server_ip,$session_name,$one_mysql_log);} - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') - { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) - { - $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # #### update vicidial_agent_log if not MANUAL dial_method + # if ($dial_method != 'MANUAL') + # { + # $pause_sec=0; + # $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; + # if ($DB) {echo "$stmt\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00302',$user,$server_ip,$session_name,$one_mysql_log);} + # $VDpr_ct = mysql_num_rows($rslt); + # if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + # { + # $row=mysql_fetch_row($rslt); + # $agent_log_id = $row[5]; + # $pause_sec = (($StarTtime - $row[0]) + $row[1]); + # + # $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + # if ($format=='debug') {echo "\n";} + # $rslt=mysql_query($stmt, $link); + # if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} + # } + # } - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00303',$user,$server_ip,$session_name,$one_mysql_log);} - } + + $val_pause_epoch=0; + $val_pause_sec=0; + $stmt = "SELECT pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00323',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) + { + $row=mysql_fetch_row($rslt); + $val_pause_epoch = $row[0]; + $val_pause_sec = ($StarTtime - $val_pause_epoch); } + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00324',$user,$server_ip,$session_name,$one_mysql_log);} + + if ($agent_dialed_number > 0) { $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$phone_number','$Ndialstring','$lead_id','$CCID','$RAWaccount')"; @@ -2084,6 +2192,7 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $VDCL_xferconf_c_number . "\n"; $LeaD_InfO .= $VDCL_xferconf_d_number . "\n"; $LeaD_InfO .= $VDCL_xferconf_e_number . "\n"; + $LeaD_InfO .= $entry_list_id . "\n"; echo $LeaD_InfO; } @@ -2201,7 +2310,7 @@ if ($ACTION == 'manDiaLonly') else { ##### grab number of calls today in this campaign and increment - $stmt="SELECT calls_today FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; + $stmt="SELECT calls_today,extension FROM vicidial_live_agents WHERE user='$user' and campaign_id='$campaign';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00043',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -2209,12 +2318,26 @@ if ($ACTION == 'manDiaLonly') if ($vla_cc_ct > 0) { $row=mysql_fetch_row($rslt); - $calls_today =$row[0]; + $calls_today = $row[0]; + $eac_phone = $row[1]; } else {$calls_today ='0';} $calls_today++; + ### check for extension append in campaign + $use_eac=0; + $stmt = "SELECT count(*) FROM vicidial_campaigns where extension_appended_cidname='Y' and campaign_id='$campaign';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00325',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $eacid_ct = mysql_num_rows($rslt); + if ($eacid_ct > 0) + { + $row=mysql_fetch_row($rslt); + $use_eac = $row[0]; + } + ### prepare variables to place manual call from VICIDiaL $CCID_on=0; $CCID=''; $local_DEF = 'Local/'; @@ -2282,8 +2405,14 @@ if ($ACTION == 'manDiaLonly') # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL $MqueryCID = "M$CIDdate$PADlead_id"; - if ($CCID_on) {$CIDstring = "\"$MqueryCID\" <$CCID>";} - else {$CIDstring = "$MqueryCID";} + $EAC=''; + if ($use_eac > 0) + { + $eac_extension = preg_replace("/SIP\/|IAX2\/|Zap\/|DAHDI\/|Local\//",'',$eac_phone); + $EAC=" $eac_extension"; + } + if ($CCID_on) {$CIDstring = "\"$MqueryCID$EAC\" <$CCID>";} + else {$CIDstring = "$MqueryCID$EAC";} if ( ($usegroupalias > 0) and (strlen($account)>1) ) { @@ -2333,27 +2462,91 @@ if ($ACTION == 'manDiaLonly') echo "$MqueryCID\n"; - #### update vicidial_agent_log if not MANUAL dial_method - if ($dial_method != 'MANUAL') +# #### update vicidial_agent_log if not MANUAL dial_method +# if ($dial_method != 'MANUAL') +# { +# $pause_sec=0; +# $stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; +# if ($DB) {echo "$stmt\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} +# $VDpr_ct = mysql_num_rows($rslt); +# if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) +# { +# $row=mysql_fetch_row($rslt); +# $agent_log_id = $row[5]; +# $pause_sec = (($StarTtime - $row[0]) + $row[1]); +# +# $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; +# if ($format=='debug') {echo "\n";} +# $rslt=mysql_query($stmt, $link); +# if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} +# } +# } + + $val_pause_epoch=0; + $val_pause_sec=0; + $val_dispo_epoch=0; + $val_dispo_sec=0; + $val_wait_epoch=0; + $val_wait_sec=0; + $stmt = "SELECT dispo_epoch,wait_epoch,pause_epoch FROM vicidial_agent_log where agent_log_id='$agent_log_id';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00326',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vald_ct = mysql_num_rows($rslt); + if ($vald_ct > 0) { - $pause_sec=0; - $stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;"; - if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + $val_dispo_epoch = $row[0]; + $val_wait_epoch = $row[1]; + $val_pause_epoch = $row[2]; + $val_dispo_sec = ($StarTtime - $val_dispo_epoch); + $val_wait_sec = ($StarTtime - $val_wait_epoch); + $val_pause_sec = ($StarTtime - $val_pause_epoch); + } + if ($val_dispo_epoch > 1000) + { + $stmt="UPDATE vicidial_agent_log set status='ALTNUM',dispo_sec='$val_dispo_sec' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00304',$user,$server_ip,$session_name,$one_mysql_log);} - $VDpr_ct = mysql_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00327',$user,$server_ip,$session_name,$one_mysql_log);} + + $user_group=''; + $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00328',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $ug_record_ct = mysql_num_rows($rslt); + if ($ug_record_ct > 0) { $row=mysql_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); - - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00305',$user,$server_ip,$session_name,$one_mysql_log);} + $user_group = trim("$row[0]"); } + + $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$user','$server_ip','$NOW_TIME','$campaign','$StarTtime','0','$StarTtime','$user_group','ANDIAL');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00329',$user,$server_ip,$session_name,$one_mysql_log);} + $affected_rows = mysql_affected_rows($link); + $agent_log_id = mysql_insert_id($link); + + $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id',last_state_change='$NOW_TIME' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00330',$VD_login,$server_ip,$session_name,$one_mysql_log);} + $VLAaffected_rows_update = mysql_affected_rows($link); } + else + { + $stmt="UPDATE vicidial_agent_log set pause_sec='$val_pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00331',$user,$server_ip,$session_name,$one_mysql_log);} + } + + echo "$agent_log_id\n"; + if ($agent_dialed_number > 0) { @@ -2371,8 +2564,7 @@ if ($ACTION == 'manDiaLonly') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00048',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); - $i=0; - while ($i < $qm_conf_ct) + if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; @@ -2381,7 +2573,6 @@ if ($ACTION == 'manDiaLonly') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; - $i++; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### @@ -2478,9 +2669,10 @@ if ($ACTION == 'manDiaLlookCaLL') $dialstatus =$row[0]; $hangup_cause =$row[1]; - $channel = $dialstatus . "-" . $hangup_cause; + $channel = $dialstatus; + $hangup_cause_msg = "Cause: " . $hangup_cause . " - " . hangup_cause_description($hangup_cause); - $call_output = "$uniqueid\n$channel\nERROR"; + $call_output = "$uniqueid\n$channel\nERROR\n" . $hangup_cause_msg; $call_good++; ### Delete call record @@ -2510,7 +2702,7 @@ if ($ACTION == 'manDiaLlookCaLL') if ( ($now_dead_epoch > 1000) and ($now_dead_epoch < $StarTtime) ) {$dead_epochSQL = ",dead_epoch='$StarTtime'";} } - $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',wait_epoch='$StarTtime',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec',talk_epoch='$StarTtime',lead_id='$lead_id' $dead_epochSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00054',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2680,13 +2872,13 @@ if ($stage == "end") $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); ##### look for the start epoch in the vicidial_closer_log table - $stmt="SELECT start_epoch,term_reason,closecallid,campaign_id FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,closecallid,campaign_id,status FROM vicidial_closer_log where phone_number='$phone_number' and lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by closecallid desc limit 1;"; $VDIDselect = "VDCL_LID $lead_id $phone_number $user $four_hours_ago"; } else { ##### look for the start epoch in the vicidial_log table - $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; + $stmt="SELECT start_epoch,term_reason,uniqueid,campaign_id,status FROM vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;"; $VDIDselect = "VDL_UIDLID $uniqueid $lead_id"; } $rslt=mysql_query($stmt, $link); @@ -2700,6 +2892,7 @@ if ($stage == "end") $VDterm_reason = $row[1]; $VDvicidial_id = $row[2]; $VDcampaign_id = $row[3]; + $VDstatus = $row[4]; $length_in_sec = ($StarTtime - $start_epoch); } else @@ -2741,7 +2934,9 @@ if ($stage == "end") if ($VLA_inOUT == 'INBOUND') { - $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec', status='$status_dispo' where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $vcl_statusSQL=''; + if ($VDstatus == 'INCALL') {$vcl_statusSQL = ",status='$status_dispo'";} + $stmt = "UPDATE vicidial_closer_log set end_epoch='$StarTtime', length_in_sec='$length_in_sec' $vcl_statusSQL where lead_id='$lead_id' and user='$user' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00062',$user,$server_ip,$session_name,$one_mysql_log);} @@ -2749,6 +2944,10 @@ if ($stage == "end") if ($affected_rows > 0) { echo "$uniqueid\n$channel\n"; + + # $fp = fopen ("./vicidial_debug.txt", "a"); + # fwrite ($fp, "$NOW_TIME|INBND_LOG_4|$VDstatus|$uniqueid|$lead_id|$user|$inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$start_epoch|$stmt|\n"); + # fclose($fp); } else { @@ -2990,7 +3189,7 @@ if ($stage == "end") {$Xlast=0;} $VD_altdialx=''; - $stmt="SELECT gmt_offset_now,state,list_id FROM vicidial_list where lead_id='$lead_id';"; + $stmt="SELECT gmt_offset_now,state,list_id,entry_list_id FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00073',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -3001,6 +3200,7 @@ if ($stage == "end") $EA_gmt_offset_now = $row[0]; $EA_state = $row[1]; $EA_list_id = $row[2]; + $EA_entry_list_id = $row[3]; } $alt_dial_phones_count=0; $stmt="SELECT count(*) FROM vicidial_list_alt_phones where lead_id='$lead_id';"; @@ -3367,7 +3567,7 @@ if ($stage == "end") if (strlen($SQLterm) > 0) { ##### update the duration and end time in the vicidial_log table - $stmt="UPDATE vicidial_closer_log set $SQLterm, status='$status_dispo' where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; + $stmt="UPDATE vicidial_closer_log set $SQLterm where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00092',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3629,7 +3829,7 @@ if ($stage == "end") } } } - $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime' $talk_epochSQL $dead_secSQL $lead_id_commentsSQL where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set talk_sec='$talk_sec',dispo_epoch='$StarTtime',uniqueid='$uniqueid' $talk_epochSQL $dead_secSQL $lead_id_commentsSQL where agent_log_id='$agent_log_id';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00102',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3769,7 +3969,7 @@ if ($ACTION == 'VDADcheckINCOMING') if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00107',$user,$server_ip,$session_name,$one_mysql_log);} ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00108',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -3807,6 +4007,7 @@ if ($ACTION == 'VDADcheckINCOMING') $called_count = trim("$row[30]"); $rank = trim("$row[32]"); $owner = trim("$row[33]"); + $entry_list_id = trim("$row[34]"); } ##### if lead is a callback, grab the callback comments @@ -3837,6 +4038,19 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00110',$user,$server_ip,$session_name,$one_mysql_log);} + ### gather custom_call_id from vicidial_log_extended table + $custom_call_id=''; + $stmt="SELECT custom_call_id FROM vicidial_log_extended where uniqueid='$uniqueid';"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00333',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vle_record_ct = mysql_num_rows($rslt); + if ($vle_record_ct > 0) + { + $row=mysql_fetch_row($rslt); + $custom_call_id = $row[0]; + } + ### update the log status to INCALL $user_group=''; $stmt="SELECT user_group FROM vicidial_users where user='$user' LIMIT 1;"; @@ -3850,7 +4064,6 @@ if ($ACTION == 'VDADcheckINCOMING') $user_group = trim("$row[0]"); } - $stmt = "SELECT campaign_id,phone_number,alt_dial,call_type from vicidial_auto_calls where callerid = '$callerid' order by call_time desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -3875,7 +4088,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00248',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -3885,7 +4098,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00249',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -3956,7 +4169,7 @@ if ($ACTION == 'VDADcheckINCOMING') $script_recording_delay = $row[0]; } - $stmt = "SELECT campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "SELECT campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action,timer_action_message,timer_action_seconds,timer_action_destination from vicidial_campaigns where campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00114',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3964,19 +4177,23 @@ if ($ACTION == 'VDADcheckINCOMING') if ($VDIG_cid_ct > 0) { $row=mysql_fetch_row($rslt); - $VDCL_campaign_script = $row[0]; - $VDCL_get_call_launch = $row[1]; - $VDCL_xferconf_a_dtmf = $row[2]; - $VDCL_xferconf_a_number = $row[3]; - $VDCL_xferconf_b_dtmf = $row[4]; - $VDCL_xferconf_b_number = $row[5]; - $VDCL_default_xfer_group = $row[6]; + $VDCL_campaign_script = $row[0]; + $VDCL_get_call_launch = $row[1]; + $VDCL_xferconf_a_dtmf = $row[2]; + $VDCL_xferconf_a_number = $row[3]; + $VDCL_xferconf_b_dtmf = $row[4]; + $VDCL_xferconf_b_number = $row[5]; + $VDCL_default_xfer_group = $row[6]; if (strlen($VDCL_default_xfer_group)<2) {$VDCL_default_xfer_group='X';} - $VDCL_start_call_url = $row[7]; - $VDCL_dispo_call_url = $row[8]; - $VDCL_xferconf_c_number = $row[9]; - $VDCL_xferconf_d_number = $row[10]; - $VDCL_xferconf_e_number = $row[11]; + $VDCL_start_call_url = $row[7]; + $VDCL_dispo_call_url = $row[8]; + $VDCL_xferconf_c_number = $row[9]; + $VDCL_xferconf_d_number = $row[10]; + $VDCL_xferconf_e_number = $row[11]; + $VDCL_timer_action = $row[12]; + $VDCL_timer_action_message = $row[13]; + $VDCL_timer_action_seconds = $row[14]; + $VDCL_timer_action_destination = $row[15]; } ### Check for List ID override settings @@ -4003,7 +4220,7 @@ if ($ACTION == 'VDADcheckINCOMING') } } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X|||||$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X|||||$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number||||$VDCL_timer_action_destination|\n|\n"; if (ereg('X',$dialed_label)) { @@ -4064,7 +4281,7 @@ if ($ACTION == 'VDADcheckINCOMING') $script_recording_delay = $row[0]; } - $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_inbound_groups where group_id='$VDADchannel_group';"; + $stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination from vicidial_inbound_groups where group_id='$VDADchannel_group';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);} @@ -4095,8 +4312,11 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_c_number = $row[20]; $VDCL_xferconf_d_number = $row[21]; $VDCL_xferconf_e_number = $row[22]; + $VDCL_uniqueid_status_display = $row[23]; + $VDCL_uniqueid_status_prefix = $row[24]; + $VDCL_timer_action_destination = $row[25]; - $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);} @@ -4130,6 +4350,8 @@ if ($ACTION == 'VDADcheckINCOMING') {$VDCL_xferconf_d_number = $row[12];} if (strlen($VDCL_xferconf_e_number) < 1) {$VDCL_xferconf_e_number = $row[13];} + if (strlen($VDCL_timer_action_destination) < 1) + {$VDCL_timer_action_destination = $row[14];} if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) ) { @@ -4184,7 +4406,7 @@ if ($ACTION == 'VDADcheckINCOMING') } else { - $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$VDADchannel_group';"; + $stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$VDADchannel_group';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);} @@ -4207,6 +4429,7 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_xferconf_c_number = $row[12]; $VDCL_xferconf_d_number = $row[13]; $VDCL_xferconf_e_number = $row[14]; + $VDCL_timer_action_destination = $row[15]; } $script_recording_delay=0; @@ -4274,8 +4497,8 @@ if ($ACTION == 'VDADcheckINCOMING') } ### if web form is set then send en to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|\n";} - else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -4363,6 +4586,7 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $rank . "\n"; $LeaD_InfO .= $owner . "\n"; $LeaD_InfO .= $script_recording_delay . "\n"; + $LeaD_InfO .= $entry_list_id . "\n"; echo $LeaD_InfO; @@ -4552,10 +4776,24 @@ if ($ACTION == 'VDADcheckINCOMING') $durationLimit = preg_replace('/\D/','',$SCUresponse[1]); } if (strlen($durationLimit) < 1) {$durationLimit = 0;} + $durationLimitSECnext = ( ($minuteswarning + 0) * 60); $durationLimitSEC = ( ( ($durationLimit + 0) - $minuteswarning) * 60); # minutes - 3 for 3-minute-warning if ($durationLimitSEC < 5) {$durationLimitSEC = 5;} + if ( ($durationLimitSECnext < 30) or (strlen($durationLimitSECnext)<1) ) {$durationLimitSECnext = 30;} - $stmt="UPDATE vicidial_live_agents set external_timer_action='D1_DIAL',external_timer_action_message='$minuteswarning minute warning for customer',external_timer_action_seconds='$durationLimitSEC' where user='$user';"; + $timer_action_destination=''; + if (preg_match("/nextstep=/",$VDCL_start_call_url)) + { + $nextstepARY = explode('nextstep=',$VDCL_start_call_url); + $nextstep = preg_replace("/&.*/",'',$nextstepARY[1]); + $nextmessageARY = explode('nextmessage=',$VDCL_start_call_url); + $nextmessage = preg_replace("/&.*/",'',$nextmessageARY[1]); + $destinationARY = explode('destination=',$VDCL_start_call_url); + $destination = preg_replace("/&.*/",'',$destinationARY[1]); + $timer_action_destination = "nextstep---$nextstep--$durationLimitSECnext--$destination--$nextmessage--"; + } + + $stmt="UPDATE vicidial_live_agents set external_timer_action='D1_DIAL',external_timer_action_message='$minuteswarning minute warning for customer',external_timer_action_seconds='$durationLimitSEC',external_timer_action_destination='$timer_action_destination' where user='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00295',$user,$server_ip,$session_name,$one_mysql_log);} @@ -4795,7 +5033,7 @@ if ($ACTION == 'updateDISPO') } else { - $stmt = "SELECT dispo_call_url from vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "SELECT dispo_call_url,queuemetrics_callstatus_override from vicidial_campaigns vc,vicidial_live_agents vla where vla.campaign_id=vc.campaign_id and vla.user='$user';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00284',$user,$server_ip,$session_name,$one_mysql_log);} @@ -4803,11 +5041,12 @@ if ($ACTION == 'updateDISPO') if ($VC_dcu_ct > 0) { $row=mysql_fetch_row($rslt); - $dispo_call_url =$row[0]; + $dispo_call_url = $row[0]; + $queuemetrics_callstatus_override = $row[1]; } ### reset the API fields in vicidial_live_agents record - $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='',external_update_fields='0',external_update_fields_data='',external_timer_action_seconds='-1',last_state_change='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; + $stmt = "UPDATE vicidial_live_agents set lead_id=0,external_hangup=0,external_status='',external_update_fields='0',external_update_fields_data='',external_timer_action_seconds='-1',external_dtmf='',external_transferconf='',external_park='',last_state_change='$NOW_TIME' where user='$user' and server_ip='$server_ip';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00141',$user,$server_ip,$session_name,$one_mysql_log);} @@ -4834,6 +5073,10 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00142',$user,$server_ip,$session_name,$one_mysql_log);} + # $fp = fopen ("./vicidial_debug.txt", "a"); + # fwrite ($fp, "$NOW_TIME|DISPO_CALL |$MDnextCID|$stage|$campaign|$lead_id|$dispo_choice|$user|$uniqueid|$auto_dial_level|$agent_log_id|\n"); + # fclose($fp); + $stmt = "SELECT count(*) from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); @@ -4841,10 +5084,21 @@ if ($ACTION == 'updateDISPO') $row=mysql_fetch_row($rslt); if ($row[0] > 0) { + $call_type='IN'; $stmt = "UPDATE vicidial_closer_log set status='$dispo_choice' where lead_id='$lead_id' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00144',$user,$server_ip,$session_name,$one_mysql_log);} + $VCLaffected_rows = mysql_affected_rows($link); + + # $fp = fopen ("./vicidial_debug.txt", "a"); + # fwrite ($fp, "$NOW_TIME|DISPO_CALL2|$VCLaffected_rows|$stmt|\n"); + # fclose($fp); + + $stmt = "UPDATE vicidial_live_inbound_agents set last_call_finish=NOW() where group_id='$stage' and user='$user' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00322',$user,$server_ip,$session_name,$one_mysql_log);} $stmt = "SELECT dispo_call_url from vicidial_inbound_groups where group_id='$stage';"; if ($format=='debug') {echo "\n";} @@ -4855,6 +5109,7 @@ if ($ACTION == 'updateDISPO') } else { + $call_type='OUT'; $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); if ( ($auto_dial_level < 1) or (preg_match('/^M/',$MDnextCID)) ) @@ -4918,7 +5173,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00250',$user,$server_ip,$session_name,$one_mysql_log);} $VDAP_cid_ct = mysql_num_rows($rslt); - if ($VDACP_cid_ct > 0) + if ($VDAP_cid_ct > 0) { $row=mysql_fetch_row($rslt); $Xalt_phone_count =$row[0]; @@ -4928,7 +5183,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00251',$user,$server_ip,$session_name,$one_mysql_log);} $VDAPct_cid_ct = mysql_num_rows($rslt); - if ($VDACPct_cid_ct > 0) + if ($VDAPct_cid_ct > 0) { $row=mysql_fetch_row($rslt); $COUNTalt_phone_count =$row[0]; @@ -5625,7 +5880,7 @@ if ($ACTION == 'updateDISPO') ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_callstatus FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00159',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -5639,10 +5894,11 @@ if ($ACTION == 'updateDISPO') $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; + $queuemetrics_callstatus = $row[6]; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### - if ($enable_queuemetrics_logging > 0) + if ( ($enable_queuemetrics_logging > 0) and ( ( ($queuemetrics_callstatus > 0) or ($queuemetrics_callstatus_override=='YES') ) and ($queuemetrics_callstatus_override!='NO') ) ) { $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); @@ -5740,11 +5996,34 @@ if ($ACTION == 'updateDISPO') if (strlen($status_name) < 1) {$status_name = $dispo_choice;} } $dispo_name = urlencode(trim($status_name)); - + + + if (eregi('--A--dialed_',$dispo_call_url)) + { + $dialed_number = $phone_number; + $dialed_label = 'NONE'; + + if ($call_type=='OUT') + { + ### find the dialed number and label for this call + $stmt = "SELECT phone_number,alt_dial from vicidial_log where uniqueid='$uniqueid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $vl_dialed_ct = mysql_num_rows($rslt); + if ($vl_dialed_ct > 0) + { + $row=mysql_fetch_row($rslt); + $dialed_number = $row[0]; + $dialed_label = $row[1]; + } + } + } + ##### grab the data from vicidial_list for the lead_id - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00290',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -5782,6 +6061,7 @@ if ($ACTION == 'updateDISPO') $called_count = urlencode(trim($row[30])); $rank = urlencode(trim($row[32])); $owner = urlencode(trim($row[33])); + $entry_list_id = urlencode(trim($row[34])); } $dispo_call_url = preg_replace('/^VAR/','',$dispo_call_url); @@ -6097,7 +6377,10 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') ) if ($comments != 'NO_STATUS_CHANGE') { - $stmt="UPDATE vicidial_live_agents set status='$stage' where user='$user' and server_ip='$server_ip';"; + $vla_lead_wipeSQL=''; + if ($ACTION == 'VDADready') + {$vla_lead_wipeSQL = ",lead_id=0";} + $stmt="UPDATE vicidial_live_agents set status='$stage' $vla_lead_wipeSQL where user='$user' and server_ip='$server_ip';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00166',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6312,7 +6595,7 @@ if ($ACTION == 'PauseCodeSubmit') ### if this is the first pause code entry in a pause session, simply update and log to queue_log if ($stage < 1) { - $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id='$agent_log_id';"; + $stmt="UPDATE vicidial_agent_log set sub_status=\"$status\" where agent_log_id >= '$agent_log_id' and user='$user' and ( (sub_status is NULL) or (sub_status='') )order by agent_log_id limit 2;"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00175',$user,$server_ip,$session_name,$one_mysql_log);} @@ -6952,10 +7235,55 @@ if ($ACTION == 'LEADINFOview') {echo "ERROR: no Lead ID";} else { + ### BEGIN find any custom field labels ### + $label_title = 'Título'; + $label_first_name = 'Primero'; + $label_middle_initial = 'MI'; + $label_last_name = 'Último'; + $label_address1 = 'Dirección1'; + $label_address2 = 'Dirección2'; + $label_address3 = 'Dirección3'; + $label_city = 'Ciudad'; + $label_state = 'Estado'; + $label_province = 'Provincia'; + $label_postal_code = 'CódigoPostal'; + $label_vendor_lead_code = 'VendedorID'; + $label_gender = 'Gender'; + $label_phone_number = 'Teléfono'; + $label_phone_code = 'Código Del Dial'; + $label_alt_phone = 'Teléfono Alt'; + $label_security_phrase = 'Demostración'; + $label_email = 'Email'; + $label_comments = 'Comentarios'; + + $stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if (strlen($row[0])>0) {$label_title = $row[0];} + if (strlen($row[1])>0) {$label_first_name = $row[1];} + if (strlen($row[2])>0) {$label_middle_initial = $row[2];} + if (strlen($row[3])>0) {$label_last_name = $row[3];} + if (strlen($row[4])>0) {$label_address1 = $row[4];} + if (strlen($row[5])>0) {$label_address2 = $row[5];} + if (strlen($row[6])>0) {$label_address3 = $row[6];} + if (strlen($row[7])>0) {$label_city = $row[7];} + if (strlen($row[8])>0) {$label_state = $row[8];} + if (strlen($row[9])>0) {$label_province = $row[9];} + if (strlen($row[10])>0) {$label_postal_code = $row[10];} + if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} + if (strlen($row[12])>0) {$label_gender = $row[12];} + if (strlen($row[13])>0) {$label_phone_number = $row[13];} + if (strlen($row[14])>0) {$label_phone_code = $row[14];} + if (strlen($row[15])>0) {$label_alt_phone = $row[15];} + if (strlen($row[16])>0) {$label_security_phrase = $row[16];} + if (strlen($row[17])>0) {$label_email = $row[17];} + if (strlen($row[18])>0) {$label_comments = $row[18];} + ### END find any custom field labels ### + echo "
\n"; echo ""; - $stmt="select status,vendor_lead_code,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='$lead_id'limit 1;"; + $stmt="select status,vendor_lead_code,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='$lead_id'limit 1;"; $rslt=mysql_query($stmt, $link); $info_to_print = mysql_num_rows($rslt); if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";} @@ -6964,33 +7292,34 @@ if ($ACTION == 'LEADINFOview') { $row=mysql_fetch_row($rslt); echo ""; - echo ""; + echo ""; echo ""; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo ""; # echo ""; # echo ""; + # echo ""; } echo "
Estado:   $row[0]
VendedorID:   $row[1]
$label_vendor_lead_code:   $row[1]
List ID:   $row[2]
Timezone:   $row[3]
Llamado SInce Último Reset:   $row[4]
Teléfono Code:   $row[5]
Teléfono Number:   $row[6] -         DIAL
Título:   $row[7]
Primero Name:   $row[8]
IM:   $row[9]
Último Name:   $row[10]
Dirección 1:   $row[11]
Dirección 2:   $row[12]
Dirección 3:   $row[13]
Ciudad:   $row[14]
Estado:   $row[15]
Provincia:   $row[16]
Postal Code:   $row[17]
Llamado Since Último Reset:   $row[4]
$label_phone_code:   $row[5]
$label_phone_number:   $row[6] -         DIAL
$label_title:   $row[7]
$label_first_name:   $row[8]
$label_middle_initial:   $row[9]
$label_last_name:   $row[10]
$label_address1:   $row[11]
$label_address2:   $row[12]
$label_address3:   $row[13]
$label_city:   $row[14]
$label_state:   $row[15]
$label_province:   $row[16]
$label_postal_code:   $row[17]
Country:   $row[18]
Género:  $row[19]
Teléfono Alt:   $row[20] -         DIAL
Email:   $row[21]
Demostración:   $row[22]
Comentarios:  $row[23]
$label_gender:   $row[19]
$label_alt_phone:   $row[20] -         DIAL
$label_email:   $row[21]
$label_security_phrase:   $row[22]
$label_comments:   $row[23]
Llamado Count:   $row[24]
Último Local Call Time:   $row[25]
Rank:   $row[26]
Owner:   $row[27]
Entry List ID:   $row[28]
"; @@ -7136,7 +7465,14 @@ if ($ACTION == 'CalLBacKCounT') $row=mysql_fetch_row($rslt); $cbcount=$row[0]; - echo "$cbcount"; + $stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' $campaignCBsql and status IN('LIVE');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00332',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + $cbcount_live=$row[0]; + + echo "$cbcount|$cbcount_live"; } @@ -7162,6 +7498,21 @@ if ($ACTION == 'DiaLableLeaDsCounT') } +################################################################################ +### Clear_API_Field - clears a single vicidial_live_agents field +################################################################################ +if ($ACTION == 'Clear_API_Field') + { + $stmt="UPDATE vicidial_live_agents SET $comments='' where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "DONE: $comments"; + } + + + if ($format=='debug') @@ -7175,7 +7526,13 @@ echo "\n\n\n"; exit; - +##### Hangup Cause Description Map ##### +function hangup_cause_description($code) +{ +global $hangup_cause_dictionary; +if ( array_key_exists($code,$hangup_cause_dictionary) ) { return $hangup_cause_dictionary[$code]; } +else { return "Unidentified Hangup Cause Code."; } +} ##### MySQL Error Logging ##### diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php new file mode 100644 index 00000000..3f0e6ca7 --- /dev/null +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php @@ -0,0 +1,359 @@ + LICENSE: AGPLv2 +# +# This script is designed display the contents of the FORM tab in the agent +# interface, as well as take submission of the form submission when the agent +# dispositions the call +# +# CHANGELOG: +# 100630-1119 - First build of script +# 100703-1124 - Added submit_button,admin_submit fields, which will log to admin log +# 100712-2322 - Added code to log vicidial_list.entry_list_id field if data altered +# + +$version = '2.4-3'; +$build = '100712-2322'; + +require("dbconnect.php"); +require("functions.php"); + + +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["submit_button"])) {$submit_button=$_GET["submit_button"];} + elseif (isset($_POST["submit_button"])) {$submit_button=$_POST["submit_button"];} +if (isset($_GET["admin_submit"])) {$admin_submit=$_GET["admin_submit"];} + elseif (isset($_POST["admin_submit"])) {$admin_submit=$_POST["admin_submit"];} +if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} + elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +$txt = '.txt'; +$StarTtime = date("U"); +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$CIDdate = date("mdHis"); +$ENTRYdate = date("YmdHis"); +$MT[0]=''; +$agents='@agents'; +$script_height = ($script_height - 20); +if (strlen($bgcolor) < 6) {$bgcolor='FFFFFF';} + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|'; + +$IFRAME=0; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,custom_fields_enabled FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $agentonly_callback_campaign_lock = $row[2]; + $custom_fields_enabled = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $user=ereg_replace("[^-_0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); + $phone_code = ereg_replace("[^0-9]","",$phone_code); + $phone_number = ereg_replace("[^0-9]","",$phone_number); + } +else + { + $user = ereg_replace("'|\"|\\\\|;","",$user); + $pass = ereg_replace("'|\"|\\\\|;","",$pass); + } + + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and modify_leads='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$VUmodify=$row[0]; + +$stmt="SELECT count(*) from vicidial_live_agents where user='$user';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LVAactive=$row[0]; + +if ($custom_fields_enabled < 1) + { + echo "Custom Fields Disabled: |$custom_fields_enabled|\n"; + echo "
\n"; + echo "\n"; + echo "
\n"; + exit; + } + +if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ( ($LVAactive < 1) and ($VUmodify < 1) ) ) + { + echo "Invalid Username/Password: |$user|$pass|\n"; + echo "
\n"; + echo "\n"; + echo "
\n"; + exit; + } +else + { + # do nothing for now + } + + +### BEGIN parse submission of the custom fields form ### +if ($stage=='SUBMIT') + { + $update_sent=0; + $CFoutput=''; + $stmt="SHOW TABLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06001',$user,$server_ip,$session_name,$one_mysql_log);} + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $update_SQL=''; + $VL_update_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06003',$user,$server_ip,$session_name,$one_mysql_log);} + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $new_field_value=''; + $form_field_value=''; + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_type[$o] = $rowx[6]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_required[$o] = $rowx[12]; + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o]; + + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ( ($A_field_type[$o]=='MULTI') or ($A_field_type[$o]=='CHECKBOX') or ($A_field_type[$o]=='RADIO') ) + { + $k=0; + $multi_count = count($form_field_value); + $multi_array = $form_field_value; + while ($k < $multi_count) + { + $new_field_value .= "$multi_array[$k],"; + $k++; + } + $form_field_value = preg_replace("/,$/","",$new_field_value); + } + + if ($A_field_type[$o]=='TIME') + { + if (isset($_GET["MINUTE_$field_name_id"])) {$form_field_valueM=$_GET["MINUTE_$field_name_id"];} + elseif (isset($_POST["MINUTE_$field_name_id"])) {$form_field_valueM=$_POST["MINUTE_$field_name_id"];} + if (isset($_GET["HOUR_$field_name_id"])) {$form_field_valueH=$_GET["HOUR_$field_name_id"];} + elseif (isset($_POST["HOUR_$field_name_id"])) {$form_field_valueH=$_POST["HOUR_$field_name_id"];} + $form_field_value = "$form_field_valueH:$form_field_valueM:00"; + } + + $A_field_value[$o] = $form_field_value; + + if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') ) + { + $A_field_value[$o]='----IGNORE----'; + } + else + { + if (preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $VL_update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + else + { + $update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + + $SUBMIT_output .= "$A_field_name[$o]: $A_field_value[$o]
"; + } + $o++; + } + + $custom_update_count=0; + if (strlen($update_SQL)>3) + { + $custom_record_lead_count=0; + $stmt="SELECT count(*) from custom_$list_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'06004',$user,$server_ip,$session_name,$one_mysql_log);} + $fieldleadcount_to_print = mysql_num_rows($rslt); + if ($fieldleadcount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_record_lead_count = $rowx[0]; + } + $update_SQL = preg_replace("/,$/","",$update_SQL); + $custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$update_SQL;"; + if ($custom_record_lead_count > 0) + {$custom_table_update_SQL = "UPDATE custom_$list_id SET $update_SQL where lead_id='$lead_id';";} + + $rslt=mysql_query($custom_table_update_SQL, $link); + $custom_update_count = mysql_affected_rows($link); + if ($DB) {echo "$custom_update_count|$custom_table_update_SQL\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $update_sent++; + } + + if (strlen($VL_update_SQL)>3) + { + $custom_update_vl_SQL=''; + if ($custom_update_count > 0) + {$custom_update_vl_SQL = "entry_list_id='$list_id',";} + $VL_update_SQL = preg_replace("/,$/","",$VL_update_SQL); + $list_table_update_SQL = "UPDATE vicidial_list SET $custom_update_vl_SQL $VL_update_SQL where lead_id='$lead_id';"; + + $rslt=mysql_query($list_table_update_SQL, $link); + $list_update_count = mysql_affected_rows($link); + if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $update_sent++; + } + else + { + if ($custom_update_count > 0) + { + $list_table_update_SQL = "UPDATE vicidial_list SET entry_list_id='$list_id' where lead_id='$lead_id';"; + $rslt=mysql_query($list_table_update_SQL, $link); + $list_update_count = mysql_affected_rows($link); + if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + } + + if ( ($admin_submit=='YES') and ($update_sent > 0) ) + { + ### LOG INSERTION Admin Log Table ### + $ip = getenv("REMOTE_ADDR"); + $SQL_log = "$list_table_update_SQL|$custom_table_update_SQL|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LEADS', event_type='MODIFY', record_id='$lead_id', event_code='ADMIN MODIFY CUSTOM LEAD', event_sql=\"$SQL_log\", event_notes='$custom_update_count|$list_update_count';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + {$CFoutput .= "ERROR: no custom list fields table\n";} + + echo "Custom Form Output:\n
\n"; + + echo "$SUBMIT_output"; + + echo "
\n"; + echo "\n"; + echo "
\n"; + } +### END parse submission of the custom fields form ### +else + { + echo "\n"; + echo "\n"; + echo "\n"; + echo "ViciDial Form Display Script"; + echo "\n"; + + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo ''; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + require("functions.php"); + + $CFoutput = custom_list_fields_values($lead_id,$list_id,$uniqueid,$user); + + echo "$CFoutput"; + + if ($submit_button=='YES') + { + echo "\n"; + echo "

\n"; + } + echo "


\n"; + echo "\n"; + } + + +exit; + +?> diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php index 81115084..9af96d86 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php @@ -275,6 +275,12 @@ if ($ignore_list_script < 1) {$call_script = $agent_script_override;} } +$stmt="SELECT list_name,list_description from vicidial_lists where list_id='$list_id';"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$list_name = $row[0]; +$list_description = $row[1]; + $stmt="SELECT script_name,script_text from vicidial_scripts where script_id='$call_script';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -288,6 +294,8 @@ if (eregi("iframe src",$script_text)) $vendor_id = eregi_replace(' ','+',$vendor_id); $vendor_lead_code = eregi_replace(' ','+',$vendor_lead_code); $list_id = eregi_replace(' ','+',$list_id); + $list_name = eregi_replace(' ','+',$list_name); + $list_description = eregi_replace(' ','+',$list_description); $gmt_offset_now = eregi_replace(' ','+',$gmt_offset_now); $phone_code = eregi_replace(' ','+',$phone_code); $phone_number = eregi_replace(' ','+',$phone_number); @@ -361,6 +369,8 @@ $script_text = eregi_replace('--A--lead_id--B--',"$lead_id",$script_text); $script_text = eregi_replace('--A--vendor_id--B--',"$vendor_id",$script_text); $script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); $script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); +$script_text = eregi_replace('--A--list_name--B--',"$list_name",$script_text); +$script_text = eregi_replace('--A--list_description--B--',"$list_description",$script_text); $script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); $script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); $script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_script_notes.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_script_notes.php new file mode 100644 index 00000000..afeae2fb --- /dev/null +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_script_notes.php @@ -0,0 +1,648 @@ + LICENSE: AGPLv2 +# +# This script is designed open in the SCRIPT tab in the agent interface through +# an IFRAME. It will create a new record for every SUBMIT +# +# Example of a ViciDial agent SCRIPT using this script: +# +# +# CHANGELOG: +# 100215-0744 - First build of script +# 100622-2230 - Added field labels +# + +$version = '2.4-2'; +$build = '100622-2230'; + +require("dbconnect.php"); + + +if (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + elseif (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} +if (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} + elseif (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + $vendor_lead_code = $vendor_id; +if (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} + elseif (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} +if (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];} + elseif (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];} +if (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} + elseif (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} +if (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + elseif (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} +if (isset($_POST["title"])) {$title=$_POST["title"];} + elseif (isset($_GET["title"])) {$title=$_GET["title"];} +if (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} + elseif (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} +if (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} + elseif (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} +if (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} + elseif (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} +if (isset($_POST["address1"])) {$address1=$_POST["address1"];} + elseif (isset($_GET["address1"])) {$address1=$_GET["address1"];} +if (isset($_POST["address2"])) {$address2=$_POST["address2"];} + elseif (isset($_GET["address2"])) {$address2=$_GET["address2"];} +if (isset($_POST["address3"])) {$address3=$_POST["address3"];} + elseif (isset($_GET["address3"])) {$address3=$_GET["address3"];} +if (isset($_POST["city"])) {$city=$_POST["city"];} + elseif (isset($_GET["city"])) {$city=$_GET["city"];} +if (isset($_POST["state"])) {$state=$_POST["state"];} + elseif (isset($_GET["state"])) {$state=$_GET["state"];} +if (isset($_POST["province"])) {$province=$_POST["province"];} + elseif (isset($_GET["province"])) {$province=$_GET["province"];} +if (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} + elseif (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} +if (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} + elseif (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} +if (isset($_POST["gender"])) {$gender=$_POST["gender"];} + elseif (isset($_GET["gender"])) {$gender=$_GET["gender"];} +if (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} + elseif (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} +if (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} + elseif (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} +if (isset($_POST["email"])) {$email=$_POST["email"];} + elseif (isset($_GET["email"])) {$email=$_GET["email"];} +if (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} + elseif (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} +if (isset($_POST["comments"])) {$comments=$_POST["comments"];} + elseif (isset($_GET["comments"])) {$comments=$_GET["comments"];} +if (isset($_POST["user"])) {$user=$_POST["user"];} + elseif (isset($_GET["user"])) {$user=$_GET["user"];} +if (isset($_POST["pass"])) {$pass=$_POST["pass"];} + elseif (isset($_GET["pass"])) {$pass=$_GET["pass"];} +if (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} + elseif (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} +if (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} + elseif (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} +if (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];} + elseif (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];} +if (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} + elseif (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} +if (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];} + elseif (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];} +if (isset($_POST["closer"])) {$closer=$_POST["closer"];} + elseif (isset($_GET["closer"])) {$closer=$_GET["closer"];} +if (isset($_POST["group"])) {$group=$_POST["group"];} + elseif (isset($_GET["group"])) {$group=$_GET["group"];} +if (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} + elseif (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} +if (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];} + elseif (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];} +if (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];} + elseif (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];} +if (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} + elseif (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} +if (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} + elseif (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} +if (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];} + elseif (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];} +if (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + elseif (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} +if (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];} + elseif (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];} +if (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} + elseif (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} +if (isset($_POST["phone"])) {$phone=$_POST["phone"];} + elseif (isset($_GET["phone"])) {$phone=$_GET["phone"];} +if (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} + elseif (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} +if (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + elseif (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} +if (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];} + elseif (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];} +if (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];} + elseif (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];} +if (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];} + elseif (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];} +if (isset($_POST["rank"])) {$rank=$_POST["rank"];} + elseif (isset($_GET["rank"])) {$rank=$_GET["rank"];} +if (isset($_POST["owner"])) {$owner=$_POST["owner"];} + elseif (isset($_GET["owner"])) {$owner=$_GET["owner"];} +if (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];} + elseif (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];} +if (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];} + elseif (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];} +if (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];} + elseif (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];} +if (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];} + elseif (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];} +if (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} + elseif (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} +if (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];} + elseif (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];} +if (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];} + elseif (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];} +if (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];} + elseif (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];} +if (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];} + elseif (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];} +if (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];} + elseif (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];} +if (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];} + elseif (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];} +if (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];} + elseif (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];} +if (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];} + elseif (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];} +if (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];} + elseif (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];} +if (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];} + elseif (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];} +if (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];} + elseif (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];} +if (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];} + elseif (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];} +if (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];} + elseif (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];} +if (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];} + elseif (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];} +if (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];} + elseif (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];} +if (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];} + elseif (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} +if (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];} + elseif (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} + +if (isset($_POST["DB"])) {$DB=$_POST["DB"];} + elseif (isset($_GET["DB"])) {$DB=$_GET["DB"];} +if (isset($_POST["process"])) {$process=$_POST["process"];} + elseif (isset($_GET["process"])) {$process=$_GET["process"];} +if (isset($_POST["vicidial_id"])) {$vicidial_id=$_POST["vicidial_id"];} + elseif (isset($_GET["vicidial_id"])) {$vicidial_id=$_GET["vicidial_id"];} +if (isset($_POST["call_date"])) {$call_date=$_POST["call_date"];} + elseif (isset($_GET["call_date"])) {$call_date=$_GET["call_date"];} +if (isset($_POST["order_id"])) {$order_id=$_POST["order_id"];} + elseif (isset($_GET["order_id"])) {$order_id=$_GET["order_id"];} +if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} + elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} +if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} + elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} +if (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} + elseif (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} +if (isset($_POST["notesid"])) {$notesid=$_POST["notesid"];} + elseif (isset($_GET["notesid"])) {$notesid=$_GET["notesid"];} +if ($notesid < 100) + {$notesid=0;} +if (strlen($vicidial_id) < 1) + {$vicidial_id = $uniqueid;} +if (strlen($appointment_time) < 1) + {$appointment_time = '12:00:00';} + +$appointment_timeARRAY = explode(":",$appointment_time); +$appointment_hour = $appointment_timeARRAY[0]; +$appointment_min = $appointment_timeARRAY[1]; + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +$txt = '.txt'; +$StarTtime = date("U"); +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$CIDdate = date("mdHis"); +$ENTRYdate = date("YmdHis"); +$MT[0]=''; +$agents='@agents'; + +if (strlen($call_date) < 1) + {$call_date = $NOW_TIME;} + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $timeclock_end_of_day = $row[1]; + $agentonly_callback_campaign_lock = $row[2]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ($non_latin < 1) + { + $user=ereg_replace("[^-_0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass); + $length_in_sec = ereg_replace("[^0-9]","",$length_in_sec); + $phone_code = ereg_replace("[^0-9]","",$phone_code); + $phone_number = ereg_replace("[^0-9]","",$phone_number); + } +else + { + $user = ereg_replace("'|\"|\\\\|;","",$user); + $pass = ereg_replace("'|\"|\\\\|;","",$pass); + } + +if ($DB > 0) + { + echo "
$lead_id|$entry_date|$modify_date|$status|$user|$vendor_lead_code|$source_id|$list_id|$gmt_offset_now|$called_since_last_reset|$phone_code|$phone_number|$title|$first_name|$middle_initial|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country_code|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$last_local_call_time|$rank|$owner|\n
"; + } + +### BEGIN find any custom field labels ### +$label_title = 'Título'; +$label_first_name = 'Primero'; +$label_middle_initial = 'MI'; +$label_last_name = 'Último'; +$label_address1 = 'Dirección1'; +$label_address2 = 'Dirección2'; +$label_address3 = 'Dirección3'; +$label_city = 'Ciudad'; +$label_state = 'Estado'; +$label_province = 'Provincia'; +$label_postal_code = 'CódigoPostal'; +$label_vendor_lead_code = 'VendedorID'; +$label_gender = 'Gender'; +$label_phone_number = 'Teléfono'; +$label_phone_code = 'Código Del Dial'; +$label_alt_phone = 'Teléfono Alt'; +$label_security_phrase = 'Demostración'; +$label_email = 'Email'; +$label_comments = 'Comentarios'; + +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} +### END find any custom field labels ### + +# default optional vars if not set +if (!isset($format)) {$format="text";} + if ($format == 'debug') {$DB=1;} +if (!isset($ACTION)) {$ACTION="refresh";} +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; +if ($DB) {echo "|$stmt|\n";} +if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; + +if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) + { + echo "Inválido Nombre del usuario/Contraseña: |$user|$pass|\n"; + exit; + } +else + { + # do nothing for now + } + +echo "\n"; +echo "\n"; +echo "\n"; +echo "ViciDial Notas"; +echo "\n"; +echo "\n"; +echo "\n"; +?> + +\n"; +echo "\n"; + +if ($process > 0) + { + #Update vicidial_list record + $stmt="UPDATE vicidial_list SET vendor_lead_code='$vendor_lead_code',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',phone_code='$phone_code',phone_number='$phone_number',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',rank='$rank',owner='$owner' where lead_id='$lead_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + + #Update the agent screen with new data + $stmt="UPDATE vicidial_live_agents set external_update_fields='1',external_update_fields_data='vendor_lead_code,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,phone_code,phone_number,gender,date_of_birth,alt_phone,email,security_phrase,comments,rank,owner' where user='$user';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + + if ($notesid < 100) + { + # Insert into vicidial_call_notes + $stmt="INSERT INTO vicidial_call_notes set lead_id='$lead_id',vicidial_id='$vicidial_id',call_date='$call_date',order_id='$order_id',appointment_date='$appointment_date',appointment_time='$appointment_time',call_notes='$call_notes';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + $notesid = mysql_insert_id($link); + } + else + { + # update vicidial_call_notes record + $stmt="UPDATE vicidial_call_notes set order_id='$order_id',appointment_date='$appointment_date',appointment_time='$appointment_time',call_notes='$call_notes' where notesid='$notesid';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + } + + echo "
Data Changes Accepted

"; + } + +$URLarray = explode("?", $PHP_SELF); +$URLsubmit = $URLarray[0]; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+> + + + + + + + + + + + + + + + + + + +
: *
: *
: *
:
:
: *
: + *
: *
: *
Order ID:
Appointment Date/Time: + + + + + + + +
Appointment Notas:

+
Please click ENVIAR to commit the changes,           * denotes required fields
+
+ + + + +
+ + +
+ + + + + + + + + + diff --git a/agc_2-X/trunk/LANG_www/agc_es/vicidial.php b/agc_2-X/trunk/LANG_www/agc_es/vicidial.php index b18cca0d..5df0a1ea 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vicidial.php @@ -283,15 +283,36 @@ # 100306-0852 - Added options.php optional file for setting interface options that will survive upgrade # 100309-0525 - Added queuemetrics_loginout option # 100313-0053 - Added display options for transfer/conf buttons +# 100315-1148 - fix for rare recording_log uniqueid issue on manual dial calls to same number +# 100317-1301 - Added agent_fullscreen User Group option +# 100327-0901 - fix for manual dial answering machine message +# 100331-1220 - Added human-readable hangup codes for manual dial +# 100401-0019 - Added agent_choose_blended option +# 100413-1349 - Various small logging fixes and extended alt-dial fixes +# 100420-1009 - Added scheduled_callbacks_count option +# 100423-1156 - Added more user logging data and manual_dial_override, blind monitor warnings, uniqueid display and codec features +# 100428-0544 - Added uniqueid display option for PRESERVE +# 100513-0714 - Added options.php option to hide the timeclock link +# 100513-2337 - Changed user_login_first to attempt full login if phone_login/pass are filled in +# 100527-2212 - Added API send_dtmf, transfer_conference and park_call functions +# 100616-1622 - Allowed longer manual dial numbers +# 100622-2209 - Added field labels +# 100625-1118 - Added poor-network-connection-mitigating code +# 100629-1158 - Added initial code for custom list fields +# 100702-1315 - Custom List Fields functionality enabled +# 100712-1441 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100723-1522 - Added LOCKED options for quick transfer button feature +# 100726-1233 - Added HANGUP, CALLMENU, EXTENSION, IN_GROUP timer actions # -$version = '2.4-261'; -$build = '100313-0053'; +$version = '2.4-281'; +$build = '100726-1233'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=64; +$mysql_log_count=66; $one_mysql_log=0; require("dbconnect.php"); +require("functions.php"); if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} @@ -368,7 +389,7 @@ $random = (rand(1000000, 9999999) + 10000000); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url FROM system_settings;"; +$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -388,6 +409,7 @@ if ($qm_conf_ct > 0) $enable_second_webform = $row[9]; $user_territories_active = $row[10]; $static_agent_url = $row[11]; + $custom_fields_enabled = $row[12]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -429,6 +451,8 @@ else $DefaulTAlTDiaL = '0'; # set to 1 to enable ALT DIAL by default if enabled for the campaign $AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option $disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen + $hide_timeclock_link = '0'; # set to 1 to hide the timeclock link en the agent login screen + $conf_check_attempts = '3'; # number of attempts to try before loosing webserver connection, for bad network setups $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen @@ -437,9 +461,54 @@ else $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 $MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 $SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 + $FORM_COLOR = '#EFEFEF'; $SIDEBAR_COLOR = '#F6F6F6'; } +### BEGIN find any custom field labels ### +$label_title = 'Título'; +$label_first_name = 'Primero'; +$label_middle_initial = 'MI'; +$label_last_name = 'Último'; +$label_address1 = 'Dirección1'; +$label_address2 = 'Dirección2'; +$label_address3 = 'Dirección3'; +$label_city = 'Ciudad'; +$label_state = 'Estado'; +$label_province = 'Provincia'; +$label_postal_code = 'CódigoPostal'; +$label_vendor_lead_code = 'VendedorID'; +$label_gender = 'Gender'; +$label_phone_number = 'Teléfono'; +$label_phone_code = 'Código Del Dial'; +$label_alt_phone = 'Teléfono Alt'; +$label_security_phrase = 'Demostración'; +$label_email = 'Email'; +$label_comments = 'Comentarios'; + +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} +### END find any custom field labels ### $US='_'; $CL=':'; @@ -676,7 +745,8 @@ if ($relogin == 'YES') echo "Agent web client: Conexión Otra Vez\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + if ($hide_timeclock_link < 1) + {echo "Timeclock
\n";} echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -716,7 +786,8 @@ if ($user_login_first == 1) echo "Agent web client: Conexión en la Campaña\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + if ($hide_timeclock_link < 1) + {echo "Timeclock
\n";} echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -759,40 +830,44 @@ echo "Agent web client: Conexión\n"; - echo "\n"; - echo "\n"; - echo "Timeclock
\n"; - echo "\n"; - echo "\n"; -echo "\n";echo "\n"; echo "
English Español
\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


"; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
Conexión
 
Conexión Del Teléfono:
Contraseña Del Teléfono:
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code
  \n"; - echo "

VERSIÓN: $version       CONSTRUCCION: $build
\n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; + if ( (strlen($phone_login) < 1) or (strlen($phone_pass) < 1) ) + { + echo "Agent web client: Login\n"; + echo "\n"; + echo "\n"; + if ($hide_timeclock_link < 1) + {echo "Timeclock
\n";} + echo "\n"; + echo "\n"; +echo "\n";echo "\n"; echo "
English Español
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "


"; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Conexión
 
Conexión Del Teléfono:
Contraseña Del Teléfono:
Conexión Del Usuario:
Contraseña Del Usuario:
Campaña: $camp_form_code
  \n"; + echo "

VERSIÓN: $version       CONSTRUCCION: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + exit; + } } } } @@ -802,7 +877,8 @@ if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) echo "Agent web client: Conexión Del Teléfono\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + if ($hide_timeclock_link < 1) + {echo "Timeclock
\n";} echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -852,7 +928,7 @@ else $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override,agent_choose_blended from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); @@ -880,14 +956,16 @@ else $VU_custom_three = $row[21]; $VU_custom_four = $row[22]; $VU_custom_five = $row[23]; - $VU_agent_call_log_view_override = $row[23]; + $VU_agent_call_log_view_override = $row[24]; + $VU_agent_choose_blended = $row[25]; + if ( ($VU_alert_enabled > 0) and ($VU_allow_alerts > 0) ) {$VU_alert_enabled = 'ON';} else {$VU_alert_enabled = 'OFF';} $AgentAlert_allowed = $VU_allow_alerts; ### Gather timeclock and shift enforcement restriction settings - $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial from vicidial_user_groups where user_group='$VU_user_group';"; + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen from vicidial_user_groups where user_group='$VU_user_group';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); @@ -924,6 +1002,7 @@ else {$agent_call_log_view=1;} if ($VU_agent_call_log_view_override == 'N') {$agent_call_log_view=0;} + $agent_fullscreen = $row[12]; ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) @@ -1062,7 +1141,8 @@ else echo "Agent web client: Conexión en la Campaña\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + if ($hide_timeclock_link < 1) + {echo "Timeclock
\n";} echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -1167,7 +1247,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1240,7 +1320,17 @@ echo "Agent web client: Conexión en la Campaña\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + if ($hide_timeclock_link < 1) + {echo "Timeclock
\n";} echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -1598,7 +1692,8 @@ echo "Agent web client: Conexión Del Teléfono Error\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + if ($hide_timeclock_link < 1) + {echo "Timeclock
\n";} echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -1684,7 +1779,7 @@ echo "\n"; } echo "Agent web client\n"; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -1751,8 +1846,10 @@ echo " 0) || (ereg('Y',$no_hopper_leads_logins)) ) { - ### insert an entry into the user log for the login event - $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; $rslt=mysql_query($stmt, $link); @@ -1922,29 +2013,36 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysql_affected_rows($link); - echo "\n"; + $vlERIaffected_rows = mysql_affected_rows($link); + echo "\n"; $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysql_affected_rows($link); - echo "\n"; + $vhICaffected_rows = mysql_affected_rows($link); + echo "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysql_affected_rows($link); - echo "\n"; + $vlaLIaffected_rows = mysql_affected_rows($link); + echo "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysql_affected_rows($link); - echo "\n"; + $vliaLIaffected_rows = mysql_affected_rows($link); + echo "\n"; + + ### insert an entry into the user log for the login event + $vul_data = "$vlERIaffected_rows|$vhICaffected_rows|$vlaLIaffected_rows|$vliaLIaffected_rows"; + $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group,session_id,server_ip,extension,computer_ip,browser,data) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group','$session_id','$server_ip','$protocol/$extension','$ip','$browser','$vul_data')"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} # echo "You have logged in as user: $VD_login en phone: $SIP_user a la campaña: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; @@ -1997,13 +2095,16 @@ echo "
0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01065',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $exip_ct = mysql_num_rows($rslt); if ($exip_ct > 0) @@ -2015,7 +2116,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01XXX',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01066',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $wu_ct = mysql_num_rows($rslt); if ($wu_ct > 0) @@ -2026,13 +2127,14 @@ echo " "; } @@ -2157,7 +2259,8 @@ echo "Agent web client: Conexión en la Campaña\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + if ($hide_timeclock_link < 1) + {echo "Timeclock
\n";} echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -2183,7 +2286,8 @@ echo "Agent web client: Conexión en la Campaña\n"; echo "\n"; echo "\n"; - echo "Timeclock
\n"; + if ($hide_timeclock_link < 1) + {echo "Timeclock
\n";} echo "\n"; echo "\n"; echo "\n";echo "\n"; echo "
English Español
\n"; @@ -2315,6 +2419,11 @@ if ($stretch_dimensions > 0) if ($JS_browser_height >= 340) {$BROWSER_HEIGHT = ($JS_browser_height - 40);} } +if ($agent_fullscreen=='Y') + { + $BROWSER_WIDTH = ($JS_browser_width - 10); + $BROWSER_HEIGHT = $JS_browser_height; + } $MASTERwidth=($BROWSER_WIDTH - 340); $MASTERheight=($BROWSER_HEIGHT - 200); if ($MASTERwidth < 430) {$MASTERwidth = '430';} @@ -2504,6 +2613,7 @@ $CCAL_OUT .= ""; var VU_agent_choose_ingroups_DV = ''; var agent_choose_territories = ''; var agent_select_territories = ''; + var agent_choose_blended = ''; var VU_closer_campaigns = ''; var CallBackDatETimE = ''; var CallBackrecipient = ''; @@ -2809,6 +2919,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VU_user_group = ''; var quick_transfer_button = ''; var quick_transfer_button_enabled = ''; + var quick_transfer_button_orig = ''; + var quick_transfer_button_locked = ''; var prepopulate_transfer_preset = ''; var prepopulate_transfer_preset_enabled = ''; var view_calls_in_queue = ''; @@ -2842,21 +2954,51 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var campaign_timer_action = ''; var campaign_timer_action_message = ''; var campaign_timer_action_seconds = ''; + var campaign_timer_action_destination = ''; var timer_action=''; var timer_action_message=''; var timer_action_seconds=''; + var timer_action_destination = ''; var is_webphone=''; var WebPhonEurl=''; var pause_code_counter=1; var agent_call_log_view=''; var scheduled_callbacks_alert=''; - var last_uniqueid=''; + var scheduled_callbacks_count=''; + var tmp_vicidial_id=''; var agent_xfer_consultative=''; var agent_xfer_dial_override=''; var agent_xfer_vm_transfer=''; var agent_xfer_blind_transfer=''; var agent_xfer_dial_with_customer=''; var agent_xfer_park_customer_dial=''; + var EAphone_code=''; + var EAphone_number=''; + var EAalt_phone_notes=''; + var EAalt_phone_active=''; + var EAalt_phone_count=''; + var conf_check_attempts = ''; + var conf_check_attempts_cleanup = ''; + var blind_monitor_warning=''; + var blind_monitor_message=''; + var blind_monitor_filename=''; + var blind_monitoring_now=0; + var blind_monitoring_now_trigger=0; + var no_blind_monitors=0; + var uniqueid_status_display=''; + var uniqueid_status_prefix=''; + var custom_call_id=''; + var api_dtmf=''; + var api_transferconf_function=''; + var api_transferconf_group=''; + var api_transferconf_number=''; + var api_transferconf_consultative=''; + var api_transferconf_override=''; + var api_parkcustomer=''; + var API_selected_xfergroup=''; + var API_selected_callmenu='' + var custom_fields_enabled=''; + var form_contents_loaded=0; var DiaLControl_auto_HTML = "\"\"Comienzo\""; var DiaLControl_auto_HTML_ready = "\"\"Comienzo\""; var DiaLControl_auto_HTML_OFF = "\"\"Comienzo\""; @@ -3182,8 +3324,17 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Originate command to manager to place a phone call - function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias) + function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias,taskalert) { + if (taskalert == '1') + { + var TAqueryCID = tasknum; + tasknum = '83047777777777'; + taskdialvalue = '7' + taskdialvalue; + var alertquery = 'alertCID=1'; + } + else + {var alertquery = 'alertCID=0';} var usegroupalias=0; var consultativexfer_checked = 0; if (document.vicidial_form.consultativexfer.checked==true) @@ -3196,16 +3347,19 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { var Ctasknum = tasknum_string.replace(regCXFvars, ''); if (Ctasknum.length < 2) - {Ctasknum = '990009';} + {Ctasknum = '90009';} var agentdirect = ''; } else { - Ctasknum = '990009'; + Ctasknum = '90009'; var agentdirect = tasknum_string; } var XfeRSelecT = document.getElementById("XfeRGrouP"); - tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + dialed_number + '*' + user + '*' + agentdirect + '*' + VD_live_call_secondS + '*'; + var XfeR_GrouP = XfeRSelecT.value; + if (API_selected_xfergroup.length > 1) + {var XfeR_GrouP = API_selected_xfergroup;} + tasknum = Ctasknum + "*" + XfeR_GrouP + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + dialed_number + '*' + user + '*' + agentdirect + '*' + VD_live_call_secondS + '*'; CustomerData_update(); } @@ -3282,6 +3436,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} else {var queryCID = "DVagcW" + epoch_sec + user_abb;} + if (taskalert == '1') + { + queryCID = TAqueryCID; + } + if (cid_choice.length > 3) { var call_cid = cid_choice; @@ -3295,7 +3454,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {var call_cid = campaign_cid;} } - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&" + alertquery; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -3363,7 +3522,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (xmlhttp) { var queryCID = dtmf_string; - VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; + VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDdtmfOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1"; xmlhttp.open('POST', 'manager_send.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(VMCoriginate_query); @@ -3385,6 +3544,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (typeof(xmlhttprequestcheckconf) == "undefined") { //alert (xmlhttprequestcheckconf == xmlhttpSendConf); + xmlhttprequestcheckconf_wait = 0; custchannellive--; if ( (agentcallsstatus == '1') || (callholdstatus == '1') ) { @@ -3431,8 +3591,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttprequestcheckconf.send(checkconf_query); xmlhttprequestcheckconf.onreadystatechange = function() - { - if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) + { + if (xmlhttprequestcheckconf && xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200) { var check_conf = null; var LMAforce = taskforce; @@ -3522,14 +3682,91 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} api_timer_action_message = APITimerMessage_array[1]; var APITimerSeconds_array = check_time_array[19].split("APITimerSeconds: "); api_timer_action_seconds = APITimerSeconds_array[1]; + var APITimerDestination_array = check_time_array[23].split("APITimerDestination: "); + api_timer_action_destination = APITimerDestination_array[1]; + var APIdtmf_array = check_time_array[20].split("APIdtmf: "); + api_dtmf = APIdtmf_array[1]; + var APItransfercond_array = check_time_array[21].split("APItransferconf: "); + var api_transferconf_values_array = APItransfercond_array[1].split("---"); + api_transferconf_function = api_transferconf_values_array[0]; + api_transferconf_group = api_transferconf_values_array[1]; + api_transferconf_number = api_transferconf_values_array[2]; + api_transferconf_consultative = api_transferconf_values_array[3]; + api_transferconf_override = api_transferconf_values_array[4]; + var APIpark_array = check_time_array[22].split("APIpark: "); + api_parkcustomer = APIpark_array[1]; + + if (api_transferconf_function.length > 0) + { + if (api_transferconf_function == 'HANGUP_XFER') + {xfercall_send_hangup();} + if (api_transferconf_function == 'HANGUP_BOTH') + {bothcall_send_hangup();} + if (api_transferconf_function == 'LEAVE_VM') + {mainxfer_send_redirect('XfeRVMAIL',lastcustchannel,lastcustserverip);} + if (api_transferconf_function == 'LEAVE_3WAY_CALL') + {leave_3way_call('FIRST');} + if (api_transferconf_function == 'BLIND_TRANSFER') + { + document.vicidial_form.xfernumber.value = api_transferconf_number; + mainxfer_send_redirect('XfeRBLIND',lastcustchannel,lastcustserverip); + } + if (api_transferconf_function == 'LOCAL_CLOSER') + { + API_selected_xfergroup = api_transferconf_group; + document.vicidial_form.xfernumber.value = api_transferconf_number; + mainxfer_send_redirect('XfeRLOCAL',lastcustchannel,lastcustserverip); + } + if (api_transferconf_function == 'DIAL_WITH_CUSTOMER') + { + if (api_transferconf_consultative=='YES') + {document.vicidial_form.consultativexfer.checked=true;} + if (api_transferconf_consultative=='NO') + {document.vicidial_form.consultativexfer.checked=false;} + if (api_transferconf_override=='YES') + {document.vicidial_form.xferoverride.checked=true;} + API_selected_xfergroup = api_transferconf_group; + document.vicidial_form.xfernumber.value = api_transferconf_number; + SendManualDial('YES'); + } + if (api_transferconf_function == 'PARKING_CUSTOMER_DIAL') + { + if (api_transferconf_consultative=='YES') + {document.vicidial_form.consultativexfer.checked=true;} + if (api_transferconf_consultative=='NO') + {document.vicidial_form.consultativexfer.checked=false;} + if (api_transferconf_override=='YES') + {document.vicidial_form.xferoverride.checked=true;} + API_selected_xfergroup = api_transferconf_group; + document.vicidial_form.xfernumber.value = api_transferconf_number; + xfer_park_dial(); + } + Clear_API_Field('external_transferconf'); + } + if (api_parkcustomer == 'PARKING_CUSTOMER') + {mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip);} + if (api_parkcustomer == 'GRAB_CUSTOMER') + {mainxfer_send_redirect('FROMParK',lastcustchannel,lastcustserverip);} + if (api_dtmf.length > 0) + { + var REGdtmfPOUND = new RegExp("P","g"); + var REGdtmfSTAR = new RegExp("S","g"); + var REGdtmfQUIET = new RegExp("Q","g"); + api_dtmf = api_dtmf.replace(REGdtmfPOUND, '#'); + api_dtmf = api_dtmf.replace(REGdtmfSTAR, '*'); + api_dtmf = api_dtmf.replace(REGdtmfQUIET, ','); + document.vicidial_form.conf_dtmf.value = api_dtmf; + SendConfDTMF(session_id); + } if (api_timer_action.length > 2) { timer_action = api_timer_action; timer_action_message = api_timer_action_message; timer_action_seconds = api_timer_action_seconds; + timer_action_destination = api_timer_action_destination; + // alert("TIMER_API:" + timer_action + '|' + timer_action_message + '|' + timer_action_seconds + '|' + timer_action_destination + '|'); } - if ( (APIHanguP==1) && (VD_live_customer_call==1) ) { hideDiv('CustomerGoneBox'); @@ -3538,7 +3775,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} dialedcall_send_hangup(); } - if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 0) ) + if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 1) ) { document.vicidial_form.DispoSelection.value = APIStatuS; DispoSelect_submit(); @@ -3625,7 +3862,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (InGroupChange > 0) { var external_blended = InGroupChangeBlend; - var external_igb_set_user = InGroupChangeUsuario; + var external_igb_set_user = InGroupChangeUser; external_igb_set_name = InGroupChangeName; manager_ingroups_set=1; @@ -3636,8 +3873,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {VICIDiaL_closer_blended = '0';} } - -// ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working en API functions var check_conf_array=check_ALL_array[1].split("|"); var live_conf_calls = check_conf_array[0]; var conf_chan_array = check_conf_array[1].split(" ~"); @@ -3645,6 +3880,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (live_conf_calls > 0) { + var temp_blind_monitors=0; var loop_ct=0; var ARY_ct=0; var LMAalter=0; @@ -3681,6 +3917,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) ) { var hide_channel=1; + blind_monitoring_now++; + temp_blind_monitors++; + if (blind_monitoring_now==1) + {blind_monitoring_now_trigger=1;} } else { @@ -3772,6 +4012,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;} } nochannelinsession=0; + if (temp_blind_monitors < 1) + { + no_blind_monitors++; + if (no_blind_monitors > 2) + {blind_monitoring_now=0;} + } } else { @@ -3786,27 +4032,64 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } custchannellive = -99; nochannelinsession++; + + no_blind_monitors++; + if (no_blind_monitors > 2) + {blind_monitoring_now=0;} } } + delete xmlhttprequestcheckconf; xmlhttprequestcheckconf = undefined; - delete xmlhttprequestcheckconf; + } + else if (xmlhttprequestcheckconf && xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status != 200) + { + // Cleanup after AJAX Request returns error. + // alert("Status: " + xmlhttprequestcheckconf.status); + delete xmlhttprequestcheckconf; + xmlhttprequestcheckconf = undefined; } } } } + else + { + if (xmlhttprequestcheckconf) + { + xmlhttprequestcheckconf_wait++; + if (xmlhttprequestcheckconf_wait >= conf_check_attempts) + { + // Abort AJAX Request, due to timeout. + // The handler must take care of cleanup. + // alert("xmlhttprequestcheckconf: Abort (Wait > 3 sec)"); + xmlhttprequestcheckconf.abort(); + } + } + if (xmlhttprequestcheckconf_wait >= conf_check_attempts_cleanup) + { + // In case the handler function fails to do cleanup, cleanup manually. + xmlhttprequestcheckconf_wait = 0; + delete xmlhttprequestcheckconf; + xmlhttprequestcheckconf = undefined; + } + else + { + xmlhttprequestcheckconf = undefined; + } + } } + // ################################################################################ // Send MonitorConf/StopMonitorConf command for recording of conferences function conf_send_recording(taskconfrectype,taskconfrec,taskconffile) { if (inOUT == 'OUT') { - var tmp_vicidial_id = document.vicidial_form.uniqueid.value; + tmp_vicidial_id = document.vicidial_form.uniqueid.value; } else { - var tmp_vicidial_id = 'IN'; + tmp_vicidial_id = 'IN'; } var xmlhttp=false; /*@cc_on @*/ @@ -3922,7 +4205,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Send Redirect command for live call to Directorsends phone name where call is going to // Covers the following types: XFER, VMAIL, ENTRY, CONF, PARKING, FROMPARKING, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL - function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote,taskdispowindow) + function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote,taskdispowindow,tasklockedquick) { blind_transfer=1; var consultativexfer_checked = 0; @@ -3958,6 +4241,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {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 regXFvars = new RegExp("XFER","g"); @@ -3988,21 +4273,28 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {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; + 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<'2') + if (blindxferdialstring.length<'1') { xferredirect_query=''; taskvar = 'NOTHING'; - alert("El número de la transferencia debe tener más de 1 dígito:" + blindxferdialstring); + alert("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=" + 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 + "&nodeletevdac=" + no_delete_VDAC; + 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; } } if (taskvar == 'XfeRINTERNAL') @@ -4019,9 +4311,15 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} CustomerData_update(); 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*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + dialed_number + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*'; + 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; } @@ -4052,6 +4350,9 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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';} @@ -4063,7 +4364,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} 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=" + XfeRSelecT.value + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level; + 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') { @@ -4403,7 +4704,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CBpost = ''; // alert(xmlhttp.responseText); - var CBcounT = xmlhttp.responseText; + var CBcounTtotal = xmlhttp.responseText; + var CBcounTtotal_array=CBcounTtotal.split("|"); + var CBcounT = CBcounTtotal_array[0]; + if (scheduled_callbacks_count='LIVE') + {CBcounT = CBcounTtotal_array[1];} if (CBcounT == 0) {var CBprint = "NO";} else { @@ -4482,7 +4787,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var CB_calls = all_CBs_array[0]; var loop_ct=0; var conv_start=0; - var CB_HTML = ">" + var CB_HTML = "
# LLAMADABACK DATE/TIMENÚMERONAME ESTADOCAMPAIGNLAST FECHA/HORA DE LA LLAMADA COMMENTS
>>" while (loop_ct < CB_calls) { loop_ct++; @@ -4741,7 +5046,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (XDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + XDchannel; + var XDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + XDchannel + "\n" + XDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) ) @@ -4784,7 +5090,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (MDalert == 'ERROR') { - var DiaLAlerTMessagE = "Call Rejected: " + MDchannel; + var MDerrorDesc = MDlookResponse_array[3]; + var DiaLAlerTMessagE = "Call Rejected: " + MDchannel + "\n" + MDerrorDesc; TimerActionRun("DiaLAlerT",DiaLAlerTMessagE); } if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') ) @@ -4797,7 +5104,6 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} custchannellive=1; document.vicidial_form.uniqueid.value = MDlookResponse_array[0]; - last_uniqueid = MDlookResponse_array[0]; document.getElementById("callchannel").innerHTML = MDlookResponse_array[1]; lastcustchannel = MDlookResponse_array[1]; if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;} @@ -4828,37 +5134,44 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("VolumeUpSpan").innerHTML = ""; document.getElementById("VolumeDownSpan").innerHTML = ""; - if (quick_transfer_button == 'IN_GROUP') + if ( (quick_transfer_button == 'IN_GROUP') || (quick_transfer_button == 'LOCKED_IN_GROUP') ) { - document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; + quick_transfer_button_orig=''; + if (quick_transfer_button_locked > 0) + {quick_transfer_button_orig = default_xfer_group;} + + document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; } if (prepopulate_transfer_preset_enabled > 0) { - if (prepopulate_transfer_preset == 'PRESET_1') + if ( (prepopulate_transfer_preset == 'PRESET_1') || (prepopulate_transfer_preset == 'LOCKED_PRESET_1') ) {document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber;} - if (prepopulate_transfer_preset == 'PRESET_2') + if ( (prepopulate_transfer_preset == 'PRESET_2') || (prepopulate_transfer_preset == 'LOCKED_PRESET_2') ) {document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber;} - if (prepopulate_transfer_preset == 'PRESET_3') + if ( (prepopulate_transfer_preset == 'PRESET_3') || (prepopulate_transfer_preset == 'LOCKED_PRESET_3') ) {document.vicidial_form.xfernumber.value = CalL_XC_c_NuMber;} - if (prepopulate_transfer_preset == 'PRESET_4') + if ( (prepopulate_transfer_preset == 'PRESET_4') || (prepopulate_transfer_preset == 'LOCKED_PRESET_4') ) {document.vicidial_form.xfernumber.value = CalL_XC_d_NuMber;} - if (prepopulate_transfer_preset == 'PRESET_5') + if ( (prepopulate_transfer_preset == 'PRESET_5') || (prepopulate_transfer_preset == 'LOCKED_PRESET_5') ) {document.vicidial_form.xfernumber.value = CalL_XC_e_NuMber;} } - if ( (quick_transfer_button == 'PRESET_1') || (quick_transfer_button == 'PRESET_2') || (quick_transfer_button == 'PRESET_3') || (quick_transfer_button == 'PRESET_4') || (quick_transfer_button == 'PRESET_5') ) + if ( (quick_transfer_button == 'PRESET_1') || (quick_transfer_button == 'PRESET_2') || (quick_transfer_button == 'PRESET_3') || (quick_transfer_button == 'PRESET_4') || (quick_transfer_button == 'PRESET_5') || (quick_transfer_button == 'LOCKED_PRESET_1') || (quick_transfer_button == 'LOCKED_PRESET_2') || (quick_transfer_button == 'LOCKED_PRESET_3') || (quick_transfer_button == 'LOCKED_PRESET_4') || (quick_transfer_button == 'LOCKED_PRESET_5') ) { - document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; - - if (quick_transfer_button == 'PRESET_1') + if ( (quick_transfer_button == 'PRESET_1') || (quick_transfer_button == 'LOCKED_PRESET_1') ) {document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber;} - if (quick_transfer_button == 'PRESET_2') + if ( (quick_transfer_button == 'PRESET_2') || (quick_transfer_button == 'LOCKED_PRESET_2') ) {document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber;} - if (quick_transfer_button == 'PRESET_3') + if ( (quick_transfer_button == 'PRESET_3') || (quick_transfer_button == 'LOCKED_PRESET_3') ) {document.vicidial_form.xfernumber.value = CalL_XC_c_NuMber;} - if (quick_transfer_button == 'PRESET_4') + if ( (quick_transfer_button == 'PRESET_4') || (quick_transfer_button == 'LOCKED_PRESET_4') ) {document.vicidial_form.xfernumber.value = CalL_XC_d_NuMber;} - if (quick_transfer_button == 'PRESET_5') + if ( (quick_transfer_button == 'PRESET_5') || (quick_transfer_button == 'LOCKED_PRESET_5') ) {document.vicidial_form.xfernumber.value = CalL_XC_e_NuMber;} + quick_transfer_button_orig=''; + if (quick_transfer_button_locked > 0) + {quick_transfer_button_orig = document.vicidial_form.xfernumber.value;} + + document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; } if (call_requeue_button > 0) @@ -5151,6 +5464,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {web_form_vars = '?' + web_form_vars} TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + + var regWFAqavars = new RegExp("\\?&","ig"); + var regWFAaavars = new RegExp("&&","ig"); + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAqavars, '?'); + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAaavars, '&'); } if (VDIC_web_form_address_two.match(regWFAcustom)) @@ -5246,6 +5564,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {web_form_vars_two = '?' + web_form_vars_two} TEMP_VDIC_web_form_address_two = VDIC_web_form_address_two + "" + web_form_vars_two; + + var regWFAqavars = new RegExp("\\?&","ig"); + var regWFAaavars = new RegExp("&&","ig"); + TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAqavars, '?'); + TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAaavars, '&'); } document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; @@ -5350,7 +5673,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var MDnextResponse_array=MDnextResponse.split("\n"); MDnextCID = MDnextResponse_array[0]; - var regMNCvar = new RegExp("HOPPER","ig"); + var regMNCvar = new RegExp("TOLVA VACÍA","ig"); var regMDFvarDNC = new RegExp("DNC","ig"); var regMDFvarCAMP = new RegExp("CAMPLISTS","ig"); if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) ) @@ -5448,10 +5771,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} CalL_XC_c_NuMber = MDnextResponse_array[41]; CalL_XC_d_NuMber = MDnextResponse_array[42]; CalL_XC_e_NuMber = MDnextResponse_array[43]; + document.vicidial_form.entry_list_id.value = MDnextResponse_array[44]; timer_action = campaign_timer_action; timer_action_message = campaign_timer_action_message; timer_action_seconds = campaign_timer_action_seconds; + timer_action_destination = campaign_timer_action_destination; lead_dial_number = document.vicidial_form.phone_number.value; var dispnum = document.vicidial_form.phone_number.value; @@ -5567,6 +5892,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {web_form_vars = '?' + web_form_vars} TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + + var regWFAqavars = new RegExp("\\?&","ig"); + var regWFAaavars = new RegExp("&&","ig"); + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAqavars, '?'); + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAaavars, '&'); } if (VDIC_web_form_address_two.match(regWFAcustom)) @@ -5662,6 +5992,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {web_form_vars_two = '?' + web_form_vars_two} TEMP_VDIC_web_form_address_two = VDIC_web_form_address_two + "" + web_form_vars_two; + + var regWFAqavars = new RegExp("\\?&","ig"); + var regWFAaavars = new RegExp("&&","ig"); + TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAqavars, '?'); + TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAaavars, '&'); } document.getElementById("WebFormSpan").innerHTML = "\"Formulario\n"; @@ -5783,6 +6118,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + if (custom_fields_enabled > 0) + { + FormContentsLoad(); + } if (get_call_launch == 'SCRIPT') { if (delayed_script_load == 'YES') @@ -5792,6 +6131,12 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} ScriptPanelToFront(); } + if (get_call_launch == 'FORM') + { + FormPanelToFront(); + } + + if (get_call_launch == 'WEBFORM') { window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); @@ -5890,6 +6235,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.lead_id.value =''; document.vicidial_form.vendor_lead_code.value=''; document.vicidial_form.list_id.value =''; + document.vicidial_form.entry_list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; if ( (disable_alter_custphone=='Y') || (disable_alter_custphone=='HIDE') ) @@ -6044,7 +6390,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type + "&dial_method=" + dial_method + "&agent_log_id=" + agent_log_id + "&security=" + document.vicidial_form.security_phrase.value; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(manDiaLonly_query); + xmlhttp.send(manDiaLonly_query); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) @@ -6055,7 +6401,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} MDOnextResponse = xmlhttp.responseText; var MDOnextResponse_array=MDOnextResponse.split("\n"); - MDnextCID = MDOnextResponse_array[0]; + MDnextCID = MDOnextResponse_array[0]; + agent_log_id = MDOnextResponse_array[1]; if (MDnextCID == " LLAMADA NOT PLACED") { alert("la llamada no fue atendida, hubo un error:\n" + MDOnextResponse); @@ -6169,6 +6516,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + if (custom_fields_enabled > 0) + { + FormContentsLoad(); + } if (get_call_launch == 'SCRIPT') { if (delayed_script_load == 'YES') @@ -6177,6 +6528,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } ScriptPanelToFront(); } + if (get_call_launch == 'FORM') + { + FormPanelToFront(); + } if (get_call_launch == 'WEBFORM') { window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450'); @@ -6554,27 +6909,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} timer_action = campaign_timer_action; timer_action_message = campaign_timer_action_message; timer_action_seconds = campaign_timer_action_seconds; + timer_action_destination = campaign_timer_action_destination; } else { var call_timer_action_message = VDIC_data_VDIG[19]; var call_timer_action_seconds = VDIC_data_VDIG[20]; + var call_timer_action_destination = VDIC_data_VDIG[27]; timer_action = call_timer_action; timer_action_message = call_timer_action_message; timer_action_seconds = call_timer_action_seconds; + timer_action_destination = call_timer_action_destination; } CalL_XC_c_NuMber = VDIC_data_VDIG[21]; CalL_XC_d_NuMber = VDIC_data_VDIG[22]; CalL_XC_e_NuMber = VDIC_data_VDIG[23]; - + CalL_XC_e_NuMber = VDIC_data_VDIG[23]; + uniqueid_status_display = VDIC_data_VDIG[24]; + uniqueid_status_prefix = VDIC_data_VDIG[26]; var VDIC_data_VDFR=check_VDIC_array[3].split("|"); if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') ) {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];} document.vicidial_form.lead_id.value = VDIC_data_VDAC[0]; document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1]; - last_uniqueid = VDIC_data_VDAC[1]; CIDcheck = VDIC_data_VDAC[2]; CalLCID = VDIC_data_VDAC[2]; document.getElementById("callchannel").innerHTML = VDIC_data_VDAC[3]; @@ -6585,6 +6944,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.SecondS.value = 0; document.getElementById("SecondSDISP").innerHTML = '0'; + if (uniqueid_status_display=='ENABLED') + {custom_call_id = " Call ID " + VDIC_data_VDAC[1];} + if (uniqueid_status_display=='ENABLED_PREFIX') + {custom_call_id = " Call ID " + uniqueid_status_prefix + "" + VDIC_data_VDAC[1];} + if (uniqueid_status_display=='ENABLED_PRESERVE') + {custom_call_id = " Call ID " + VDIC_data_VDIG[25];} + VD_live_customer_call = 1; VD_live_call_secondS = 0; @@ -6645,6 +7011,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.rank.value = check_VDIC_array[44]; document.vicidial_form.owner.value = check_VDIC_array[45]; script_recording_delay = check_VDIC_array[46]; + document.vicidial_form.entry_list_id.value = check_VDIC_array[47]; var gIndex = 0; if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;} @@ -6657,7 +7024,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var callnum = dialed_number; var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + dial_display_number + " UID: " + CIDcheck + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + dial_display_number + " " + custom_call_id + " UID: " + CIDcheck + "   " + VDIC_fronter; if (LeaDPreVDispO == 'CALLBK') { @@ -6703,7 +7070,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var callnum = dialed_number; var dial_display_number = phone_number_format(callnum); - document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + dial_display_number + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; + document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + dial_display_number + " " + custom_call_id + " Group- " + VDIC_data_VDIG[1] + "   " + VDIC_fronter; } document.getElementById("ParkControl").innerHTML ="\"Aparcar"; @@ -6718,37 +7085,42 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.getElementById("DialBlindVMail").innerHTML = "\"Blind"; - if (quick_transfer_button == 'IN_GROUP') + if ( (quick_transfer_button == 'IN_GROUP') || (quick_transfer_button == 'LOCKED_IN_GROUP') ) { - document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; + if (quick_transfer_button_locked > 0) + {quick_transfer_button_orig = default_xfer_group;} + + document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; } if (prepopulate_transfer_preset_enabled > 0) { - if (prepopulate_transfer_preset == 'PRESET_1') + if ( (prepopulate_transfer_preset == 'PRESET_1') || (prepopulate_transfer_preset == 'LOCKED_PRESET_1') ) {document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber;} - if (prepopulate_transfer_preset == 'PRESET_2') + if ( (prepopulate_transfer_preset == 'PRESET_2') || (prepopulate_transfer_preset == 'LOCKED_PRESET_2') ) {document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber;} - if (prepopulate_transfer_preset == 'PRESET_3') + if ( (prepopulate_transfer_preset == 'PRESET_3') || (prepopulate_transfer_preset == 'LOCKED_PRESET_3') ) {document.vicidial_form.xfernumber.value = CalL_XC_c_NuMber;} - if (prepopulate_transfer_preset == 'PRESET_4') + if ( (prepopulate_transfer_preset == 'PRESET_4') || (prepopulate_transfer_preset == 'LOCKED_PRESET_4') ) {document.vicidial_form.xfernumber.value = CalL_XC_d_NuMber;} - if (prepopulate_transfer_preset == 'PRESET_5') + if ( (prepopulate_transfer_preset == 'PRESET_5') || (prepopulate_transfer_preset == 'LOCKED_PRESET_5') ) {document.vicidial_form.xfernumber.value = CalL_XC_e_NuMber;} } - if ( (quick_transfer_button == 'PRESET_1') || (quick_transfer_button == 'PRESET_2') || (quick_transfer_button == 'PRESET_3') || (quick_transfer_button == 'PRESET_4') || (quick_transfer_button == 'PRESET_5') ) + if ( (quick_transfer_button == 'PRESET_1') || (quick_transfer_button == 'PRESET_2') || (quick_transfer_button == 'PRESET_3') || (quick_transfer_button == 'PRESET_4') || (quick_transfer_button == 'PRESET_5') || (quick_transfer_button == 'LOCKED_PRESET_1') || (quick_transfer_button == 'LOCKED_PRESET_2') || (quick_transfer_button == 'LOCKED_PRESET_3') || (quick_transfer_button == 'LOCKED_PRESET_4') || (quick_transfer_button == 'LOCKED_PRESET_5') ) { - document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; - - if (quick_transfer_button == 'PRESET_1') + if ( (quick_transfer_button == 'PRESET_1') || (quick_transfer_button == 'LOCKED_PRESET_1') ) {document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber;} - if (quick_transfer_button == 'PRESET_2') + if ( (quick_transfer_button == 'PRESET_2') || (quick_transfer_button == 'LOCKED_PRESET_2') ) {document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber;} - if (quick_transfer_button == 'PRESET_3') + if ( (quick_transfer_button == 'PRESET_3') || (quick_transfer_button == 'LOCKED_PRESET_3') ) {document.vicidial_form.xfernumber.value = CalL_XC_c_NuMber;} - if (quick_transfer_button == 'PRESET_4') + if ( (quick_transfer_button == 'PRESET_4') || (quick_transfer_button == 'LOCKED_PRESET_4') ) {document.vicidial_form.xfernumber.value = CalL_XC_d_NuMber;} - if (quick_transfer_button == 'PRESET_5') + if ( (quick_transfer_button == 'PRESET_5') || (quick_transfer_button == 'LOCKED_PRESET_5') ) {document.vicidial_form.xfernumber.value = CalL_XC_e_NuMber;} + if (quick_transfer_button_locked > 0) + {quick_transfer_button_orig = document.vicidial_form.xfernumber.value;} + + document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; } if (call_requeue_button > 0) @@ -6899,6 +7271,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {web_form_vars = '?' + web_form_vars} TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + + var regWFAqavars = new RegExp("\\?&","ig"); + var regWFAaavars = new RegExp("&&","ig"); + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAqavars, '?'); + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAaavars, '&'); } if (VDIC_web_form_address_two.match(regWFAcustom)) @@ -6994,6 +7371,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {web_form_vars_two = '?' + web_form_vars_two} TEMP_VDIC_web_form_address_two = VDIC_web_form_address_two + "" + web_form_vars_two; + + var regWFAqavars = new RegExp("\\?&","ig"); + var regWFAaavars = new RegExp("&&","ig"); + TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAqavars, '?'); + TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAaavars, '&'); } @@ -7098,6 +7480,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } } + if (custom_fields_enabled > 0) + { + FormContentsLoad(); + } if (CalL_AutO_LauncH == 'SCRIPT') { if (delayed_script_load == 'YES') @@ -7106,6 +7492,10 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } ScriptPanelToFront(); } + if (CalL_AutO_LauncH == 'FORM') + { + FormPanelToFront(); + } if (CalL_AutO_LauncH == 'WEBFORM') { @@ -7275,6 +7665,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {web_form_vars = '?' + web_form_vars} TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars; + + var regWFAqavars = new RegExp("\\?&","ig"); + var regWFAaavars = new RegExp("&&","ig"); + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAqavars, '?'); + TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAaavars, '&'); } @@ -7400,6 +7795,11 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} {web_form_vars_two = '?' + web_form_vars_two} TEMP_VDIC_web_form_address_two = VDIC_web_form_address_two + "" + web_form_vars_two; + + var regWFAqavars = new RegExp("\\?&","ig"); + var regWFAaavars = new RegExp("&&","ig"); + TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAqavars, '?'); + TEMP_VDIC_web_form_address_two = TEMP_VDIC_web_form_address_two.replace(regWFAaavars, '&'); } @@ -8109,7 +8509,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } if (xmlhttp) { - DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&vtiger_callback_id=" + vtiger_callback_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&dial_method" + dial_method + "&uniqueid=" + last_uniqueid + "&comments=" + CallBackCommenTs; + DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&vtiger_callback_id=" + vtiger_callback_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&dial_method" + dial_method + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&comments=" + CallBackCommenTs; xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(DSupdate_query); @@ -8135,6 +8535,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.lead_id.value =''; document.vicidial_form.vendor_lead_code.value=''; document.vicidial_form.list_id.value =''; + document.vicidial_form.entry_list_id.value =''; document.vicidial_form.gmt_offset_now.value =''; document.vicidial_form.phone_code.value =''; if ( (disable_alter_custphone=='Y') || (disable_alter_custphone=='HIDE') ) @@ -8168,6 +8569,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} vtiger_callback_id='0'; recording_filename=''; recording_id=''; + document.vicidial_form.uniqueid.value=''; + MDuniqueid=''; + XDuniqueid=''; + tmp_vicidial_id=''; + EAphone_code=''; + EAphone_number=''; + EAalt_phone_notes=''; + EAalt_phone_active=''; + EAalt_phone_count=''; + XDnextCID=''; + XDcheck = ''; + MDnextCID=''; + XD_live_customer_call = 0; + XD_live_call_secondS = 0; + MD_channel_look=0; + MD_ring_secondS=0; + uniqueid_status_display=''; + uniqueid_status_prefix=''; + custom_call_id=''; + API_selected_xfergroup=''; + API_selected_callmenu=''; + timer_action=''; + timer_action_seconds=''; + timer_action_mesage=''; + timer_action_destination=''; if (manual_dial_in_progress==1) { @@ -8358,6 +8784,31 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} document.vicidial_form.xfernumber.value = CalL_XC_e_NuMber; basic_originate_call(CalL_XC_e_NuMber,'NO','YES',session_id,'YES','','1','0'); } + function hangup_timer_xfer() + { + hideDiv('CustomerGoneBox'); + WaitingForNextStep=0; + custchannellive=0; + + dialedcall_send_hangup(); + } + function extension_timer_xfer() + { + document.vicidial_form.xfernumber.value = timer_action_destination; + mainxfer_send_redirect('XfeRBLIND',lastcustchannel,lastcustserverip); + } + function callmenu_timer_xfer() + { + API_selected_callmenu = timer_action_destination; + document.vicidial_form.xfernumber.value = timer_action_destination; + mainxfer_send_redirect('XfeRBLIND',lastcustchannel,lastcustserverip); + } + function ingroup_timer_xfer() + { + API_selected_xfergroup = timer_action_destination; + document.vicidial_form.xfernumber.value = timer_action_destination; + mainxfer_send_redirect('XfeRLOCAL',lastcustchannel,lastcustserverip); + } // ################################################################################ // Demostración message that customer has hungup the call before agent has @@ -8748,6 +9199,47 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } +// ################################################################################ +// clear api field + function Clear_API_Field(temp_field) + { + var xmlhttp=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 { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + TERRupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Clear_API_Field&format=text&user=" + user + "&pass=" + pass + "&comments=" + temp_field; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(TERRupdate_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + } + + // ################################################################################ // Log the user out of the system when they close their browser while logged in function BrowserCloseLogout() @@ -8793,56 +9285,61 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - var xmlhttp=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 { - xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); - } catch (e) { - try { - xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); - } catch (E) { - xmlhttp = false; - } - } - @end @*/ - if (!xmlhttp && typeof XMLHttpRequest!='undefined') + if (alt_dial_status_display==1) { - xmlhttp = new XMLHttpRequest(); + alert("You are in ALT dial mode, you must finish the lead before logging out.\n" + reselect_alt_dial); } - if (xmlhttp) - { - VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; - xmlhttp.open('POST', 'vdc_db_query.php'); - xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); - xmlhttp.send(VDlogout_query); - xmlhttp.onreadystatechange = function() - { - if (xmlhttp.readyState == 4 && xmlhttp.status == 200) - { - // alert(xmlhttp.responseText); - } + else + { + var xmlhttp=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 { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); } - delete xmlhttp; + if (xmlhttp) + { + VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(VDlogout_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + } + } + delete xmlhttp; + } + + hideDiv('MainPanel'); + showDiv('LogouTBox'); + var logout_content=''; + if (tempreason=='SHIFT') + {logout_content='Su cambio es de más o ha cambiado, se le ha cerrado la sesión de su período de sesiones

';} + + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "PINCHA AQUÍ PARA ENTRAR OTRA VEZ\n"; + + logout_stop_timeouts = 1; + + // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; } - - hideDiv('MainPanel'); - showDiv('LogouTBox'); - var logout_content=''; - if (tempreason=='SHIFT') - {logout_content='Su cambio es de más o ha cambiado, se le ha cerrado la sesión de su período de sesiones

';} - - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "PINCHA AQUÍ PARA ENTRAR OTRA VEZ\n"; - - logout_stop_timeouts = 1; - - // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass; - } } - } 0) @@ -9761,6 +10258,20 @@ function phone_number_format(formatphone) { } + +// ################################################################################ +// Recarga the FORM content + function FormContentsLoad() + { + var form_list_id = document.vicidial_form.list_id.value; + var form_entry_list_id = document.vicidial_form.entry_list_id.value; + if (form_entry_list_id.length > 2) + {form_list_id = form_entry_list_id} + document.getElementById('vcFormIFrame').src='./vdc_form_display.php?lead_id=' + document.vicidial_form.lead_id.value + '&list_id=' + form_list_id + '&user=' + user + '&pass=' + pass + '&campaign=' + campaign + '&server_ip=' + server_ip + '&session_id=' + '&uniqueid=' + document.vicidial_form.uniqueid.value + '&stage=DISPLAY'; + form_list_id = ''; + form_entry_list_id = ''; + } + // ################################################################################ // Move the Dispo frame out of the way and change the link to maximize function DispoMinimize() @@ -9963,9 +10474,10 @@ else // Finish the wrapup timer early function TimerActionRun(taskaction,taskdialalert) { + var next_action=0; if (taskaction == 'DiaLAlerT') { - document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert + "
"; + document.getElementById("TimerContentSpan").innerHTML = "DIAL ALERT:

" + taskdialalert.replace("\n","
") + "
"; showDiv('TimerSpan'); } @@ -10008,8 +10520,43 @@ else { DtMf_PreSet_e_DiaL(); } + if ( (timer_action == 'HANGUP') && (VD_live_customer_call==1) ) + { + hangup_timer_xfer(); + } + if ( (timer_action == 'EXTENSION') && (VD_live_customer_call==1) && (timer_action_destination.length > 0) ) + { + extension_timer_xfer(); + } + if ( (timer_action == 'CALLMENU') && (VD_live_customer_call==1) && (timer_action_destination.length > 0) ) + { + callmenu_timer_xfer(); + } + if ( (timer_action == 'IN_GROUP') && (VD_live_customer_call==1) && (timer_action_destination.length > 0) ) + { + ingroup_timer_xfer(); + } + if (timer_action_destination.length > 0) + { + var regNS = new RegExp("nextstep---","ig"); + if (timer_action_destination.match(regNS)) + { + next_action=1; + timer_action = 'NONE'; + var next_action_array=timer_action_destination.split("nextstep---"); + var next_action_details_array=next_action_array[1].split("--"); + timer_action = next_action_details_array[0]; + timer_action_seconds = parseInt(next_action_details_array[1]); + timer_action_seconds = (timer_action_seconds + VD_live_call_secondS); + timer_action_destination = next_action_details_array[2]; + timer_action_message = next_action_details_array[3]; + // alert("NEXT: " + timer_action + '|' + timer_action_message + '|' + timer_action_seconds + '|' + timer_action_destination + '|'); + } + } } - timer_action = 'NONE'; + + if (next_action < 1) + {timer_action = 'NONE';} } @@ -10041,6 +10588,8 @@ else hideDiv('MainPanel'); hideDiv('ScriptPanel'); hideDiv('ScriptRefresH'); + hideDiv('FormPanel'); + hideDiv('FormRefresH'); hideDiv('DispoSelectBox'); hideDiv('LogouTBox'); hideDiv('AgenTDisablEBoX'); @@ -10064,6 +10613,7 @@ else hideDiv('CalLLoGDisplaYBox'); hideDiv('LeaDInfOBox'); hideDiv('agentdirectlink'); + hideDiv('blind_monitor_notice_span'); if (is_webphone!='Y') {hideDiv('webphoneSpan');} if (view_calls_in_queue_launch != '1') @@ -10156,11 +10706,11 @@ else } if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) ) { - document.getElementById("ScriptContents").innerHTML = " "; + document.getElementById("ScriptContents").innerHTML = " "; } if ( (VtigeRLogiNScripT == 'NEW_WINDOW') && (VtigeREnableD > 0) ) { - var VtigeRall = VtigeRurl + "/index.php?module=Usuarios&action=Authenticate&return_module=Usuarios&return_action=Conexión&user_name=" + user + "&user_password=" + pass + "&login_theme=softed&login_language=en_us"; + var VtigeRall = VtigeRurl + "/index.php?module=Users&action=Authenticate&return_module=Users&return_action=Login&user_name=" + user + "&user_password=" + pass + "&login_theme=softed&login_language=es_es"; VtigeRwin =window.open(VtigeRall, web_form_target,'toolbar=1,location=1,directories=1,status=1,menubar=1,scrollbars=1,resizable=1,width=700,height=480'); @@ -10237,11 +10787,19 @@ else reselect_alt_dial = 0; } } + + // Submit custom form if it is custom_fields_enabled + if (custom_fields_enabled > 0) + { + // alert("IFRAME submitting!"); + vcFormIFrame.document.form_custom_fields.submit(); + } } - if (AgentDispoing==1) + if (AgentDispoing > 0) { WaitingForNextStep=1; check_for_conf_calls(session_id, '0'); + AgentDispoing++; } if (logout_stop_timeouts==1) {WaitingForNextStep=1;} if ( (custchannellive < -30) && (lastcustchannel.length > 3) && (no_empty_session_warnings < 1) ) {CustomerChanneLGone();} @@ -10350,6 +10908,33 @@ else // check_for_live_calls(); check_s = check_n.toString(); } + if ( (blind_monitoring_now > 0) && ( (blind_monitor_warning=='ALERT') || (blind_monitor_warning=='NOTICE') || (blind_monitor_warning=='AUDIO') || (blind_monitor_warning=='ALERT_NOTICE') || (blind_monitor_warning=='ALERT_AUDIO') || (blind_monitor_warning=='NOTICE_AUDIO') || (blind_monitor_warning=='ALL') ) ) + { + if ( (blind_monitor_warning=='NOTICE') || (blind_monitor_warning=='ALERT_NOTICE') || (blind_monitor_warning=='NOTICE_AUDIO') || (blind_monitor_warning=='ALL') ) + { + document.getElementById("blind_monitor_notice_span_contents").innerHTML = blind_monitor_message + "
"; + showDiv('blind_monitor_notice_span'); + } + if (blind_monitoring_now_trigger > 0) + { + if ( (blind_monitor_warning=='ALERT') || (blind_monitor_warning=='ALERT_NOTICE')|| (blind_monitor_warning=='ALERT_AUDIO') || (blind_monitor_warning=='ALL') ) + { + document.getElementById("blind_monitor_alert_span_contents").innerHTML = blind_monitor_message; + showDiv('blind_monitor_alert_span'); + } + if ( (blind_monitor_filename.length > 0) && ( (blind_monitor_warning=='AUDIO') || (blind_monitor_warning=='ALERT_AUDIO')|| (blind_monitor_warning=='NOTICE_AUDIO') || (blind_monitor_warning=='ALL') ) ) + { + basic_originate_call(blind_monitor_filename,'NO','YES',session_id,'YES','','1','0','1'); + } + blind_monitoring_now_trigger=0; + } + } + else + { + hideDiv('blind_monitor_notice_span'); + document.getElementById("blind_monitor_notice_span_contents").innerHTML = ''; + hideDiv('blind_monitor_alert_span'); + } if (wrapup_seconds > 0) { document.getElementById("WrapupTimer").innerHTML = (wrapup_seconds - wrapup_counter); @@ -10711,7 +11296,7 @@ else HKbutton_allowed = 0; showDiv('TransferMain'); document.getElementById("XferControl").innerHTML = "\"Transferencia"; - if (quick_transfer_button_enabled > 0) + if ( (quick_transfer_button_enabled > 0) && (quick_transfer_button_locked < 1) ) {document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA";} } else @@ -10723,13 +11308,13 @@ else { document.getElementById("XferControl").innerHTML = "\"Transferencia"; - if (quick_transfer_button == 'IN_GROUP') + if ( (quick_transfer_button == 'IN_GROUP') || (quick_transfer_button == 'LOCKED_IN_GROUP') ) { - document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; + document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; } - if ( (quick_transfer_button == 'PRESET_1') || (quick_transfer_button == 'PRESET_2') || (quick_transfer_button == 'PRESET_3') || (quick_transfer_button == 'PRESET_4') || (quick_transfer_button == 'PRESET_5') ) + if ( (quick_transfer_button == 'PRESET_1') || (quick_transfer_button == 'PRESET_2') || (quick_transfer_button == 'PRESET_3') || (quick_transfer_button == 'PRESET_4') || (quick_transfer_button == 'PRESET_5') || (quick_transfer_button == 'LOCKED_PRESET_1') || (quick_transfer_button == 'LOCKED_PRESET_2') || (quick_transfer_button == 'LOCKED_PRESET_3') || (quick_transfer_button == 'LOCKED_PRESET_4') || (quick_transfer_button == 'LOCKED_PRESET_5') ) { - document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; + document.getElementById("QuickXfer").innerHTML = "\"TRANSFERENCIA"; } } } @@ -10764,6 +11349,8 @@ else document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); hideDiv('ScriptRefresH'); + hideDiv('FormPanel'); + hideDiv('FormRefresH'); showDiv('MainPanel'); ShoWGenDerPulldown(); @@ -10810,6 +11397,8 @@ else { showDiv('ScriptPanel'); showDiv('ScriptRefresH'); + hideDiv('FormPanel'); + hideDiv('FormRefresH'); document.getElementById("MainTable").style.backgroundColor=""; document.getElementById("MaiNfooter").style.backgroundColor=""; panel_bgcolor=''; @@ -10818,6 +11407,18 @@ else HidEGenDerPulldown(); } + function FormPanelToFront() + { + showDiv('FormPanel'); + showDiv('FormRefresH'); + document.getElementById("MainTable").style.backgroundColor=""; + document.getElementById("MaiNfooter").style.backgroundColor=""; + panel_bgcolor=''; + document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + + HidEGenDerPulldown(); + } + function HidEGenDerPulldown() { var gIndex = 0; @@ -10848,14 +11449,14 @@ else
# LLAMADABACK DATE/TIMENÚMERONAME ESTADOCAMPAIGNLAST FECHA/HORA DE LA LLAMADA COMMENTS