LICENSE: AGPLv2 # # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution # - conf_exten_check.php: time sync and status updater, calls in queue # - vdc_script_display.php: displays script with variables # - vdc_form_display.php: display custom fields form # - vdc_email_display.php: display email interface # - vdc_chat_display.php: display chat interface # - agc_agent_manager_chat_interface.php: display internal chats # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished # 50628-1620 - Added some basic formatting and worked on process flow # 50628-1715 - Startup variables mapped to javascript variables # 50629-1303 - Added Login Closer in-groups selection box and vla update # 50629-1530 - Rough layout for customer info form section and button links # 50630-1453 - Rough Manual Dial/Hangup with customer info displayed # 50701-1450 - Added vicidial_log entries on dial and hangup # 50701-1634 - Added Logout function # 50705-1259 - Added call disposition functionality # 50705-1432 - Added lead info DB update function # 50705-1658 - Added web form functionality # 50706-1043 - Added call park and pickup functions # 50706-1234 - Added Start/Stop Recording functionality # 50706-1614 - Added conference channels display option # 50711-1333 - Removed call check redundancy and fixed a span bug # 50727-1424 - Added customer channel and participant present sensing/alerts # 50804-1057 - Added SendDTMF function and reconfigured the transfer span # 50804-1224 - Added Local and Internal Closer transfer functions # 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs # 50804-1808 - Added button images for left buttons # 50815-1151 - Added 3Way calling functions to Transfer-conf frame # 50815-1602 - Added images and buttons for xfer functions # 50816-1813 - Added basic autodial outbound call pickup functions # 50817-1113 - Fixes to auto_dialing call receipt # 50817-1234 - Added inbound call receipt capability # 50817-1541 - Added customer time display # 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option # 50818-1703 - Added pretty login section # 50825-1200 - Modified form field lengths, added double-click dispositions # 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER # 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug # 50903-0904 - Added preview-lead code for manual dialing # 50904-0016 - Added ability to hangup manual dials before pickup # 50906-1319 - Added override for filters on xfer calls, fixed login display bug # 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode # 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use # 50913-1212 - Added campaign_cid to 3rd party calls # 50923-1546 - Modified to work with language translation # 50926-1656 - Added campaign pull-down at login of active campaigns # 50928-1633 - Added manual dial alternate number dial option # 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs # 51004-1656 - Fixed recording filename bug and new Spanish translation # 51020-1103 - Added campaign-specific recording control abilities # 51020-1352 - Added Basic vicidial_agent_log framework # 51021-1050 - Fixed custtime display and disable Enter/Return keypresses # 51021-1718 - Allows for multi-line comments (changes \n to !N in database) # 51110-1432 - Fixed non-standard http port issue # 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial # 51118-1305 - Activate multi-line comments from $multi_line_comments var # 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view # 51121-1506 - Small PHP optimizations in many scripts and disabled globalize # 51129-1010 - Added ability to accept calls from other VICIDIAL servers # 51129-1254 - Fixed Hangups of other agents channels when customer hangs up # 51208-1732 - Created user-first login that looks for default phone info # 51219-1526 - Added variable framework for campaign and in-group scripts # 51221-1200 - Added SCRIPT tab, layout and functionality # 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup # 51222-1605 - Added VMail message blind transfer button to xfer-conf frame # 51229-1028 - Added checks on web_form_address to allow for var in the DB value # 60117-1312 - Added Transfer-conf frame toggle on button press # 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame # 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys # 60213-1210 - Added ability to sort routing of calls by user_level # 60214-0932 - Initial Callback calendar display framework # 60214-1407 - Added ability to minimize the dispo screen to see info below # 60215-1104 - Added ANYONE scheduled callbacks functionality # 60410-1116 - Added persistant pause after dispo option and change dispo text # - Added web form submit that opens new window with dispo on submit # - Added PREVIOUS CALLBACK in customer info to flag callbacks # - Added link to try to hangup the call again in the dispo screen # - Added link noone-in-session screen to call agent phone again # - Added link customer-hungup screen to go straight to dispo screen # 60410-1532 - Added agent status and campaign calls dialing display option # 60411-1547 - Add ability to set callback as USERONLY and some basic formatting # 60413-1752 - Add basic USERONLY callback frame and listings # 60414-1039 - Changed manual dial preview and alt dial checkboxes to spans # - Added beta-level USERONLY callback functionality # - Added beta-level manual dialing with lead insertion functionality # 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug # 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode # - Changed several permissions to database-defined # 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished # 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error # 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES # 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials # 60426-1058 - Added vicidial_user setting for default blended check for CLOSER # 60501-1008 - Added option to manual dial screen to manually lookup phone number # 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen # 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug # - Fixed recording filename display to not overrun 25 characters # 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo # 60608-1453 - Added CLOSER campaign allowable in-groups limitations # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC # 60619-1047 - Added variable filters to close security holes for login form # 60804-1710 - fixed scheduled CALLBK for other languages build # 60808-1145 - Added consultative transfers with customer data # 60808-2232 - Added campaign name to pulldown for login screen # 60809-1603 - Added option to locally transfer consult xfers # 60809-1732 - Added recheck of transferred channels before customer gone mesg # 60810-1011 - Fixed CXFER leave 3way call bugs # 60816-1602 - Added ALLCALLS recording delay option allcalls_delay # 60816-1716 - Fixed customer time display bug and client DST setting # 60821-1555 - Added option to omit phone_code on dialout of leads # 60821-1628 - Added ALLFORCE recording option # 60821-1643 - Added no_delete_sessions option to not delete sessions # 60822-0512 - Changed phone number fields to be maxlength of 12 # 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php # 60906-1152 - Added Previous CallBack info display span # 60906-1715 - Allow for Local phone extension conferences # 61004-1729 - Add ability to control volume per channel in "calls in this session" # 61122-1341 - Added vicidial_user_groups allowed_campaigns restrictions # 61122-1523 - Added more SCRIPT variables # 61128-2229 - Added vicidial_live_agents and vicidial_auto_calls manual dial entries # 61130-1617 - Added lead_id to MonitorConf for recording_log # 61221-1212 - Changed width to 760 to better fit 800x600 screens, widened SCRIPT # 70109-1128 - Fixed wrapup timer bug # 70109-1635 - Added option for HotKeys automatically dialing next number in manual mode # - Added option for alternate number dialing with hotkeys # 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns # 70118-1517 - Added vicidial_agent_log and vicidial_user_log logging of user_group # 70201-1249 - Added FAST DIAL option for manually dialing, added UTF8 compatible code # 70201-1703 - Fixed cursor bug for most text input fields # 70202-1453 - Added first portions of Agent Pause Codes # 70203-0108 - Finished Agent Pause Codes functionality # 70203-0930 - Added dialed_number to webform output # 70203-1010 - Added dialed_label to webform output # 70206-1201 - Fixed allow_closers bug # 70206-1332 - Added vicidial_recording_override users setting function # 70212-1252 - Fixed small issue with CXFER # 70213-1018 - Changed CXFER and AXFER to update customer information before transfer # 70214-1233 - Added queuemetrics_log_id field for server_id in queue_log # 70215-1240 - Added queuemetrics_log_id field for server_id in queue_log # 70222-1617 - Changed queue_log PAUSE/UNPAUSE to PAUSEALL/UNPAUSEALL # 70226-1252 - Added Mute/UnMute to agent screen # 70309-1035 - Allow amphersands and questions marks in comments to pass through # 70313-1052 - Allow pound signs(hash) in comments to pass through # 70316-1406 - Moved the MUTE button to be accessible during a transfer/conf # 70319-1446 - Added agent-deactive-display and disable customer info update functions # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen # 70322-1545 - Added sipsak display ability # 70510-1319 - Added onUnload force Logout # 70806-1530 - Added Presets Dial links above agent mute button # 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE # 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM # 71022-1427 - Added formatting of the customer phone number in the main status bar # 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions # 71101-1204 - Fixed bug in callback calendar with DST # 71116-0957 - Added campaign_weight and calls_today to the vla table insertion # 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login # 71122-0256 - Added auto-pause notification # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to # 71127-0408 - Added height and width settings for easier modification of screen size # 71129-2025 - restricted callbacks count and list to campaign only # 71223-0318 - changed logging of closer calls # 71226-1117 - added option to kick all calls from conference upon logout # 80109-1510 - added gender select list # 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused # 80317-2106 - added recording override options for inbound group calls # 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls # 80402-0121 - Fixes for manual dial transfers on some systems # 80407-2112 - Work on adding phone login load balancing across servers # 80416-0559 - Added ability to log computer_ip at login, set the $PhonESComPIP variable # 80428-0413 - UTF8 changes and testing # 80505-0054 - Added multi-phones load-balanced alias option # 80507-0932 - Fixed Script display bug (+ instead of space) # 80519-1425 - Added calls in queue display # 80523-1630 - Added Timeclock links # 80625-0047 - Added U option for gender, added date/phone display options # 80630-2210 - Added queue_log entries for Manual Dial # 80703-0139 - Added alter customer phone permissions # 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count # 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording # 80709-0358 - Added Default alt phone dial hard-code option # 80719-1147 - Changed recording and senddtmf conf prefix # 80815-1014 - Added manual dial list restriction option # 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) # 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls # 80909-1717 - Added support for campaign-specific DNC lists # 80915-1754 - Rewrote leave-3way functions for external calling # 81002-1908 - Fixed double-login bug in some conditions # 81007-0945 - Added three_way_call_cid option for outbound 3way calls # 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements # 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call # 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls # 81013-1644 - Fixed bug in leave 3way for manual dial fronters # 81015-0405 - Fixed bug related to hangups on 3way calls # 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available # 81020-1501 - Fixed bugs in queue_log logging # 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes # 81030-0403 - Added option to force Pause Codes on PAUSE # 81103-1427 - Added 3way call dial prefix # 81104-0140 - Added mysql error logging capability # 81104-1618 - Changed MySQL queries logging # 81106-0411 - Changedthe campaign login list behaviour # 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause # 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug # 81119-1811 - webform backslash fix # 81124-2213 - Fixes blind transfer bug # 81209-1617 - Added campaign web form target option and web form address variables # 81211-0422 - Fixed Manual dial agent_log bug # 90102-1402 - Added time sync check notification # 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only # 90120-1719 - Added API pause/resume and number dial functionality # 90126-2302 - Added Vtiger login option and agent alert option # 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup # 90202-0148 - Added option to disable BLENDED checkbox # 90209-0132 - Changed tab images and color scheme # 90303-1145 - Fixed rare manual dial live hangup bug # 90304-1333 - Added user-specific web vars option # 90305-0917 - Added prefix-choice and group-alias options for calls coming from API # 90307-1736 - Added Shift enforcement and manager override features # 90315-1009 - Changed revision for new trunk 2.2.0 # 90320-0309 - Fixed agent log bug when using wrapup time # 90323-1555 - Initial call to agent phone now has campaign callerIDnumber # 90408-0104 - Added Vtiger callback record ability # 90508-0727 - Changed to PHP long tags # 90511-1018 - Added restriction not allowing dialing into agent sessions from manual dial # 90519-0635 - Fixed manual dial status and logging bug # 90525-1012 - Fixed transfer issue of auto-received call after manual dial call # 90529-0741 - Added nophone agent phone login that will not show any empty session alerts # 90531-0635 - Added option to hide customer phone number # 90611-1422 - Fixed multiple logging bugs # 90628-0655 - Added Quick Transfer button and Preset Prepopulate option # 90705-1400 - Added Agent view sidebar option # 90706-1432 - Added Agent view transfer selection # 90709-1649 - Fixed alt-number transfers and dispo variable reset for webform # 90712-2304 - Added ADD-ALL group selection, view calls in queue, grab call from queue, requeue button # 90717-0640 - Added dialed_label and dialed_number to script variables # 90721-1114 - Added rank and owner as vicidial_list fields # 90726-2012 - Added allow_alerts option # 90729-0647 - Added agent_display_dialable_leads option # 90730-0145 - Fixed bugs in re-queue and INBOUND_MAN with blended selected # 90808-0117 - Fixed manual dial calls today bug, added last_state_change to vicidial_live_agents # 90812-0046 - Added no-delete-sessions = 1 as default, unused sessions cleared out at timeclock end of day # 90814-0829 - Moved mute button next to hotkeys button # 90827-0133 - Reworked Script display code # 90827-1549 - Added list script override option, original_phone_login variable # 90831-1456 - Added active_agent_login_server option for servers # 90908-1038 - Added DEAD call display # 90909-0921 - Fixed park issues # 90916-1144 - Added Second web form button, Answering Machine Message change # 90917-1325 - Fixed script loading bug with customer webform at the same time # 90920-2108 - Changed web forms to use window.open instead of traditional links(IE7 compatibility issue) # 90923-1310 - Rolled back last change # 90928-1955 - Added lead update before closer transfer # 90930-2243 - Added Territory selection functions # 91108-2118 - Added QM pause code entry # 91111-1433 - Fixed Gender pulldown list display for IE, remove links for recording channels in SHOW CHANNELS # 91123-1801 - Added code for outbound_autodial field # 91130-2021 - Added code for manager override of in-group selection # 91204-1638 - Added recording_filename and recording_id script variables and script refresh link # 91205-2055 - Added CONSULTATIVE checkbox in a redesigned Transfer-Conf frame # 91206-2020 - Fixed vicidial_agent_log logging bug on logout when not paused # 91211-1412 - Added User custom variables and CRM login popup # 91219-0657 - Set pause code automatically on ReQueue and INBOUND_MAN Dial-Next-Number # 91228-1339 - Added API "fields update" functions and "timer action" functions # 100103-1250 - Added 3 more conf-presets, list ID override presets and call start/dispo URLs # 100107-0108 - Added dynamic screen size based on login screen browser dimensions # 100109-0801 - Added ALTNUM alt number status, fixed alt number dialing from setting # 100109-1338 - Fixed Manual dial live call detection # 100116-0709 - Added presets to script and web form variables # 100123-0954 - changes to AGENTDIRECT selection span # 100131-2233 - Added functions to allow for a webphone loaded in a separate IFRAME # 100203-0639 - Fixed logging issues related to INBOUND_MAN dial method # 100207-1103 - Changed Pause Codes function to allow for multiple pause codes per pause period # 100220-1040 - Added Call Log View and Customer Info View and fixed HotKeys position # 100221-1107 - Added Custom CID compatibility # 100301-1330 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field # 100302-2145 - Added scheduled callbacks alert feature # 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 # 100803-2324 - Cleanup of URLDecode (issue #375) # 100811-0810 - Added webphone_url_override option from user Groups # 100813-0554 - Added Campaign presets # 100815-1015 - Added manual_dial_prefix campaign option # 100823-1605 - Added DID variables for webform and scripting # 100827-1436 - Added webphone dialpad options # 100902-0046 - Added initial loading screen # 100902-1349 - Added closecallid, xfercallid, agent_log_id as webform and script variables # 100908-0955 - Added customer 3way hangup # 100912-1304 - Changed Dispo screen phone number display to dialed_number # 100927-1616 - Added custom fields ability to web forms and optimized related code # 101004-1322 - Added "IVR Park Call" button in agent interface # 101006-1358 - Raised limits on several dynamic items from the database # 101008-0356 - Added manual_preview_dial and two new variables for recording filenames # 101012-1656 - Added scroll command at dispo submission to for scrolling to the top of the screen # 101024-1639 - Added parked call counter # 101108-0110 - Added ADDMEMBER option for queue_log # 101124-0436 - Added manual dial queue and manual dial call time check features # 101125-2151 - Changed CIDname for 3way calls # 101128-0102 - Added list webform override options # 101207-1621 - Added scroll to the top after in-group, pause code, etc... selections, and added focus blur to several functions # 101208-1210 - Fixed focus/blur coding to work after Dispo # 101216-1758 - Added the ability to hide fields if the label is set to ---HIDE--- in System Settings # 101227-1645 - Added dialplan off toggle options, and settings and code changes for top bar webphone # 110109-1205 - Added queuemetrics_loginout NONE option # 110112-1254 - Added options.php option for focus/blur/enter functions # 110129-1050 - Changed to XHTML compliant formatting, issue #444 # 110208-1202 - Made scheduled callbacks notice move when on script/form tabs # 110212-2206 - Added scheduled callback custom statuses compatibility # 110215-1412 - Added my_callback_option and per_call_notes options # 110218-1522 - Added agent_lead_search feature # 110221-1251 - Changed statuses display to keep track of non-selectable statuses # 110224-1713 - Added compatibility with QM phone environment logging, QM pause code last call logging and active server twin check # 110225-1231 - Changed scheduled callbacks list to allow clicking to see lead info without dialing, and separate dial link # 110303-2321 - Added notice of on-hook phone use, and ability to click 'ring' to call into session, minor queue_log fix # 110304-1623 - Added callback count notification defer options # 110310-0331 - Added auto-pause/resume functions in auto-dial mode for pre-call work # 110310-1627 - Changed most browser alerts to HTML alerts, other bug fixes # 110322-0923 - Allowed hiding of gender pulldown # 110413-1244 - Added ALT dialing from scheduled callback list, and other formatting changes # 110420-1211 - Added web_vars variable # 110428-1549 - Added use of manual_dial_cid setting # 110430-1126 - Added ability to use external_dial API function with lead_id and alt_dial options # 110430-1924 - Added post_phone_time_diff_alert campaign feature # 110506-1612 - Added custom_3way_button_transfer button feature # 110510-1637 - Added number validation to custom_3way_button_transfer function # 110526-1723 - Added webphone_auto_answer option # 110528-1033 - Added waiting_on_dispo manual dial check # 110531-2158 - Added callback_days_limit campaign feature # 110619-2005 - Added disable_dispo_ options # 110624-2311 - Added screen labels option and status display fields option # 110626-2234 - Added queuemetrics_pe_phone_append # 110707-1412 - Added last_inbound_call_time and finish compatibility # 110713-0048 - Allow for full hiding of the phone number field label # 110718-1159 - Added logging of skipped leads # 110719-0854 - Removed debug output and small display alignment changes # 110723-2308 - Complete hiding of phone numbers in logs when alter phone is set to HIDE # 110730-2240 - Added option to hide dispo statuses, only to be used with API # 110802-0122 - Added call_id variable # 110911-1604 - Added API logout function # 110916-1514 - Fixed dial timeout to check for dial_timeout setting and greater than 49 seconds # 110919-1603 - Added Phone login load balancing grouping options # 111015-2037 - Added contact search functions # 111018-1528 - Added more contact fields, added code to prevent API transfer duplicates # 111021-1623 - Fix for rare stuck vac issue with manual alt dial # 111024-1237 - Added callback_list_calltime option # 111114-0039 - Added scheduled callback and qm-dispo-code fields to API # 111202-1444 - Added grade-random next-agent-call options # 111227-1940 - Added Timer Action for Dx_DIAL_QUIET options # 120213-2029 - Changed consultative transfer with custom fields behavior for better data updating # 120223-2119 - Removed logging of good login passwords if webroot writable is enabled # 120308-1617 - Added compatibility for DAHDI phones using asterisk version for server > 1.4.21.2 # 120403-1204 - Fixed issue with MANUAL dial method hotkeys, added 1 second delay # 120420-1621 - Forked 2.4 to branches, changing trunk to 2.6 # 120427-1718 - Fixed 3-way logging issue # 120512-0849 - Added In-Group Manual Dial functions # 120518-1225 - Added transfer call to answering machine message with hotkey (LTMG or XFTAMM) # 120810-0056 - Added recording api function # 120819-1747 - Added vicidial_session_data logging for webphone api function # 120914-1357 - Added group_alias to transfer_conference function # 121025-2335 - Do not allow AGENTDIRECT transfers without a user defined # 121029-0122 - Added pause_after_next_call and owner_populate campaign options # 121114-1759 - Fixed manual dial lead preview script variable issue # 121114-1937 - Added INGROUP recording option # 121116-1407 - Added QC functionality # 121129-2149 - Corrected hotkeys activation conditions # 121130-0734 - Fixed call notes amphersand issue #612 # 121206-0634 - Added inbound lead search feature # 121222-2315 - Added inbound email features # 130220-1214 - Fixed issue with 3-way call dial timeout # 130328-0006 - Converted ereg to preg functions # 130328-0934 - Applied changes from Issue #655 # 130328-1017 - Added validation for agent manual dial permission on DIAL links # 130402-2250 - Added user_group variable in scripts, forms and webforms # 130412-1359 - Added SIP message for failed calls # 130417-1937 - Changed locked agent choose in-group/closer/territories to auto-close # 130508-2223 - Cleanup for other language builds # 130508-2307 - Branched 2.7, trunk becomes 2.8 # 130603-2209 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes # 130615-1125 - Added recording_id to dispo url # 130625-0841 - Added more user log data on login # 130705-1439 - Added optional encrypted passwords compatibility # 130718-0745 - Added recording_filename to dispo_call_url # 130802-1134 - Changed to PHP mysqli functions # 130822-0656 - Changed all require to require_once in agc directory for PHP backward compatibility # 130903-1920 - Added security check for browser window name, see launch.php for more information # 130925-2119 - Fixed span order issue # 131007-1348 - Added mrglock_ig_select_ct options.php setting # 131010-2149 - Added option to allow manual dial by lead_id # 131208-2331 - Added campaign options for max dead, dispo and pause time. Changed CB blink to CSS # 131209-1604 - Addded called_count logging # 131210-1354 - Fixed manual dial CID choice issue with AC-CID settings # 140107-2034 - Added webserver/url login logging # 140126-0741 - Added pause code API function # 140204-1230 - Added check for valid date in call log view # 140214-1851 - Added preview_dial_action API function # 140301-2059 - Added API functions options for SEARCH for phone within lead_id and Dial Next Number # 140302-1018 - Changes to allow for & and + in standard fields # 140312-2109 - Added CALLID as recording filename variable # 140403-1731 - Added recording filename API append option # 140418-0937 - Added max inbound calls feature # 140423-1728 - Added campaign options manual_dial_search_checkbox and hide_call_log_info # 140428-1514 - Added pause_type # 140429-2040 - Added called_count and call notes display option as script and form variables # 140519-1011 - Fixed calls in this session to not count monitoring channels # 140521-2147 - Added manual alt dial options and more agent login error messages # 140609-2246 - Fixed issue with webform2 button after manual alt-dial # 140612-2152 - branched 2.9 version, raised trunk to 2.10 # 140617-1041 - Fixed issue with non-latin, issue #773 # 140617-2015 - Added vicidial_users wrapup_seconds_override option # 140621-1557 - Added update_settings call to grab selected user and campaign settings more frequently # 140623-1710 - Added wrapup_bypass setting # 140626-0757 - Added wrapup_after_hotkey setting # 140630-0921 - Added the FSCREEN option to Wrapup message to allow for message only display # 140703-1658 - Several logging fixes, mostly related to manual dial calls # 140706-0932 - Added callback_time_24hour for callback setting screen # 140811-1219 - Changed to use QXZ function for echoing text # 140822-0900 - Fixed issue with phone alias login # 140902-0826 - Added callback_active_limit and callback_active_limit_override # 140918-1606 - Fixed manual dial pause warning issue # 141105-1153 - Fixed issue with AGENTDIRECT transfers to agents with IDs over 7 characters long # 141113-1431 - Added admin_test option to allow login on active_agent=N servers # 141116-1805 - Fixed issue #801 # 141118-1229 - Formatting changes for QXZ output # 141118-1439 - Added agent_email as webform and script variable # 141121-1005 - Added new QC and comments campaign options # 141124-1144 - Added new Callback Comments campaign option # 141124-2146 - Added show_previous_callback campaign option # 141124-2217 - Fix for issue #798 # 141124-2234 - Added clear_script campaign option # 141125-0100 - Added parked_hangup code # 141125-1235 - Fixed issue with lead info not being updated when Max Dead time is triggered # 141128-0848 - Code cleanup for QXZ functions # 141204-1211 - Added more error checking on login # 141207-1155 - Added pause_trigger to logout to force pause before running logout process # 141216-1859 - Added agent choose language option # 141222-2035 - Fix for issue #811 # 141223-2109 - Fix for hide_gender issue # 141227-1759 - Found missing phrase for QXZ # 141229-1429 - Changed single-quote QXZ arguments to double-quotes # 150101-1516 - Updated for 2015 # 150108-1725 - Added more validation for API transfer commands # 150111-1545 - Added manual_dial_search_filter campaign option(Issue #812) # 150114-2052 - Added list_name web url variable # 150117-1445 - Added NAME as status display variable # 150117-1524 - Changed Pause/Resume buttons to single button(Issue #814) # 150122-0629 - Fixed issue with double dispo warning, Fixed issue with alt-dial/preview-dial custom form reset # 150123-1505 - Fixed issue with manual dial hotkey usage and agent logs # 150129-0828 - Added confirmation if agent tries to leave the page without logging out, issue #821 # 150202-0829 - Reconfigured hotkeys and auto-manual-dial for less delay # 150203-1331 - Small changes to improve manual dial hotkey use # 150204-1911 - Changed Manual hotkey auto-manual-dial to a variable delay depending on dispo processing time # 150210-1225 - Added LOCK options for manual_dial_search_checkbox, fixed missing QXZ tags(issue #827) # 150212-0034 - Added case-sensitive user validation(issue #682) # 150218-1356 - Fixes for QXZ enclosed in single-quotes # 150220-1533 - Fix for leave page confirmation after logout and QXZ fixes # 150302-0950 - Release of 2.11 stable branch and raising trunk to 2.12 # 150309-0315 - Added custom agent login prompt option # 150405-1410 - Fixed issue with API dialing and preview # 150418-2206 - Fixed issue with manual dial with hotkeys in RATIO method, issue #836 # 150428-1735 - Added web form three # 150522-1254 - Fixed issue #859 # 150608-1126 - Added campaign option to disable the manual dial override field # 150609-1736 - Added status_display_ingroup option # 150609-1917 - Added list_description web url variable # 150610-0940 - Added customer_gone_seconds campaign option # 150701-1211 - Modified mysqli_error() to mysqli_connect_error() where appropriate # 150704-0005 - Changed disposubmit to be blocking before resume, Issue #863 # 150712-2045 - Changed dispo call url to operate through a separate AJAX process # 150723-1741 - Created method for logging agent button/link clicks # 150725-1744 - Added Agent Display Fields campaign option # 150727-0908 - Added default_language # 150808-1439 - Added compatibility for custom fields data option # 150909-0212 - Fixed MDlogEPOCH variable issue #882 # 150917-0926 - Added dynamic default field maxlengths based on DB schema # 150923-1952 - Added DID custum fields as web and form variables # 150928-1205 - Fixed issue with API transfers and dial_override flag # 151022-0004 - Added audio alert when email arrives, issue #899 # 151028-1458 - Added status groups statuses feature with min/max seconds qualifiers for statuses # 151119-1925 - Fixed issue with scheduled callbacks and status groups # 151125-0942 - Fixed manual call only logging bug # 151212-0922 - Added all chat functionality # 151218-1200 - Fixes for chat security and language translation # 151229-2240 - Fixed issue #907, script reload after canceling manual 3way call # 151229-2331 - Added campaign setting for manual_dial_timeout, Issue #903 # 151230-0911 - Fixed transfer of parked call logging issue #901 # 160101-1131 - Added code to handle routing initiated recordings # 160104-1237 - Added images for live chat and email, and dead chat # 160106-2215 - Deactivated several call action buttons while Email/Chat handling # 160306-1019 - Added more webphone options # 160326-0941 - Fixed issue #933, variables # 160326-1001 - Fixed issue #934, phone_login # 160331-2129 - Fixed missing start and dispo call url variables, issue #938 # 160414-0922 - Added default_phone_code system settings option # 160420-1342 - Fixed text link overlaps with other languages # 160428-1826 - Fixed user_authorization bug # 160706-1438 - Redesign for loading, login and logout screens. Added Screen Colors. Logging of browser width/height # 160731-1102 - Added option to automatically dial the next number after X seconds in a manual dial mode # 160901-1728 - Added last_local_call_time display field # 160915-0955 - Added ---READONLY--- option for most screen labels # 161019-0031 - Added ---REQUIRED--- option for most screen labels # 161029-0858 - Added option to park xfer channel # 161102-1121 - Fixed QM partition problem # 161106-2221 - Changed to screen colors for main tab logo, other small style changes # 161117-1532 - Changed default main screen logo background color to white(screen color standard row 5) # 161126-2152 - Release of 2.13 stable branch and raising trunk to 2.14 # 161217-0826 - Added debug logging of dead call trigger # 161222-0727 - Fixed issue with Scheduled Callbacks with tilde'~' in text fields # 161222-1111 - Added more debug logging of events # 170201-2215 - Fixes for pause-while-call-coming-in issues # 170207-1314 - Added user option api_only_user # 170217-1359 - Added dead_to_dispo campaign option # 170220-1306 - Added external_lead_id trigger for switch_lead API function # 170223-2122 - Fixed rare recording issue # 170301-0839 - Added functionality for required custom fields # 170303-1206 - Expanded required custom fields types # 170309-0705 - Small fix for INBOUND_MAN agent logging issue # 170309-1215 - Added agent_xfer_validation option # 170317-2342 - Fix for script tab ignore list script override # 170331-2255 - Assure that custom field form submitted after standard field submit # 170409-1601 - Added IP List validation code # 170411-1158 - Added called_count as a webform variable # 170416-1640 - Added ready_max_logout option # 170429-0851 - Added callback_display_days option # 170430-1005 - Added three_way_record_stop and hangup_xfer_record_start campaign options # 170513-1527 - Added debug logging of all alert boxes # 170531-0937 - Added Agent Events Push function # 170601-2017 - Added more agent events # 170609-1711 - Added 'commit' function to force immediate submission of Customer Information changes to database # 170629-1831 - Added some new agent_events entries # 170709-1116 - Added Xfer Hung Up notification # 170710-1802 - Added logging of clicks on webform buttons # 170725-2147 - Added counter(aec) to agent_events calls # 170808-1014 - Added more qualifiers for Hungup Xfer function to be triggered # 170816-2336 - Added ask post-call survey feature for in-group calls # 170912-1619 - Fix for no-hopper dnc dialing issue # 170913-1747 - Small change for two agent events # 170914-0708 - Fix for script tab issue # 170923-1336 - Small change to hangup customer process # 171011-1524 - Added webphone_layout options # 171026-0109 - Small change for email queue_log logging # 171115-0713 - Hide preview call if preview campaign option is disabled # 171124-1057 - Added max_inbound_calls_outcome options # 171124-1459 - Added manual_auto_next_options options # 171126-1140 - Added ability to use EMAILinbound_message script variable # 171130-0226 - Added agent_screen_time_display option # 171214-2018 - Added PREVIEW_ get_call_launch options # 171224-1244 - Added List default_xfer_group override # 180105-1543 - Small javascript fixes, and more debug logging, change to 2018 # 180126-0855 - Added more agent api pause debug output # 180204-2304 - Added API dial_ingroup option to external_dial # 180210-0001 - Added flag for WebRTC webphone compatibility in iframe # 180215-1105 - Changes for CID Groups functionality # 180216-1349 - Fix for callback alt dial isssue #1066 # 180217-0915 - Added pause_max_dispo, fix for issue #1030 # 180223-1150 - Fix for rare webform VAR url issue # 180224-1433 - Added LOGINvar variables, and options.php $INSERT_ variables # 180302-1704 - Fix for pause code issue # 180306-1717 - Added script_top_dispo feature # 180314-2222 - Fix for lead search screen hidden fields, issue #1079 # 180323-2228 - Added more logging for notices # 180327-1355 - Added code for LOCALFQDN conversion to browser-used server URL for webform and script iframes # 180405-0913 - Fix for API Hangup after dial timeout # 180410-1629 - Added Pause Code manager approval feature, Added switch_lead logging # 180421-0754 - Moved AGENT TIME link and Dialable Leads display to not overlap # 180425-2036 - Added INSERT_first_onload variable # 180506-2222 - Added SWITCH custom field type # 180512-2226 - Added support for users-max_hopper_calls feature # 180522-1921 - Added Routing Initiated Recording ability for manual dial calls # 180606-0024 - Fixed email transfers bugs, modified transfer-conf panel for same # 180610-2305 - Added dead_trigger_ features # 180727-2044 - Small fix for pause code issue # 180807-1703 - Added agent_logout_link credentials system setting # 180809-1649 - Added scheduled_callbacks_force_dial campaign feature # 180827-1224 - Added scheduled_callbacks_timezones_... features # 180924-0002 - Added three_way_volume_buttons campaign feature # 180926-1757 - Fix for rare webform URL issue # 181003-1737 - Added external_web_socket_url option # 181005-1909 - Added SYSTEM manual_dial_filter option # 190108-0833 - Added manual_dial_validation option, updated dates for 2019 # 190222-1316 - Added recent session per-call logging # 190310-2017 - Added mute_recordings system/campaign/user option # 190330-0815 - Added logged_in_refresh_link option # 190406-1615 - Added agent next_dial_my_callbacks override # 190529-2144 - Fix for shift enforcement dispo-call-url issue # 190617-1116 - Fix for script variable issue # 190627-2134 - Added new options for campaign agent_screen_time_display feature # 190723-1655 - Fix for script tab custom fields # 190730-0925 - Added campaign SIP Actions processing # 190901-0956 - Added cid_choice option to API transfer_conference function # 190902-0914 - Fix for PHP 7.2 # 190925-1346 - Changes for more SIP Event Action features # 191018-0904 - Added User Inbound Filtered features # 191101-1150 - Added VM Message Groups features, second script tab # 191104-1759 - Fixes for translations # 191105-0824 - Fix for issue #1177 # 191107-0935 - Added $webphone_call_seconds option # 191107-1011 - Fix for issue #1180, hide phone number in callback list # 191111-0837 - Added LTMGAD/XAMMAD Hotkey options # 191111-1619 - Added user additional status groups # 191114-0949 - Added options for enable_first_webform and recording_buttons # 191227-1227 - Fix for translation phrases gathering process # 200123-1554 - PHP7 fix for array # 200310-1116 - Added manual_dial_cid AGENT_PHONE_OVERRIDE option # 200403-1539 - Added Manual Dial API outbound_cid function # 200406-0949 - Fix for manual dial box with no phone number, Issue #1188 # 200406-1205 - Fix for gender custom field population, Issue #1205 # 200407-1822 - Added Agent Browser Call Alert Sounds # 200408-0952 - Small fix for Issue #1188, allow dial override # 200425-0948 - Added 2nd option for agentcall_manual to disable FAST DIAL # 200512-1005 - Added hide_relogin_fields URL variable feature # 200515-1352 - Disable volume controls for Asterisk 13 servers, added options.php override setting(ast13_volume_override) # 200524-1021 - Fix for agentchannel not populating while volumecontrol_active disabled # 200528-2239 - Added three_way_record_stop_exception campaign setting # 200909-0952 - Fix for script_top_dispo issue #1228 # 200912-1426 - Added more get_call_launch PREVIEW_ options # 200913-0817 - Added UNSELECTED options for campaign alt_number_dialing # 200922-0948 - Added manual_dial_phone_strip system setting feature # 201004-1112 - Added pause_max_exceptions campaign feature # 201010-2223 - Added force change password feature # 201026-0143 - Fix for pause_max_exceptions issue # 201107-2236 - Change for parked call logging # 201112-1110 - Added better QueueMetrics misconfiguration error handling # 201117-0818 - Changes for better compatibility with non-latin data input # 201123-1436 - Added Daily call count limit features # 201201-2015 - Added transfer_button_launch feature # 210222-0819 - Fixes for manual dial agent-state issues and a translation issue # 210312-1520 - Force clearing of webphone panel upon logout # 210315-2102 - Added CALLBACK manual dial filter option, Issue #1139 # 210317-1207 - Fixes for better consistency in password change process, Issue #1261 # 210318-0236 - Added agent browser visibility logging and Agent Hidden Browser Sounds # 210319-1500 - Small change for agent screen visibility logging on logout # 210320-2348 - Added additional update_fields options: scriptreload,script2reload # 210322-1301 - Fixed issue with agent_hidden_sound # 210324-1604 - Added leave_3way_start_recording campaign options # 210327-2058 - Added system setting(agent_screen_timer) for selection of JavaScript timer: setTimeout or EventSource # 210330-2254 - Fixed issues with dashes as custom fields values throwing off delimiters # 210417-1109 - Added calls_waiting_vl_ campaign options # 210421-2110 - Added more screen labels # 210606-0955 - Cleanup of debugbottomspan, testing of TILTX features # 210609-0942 - Added in_man_dial_next_ready_seconds campaign options # 210615-0959 - Default security fix, CVE-2021-28854 # 210616-1852 - Added optional CORS support, see options.php for details # 210623-0912 - Fix for Leave 3-Way Start Recording issue # 210623-0930 - Fix for WebForm 3 after API update fields issue # 210702-0945 - Added transfer_no_dispo campaign setting # 210705-0949 - Fixes for a couple of small issues(script two, manual dial ready timer) # 210705-1038 - Added User override for campaign manual_dial_filter setting # 210705-1626 - Added user_pass_webform and phone_login_webform options.php settings # 210706-0114 - Added display of Call Time Holidays to the Scheduled Callbacks calendar # 210715-1215 - Added 24-Hour Call Count Limit features # 210719-0907 - Added new state override options for 24-Hour Call Count Limits # 210720-0850 - Fixes for inconsistent hangup_xfer_record_start behavior # 210913-0831 - Fix for alternate number auto-dial logging issues # 211223-0824 - Fix for API hangup post-call survey issue #1338 # 211223-0906 - Fix for API transfer if AGENTDIRECT selected, issue #1330 # 220128-0030 - Added more logging of dial alerts, force PauseCode MDSKIP when skipping previewed lead # 220212-0813 - Added pause_max_url triggering # 220217-1938 - Added agent_hide_hangup campaign feature # 220219-0133 - Added allow_web_debug system setting # 220303-2018 - Changes to some input variable filters # 220309-2215 - Fix for issue with pausing when calling agent phone again while already paused # 220310-0935 - Added more time-sync detailed logging # 220506-0902 - Added ig_xfer_list_sort campaign setting # 220510-1625 - Added script_tab_frame_size campaign setting # 220518-2209 - Small fix for encrypted auth # 220524-1846 - Fix for rare Dead audio trigger and blind monitor trigger issue #1361 # 220623-0911 - Added max_logged_in_agents campaign setting and list dial_prefix override # 220725-0839 - Fix for rare Agent Pause Max issue with previewed manual dial calls that don't answer # 220901-0853 - Added user_group_script campaign user_group_script option # 220901-1330 - Fix for issues with manager validation where manager has a long password # 220908-0819 - Small change for user_group_script override # 220916-0906 - Added INSERT_before_body_close options.php setting, Issue #1375 # 220922-1032 - Fix for loading internal chat while agent screen is still loading # 221012-1723 - Fix for webform URLs updates with correct recording variables # 221020-1651 - Added login_kickall system setting # 221021-1022 - Added webphone_settings phones option # 221112-1638 - Fix for dispo timer issue #1387 # 221116-1059 - Fix for long in-group dialstring extensions # 221116-2159 - Fix for recording buttons ALLFORCE issue #1389 # 221206-1520 - Added login form multi-submit prevention ($login_submit_once), Added dialRegExten_enabled webphone option # 230118-0947 - Added agent_hangup_route features # 230131-0826 - Added filtering of 3-way number to dial to remove non-diable characters # 230220-1802 - Fix for In-Group manual dial issue # 230304-0806 - Fix for AgentHangupCallRoute on ringing calls # 230306-1335 - Added 20Hz_tone browser sound, Issue #1448 # 230306-2034 - Added setTimeoutAudioLoop agent_screen_timer option, Issue #1448 # 230407-1839 - Fix for input variable filter issue # 230412-1018 - Added code for send_notification API function # 230418-1425 - Added vicidial_user_dial_log logging # 230420-2015 - Added latency calculation and logging, Issue #1457 # 230424-1754 - Changed phone login to readonly when password is forced to change # 230513-2010 - Fix for manual dial call error handling # 230518-0912 - Added in-group and campaign custom fields 1-5, for script/webform/dispo-call-url use, chat fixes # 230523-0826 - Added User inbound_credits feature # 230615-0842 - Added dead_stop_recording feature # 230810-1652 - Added force_per_call_notes campaign setting # 230927-2036 - Added agent_search_ingroup_list campaign and agent_search_list ingroup options # 231108-0820 - Added several fields to update_settings related to manual dial calls # 231109-0827 - Added 2FA for agent screen logins # 231115-1618 - Added default_consultative options.php setting # 231129-0952 - Added phone number daily call limits # 231129-1359 - Fix for Dial-In-Group user-group issue #1493 # 231129-1540 - Added refresh_panel agent API function # 240214-0400 - Added state_descriptions banners # 240220-0245 - Added daily_limit for user/in-group parameter # 240221-0317 - Small changes for state_descriptions Banner # 240322-0034 - Added input filtering # 240409-2053 - Fix for Dead Trigger issue # 240415-1852 - Added script_tab_height campaign option # 240416-1750 - Fix for HotKey issue #1518 # 240420-2228 - ConfBridge code added # 240429-2237 - Added PARK_XFER|GRAB_XFER options for park_call API function # 240624-1357 - Added SWAP_PARK_CUSTOMER|SWAP_PARK_XFER|HANGUP_XFER_GRAB_CUSTOMER options for park_call API function # 240627-1937 - Added leave_3way_stop_recording campaign option # 240630-0920 - Fix for Group Alias issue #1515 # 240830-1112 - Added campaign manual_minimum_... settings # 250207-1821 - Fix for JavaScript error if chat disabled # 250326-2032 - Added agent_hide_dial_fail system_setting # 250806-0859 - Added manual_dial_lead_id 'ONLY' option and user override setting # 250808-1322 - Added agent_man_dial_filter & agent_3way_dial_filter system settings # 250916-2055 - Added stereo recording features # 250924-0953 - Added Talk Seconds URLs features # 251002-1353 - Added call_count_limit_restrict campaign option # 251020-0849 - Added code for recording_dtmf_muting, fix for Stereo Call Recording # 251124-0936 - Added lead status display for callbacks list # 260106-1418 - Fixes for PHP8 # $version = '2.14-720c'; $build = '260106-1418'; $php_script = 'vicidial.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=108; $one_mysql_log=0; $DB=0; $conf_table = "vicidial_conferences"; require_once("dbconnect_mysqli.php"); require_once("functions.php"); if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["JS_browser_width"])) {$JS_browser_width=$_GET["JS_browser_width"];} elseif (isset($_POST["JS_browser_width"])) {$JS_browser_width=$_POST["JS_browser_width"];} if (isset($_GET["JS_browser_height"])) {$JS_browser_height=$_GET["JS_browser_height"];} elseif (isset($_POST["JS_browser_height"])) {$JS_browser_height=$_POST["JS_browser_height"];} if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} if (isset($_GET["VD_language"])) {$VD_language=$_GET["VD_language"];} elseif (isset($_POST["VD_language"])) {$VD_language=$_POST["VD_language"];} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} if (isset($_GET["admin_test"])) {$admin_test=$_GET["admin_test"];} elseif (isset($_POST["admin_test"])) {$admin_test=$_POST["admin_test"];} if (isset($_GET["LOGINvarONE"])) {$LOGINvarONE=$_GET["LOGINvarONE"];} elseif (isset($_POST["LOGINvarONE"])) {$LOGINvarONE=$_POST["LOGINvarONE"];} if (isset($_GET["LOGINvarTWO"])) {$LOGINvarTWO=$_GET["LOGINvarTWO"];} elseif (isset($_POST["LOGINvarTWO"])) {$LOGINvarTWO=$_POST["LOGINvarTWO"];} if (isset($_GET["LOGINvarTHREE"])) {$LOGINvarTHREE=$_GET["LOGINvarTHREE"];} elseif (isset($_POST["LOGINvarTHREE"])) {$LOGINvarTHREE=$_POST["LOGINvarTHREE"];} if (isset($_GET["LOGINvarFOUR"])) {$LOGINvarFOUR=$_GET["LOGINvarFOUR"];} elseif (isset($_POST["LOGINvarFOUR"])) {$LOGINvarFOUR=$_POST["LOGINvarFOUR"];} if (isset($_GET["LOGINvarFIVE"])) {$LOGINvarFIVE=$_GET["LOGINvarFIVE"];} elseif (isset($_POST["LOGINvarFIVE"])) {$LOGINvarFIVE=$_POST["LOGINvarFIVE"];} if (isset($_GET["hide_relogin_fields"])) {$hide_relogin_fields=$_GET["hide_relogin_fields"];} elseif (isset($_POST["hide_relogin_fields"])) {$hide_relogin_fields=$_POST["hide_relogin_fields"];} if (isset($_GET["set_pass"])) {$set_pass=$_GET["set_pass"];} elseif (isset($_POST["set_pass"])) {$set_pass=$_POST["set_pass"];} if (isset($_GET["new_pass1"])) {$new_pass1=$_GET["new_pass1"];} elseif (isset($_POST["new_pass1"])) {$new_pass1=$_POST["new_pass1"];} if (isset($_GET["new_pass2"])) {$new_pass2=$_GET["new_pass2"];} elseif (isset($_POST["new_pass2"])) {$new_pass2=$_POST["new_pass2"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} if (isset($_GET["rank"])) {$rank=$_GET["rank"];} elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];} if (isset($_GET["auth_entry"])) {$auth_entry=$_GET["auth_entry"];} elseif (isset($_POST["auth_entry"])) {$auth_entry=$_POST["auth_entry"];} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} } if (!isset($phone_pass)) { if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} } if (isset($VD_campaign)) { $VD_campaign = mb_strtoupper($VD_campaign,'utf-8'); $VD_campaign = preg_replace("/\s/i",'',$VD_campaign); } if (!isset($flag_channels)) { $flag_channels=0; $flag_string=''; } $DB=preg_replace("/[^0-9a-z]/","",$DB); $VD_login = preg_replace('/[^-_0-9\p{L}]/u','',$VD_login); $stage = preg_replace('/[^-_0-9\p{L}]/u','',$stage); $rank = preg_replace('/[^-_0-9\p{L}]/u','',$rank); $auth_entry = preg_replace('/[^-_0-9\p{L}]/u','',$auth_entry); $forever_stop=0; $isdst = date("I"); $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); $NOW_DATE = date("Y-m-d"); $tsNOW_TIME = date("YmdHis"); $FILE_TIME = date("Ymd-His"); $loginDATE = date("Ymd"); $CIDdate = date("ymdHis"); $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); $past_month_date = date("Y-m-d H:i:s",$month_old); $minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y")); $past_minutes_date = date("Y-m-d H:i:s",$minutes_old); $JS_date = $StarTtimE."000"; # milliseconds since epoch or "16,3,31,8,56,1,0" year,month,day,hour,minute,second,millisecond $webphone_width = 460; $webphone_height = 500; $VUselected_language = ''; $session_name=''; $server_ip=''; $random = (rand(1000000, 9999999) + 10000000); ############################################# ##### START SYSTEM_SETTINGS AND USER LANGUAGE 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,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,agent_screen_colors,manual_auto_next,agent_xfer_park_3way,admin_web_directory,agent_script,agent_push_events,agent_push_url,agent_logout_link,agentonly_callback_campaign_lock,manual_dial_validation,mute_recordings,enable_second_script,enable_first_webform,recording_buttons,outbound_cid_any,browser_call_alerts,manual_dial_phone_strip,require_password_length,pass_hash_enabled,agent_hidden_sound_seconds,agent_hidden_sound,agent_hidden_sound_volume,agent_screen_timer,agent_hide_hangup,allow_web_debug,max_logged_in_agents,login_kickall,agent_notifications,inbound_credits,two_factor_auth_agent_hours,two_factor_container,sip_event_logging,stereo_recording,agent_hide_dial_fail,agent_man_dial_filter,agent_3way_dial_filter,recording_dtmf_detection,recording_dtmf_muting FROM system_settings;"; $rslt=mysql_to_mysqli($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";} $qm_conf_ct = mysqli_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysqli_fetch_row($rslt); $non_latin = $row[0]; $vdc_header_date_format = $row[1]; $vdc_customer_date_format = $row[2]; $vdc_header_phone_format = $row[3]; $WeBRooTWritablE = $row[4]; $timeclock_end_of_day = $row[5]; $vtiger_url = $row[6]; $enable_vtiger_integration = $row[7]; $outbound_autodial_active = $row[8]; $enable_second_webform = $row[9]; $user_territories_active = $row[10]; $static_agent_url = $row[11]; $custom_fields_enabled = $row[12]; $SSpllb_grouping_limit = $row[13]; $qc_enabled = $row[14]; $email_enabled = $row[15]; $callback_time_24hour = $row[16]; $SSenable_languages = $row[17]; $SSlanguage_method = $row[18]; $meetme_enter_login_filename = $row[19]; $meetme_enter_leave3way_filename = $row[20]; $enable_third_webform = $row[21]; $default_language = $row[22]; $active_modules = $row[23]; $chat_enabled = $row[24]; $chat_URL = $row[25]; $default_phone_code = $row[26]; $agent_screen_colors = $row[27]; $SSmanual_auto_next = $row[28]; $SSagent_xfer_park_3way = $row[29]; $admin_web_directory = $row[30]; $SSagent_script = $row[31]; $agent_push_events = $row[32]; $agent_push_url = $row[33]; $agent_logout_link = $row[34]; $agentonly_callback_campaign_lock = $row[35]; $SSmanual_dial_validation = $row[36]; $SSmute_recordings = $row[37]; $SSenable_second_script = $row[38]; $SSenable_first_webform = $row[39]; $SSrecording_buttons = $row[40]; $SSoutbound_cid_any = $row[41]; $SSbrowser_call_alerts = $row[42]; $SSmanual_dial_phone_strip = $row[43]; $SSrequire_password_length = $row[44]; $SSpass_hash_enabled = $row[45]; $SSagent_hidden_sound_seconds = $row[46]; $SSagent_hidden_sound = $row[47]; $SSagent_hidden_sound_volume = $row[48]; $SSagent_screen_timer = $row[49]; $SSagent_hide_hangup = $row[50]; $SSallow_web_debug = $row[51]; $SSmax_logged_in_agents = $row[52]; $SSlogin_kickall = $row[53]; $SSagent_notifications = $row[54]; $SSinbound_credits = $row[55]; $SStwo_factor_auth_hours = $row[56]; $SStwo_factor_container = $row[57]; $SSsip_event_logging = $row[58]; $SSstereo_recording = $row[59]; $SSagent_hide_dial_fail = $row[60]; $SSagent_man_dial_filter = $row[61]; $SSagent_3way_dial_filter = $row[62]; $SSrecording_dtmf_detection = $row[63]; $SSrecording_dtmf_muting = $row[64]; if ( ($SSagent_hidden_sound == '---NONE---') or ($SSagent_hidden_sound == '') ) {$SSagent_hidden_sound_seconds=0;} } else { echo _QXZ("ERROR: System Settings missing")."\n"; exit; } if ($SSallow_web_debug < 1) {$DB=0;} $stmt="SELECT user,selected_language,force_change_password from vicidial_users where user='$VD_login';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01081',$VD_login,$server_ip,$session_name,$one_mysql_log);} $sl_ct = mysqli_num_rows($rslt); if ($sl_ct > 0) { $row=mysqli_fetch_row($rslt); $VUuser = $row[0]; $VUselected_language = $row[1]; $VUforce_change_password = $row[2]; } ##### END SETTINGS LOOKUP ##### ########################################### $VD_login=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$VD_login); $VD_pass=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$VD_pass); $VD_language = preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$VD_language); $set_pass=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$set_pass); $new_pass1=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$new_pass1); $new_pass2=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$new_pass2); $JS_browser_width=preg_replace("/[^0-9a-z]/","",$JS_browser_width); $JS_browser_height=preg_replace("/[^0-9a-z]/","",$JS_browser_height); $relogin=preg_replace("/[^0-9a-zA-Z]/","",$relogin); $MGR_override=preg_replace("/[^0-9a-zA-Z]/","",$MGR_override); if ($non_latin < 1) { $VD_login=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_login); $VD_pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$VD_pass); $new_pass1=preg_replace("/[^-_0-9a-zA-Z]/","",$new_pass1); $new_pass2=preg_replace("/[^-_0-9a-zA-Z]/","",$new_pass2); $phone_login=preg_replace("/[^\,0-9a-zA-Z]/","",$phone_login); $phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass); $VD_campaign = preg_replace("/[^-_0-9a-zA-Z]/","",$VD_campaign); $admin_test = preg_replace("/[^0-9a-zA-Z]/","",$admin_test); $LOGINvarONE=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarONE); $LOGINvarTWO=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarTWO); $LOGINvarTHREE=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarTHREE); $LOGINvarFOUR=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarFOUR); $LOGINvarFIVE=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarFIVE); $hide_relogin_fields=preg_replace("/[^-_0-9a-zA-Z]/","",$hide_relogin_fields); } else { $VD_login = preg_replace('/[^-_0-9\p{L}]/u','',$VD_login); $VD_pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$VD_pass); $new_pass1=preg_replace("/[^-_0-9\p{L}]/u","",$new_pass1); $new_pass2=preg_replace("/[^-_0-9\p{L}]/u","",$new_pass2); $phone_login=preg_replace("/[^\,0-9\p{L}]/u","",$phone_login); $phone_pass=preg_replace("/[^-_0-9\p{L}]/u","",$phone_pass); $VD_campaign = preg_replace("/[^-_0-9\p{L}]/u","",$VD_campaign); $admin_test = preg_replace("/[^0-9\p{L}]/u","",$admin_test); $LOGINvarONE=preg_replace("/[^-_0-9\p{L}]/u","",$LOGINvarONE); $LOGINvarTWO=preg_replace("/[^-_0-9\p{L}]/u","",$LOGINvarTWO); $LOGINvarTHREE=preg_replace("/[^-_0-9\p{L}]/u","",$LOGINvarTHREE); $LOGINvarFOUR=preg_replace("/[^-_0-9\p{L}]/u","",$LOGINvarFOUR); $LOGINvarFIVE=preg_replace("/[^-_0-9\p{L}]/u","",$LOGINvarFIVE); $hide_relogin_fields=preg_replace("/[^-_0-9\p{L}]/u","",$hide_relogin_fields); } if ($force_logout) { echo _QXZ("You have now logged out. Thank you")."\n"; exit; } ##### DEFINABLE SETTINGS AND OPTIONS ########################################### # set defaults for hard-coded variables $conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording $dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently $HKuser_level = '1'; # minimum vicidial user_level for HotKeys $campaign_login_list = '1'; # show drop-down list of campaigns at login $manual_dial_preview = '1'; # allow preview lead option when manual dial $multi_line_comments = '1'; # set to 1 to allow multi-line comment box $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login $view_scripts = '1'; # set to 1 to show the SCRIPTS tab $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo $callholdstatus = '1'; # set to 1 to show calls on hold count $agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count $campagentstatctmax = '3'; # Number of seconds for campaign call and agent stats $show_campname_pulldown = '1'; # set to 1 to show campaign name on login pulldown $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server $clientDST = '1'; # set to 1 to check for DST on server for agent time $no_delete_sessions = '1'; # set to 1 to not delete sessions at logout $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels $ast13_volume_override = '0'; # set to 1 to allow agent to use volume controls even on Asterisk 13 servers $PreseT_DiaL_LinKs = '0'; # set to 1 to show a DIAL link for Dial Presets $LogiNAJAX = '1'; # set to 1 to do lookups on campaigns for login $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" $hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Hangup Customer $LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout $PhonESComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login $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 on the agent login screen $conf_check_attempts = '3'; # number of attempts to try before loosing webserver connection, for bad network setups $focus_blur_enabled = '0'; # set to 1 to enable the focus/blur enter key blocking(some IE instances have issues) $consult_custom_delay = '2'; # number of seconds to delay consultative transfers when customfields are active $mrglock_ig_select_ct = '4'; # number of seconds to leave in-group select screen open if agent select is disabled $link_to_grey_version = '0'; # show link to old grey version of agent screen at login screen, next to timeclock link $no_empty_session_warnings=0; # set to 1 to disable empty session warnings on agent screen $logged_in_refresh_link = '0'; # set to 1 to allow clickable "Logged in as..." link at top to force Javascript refresh $webphone_call_seconds = '0'; # set to 1 or higher to have the agent phone(if set to webphone) called X seconds after login $user_pass_webform = '0'; # set to 1 or 2 to return to default of including the 'user'(1) and 'pass'(2) by default in webform URLs $phone_login_webform = '0'; # set to 1 or 2 to return to default of including the 'phone_login'(1) and 'phone_pass'(2) by default in webform URLs $login_submit_once = '1'; # set to 0 to remove the "disable the login submit button after submitting" feature $default_consultative = '0'; # set the CONSULTATIVE checkbox on the transfer panel be checked by default $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen, FOR DEBUG ONLY $stretch_dimensions = '1'; # sets the vicidial screen to the size of the browser window $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 $webphone_width = 460; # set the webphone frame width $webphone_height = 500; # set the webphone frame height $webphone_pad = 0; # set the table cellpadding for the webphone $webphone_location = 'right'; # set the location on the agent screen 'right' or 'bar' $banner_height = 15; # state description banner $MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 $SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 $FORM_COLOR = '#EFEFEF'; $SIDEBAR_COLOR = '#F6F6F6'; $window_validation = 0; # set to 1 to disallow direct logins to vicidial.php $win_valid_name = 'subwindow_launch'; # only window name to allow if validation enabled $INSERT_head_script = ''; # inserted right above the '; echo "\n"; echo "\n"; if ($campaign_login_list > 0) { $camp_form_code = "\n"; echo "\n"; echo "\n"; } } ### code for manager override of shift restrictions if ($MGR_override > 0) { if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} $MGR_login = preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$MGR_login); $MGR_pass = preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$MGR_pass); $MGR_auth=0; $auth_message = user_authorization($MGR_login,$MGR_pass,'MGR',0,0,0,0,'vicidial_mgr_ovrd'); if (preg_match("/^GOOD/",$auth_message)) {$MGR_auth=1;} if($MGR_auth>0) { $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} echo "\n"; ### Add a record to the vicidial_admin_log $SQL_log = "$stmt|"; $SQL_log = preg_replace('/;/','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$MGR_login', ip_address='$ip', event_section='AGENT', event_type='OVERRIDE', record_id='$VD_login', event_code='MANAGER OVERRIDE OF AGENT SHIFT ENFORCEMENT', event_sql=\"$SQL_log\", event_notes='user: $VD_login';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01060',$VD_login,$server_ip,$session_name,$one_mysql_log);} } } $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysqli_num_rows($rslt); $o=0; while ($camps_to_print > $o) { $rowx=mysqli_fetch_row($rslt); if ($show_campname_pulldown) {$campname = " - $rowx[1]";} else {$campname = '';} if ($VD_campaign) { if ( (preg_match("/$VD_campaign/i",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) {$camp_form_code .= "\n";} else { if (!preg_match('/login_allowable_campaigns/',$camp_form_code)) {$camp_form_code .= "\n";} } } else { if (!preg_match('/login_allowable_campaigns/',$camp_form_code)) {$camp_form_code .= "\n";} } $o++; } $camp_form_code .= "\n"; } else { $camp_form_code = "\n"; } if ($LogiNAJAX > 0) { ?> \n"; $LoginLoadingBox .= "
\n"._QXZ("Logging in")."...\n"; $LoginLoadingBox .= "

\n"; $LoginLoadingBox .= "\""._QXZ("Loading...")."\"\n\n"; } else { $LOGINformSUBtrigger=''; $LoginLoadingBox=''; ?> // --> 0) {$grey_link = " | "._QXZ("Old Agent Screen")."";} if ($relogin == 'YES') { echo ""._QXZ("Agent web client: Re-Login")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."$grey_link
\n";} echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; if (preg_match("/^YES$|^READONLY_LOGIN$|^READONLY_LOGINPHONE$/",$hide_relogin_fields)) { echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } if (preg_match("/^READONLY_PHONE$/",$hide_relogin_fields)) { echo "\n"; # RESET, as this is one-time echo "\n"; echo "\n"; } echo "


"; echo ""; echo ""; echo "\n"; echo "\n"; if (preg_match("/^READONLY_PHONE$/",$hide_relogin_fields)) { echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; } if (preg_match("/^READONLY_LOGIN$/",$hide_relogin_fields)) { echo ""; echo "\n"; } if (preg_match("/^READONLY_LOGINPHONE$/",$hide_relogin_fields)) { echo ""; echo "\n"; echo ""; echo "\n"; } if (!preg_match("/^YES$|^READONLY_LOGIN$|^READONLY_PHONE$|^READONLY_LOGINPHONE$/",$hide_relogin_fields)) { echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; } echo ""; echo "\n"; if ($login_submit_once > 0) {echo "\n"; echo "\n"; echo "
\"Agent "._QXZ("Re-Login")."
 
"._QXZ("Phone Login:")." $phone_login
"._QXZ("User Login").":
"._QXZ("User Password:")."
"._QXZ("User Login").": $VD_login
"._QXZ("User Login").": $VD_login
"._QXZ("Phone Login:")." $phone_login
"._QXZ("Phone Login:")."
"._QXZ("Phone Password:")."
"._QXZ("User Login").":
"._QXZ("User Password:")."
"._QXZ("Campaign:")." $camp_form_code
  \n";} else {echo "
  \n";} echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } if ($user_login_first == 1) { if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) { echo ""._QXZ("Agent web client: Campaign Login")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."$grey_link
\n";} echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; #echo "\n"; #echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "

"._QXZ("User Login")."

"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; if ($login_submit_once > 0) {echo "\n"; echo "\n"; echo "
\"Agent "._QXZ("Campaign Login")."
 
"._QXZ("User Login").":
"._QXZ("User Password:")."
"._QXZ("Campaign:")." $camp_form_code
  \n";} else {echo "
  \n";} echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } else { if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) { $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and user_level > 0 and active='Y' and api_only_user != '1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $phone_login=$row[0]; $phone_pass=$row[1]; if ( (strlen($phone_login) < 1) or (strlen($phone_pass) < 1) ) { echo ""._QXZ("Agent web client: Login")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."$grey_link
\n";} echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\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"; if ($login_submit_once > 0) {echo "\n"; echo "\n"; echo "
\"Agent "._QXZ("Login")."
 
"._QXZ("Phone Login:")."
"._QXZ("Phone Password:")."
"._QXZ("User Login").":
"._QXZ("User Password:")."
"._QXZ("Campaign:")." $camp_form_code
  \n";} else {echo "
  \n";} echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } } } } if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) { echo ""._QXZ("Agent web client: Phone Login")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."$grey_link
\n";} echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "


"; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; if ($login_submit_once > 0) {echo "\n"; echo "\n"; echo "
\"Agent "._QXZ("phone login")."
 
"._QXZ("Phone Login:")."
"._QXZ("Phone Password:")."
  \n";} else {echo "
  \n";} echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } else { if ($WeBRooTWritablE > 0) {$fp = fopen ("./vicidial_auth_entries.txt", "w");} $VDloginDISPLAY=0; if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) { $VDloginDISPLAY=1; } else { $auth=0; $auth_message = user_authorization($VD_login,$VD_pass,'',1,0,1,0,'vicidial'); if (preg_match("/^GOOD/",$auth_message)) { $auth=1; $pass_hash = preg_replace("/GOOD\|/",'',$auth_message); } # case-sensitive check for user if($auth>0) { if ($VD_login != "$VUuser") { $auth=0; $auth_message='ERRCASE'; } } # check for campaign max agents if($auth>0) { if ($SSmax_logged_in_agents > 0) { $stmt="SELECT max_logged_in_agents from vicidial_campaigns where campaign_id='$VD_campaign' $LOGallowed_campaignsSQL;"; if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01099',$VD_login,$server_ip,$session_name,$one_mysql_log);} $camps_to_print = mysqli_num_rows($rslt); if ($camps_to_print > 0) { $max_logged_in_agents=999999999; $rowx=mysqli_fetch_row($rslt); $rowx[0]=preg_replace("/[^0-9]/","",$rowx[0]); if (strlen($rowx[0]) > 0) {$max_logged_in_agents = $rowx[0];} $stmt = "SELECT count(*) FROM vicidial_live_agents where campaign_id='$VD_campaign' and user!='$VD_login';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01100',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $mvla_ct = mysqli_num_rows($rslt); if ($mvla_ct > 0) { $rowx=mysqli_fetch_row($rslt); $vla_camp_agents = $rowx[0]; } if ( ($max_logged_in_agents <= $vla_camp_agents) and ($max_logged_in_agents > 0) ) { $auth=0; $auth_message='ERRCAMPAGENTS'; } } } } if($auth>0) { # check for 2FA being active, and if so, see if there is a non-expired 2FA auth $VALID_2FA=1; if ( ($SStwo_factor_auth_hours > 0) and ($SStwo_factor_container != '') and ($SStwo_factor_container != '---DISABLED---') ) { $stmt="SELECT count(*) from vicidial_two_factor_auth where user='$VD_login' and auth_stage='1' and auth_exp_date > NOW();"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01105',$VD_login,$server_ip,$session_name,$one_mysql_log);} $auth_check_to_print = mysqli_num_rows($rslt); if ($auth_check_to_print < 1) {$VALID_2FA=0;} else { $row=mysqli_fetch_row($rslt); $VALID_2FA = $row[0]; } } if ($VALID_2FA < 1) { $subhead_font = "style=\"font-family:HELVETICA;font-size:14;color:BLACK;font-weight:bold;\""; echo "\"Two-Factor-Authentication\" "._QXZ("Two-Factor-Authentication")."
\n"; if ( ($SStwo_factor_auth_hours < 1) or ($SStwo_factor_container == '') or ($SStwo_factor_container == '---DISABLED---') ) { echo _QXZ("Two-Factor-Authentication is disabled on your system. Please contact your system administrator")." $SStwo_factor_auth_hours|$SStwo_factor_container\n"; exit; } $stmt="SELECT full_name,email,mobile_number,user_group from vicidial_users where user='$VD_login' and active='Y' and api_only_user != '1';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01106',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $LOGfullname = $row[0]; $LOGemail = $row[1]; $LOGmobile_number = $row[2]; $LOGuser_group = $row[3]; $OBSCUREemail = $LOGemail; $OBSCUREmobile_number = $LOGmobile_number; # first character and last 6 characters $temp_emailARY = explode('@',$OBSCUREemail); $field_temp_val = $temp_emailARY[0]; if (strlen($field_temp_val) > 1) {$OBSCUREemail = substr($field_temp_val,0,2) . str_repeat(".", (strlen($field_temp_val) - 2)) . '@' . $temp_emailARY[1];} else {$OBSCUREemail = '<'._QXZ("none").'>';} # first 3 digits and last 2 digits $field_temp_val = $OBSCUREmobile_number; if (strlen($field_temp_val) > 1) {$OBSCUREmobile_number = substr($field_temp_val,0,3) . str_repeat("x", (strlen($field_temp_val) - 5)) . substr($field_temp_val,-2,2);} else {$OBSCUREmobile_number = '<'._QXZ("none").'>';} ### BEGIN Gather 2FA settings container details ### $valid_2FA_config=0; $active_2FA_methods=0; $auth_code_expire_minutes='30'; $auth_code_attempts='10'; $auth_code_length='6'; $email_auth=''; $email_from=''; $email_subject=''; $email_message=''; $phone_auth=''; $phone_prefix=''; $phone_server_ip=''; $phone_cid_number=''; $phone_message_override=''; $sms_auth=''; $sms_cid_number=''; $sms_url=''; $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='$SStwo_factor_container';"; $rslt=mysql_to_mysqli($stmt, $link); $SCinfo_ct = mysqli_num_rows($rslt); if ($DB) {echo "$SCinfo_ct|$stmt\n";} if ($SCinfo_ct > 0) { $row=mysqli_fetch_row($rslt); $TFAcontainer_entry = $row[0]; $TFAcontainer_entry = preg_replace("/\r|\t|\'|\"/",'',$TFAcontainer_entry); $TFAcontainer_entry = preg_replace("/ => | =>|=> /",'=>',$TFAcontainer_entry); $two_factor_settings = explode("\n",$TFAcontainer_entry); $two_factor_settings_ct = count($two_factor_settings); $tfal=0; while ($two_factor_settings_ct > $tfal) { if (preg_match("/^auth_code_expire_minutes=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/auth_code_expire_minutes=>/",'',$two_factor_settings[$tfal]); $auth_code_expire_minutes = $two_factor_settings[$tfal]; } if (preg_match("/^auth_code_attempts=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/auth_code_attempts=>/",'',$two_factor_settings[$tfal]); $auth_code_attempts = $two_factor_settings[$tfal]; } if (preg_match("/^auth_code_length=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/auth_code_length=>/",'',$two_factor_settings[$tfal]); $auth_code_length = $two_factor_settings[$tfal]; } if (preg_match("/^email_auth=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/email_auth=>/",'',$two_factor_settings[$tfal]); $email_auth = $two_factor_settings[$tfal]; $active_2FA_methods++; } if (preg_match("/^email_from=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/email_from=>/",'',$two_factor_settings[$tfal]); $email_from = $two_factor_settings[$tfal]; $valid_2FA_config++; } if (preg_match("/^email_subject=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/email_subject=>/",'',$two_factor_settings[$tfal]); $email_subject = $two_factor_settings[$tfal]; } if (preg_match("/^email_message=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/email_message=>/",'',$two_factor_settings[$tfal]); $email_message = $two_factor_settings[$tfal]; } if (preg_match("/^phone_auth=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/phone_auth=>/",'',$two_factor_settings[$tfal]); $phone_auth = $two_factor_settings[$tfal]; $active_2FA_methods++; } if (preg_match("/^phone_prefix=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/phone_prefix=>/",'',$two_factor_settings[$tfal]); $phone_prefix = $two_factor_settings[$tfal]; } if (preg_match("/^phone_server_ip=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/phone_server_ip=>/",'',$two_factor_settings[$tfal]); $phone_server_ip = $two_factor_settings[$tfal]; $valid_2FA_config++; } if (preg_match("/^phone_cid_number=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/phone_cid_number=>/",'',$two_factor_settings[$tfal]); $phone_cid_number = $two_factor_settings[$tfal]; } if (preg_match("/^phone_message_override=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/phone_message_override=>/",'',$two_factor_settings[$tfal]); $phone_message_override = $two_factor_settings[$tfal]; } if (preg_match("/^sms_auth=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/sms_auth=>/",'',$two_factor_settings[$tfal]); $sms_auth = $two_factor_settings[$tfal]; $active_2FA_methods++; } if (preg_match("/^sms_cid_number=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/sms_cid_number=>/",'',$two_factor_settings[$tfal]); $sms_cid_number = $two_factor_settings[$tfal]; } if (preg_match("/^sms_url=>/",$two_factor_settings[$tfal])) { $two_factor_settings[$tfal] = preg_replace("/sms_url=>/",'',$two_factor_settings[$tfal]); $sms_url = $two_factor_settings[$tfal]; $valid_2FA_config++; } $tfal++; } } ### END Gather 2FA settings container details ### if ( ($valid_2FA_config < 1) or ($active_2FA_methods < 1) ) { echo "
"._QXZ("Two-Factor-Authentication is not properly configured on your system. Please contact your system administrator")."

$valid_2FA_config|$SStwo_factor_auth_hours|$SStwo_factor_container

\n"; exit; } if ( (strlen($LOGemail) < 4) and (strlen($LOGmobile_number) < 2) ) { echo _QXZ("Your User account is not configured for Two-Factor-Authentication. Please contact your system administrator. (no email or mobile number)").".\n"; exit; } $show_form=1; if ( ($stage=='SUBMIT') or ($stage==_QXZ("SUBMIT")) ) { $auth_fail=0; echo "
"; if (strlen($rank) < 2) { echo _QXZ("Please go back and enter a valid authorization code")." |1|" . strlen($rank) . "|"; $auth_fail++; } else { $stmt="SELECT count(*) from vicidial_two_factor_auth where user='$VD_login' and auth_code='$rank' and auth_stage='0' and auth_code_exp_date > NOW() and (auth_attempts < $auth_code_attempts);"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $auth_check_to_print = mysqli_num_rows($rslt); if ($auth_check_to_print < 1) {echo _QXZ("Please go back and enter a valid authorization code")." |2|$auth_check_to_print"; $auth_fail++;} else { $row=mysqli_fetch_row($rslt); if ($row[0] < 1) {echo _QXZ("Please go back and enter a valid authorization code")." |3|$row[0]"; $auth_fail++;} else { $stmt="UPDATE vicidial_two_factor_auth SET auth_stage='1', auth_attempts=(auth_attempts + 1) where user='$VD_login' and auth_stage='0' and auth_code='$rank';"; $rslt=mysql_to_mysqli($stmt, $link); $stmt = "INSERT INTO vicidial_agent_function_log set agent_log_id='0',user='$VD_login',function='2FA_good',event_time=NOW(),campaign_id='-ADMIN-',user_group='$LOGuser_group',lead_id='0',uniqueid='SUCCESS',caller_code='$ip',stage='',comments='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo _QXZ("Authorization code accepted, you may now continue")."

\n"; echo ""._QXZ("Agent web client: 2FA Auth")."\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "$DBoutput"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; # echo "\n"; echo "\n"; echo "


"; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "
\"Agent
  \n"; echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } } } if ($auth_fail > 0) { $stmt="UPDATE vicidial_two_factor_auth SET auth_attempts=(auth_attempts + 1) where user='$VD_login' and auth_stage='0';"; $rslt=mysql_to_mysqli($stmt, $link); $auth_failed_attempts=1; $stmt="SELECT auth_attempts from vicidial_two_factor_auth where user='$VD_login' and auth_stage='0' order by auth_code_exp_date desc limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $auth_attempt_to_print = mysqli_num_rows($rslt); if ($auth_attempt_to_print > 0) { $row=mysqli_fetch_row($rslt); $auth_failed_attempts = $row[0]; } if ($auth_failed_attempts >= $auth_code_attempts) { $stmt="UPDATE vicidial_users set failed_login_count='$auth_failed_attempts',last_ip='$ip' where user='$VD_login';"; $rslt=mysql_to_mysqli($stmt, $link); } } echo "
\n"; exit; } ##### BEGIN send out AUTH CODE and show auth-code entry page ##### if ($auth_entry > 0) { $ACbegin = '1'; $ACend = '9'; $i=1; while($i < $auth_code_length) { $ACbegin .= '0'; $ACend .= '9'; $i++; } $NEWauth_code = rand($ACbegin, $ACend); $auth_exp_date = date("Y-m-d H:i:s", mktime(date("H")+$SStwo_factor_auth_hours,date("i"),date("s"),date("m"),date("d"),date("Y"))); $auth_code_exp_date = date("Y-m-d H:i:s", mktime(date("H"),date("i")+$auth_code_expire_minutes,date("s"),date("m"),date("d"),date("Y"))); ### insert auth_code into vicidial_two_factor_auth table $stmt="INSERT INTO vicidial_two_factor_auth SET auth_date=NOW(),auth_exp_date='$auth_exp_date',user='$VD_login',auth_stage='0',auth_code='$NEWauth_code',auth_code_exp_date='$auth_code_exp_date',auth_method='$stage',auth_attempts='0';"; $rslt=mysql_to_mysqli($stmt, $link); $affected_rows = mysqli_affected_rows($link); if ($DB) {echo "$affected_rows|$stmt\n";} # invalidate all older auth_code entries if ($affected_rows > 0) { $stmt="UPDATE vicidial_two_factor_auth SET auth_stage='6' where user='$VD_login' and auth_stage!='6' and auth_code!='$NEWauth_code';"; $rslt=mysql_to_mysqli($stmt, $link); $affected_rows = mysqli_affected_rows($link); if ($DB) {echo "$affected_rows|$stmt\n";} } ### Send auth code by EMAIL if ($stage == 'EMAIL') { $email_message = preg_replace('/--A--auth_code--B--/i',"$NEWauth_code",$email_message); // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Create email headers $headers .= 'From: ' . $email_from . "\r\n" . 'Reply-To: ' . $email_from . "\r\n" . 'X-Mailer: PHP/' . phpversion(); $body = "" . $email_message . ""; $success = mail($LOGemail, $email_subject, $body, $headers ); if ($success) { $stmt = "INSERT INTO vicidial_agent_function_log set agent_log_id='0',user='$VD_login',function='2FA_send',event_time=NOW(),campaign_id='-ADMIN-',user_group='$LOGuser_group',lead_id='0',uniqueid='SUCCESS',caller_code='$ip',stage='$stage',comments='EMAIL: $LOGemail';"; echo "
"._QXZ("Your authorization code has been sent by %1s to",0,'',$stage).": $OBSCUREemail
\n"; } else { $stmt = "INSERT INTO vicidial_agent_function_log set agent_log_id='0',user='$VD_login',function='2FA_send',event_time=NOW(),campaign_id='-ADMIN-',user_group='$LOGuser_group',lead_id='0',uniqueid='ERROR',caller_code='$ip',stage='$stage',comments='EMAIL: $LOGemail';"; $error_msg = error_get_last()['message']; echo "$error_msg"; } ### LOG INSERTION Admin Log Table ### if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); } ### Send auth code by PHONE if ($stage == 'PHONE') { $context_2FA = '2FA_say_auth_code'; if (strlen($phone_message_override) > 0) {$context_2FA = $phone_message_override;} if (strlen($ext_context) < 1) {$ext_context='default';} $local_DEF = 'Local/'; $local_AMP = '@'; $Local_dial_timeout = '60000'; $Ndialstring = "$phone_prefix$LOGmobile_number"; $VMvariable = "Variable: access_code=$NEWauth_code"; ### insert a NEW record to the vicidial_manager table to be processed $stmtB = "INSERT INTO vicidial_manager(uniqueid,entry_date,status,response,server_ip,channel,action,callerid,cmd_line_b,cmd_line_c,cmd_line_d,cmd_line_e,cmd_line_f,cmd_line_g,cmd_line_h,cmd_line_i,cmd_line_j,cmd_line_k) values('',NOW(),'NEW','N','$phone_server_ip','','Originate','$VqueryCID','Exten: s','Context: $context_2FA','Channel: $local_DEF$Ndialstring$local_AMP$ext_context','Priority: 1','Callerid: $phone_cid_number','Timeout: $Local_dial_timeout','$VMvariable','','','')"; $rslt=mysql_to_mysqli($stmtB, $link); $stmt = "INSERT INTO vicidial_agent_function_log set agent_log_id='0',user='$VD_login',function='2FA_send',event_time=NOW(),campaign_id='-ADMIN-',user_group='$LOGuser_group',lead_id='0',uniqueid='SUCCESS',caller_code='$ip',stage='$stage',comments='PHONE: $LOGmobile_number';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "
"._QXZ("Your authorization code has been sent by %1s to",0,'',$stage).": $OBSCUREmobile_number
\n"; } ### Send auth code by SMS if ($stage == 'SMS') { $sms_url = preg_replace('/--A--auth_code--B--/i',"$NEWauth_code",$sms_url); $sms_url = preg_replace('/--A--mobile_number--B--/i',"$LOGmobile_number",$sms_url); ### insert a new url log entry $SQL_log = "$sms_url"; $SQL_log = preg_replace('/;/','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt = "INSERT INTO vicidial_url_log SET uniqueid='2FA',url_date=NOW(),url_type='2FA_SMS',url='$SQL_log',url_response='';"; # if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $affected_rows = mysqli_affected_rows($link); $url_id = mysqli_insert_id($link); $URLstart_sec = date("U"); ### grab the call_start_url ### # if ($DB > 0) {echo "$sms_url
\n";} $SCUfile = file("$sms_url"); if ( !($SCUfile) ) { $error_array = error_get_last(); $error_type = $error_array["type"]; $error_message = $error_array["message"]; $error_line = $error_array["line"]; $error_file = $error_array["file"]; } if ($DB > 0) {echo "$SCUfile[0]
\n";} ### update url log entry $URLend_sec = date("U"); $URLdiff_sec = ($URLend_sec - $URLstart_sec); if ($SCUfile) { $SCUfile_contents = implode("", $SCUfile); $SCUfile_contents = preg_replace('/;/','',$SCUfile_contents); $SCUfile_contents = addslashes($SCUfile_contents); } else { $SCUfile_contents = "PHP ERROR: Type=$error_type - Message=$error_message - Line=$error_line - File=$error_file"; } $stmt = "UPDATE vicidial_url_log SET response_sec='$URLdiff_sec',url_response='$SCUfile_contents' where url_log_id='$url_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); $affected_rows = mysqli_affected_rows($link); $stmt = "INSERT INTO vicidial_agent_function_log set agent_log_id='0',user='$VD_login',function='2FA_send',event_time=NOW(),campaign_id='-ADMIN-',user_group='$LOGuser_group',lead_id='0',uniqueid='SUCCESS',caller_code='$ip',stage='$stage',comments='SMS: $LOGmobile_number';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); echo "
"._QXZ("Your authorization code has been sent by %1s to",0,'',$stage).": $OBSCUREmobile_number
\n"; } echo ""._QXZ("Agent web client: 2FA Auth")."\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo ""; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; # echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
"._QXZ("Please enter the Auth Code that you have received by %1s into the field below, and click the SUBMIT button",0,'',$stage).". "._QXZ("To resend your auth code, click here to go back").".
 
"._QXZ("Authorization Code").":
\n"; exit; } ##### END send out AUTH CODE and show auth-code entry page ##### ##### BEGIN choose how to send out AUTH CODE page ##### else { if ($show_form > 0) { echo ""._QXZ("Agent web client: 2FA Auth")."\n"; echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo ""; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; # echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; # echo "\n"; echo "
\n"; echo "\n"; echo "\n"; #echo "\n"; echo "
"._QXZ("Your account has Two-Factor-Authorization enabled on it. In order to log in, you will need to verify your identity by submitting a temporary authorization code. Click on the icon below for the delivery method you would like to use to receive your authorization code").":

\n"; echo "\n"; $displayed_2FA=0; if ( (preg_match("/YES/i",$email_auth)) and (strlen($LOGemail) > 3) ) { echo " 0) {echo " onclick=\"send_2FA('EMAIL');\"";} echo ">\n"; echo "\n"; echo "\n"; echo "\n"; $displayed_2FA++; } if ( (preg_match("/YES/i",$phone_auth)) and (strlen($LOGmobile_number) > 1) ) { echo " 0) {echo " onclick=\"send_2FA('PHONE');\"";} echo ">\n"; echo "\n"; echo "\n"; echo "\n"; $displayed_2FA++; } if ( (preg_match("/YES/i",$sms_auth)) and (strlen($LOGmobile_number) > 1) ) { echo " 0) {echo " onclick=\"send_2FA('SMS');\"";} echo ">\n"; echo "\n"; echo "\n"; echo "\n"; $displayed_2FA++; } if ($displayed_2FA < 1) { echo _QXZ("Your User account is not configured for Two-Factor-Authentication. Please contact your system administrator").".\n"; exit; } echo "
"._QXZ("Email you an auth code")."
"._QXZ("Send an email to").":
$OBSCUREemail
"._QXZ("Call you and play an auth code")."
"._QXZ("Place a phone call to").":
$OBSCUREmobile_number
"._QXZ("Text-Message you an auth code")."
"._QXZ("Send a message to").":
$OBSCUREmobile_number

 \n"; echo "
\n"; exit; } } ##### END choose how to send out AUTH CODE page ##### } if ($VUforce_change_password == 'Y') { echo "\n"; if ($DB > 0) {$DBoutput = "\n";} $set_pass_message = _QXZ("You are required to change your password. Please enter a new password below"); if ($set_pass == '1') { $set_pass=2; if ($new_pass1 != $new_pass2) { $set_pass_message = _QXZ("You must confirm your new password by typing it in twice"); $set_pass=1; } if (strlen($new_pass1) < $SSrequire_password_length) { $set_pass_message = _QXZ("Your password is not long enough").', '.$SSrequire_password_length.' '._QXZ("characters minimum"); $set_pass=1; } if ($set_pass == '2') { $pass_hash=''; $pass_hashSQL=''; $pass_querySQL="and pass='$new_pass1'"; if ($SSpass_hash_enabled > 0) { if (strlen($new_pass1) > 1) { $pass = preg_replace("/\'|\"|\\\\|;|<|>| /","",$new_pass1); $pass_hash = exec("../agc/bp.pl --pass=$pass"); $pass_hash = preg_replace("/PHASH: |\n|\r|\t| /",'',$pass_hash); $pass_hashSQL = ",pass_hash='$pass_hash'"; $pass_querySQL = "and pass_hash='$pass_hash'"; } $new_pass1=''; } $stmt="SELECT count(*) from vicidial_users where user='$VD_login' $pass_querySQL;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01093',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $dup_password=$row[0]; if ($dup_password > 0) { $set_pass_message = _QXZ("You cannot use the same password as your last password"); $set_pass=1; } } if ($set_pass == '2') { $stmt="UPDATE vicidial_users SET force_change_password='N',pass='$new_pass1' $pass_hashSQL where user='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01094',$VD_login,$server_ip,$session_name,$one_mysql_log);} $VUpassword_affected_rows = mysqli_affected_rows($link); echo ""._QXZ("Agent web client: Change Password")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."

\n";} echo "\n"; echo "\n"; echo "\n"; echo "$DBoutput"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; # echo "\n"; echo "\n"; echo "


"; echo ""; echo ""; echo "\n"; if ($login_submit_once > 0) {echo "\n"; echo "\n"; echo "
\"Agent "._QXZ("Password has been changed successfully")."
  \n";} else {echo "
  \n";} echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } } if ( ($set_pass == '0') or (strlen($set_pass) < 1) ) { $set_pass=1; } echo ""._QXZ("Agent web client: Change Password")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."

\n";} echo "\n"; echo "\n"; echo "$DBoutput"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "


"; echo ""; echo ""; echo "\n"; echo ""; echo ""; echo "\n"; echo ""; echo "\n"; if ($login_submit_once > 0) {echo "\n"; echo "\n"; echo "
\"Agent $set_pass_message

"._QXZ("Note: Passwords may be up to 100 characters in length, and you may only use letters and numbers in your password").".
 
"._QXZ("New Password").":  
"._QXZ("Confirm New Password").":  
  \n";} else {echo "
  \n";} echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } ##### grab the full name and other settings 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,agent_choose_blended,agent_lead_search_override,preset_contact_search,max_inbound_calls,wrapup_seconds_override,email,user_choose_language,ready_max_logout,mute_recordings,max_inbound_filter_enabled,status_group_id,manual_dial_filter,inbound_credits,mobile_number,manual_dial_lead_id from vicidial_users where user='$VD_login' and active='Y' and api_only_user != '1';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $LOGfullname = $row[0]; $user_level = $row[1]; $VU_hotkeys_active = $row[2]; $VU_agent_choose_ingroups = $row[3]; $VU_scheduled_callbacks = $row[4]; $agentonly_callbacks = $row[5]; $agentcall_manual = $row[6]; $VU_vicidial_recording = $row[7]; $VU_vicidial_transfers = $row[8]; $VU_closer_default_blended = $row[9]; $VU_user_group = $row[10]; $VU_vicidial_recording_override = $row[11]; $VU_alter_custphone_override = $row[12]; $VU_alert_enabled = $row[13]; $VU_agent_shift_enforcement_override = $row[14]; $VU_shift_override_flag = $row[15]; $VU_allow_alerts = $row[16]; $VU_closer_campaigns = $row[17]; $VU_agent_choose_territories = $row[18]; $VU_custom_one = $row[19]; $VU_custom_two = $row[20]; $VU_custom_three = $row[21]; $VU_custom_four = $row[22]; $VU_custom_five = $row[23]; $VU_agent_call_log_view_override = $row[24]; $VU_agent_choose_blended = $row[25]; $VU_agent_lead_search_override = $row[26]; $VU_preset_contact_search = $row[27]; $VU_max_inbound_calls = $row[28]; $VU_wrapup_seconds_override = $row[29]; $LOGemail = $row[30]; $VU_user_choose_language = $row[31]; $VU_ready_max_logout = $row[32]; $VU_mute_recordings = $row[33]; $VU_max_inbound_filter_enabled = $row[34]; $VU_status_group_id = $row[35]; $VU_manual_dial_filter = $row[36]; $VU_inbound_credits = $row[37]; $LOGmobile_number = $row[38]; $VU_manual_dial_lead_id = $row[39]; 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,agent_fullscreen,webphone_url_override,webphone_dialpad_override,webphone_systemkey_override,admin_viewable_groups,agent_xfer_park_3way,webphone_layout,script_id from vicidial_user_groups where user_group='$VU_user_group';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $forced_timeclock_login = $row[0]; $shift_enforcement = $row[1]; $LOGgroup_shiftsSQL = preg_replace('/\s\s/i','',$row[2]); $LOGgroup_shiftsSQL = preg_replace('/\s/i',"','",$LOGgroup_shiftsSQL); $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; $agent_status_viewable_groups = $row[3]; $agent_status_viewable_groupsSQL = preg_replace('/\s\s/i','',$agent_status_viewable_groups); $agent_status_viewable_groupsSQL = preg_replace('/\s/i',"','",$agent_status_viewable_groupsSQL); $agent_status_viewable_groupsSQL = "user_group IN('$agent_status_viewable_groupsSQL')"; $agent_status_view = 0; if (strlen($agent_status_viewable_groups) > 2) {$agent_status_view = 1;} $agent_status_view_time=0; if ($row[4] == 'Y') {$agent_status_view_time=1;} if ($row[5] == 'Y') {$agent_call_log_view=1;} if ($row[6] == 'Y') {$agent_xfer_consultative=1;} if ($row[7] == 'Y') {$agent_xfer_dial_override=1;} if ($row[8] == 'Y') {$agent_xfer_vm_transfer=1;} if ($row[9] == 'Y') {$agent_xfer_blind_transfer=1;} if ($row[10] == 'Y') {$agent_xfer_dial_with_customer=1;} if ($row[11] == 'Y') {$agent_xfer_park_customer_dial=1;} if ( ($row[17] == 'Y') and ($SSagent_xfer_park_3way > 0) ) {$agent_xfer_park_3way=1;} if ($VU_agent_call_log_view_override == 'Y') {$agent_call_log_view=1;} if ($VU_agent_call_log_view_override == 'N') {$agent_call_log_view=0;} $agent_fullscreen = $row[12]; $webphone_url = $row[13]; $webphone_dialpad_override = $row[14]; $system_key = $row[15]; $admin_viewable_groups = $row[16]; $webphone_layout_override = $row[18]; $UGscript_id = $row[19]; $admin_viewable_groupsALL=0; $LOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL=''; $valLOGadmin_viewable_groupsSQL=''; $vmLOGadmin_viewable_groupsSQL=''; if ( (!preg_match('/\-\-ALL\-\-/i',$admin_viewable_groups)) and (strlen($admin_viewable_groups) > 3) ) { $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$admin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; $whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; $valLOGadmin_viewable_groupsSQL = "and val.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; $vmLOGadmin_viewable_groupsSQL = "and vm.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; } else {$admin_viewable_groupsALL=1;} if ( ($webphone_dialpad_override != 'DISABLED') and (strlen($webphone_dialpad_override) > 0) ) {$webphone_dialpad = $webphone_dialpad_override;} if ( (strlen($VD_language)>0) and ($VU_user_choose_language == '1') ) { $LANGUAGEactive=0; if ($VD_language == 'default English') {$LANGUAGEactive=1;} else { $stmt="SELECT count(*) FROM vicidial_languages where language_id='$VD_language' and active='Y' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01082',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $LANGUAGEactive=$row[0]; } if ($LANGUAGEactive > 0) { $stmt="UPDATE vicidial_users SET selected_language='$VD_language' where user='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01083',$VD_login,$server_ip,$session_name,$one_mysql_log);} $VUlanguage_affected_rows = mysqli_affected_rows($link); echo "\n"; $VUselected_language=$VD_language; } } ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR if ( (preg_match('/Y/',$forced_timeclock_login)) or ( (preg_match('/ADMIN_EXEMPT/',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) { $last_agent_event=''; $HHMM = date("Hi"); $HHteod = substr($timeclock_end_of_day,0,2); $MMteod = substr($timeclock_end_of_day,2,2); if ($HHMM < $timeclock_end_of_day) {$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d")-1, date("Y"));} else {$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d"), date("Y"));} $EoDdate = date("Y-m-d H:i:s", $EoD); ##### grab timeclock logged-in time for each user ##### $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} $events_to_parse = mysqli_num_rows($rslt); if ($events_to_parse > 0) { $rowx=mysqli_fetch_row($rslt); $last_agent_event = $rowx[0]; } if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} if ( (strlen($last_agent_event)<2) or (preg_match('/LOGOUT/',$last_agent_event)) ) { $VDloginDISPLAY=1; $VDdisplayMESSAGE = _QXZ("YOU MUST LOG IN TO THE TIMECLOCK FIRST")."
"; } } ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR if ( ( (preg_match("/START|ALL/",$shift_enforcement)) and (!preg_match("/OFF/",$VU_agent_shift_enforcement_override)) ) or (preg_match("/START|ALL/",$VU_agent_shift_enforcement_override)) ) { $shift_ok=0; if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) { $VDloginDISPLAY=1; $VDdisplayMESSAGE = _QXZ("ERROR: There are no Shifts enabled for your user group")."
"; } else { $HHMM = date("Hi"); $wday = date("w"); $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} $shifts_to_print = mysqli_num_rows($rslt); $o=0; while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) { $rowx=mysqli_fetch_row($rslt); $shift_id = $rowx[0]; $shift_start_time = $rowx[1]; $shift_length = $rowx[2]; $shift_weekdays = $rowx[3]; if (preg_match("/$wday/i",$shift_weekdays)) { $HHshift_length = substr($shift_length,0,2); $MMshift_length = substr($shift_length,3,2); $HHshift_start_time = substr($shift_start_time,0,2); $MMshift_start_time = substr($shift_start_time,2,2); $HHshift_end_time = ($HHshift_length + $HHshift_start_time); $MMshift_end_time = ($MMshift_length + $MMshift_start_time); if ($MMshift_end_time > 59) { $MMshift_end_time = ($MMshift_end_time - 60); $HHshift_end_time++; } if ($HHshift_end_time > 23) {$HHshift_end_time = ($HHshift_end_time - 24);} $HHshift_end_time = sprintf("%02s", $HHshift_end_time); $MMshift_end_time = sprintf("%02s", $MMshift_end_time); $shift_end_time = "$HHshift_end_time$MMshift_end_time"; if ( ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) ) {$shift_ok++;} } $o++; } if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) { $VDloginDISPLAY=1; $VDdisplayMESSAGE = _QXZ("ERROR: You are not allowed to log in outside of your shift")."
"; } } if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) { $VDdisplayMESSAGE.= "

"._QXZ("MANAGER OVERRIDE:")."
\n"; $VDdisplayMESSAGE.= "
\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "\n"; $VDdisplayMESSAGE.= "Manager Login:
\n"; $VDdisplayMESSAGE.= "Manager Password:
\n"; $VDdisplayMESSAGE.= "
\n"; } } ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR ### BEGIN find any custom field labels ### $label_title = _QXZ(" Title"); $label_first_name = _QXZ("First"); $label_middle_initial = _QXZ("MI"); $label_last_name = _QXZ("Last "); $label_address1 = _QXZ("Address1"); $label_address2 = _QXZ("Address2"); $label_address3 = _QXZ("Address3"); $label_city = _QXZ("City"); $label_state = _QXZ(" State"); $label_province = _QXZ("Province"); $label_postal_code = _QXZ("PostCode"); $label_vendor_lead_code = _QXZ("Vendor ID"); $label_gender = _QXZ(" Gender"); $label_phone_number = _QXZ("Phone"); $label_phone_code = _QXZ("DialCode"); $label_alt_phone = _QXZ("Alt. Phone"); $label_security_phrase = _QXZ("Show"); $label_email = _QXZ("Email"); $label_comments = _QXZ(" Comments"); $label_lead_id = _QXZ("Lead ID"); $label_list_id = _QXZ("List ID"); $label_entry_date = _QXZ("Entry Date"); $label_gmt_offset_now = _QXZ("Timezone"); $label_source_id = _QXZ("Source ID"); $label_called_since_last_reset = _QXZ("Reset Code"); $label_status = _QXZ("Status"); $label_user = _QXZ("User"); $label_date_of_birth = _QXZ("Date of Birth"); $label_country_code = _QXZ("Country"); $label_last_local_call_time = _QXZ("Last Call"); $label_called_count = _QXZ("Called Count"); $label_rank = _QXZ("Rank"); $label_owner = _QXZ("Owner"); $label_entry_list_id = _QXZ("Entry List ID"); $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,label_lead_id,label_list_id,label_entry_date,label_gmt_offset_now,label_source_id,label_called_since_last_reset,label_status,label_user,label_date_of_birth,label_country_code,label_last_local_call_time,label_called_count,label_rank,label_owner,label_entry_list_id from system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_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];} if (strlen($row[19])>0) {$label_lead_id = $row[19];} if (strlen($row[20])>0) {$label_list_id = $row[20];} if (strlen($row[21])>0) {$label_entry_date = $row[21];} if (strlen($row[22])>0) {$label_gmt_offset_now = $row[22];} if (strlen($row[23])>0) {$label_source_id = $row[23];} if (strlen($row[24])>0) {$label_called_since_last_reset = $row[24];} if (strlen($row[25])>0) {$label_status = $row[25];} if (strlen($row[26])>0) {$label_user = $row[26];} if (strlen($row[27])>0) {$label_date_of_birth = $row[27];} if (strlen($row[28])>0) {$label_country_code = $row[28];} if (strlen($row[29])>0) {$label_last_local_call_time = $row[29];} if (strlen($row[30])>0) {$label_called_count = $row[30];} if (strlen($row[31])>0) {$label_rank = $row[31];} if (strlen($row[32])>0) {$label_owner = $row[32];} if (strlen($row[33])>0) {$label_entry_list_id = $row[33];} ### END find any custom field labels ### if ($label_gender == '---HIDE---') {$hide_gender=1;} if ($WeBRooTWritablE > 0) { fwrite ($fp, "vdweb|GOOD|$date|$browser|\n"); fclose($fp); } $user_abb = "$VD_login$VD_login$VD_login$VD_login"; while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = preg_replace("/^\./i","",$user_abb); $forever_stop++;} $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $LOGallowed_campaigns =$row[0]; if ( (!preg_match("/\s$VD_campaign\s/i",$LOGallowed_campaigns)) and (!preg_match("/ALL-CAMPAIGNS/i",$LOGallowed_campaigns)) ) { echo ""._QXZ("Agent web client: Campaign Login")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."$grey_link
\n";} echo "\n"; echo "\n"; echo "
\n"; echo ""._QXZ("Sorry, you are not allowed to login to this campaign:")." $VD_campaign\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""._QXZ("Login").": \n
"; echo ""._QXZ("Password").":
\n"; echo ""._QXZ("Campaign").": $camp_form_code
\n"; if ($login_submit_once > 0) {echo "   \n";} else {echo "   \n";} echo "\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } ##### check to see that the campaign is active $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $CAMPactive=$row[0]; if($CAMPactive>0) { $VARstatuses=''; $VARstatusnames=''; $VARSELstatuses=''; $VARSELstatuses_ct=0; $VARCBstatuses=''; $VARSALEstatuses=''; $VARMINstatuses=''; $VARMAXstatuses=''; $VARCBstatusesLIST=''; $VARSALEstatusesLIST=''; $cVARstatuses=''; $cVARstatusnames=''; $cVARSELstatuses=''; $cVARSELstatuses_ct=0; $cVARCBstatuses=''; $cVARSALEstatuses=''; $cVARMINstatuses=''; $cVARMAXstatuses=''; $cVARCBstatusesLIST=''; $cVARSALEstatusesLIST=''; ##### grab the statuses that can be used for dispositioning by an agent for all calls $stmt="SELECT status,status_name,scheduled_callback,selectable,min_sec,max_sec,sale FROM vicidial_statuses WHERE status != 'NEW' order by status limit 500;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_ct = mysqli_num_rows($rslt); $i=0; while ($i < $VD_statuses_ct) { $row=mysqli_fetch_row($rslt); $statuses[$i] = $row[0]; $status_names[$i] = $row[1]; $CBstatuses[$i] = $row[2]; $SELstatuses[$i] = $row[3]; $MINsec[$i] = $row[4]; $MAXsec[$i] = $row[5]; $SALEstatuses[$i] = $row[6]; if ($TEST_all_statuses > 0) {$SELstatuses[$i]='Y';} $VARstatuses = "$VARstatuses'$statuses[$i]',"; $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; $VARSELstatuses = "$VARSELstatuses'$SELstatuses[$i]',"; $VARCBstatuses = "$VARCBstatuses'$CBstatuses[$i]',"; $VARSALEstatuses = "$VARSALEtatuses'$SALEstatuses[$i]',"; $VARMINstatuses = "$VARMINstatuses'$MINsec[$i]',"; $VARMAXstatuses = "$VARMAXstatuses'$MAXsec[$i]',"; if ($CBstatuses[$i] == 'Y') {$VARCBstatusesLIST .= " $statuses[$i]";} if ($SELstatuses[$i] == 'Y') {$VARSELstatuses_ct++;} if ($SALEstatuses[$i] == 'Y') {$VARSALEstatusesLIST .= " $statuses[$i]";} $i++; } ##### grab the additional user statuses that can be used for dispositioning by an agent for all calls if (strlen($VU_status_group_id) > 0) { $stmt="SELECT status,status_name,scheduled_callback,selectable,min_sec,max_sec,sale FROM vicidial_campaign_statuses WHERE status != 'NEW' and campaign_id='$VU_status_group_id' order by status limit 500;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01093',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VU_statuses_ct = mysqli_num_rows($rslt); $k=0; while ($k < $VU_statuses_ct) { $row=mysqli_fetch_row($rslt); $statuses[$i] = $row[0]; $status_names[$i] = $row[1]; $CBstatuses[$i] = $row[2]; $SELstatuses[$i] = $row[3]; $MINsec[$i] = $row[4]; $MAXsec[$i] = $row[5]; $SALEstatuses[$i] = $row[6]; if ($TEST_all_statuses > 0) {$SELstatuses[$i]='Y';} $VARstatuses = "$VARstatuses'$statuses[$i]',"; $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; $VARSELstatuses = "$VARSELstatuses'$SELstatuses[$i]',"; $VARCBstatuses = "$VARCBstatuses'$CBstatuses[$i]',"; $VARSALEstatuses = "$VARSALEstatuses'$SALEstatuses[$i]',"; $VARMINstatuses = "$VARMINstatuses'$MINsec[$i]',"; $VARMAXstatuses = "$VARMAXstatuses'$MAXsec[$i]',"; if ($CBstatuses[$i] == 'Y') {$VARCBstatusesLIST .= " $statuses[$i]";} if ($SELstatuses[$i] == 'Y') {$VARSELstatuses_ct++;} if ($SALEstatuses[$i] == 'Y') {$VARSALEstatusesLIST .= " $statuses[$i]";} $i++; $k++; } } ##### grab the campaign-specific statuses that can be used for dispositioning by an agent $stmt="SELECT status,status_name,scheduled_callback,selectable,min_sec,max_sec,sale FROM vicidial_campaign_statuses WHERE status != 'NEW' and campaign_id='$VD_campaign' order by status limit 500;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_statuses_camp = mysqli_num_rows($rslt); $j=0; while ($j < $VD_statuses_camp) { $row=mysqli_fetch_row($rslt); $statuses[$i] = $row[0]; $status_names[$i] = $row[1]; $CBstatuses[$i] = $row[2]; $SELstatuses[$i] = $row[3]; $MINsec[$i] = $row[4]; $MAXsec[$i] = $row[5]; $SALEstatuses[$i] = $row[6]; if ($TEST_all_statuses > 0) {$SELstatuses[$i]='Y';} $cVARstatuses = "$cVARstatuses'$statuses[$i]',"; $cVARstatusnames = "$cVARstatusnames'$status_names[$i]',"; $cVARSELstatuses = "$cVARSELstatuses'$SELstatuses[$i]',"; $cVARCBstatuses = "$cVARCBstatuses'$CBstatuses[$i]',"; $cVARSALEstatuses = "$cVARSALEstatuses'$SALEstatuses[$i]',"; $cVARMINstatuses = "$cVARMINstatuses'$MINsec[$i]',"; $cVARMAXstatuses = "$cVARMAXstatuses'$MAXsec[$i]',"; if ($CBstatuses[$i] == 'Y') {$cVARCBstatusesLIST .= " $statuses[$i]";} if ($SELstatuses[$i] == 'Y') {$cVARSELstatuses_ct++;} if ($SALEstatuses[$i] == 'Y') {$cVARSALEstatusesLIST .= " $statuses[$i]";} $i++; $j++; } # $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); $VARstatuses = substr("$VARstatuses", 0, -1); $VARstatusnames = substr("$VARstatusnames", 0, -1); $VARSELstatuses = substr("$VARSELstatuses", 0, -1); $VARCBstatuses = substr("$VARCBstatuses", 0, -1); $VARSALEstatuses = substr("$VARSALEstatuses", 0, -1); $VARMINstatuses = substr("$VARMINstatuses", 0, -1); $VARMAXstatuses = substr("$VARMAXstatuses", 0, -1); $VARCBstatusesLIST .= " "; $VARSALEstatusesLIST .= " "; $cVARstatuses = substr("$cVARstatuses", 0, -1); $cVARstatusnames = substr("$cVARstatusnames", 0, -1); $cVARSELstatuses = substr("$cVARSELstatuses", 0, -1); $cVARCBstatuses = substr("$cVARCBstatuses", 0, -1); $cVARSALEstatuses = substr("$cVARSALEstatuses", 0, -1); $cVARMINstatuses = substr("$cVARMINstatuses", 0, -1); $cVARMAXstatuses = substr("$cVARMAXstatuses", 0, -1); $cVARCBstatusesLIST .= " "; $cVARSALEstatusesLIST .= " "; ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $HK_statuses_camp = mysqli_num_rows($rslt); $w=0; $HKboxA=''; $HKboxB=''; $HKboxC=''; while ($w < $HK_statuses_camp) { $row=mysqli_fetch_row($rslt); $HKhotkey[$w] =$row[0]; $HKstatus[$w] =$row[1]; $HKstatus_name[$w] =$row[2]; $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; if ($w < 3) {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} if ( ($w >= 3) and ($w < 6) ) {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} if ($w >= 6) {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
";} $w++; } $HKhotkeys = substr("$HKhotkeys", 0, -1); $HKstatuses = substr("$HKstatuses", 0, -1); $HKstatusnames = substr("$HKstatusnames", 0, -1); ##### grab the campaign settings $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_pause_precall_code,auto_resume_precall,manual_dial_cid,custom_3way_button_transfer,callback_days_limit,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,pllb_grouping,pllb_grouping_limit,in_group_dial,in_group_dial_select,pause_after_next_call,owner_populate,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,manual_dial_timeout,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,pause_max_dispo,script_top_dispo,routing_initiated_recordings,dead_trigger_seconds,dead_trigger_action,dead_trigger_repeat,dead_trigger_filename,scheduled_callbacks_force_dial,callback_hours_block,callback_display_days,scheduled_callbacks_timezones_container,three_way_volume_buttons,manual_dial_validation,mute_recordings,leave_vm_no_dispo,leave_vm_message_group_id,campaign_script_two,browser_alert_sound,browser_alert_volume,three_way_record_stop_exception,pause_max_exceptions,transfer_button_launch,leave_3way_start_recording,leave_3way_start_recording_exception,calls_waiting_vl_one,calls_waiting_vl_two,in_man_dial_next_ready_seconds,in_man_dial_next_ready_seconds_override,transfer_no_dispo,local_call_time,pause_max_url,agent_hide_hangup,ig_xfer_list_sort,script_tab_frame_size,user_group_script,agent_hangup_route,agent_hangup_value,agent_hangup_ig_override,show_confetti,custom_one,custom_two,custom_three,custom_four,custom_five,allow_chats,dead_stop_recording,force_per_call_notes,state_descriptions,script_tab_height,leave_3way_stop_recording,manual_minimum_ring_seconds,manual_minimum_attempt_seconds,manual_minimum_answer_seconds,sip_event_logging,stereo_recording,stereo_recording_agent,recording_dtmf_muting FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysqli_fetch_row($rslt); $park_ext = $row[0]; $park_file_name = $row[1]; $web_form_address = stripslashes($row[2]); $allow_closers = $row[3]; $auto_dial_level = $row[4]; $dial_timeout = $row[5]; $dial_prefix = $row[6]; $campaign_cid = $row[7]; $campaign_vdad_exten = $row[8]; $campaign_rec_exten = $row[9]; $campaign_recording = $row[10]; $campaign_rec_filename = $row[11]; $campaign_script = $row[12]; $get_call_launch = $row[13]; $campaign_am_message_exten = '8320'; $xferconf_a_dtmf = $row[15]; $xferconf_a_number = $row[16]; $xferconf_b_dtmf = $row[17]; $xferconf_b_number = $row[18]; $alt_number_dialing = $row[19]; $VC_scheduled_callbacks = $row[20]; $wrapup_seconds = $row[21]; $wrapup_message = $row[22]; $closer_campaigns = $row[23]; $use_internal_dnc = $row[24]; $allcalls_delay = $row[25]; $omit_phone_code = $row[26]; $agent_pause_codes_active = $row[27]; $no_hopper_leads_logins = $row[28]; $campaign_allow_inbound = $row[29]; $manual_dial_list_id = $row[30]; $default_xfer_group = $row[31]; $xfer_groups = $row[32]; $disable_alter_custphone = $row[33]; $display_queue_count = $row[34]; $manual_dial_filter = $row[35]; $CopY_tO_ClipboarD = $row[36]; $use_campaign_dnc = $row[37]; $three_way_call_cid = $row[38]; $dial_method = $row[39]; $three_way_dial_prefix = $row[40]; $web_form_target = $row[41]; $vtiger_screen_login = $row[42]; $agent_allow_group_alias = $row[43]; $default_group_alias = $row[44]; $quick_transfer_button = $row[45]; $prepopulate_transfer_preset = $row[46]; $view_calls_in_queue = $row[47]; $view_calls_in_queue_launch = $row[48]; $call_requeue_button = $row[49]; $pause_after_each_call = $row[50]; $no_hopper_dialing = $row[51]; $agent_dial_owner_only = $row[52]; $agent_display_dialable_leads = $row[53]; $web_form_address_two = $row[54]; $agent_select_territories = $row[55]; $crm_popup_login = $row[56]; $crm_login_address = $row[57]; $timer_action = $row[58]; $timer_action_message = $row[59]; $timer_action_seconds = $row[60]; $start_call_url = $row[61]; $dispo_call_url = $row[62]; $xferconf_c_number = $row[63]; $xferconf_d_number = $row[64]; $xferconf_e_number = $row[65]; $use_custom_cid = $row[66]; $scheduled_callbacks_alert = $row[67]; $scheduled_callbacks_count = $row[68]; $manual_dial_override = $row[69]; $blind_monitor_warning = $row[70]; $blind_monitor_message = $row[71]; $blind_monitor_filename = $row[72]; $timer_action_destination = $row[73]; $enable_xfer_presets = $row[74]; $hide_xfer_number_to_dial = $row[75]; $manual_dial_prefix = $row[76]; $customer_3way_hangup_logging = $row[77]; $customer_3way_hangup_seconds = $row[78]; $customer_3way_hangup_action = $row[79]; $ivr_park_call = $row[80]; $manual_preview_dial = $row[81]; $api_manual_dial = $row[82]; $manual_dial_call_time_check = $row[83]; $my_callback_option = $row[84]; $per_call_notes = $row[85]; $agent_lead_search = $row[86]; $agent_lead_search_method = $row[87]; $qm_phone_environment = $row[88]; $auto_pause_precall = $row[89]; $auto_pause_precall_code = $row[90]; $auto_resume_precall = $row[91]; $manual_dial_cid = $row[92]; $custom_3way_button_transfer = $row[93]; $callback_days_limit = $row[94]; $disable_dispo_screen = $row[95]; $disable_dispo_status = $row[96]; $screen_labels = $row[97]; $status_display_fields = $row[98]; $pllb_grouping = $row[99]; $pllb_grouping_limit = $row[100]; $in_group_dial = $row[101]; $in_group_dial_select = $row[102]; $pause_after_next_call = $row[103]; $owner_populate = $row[104]; $manual_dial_lead_id = $row[105]; $dead_max = $row[106]; $dispo_max = $row[107]; $pause_max = $row[108]; $dead_max_dispo = $row[109]; $dispo_max_dispo = $row[110]; $CP_max_inbound_calls = $row[111]; $manual_dial_search_checkbox = $row[112]; $hide_call_log_info = $row[113]; $timer_alt_seconds = $row[114]; $wrapup_bypass = $row[115]; $wrapup_after_hotkey = $row[116]; $callback_active_limit = $row[117]; $callback_active_limit_override = $row[118]; $comments_all_tabs = $row[119]; $comments_dispo_screen = $row[120]; $comments_callback_screen = $row[121]; $qc_comment_history = $row[122]; $show_previous_callback = $row[123]; $clear_script = $row[124]; $manual_dial_search_filter =$row[125]; $web_form_address_three = $row[126]; $manual_dial_override_field=$row[127]; $status_display_ingroup = $row[128]; $customer_gone_seconds = $row[129]; $agent_display_fields = $row[130]; $manual_dial_timeout = $row[131]; $manual_auto_next = $row[132]; $manual_auto_show = $row[133]; $allow_required_fields = $row[134]; $dead_to_dispo = $row[135]; $agent_xfer_validation = $row[136]; $ready_max_logout = $row[137]; $callback_display_days = $row[138]; $three_way_record_stop = $row[139]; $hangup_xfer_record_start = $row[140]; $max_inbound_calls_outcome= $row[141]; $manual_auto_next_options = $row[142]; $agent_screen_time_display= $row[143]; $pause_max_dispo = $row[144]; $script_top_dispo = $row[145]; $routing_initiated_recording=$row[146]; $dead_trigger_seconds = $row[147]; $dead_trigger_action = $row[148]; $dead_trigger_repeat = $row[149]; $dead_trigger_filename = $row[150]; $scheduled_callbacks_force_dial = $row[151]; $callback_hours_block = $row[152]; $callback_display_days = $row[153]; $scheduled_callbacks_timezones_container = $row[154]; $three_way_volume_buttons = $row[155]; $manual_dial_validation = $row[156]; $mute_recordings = $row[157]; $leave_vm_no_dispo = $row[158]; $leave_vm_message_group_id = $row[159]; $campaign_script_two = $row[160]; $browser_alert_sound = $row[161]; $browser_alert_volume = $row[162]; $three_way_record_stop_exception = $row[163]; $pause_max_exceptions = $row[164]; $transfer_button_launch = $row[165]; $leave_3way_start_recording = $row[166]; $leave_3way_start_recording_exception = $row[167]; $calls_waiting_vl_one = $row[168]; $calls_waiting_vl_two = $row[169]; $in_man_dial_next_ready_seconds = $row[170]; $in_man_dial_next_ready_seconds_override = $row[171]; $transfer_no_dispo = $row[172]; $local_call_time = $row[173]; $pause_max_url = $row[174]; $agent_hide_hangup = $row[175]; $ig_xfer_list_sort = $row[176]; $script_tab_frame_size = $row[177]; $user_group_script = $row[178]; $agent_hangup_route = $row[179]; $agent_hangup_value = $row[180]; $agent_hangup_ig_override = $row[181]; $show_confetti = $row[182]; $camp_custom_one = $row[183]; $camp_custom_two = $row[184]; $camp_custom_three = $row[185]; $camp_custom_four = $row[186]; $camp_custom_five = $row[187]; $campaign_chat_enabled = $row[188]; $dead_stop_recording = $row[189]; $force_per_call_notes = $row[190]; $state_descriptions = $row[191]; $script_tab_height = $row[192]; $leave_3way_stop_recording =$row[193]; $manual_minimum_ring_seconds =$row[194]; $manual_minimum_attempt_seconds =$row[195]; $manual_minimum_answer_seconds =$row[196]; $CAMPsip_event_logging = $row[197]; $stereo_recording = $row[198]; $stereo_recording_agent = $row[199]; $recording_dtmf_muting = $row[200]; if ( (!preg_match("/DISABLED/",$VU_manual_dial_lead_id)) and (strlen($VU_manual_dial_lead_id) > 0) ) { echo "\n"; $manual_dial_lead_id = $VU_manual_dial_lead_id; } if ($SSstereo_recording < 1) {$stereo_recording='DISABLED'; $stereo_recording_agent='NEVER';} if ( ($manual_minimum_ring_seconds > 0) and ($SSsip_event_logging < 1) ) { echo "\n"; $manual_minimum_ring_seconds=0; } if ( ($manual_dial_timeout < 1) or (strlen($manual_dial_timeout) < 1) ) {$manual_dial_timeout = $dial_timeout;} if ($manual_dial_timeout > 0) { if ($manual_minimum_ring_seconds >= $manual_dial_timeout) { $manual_minimum_ring_seconds = ($manual_dial_timeout - 1); echo "\n"; } if ($manual_minimum_attempt_seconds >= $manual_dial_timeout) { $manual_minimum_attempt_seconds = ($manual_dial_timeout - 1); echo "\n"; } } $state_descriptions_banner=0; if ( ($state_descriptions != '---DISABLED---') and (strlen($state_descriptions) > 0) ) { $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='$state_descriptions';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01107',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $stde_ct = mysqli_num_rows($rslt); if ($stde_ct > 0) { $row=mysqli_fetch_row($rslt); $$state_descriptions_settings = $row[0]; $state_descriptions_banner++; } } $force_per_call_notes_minimum=0; if ($force_per_call_notes != 'DISABLED') { $force_per_call_notes_minimum=1; if (preg_match("/CHARACTERS/",$force_per_call_notes)) { $force_per_call_notes_minimum = $force_per_call_notes; $force_per_call_notes_minimum = preg_replace("/[^0-9]/",'',$force_per_call_notes_minimum); $force_per_call_notes='ENABLED'; } } if ( (strlen($UGscript_id) > 0) and ($user_group_script == 'ENABLED') ) { echo "\n"; $campaign_script = $UGscript_id; } ##### grab the datails of the campaign script in the system $camp_script_name='Agent Script'; $camp_script_color='#FFF5EC'; $stmt="SELECT script_name,script_color FROM vicidial_scripts WHERE script_id='$campaign_script';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01101',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $script_ct = mysqli_num_rows($rslt); if ($script_ct > 0) { $row=mysqli_fetch_row($rslt); $camp_script_name = $row[0]; if (strlen($row[1]) > 0) {$camp_script_color = $row[1];} } $agent_hide_hangup_ACTIVE=0; $agent_hide_hangup_ACTIVE_style=''; if ( ($agent_hide_hangup == 'Y') and ($SSagent_hide_hangup > 0) ) {$agent_hide_hangup_ACTIVE=1; $agent_hide_hangup_ACTIVE_style=';visibility:hidden';} if ( (strlen($VU_manual_dial_filter) > 0) and ($VU_manual_dial_filter != 'DISABLED') ) { echo "\n"; $manual_dial_filter = $VU_manual_dial_filter; } if ($dial_method != 'INBOUND_MAN') {$in_man_dial_next_ready_seconds=0;} $LTWSRcontainer_entry=''; if ( (strlen($leave_3way_start_recording_exception) > 1) and ($leave_3way_start_recording_exception != 'DISABLED') ) { # Gather details on Leave 3-Way Start Recording Exception settings container $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='$leave_3way_start_recording_exception';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01096',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $SCinfo_ct = mysqli_num_rows($rslt); if ($SCinfo_ct > 0) { $row=mysqli_fetch_row($rslt); $LTWSRcontainer_entry = $row[0]; $LTWSRcontainer_entry = preg_replace("/\r|\t|\'|\"/",'',$LTWSRcontainer_entry); $LTWSRcontainer_entry = preg_replace("/\n/",'x',$LTWSRcontainer_entry); if (strlen($LTWSRcontainer_entry) > 2) {$LTWSRcontainer_entry = 'x'.$LTWSRcontainer_entry.'x';} echo "\n"; } } $TWRSEcontainer_entry=''; if ( (strlen($three_way_record_stop_exception) > 1) and ($three_way_record_stop_exception != 'DISABLED') ) { # Gather details on 3-Way Recording Stop Exception settings container $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='$three_way_record_stop_exception';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01092',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $SCinfo_ct = mysqli_num_rows($rslt); if ($SCinfo_ct > 0) { $row=mysqli_fetch_row($rslt); $TWRSEcontainer_entry = $row[0]; $TWRSEcontainer_entry = preg_replace("/\r|\t|\'|\"/",'',$TWRSEcontainer_entry); $TWRSEcontainer_entry = preg_replace("/\n/",'x',$TWRSEcontainer_entry); if (strlen($TWRSEcontainer_entry) > 2) {$TWRSEcontainer_entry = 'x'.$TWRSEcontainer_entry.'x';} echo "\n"; } } if ($leave_vm_no_dispo == 'ENABLED') {$leave_vm_no_dispo = 'VMNOHANG';} else {$leave_vm_no_dispo = '';} $transfer_no_dispoLOCAL=0; $transfer_no_dispoEXTERNAL=0; $transfer_no_dispoLEAVE3WAY=0; if (preg_match("/LOCAL/",$transfer_no_dispo)) {$transfer_no_dispoLOCAL=1;} if (preg_match("/EXTERNAL/",$transfer_no_dispo)) {$transfer_no_dispoEXTERNAL=1;} if (preg_match("/LEAVE3WAY/",$transfer_no_dispo)) {$transfer_no_dispoLEAVE3WAY=1;} if ( ($SSmute_recordings < 1) or ( ($SSrecording_dtmf_detection > 0) and ($SSrecording_dtmf_muting > 0) and ($recording_dtmf_muting > 0) ) ) {$mute_recordings='N';} else { if ($VU_mute_recordings != 'DISABLED') {$mute_recordings = $VU_mute_recordings;} } if ($SSmanual_dial_validation == '2') {$manual_dial_validation='Y';} if ($SSmanual_dial_validation == '0') {$manual_dial_validation='N';} $scheduled_callbacks_timezones_enabled=0; if ( ($scheduled_callbacks_timezones_container != 'DISABLED') and (strlen($scheduled_callbacks_timezones_container) > 0) ) {$scheduled_callbacks_timezones_enabled++;} $MI_PAUSE = 0; if (preg_match("/MI_PAUSE/",$max_inbound_calls_outcome)) {$MI_PAUSE = 1;} if ($VU_ready_max_logout >= 0) {$ready_max_logout = $VU_ready_max_logout;} if ($dead_to_dispo == 'ENABLED') {$dead_to_dispo = 1;} else {$dead_to_dispo = 0;} if ( ($SSmanual_auto_next < 1) or ( ($dial_method != 'INBOUND_MAN') and ($dial_method != 'MANUAL') ) ) {$manual_auto_next = 0;} if ( (strlen($customer_gone_seconds) < 1) or ($customer_gone_seconds < 1) ) {$customer_gone_seconds=30;} $customer_gone_seconds_negative = ($customer_gone_seconds * -1); if ( ($callback_active_limit_override == 'Y') and ($callback_active_limit > 0) ) { $temp_cb_act_lmt_ovrd = preg_replace("/[^0-9]/",'',$VU_custom_three); if (strlen($temp_cb_act_lmt_ovrd) > 0) $callback_active_limit = $temp_cb_act_lmt_ovrd; } if ($VU_wrapup_seconds_override >= 0) {$wrapup_seconds = $VU_wrapup_seconds_override;} if ( ($pause_max < 10) or (strlen($pause_max)<2) ) {$pause_max=0;} if ( ($pause_max > 9) and ($pause_max <= $dial_timeout) ) {$pause_max = ($dial_timeout + 10);} if ( (strlen($pause_max_exceptions) > 1) and ($pause_max > 10) ) { # Gather details on Pause Codes Max Exceptions settings container $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='$pause_max_exceptions';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01095',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $SCinfo_ct = mysqli_num_rows($rslt); if ($SCinfo_ct > 0) { $row=mysqli_fetch_row($rslt); $PMEcontainer_entry = $row[0]; $PMEcontainer_entry = preg_replace("/\r|\t|\'|\"/",'',$PMEcontainer_entry); $PMEcontainer_entry = preg_replace("/\n/",'-',$PMEcontainer_entry); if (strlen($PMEcontainer_entry) > 2) {$PMEcontainer_entry = '-'.$PMEcontainer_entry.'-';} echo "\n"; } } $pause_max_url_trigger=0; if ( (strlen($pause_max_url) > 5) and ($pause_max > 10) ) {$pause_max_url_trigger=1;} if ( ($queuemetrics_pe_phone_append > 0) and (strlen($qm_phone_environment)>0) ) {$qm_phone_environment .= "-$qm_extension";} $status_display_NAME=0; $status_display_CALLID=0; $status_display_LEADID=0; $status_display_LISTID=0; if (preg_match("/NAME/",$status_display_fields)) {$status_display_NAME=1;} if (preg_match("/CALLID/",$status_display_fields)) {$status_display_CALLID=1;} if (preg_match("/LEADID/",$status_display_fields)) {$status_display_LEADID=1;} if (preg_match("/LISTID/",$status_display_fields)) {$status_display_LISTID=1;} if ( (strlen($leave_vm_message_group_id) > 1) and ($leave_vm_message_group_id != '---NONE---') ) { $leave_vm_message_group_exists=0; $stmt="SELECT count(*) from leave_vm_message_groups where leave_vm_message_group_id='$leave_vm_message_group_id' and active='Y';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01089',$VD_login,$server_ip,$session_name,$one_mysql_log);} $vmmg_count = mysqli_num_rows($rslt); if ($vmmg_count > 0) { $row=mysqli_fetch_row($rslt); if (strlen($row[0])>0) {$leave_vm_message_group_exists=1;} } if ($leave_vm_message_group_exists > 0) { $stmt="SELECT count(*) from leave_vm_message_groups_entries where leave_vm_message_group_id='$leave_vm_message_group_id';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01090',$VD_login,$server_ip,$session_name,$one_mysql_log);} $vmmge_count = mysqli_num_rows($rslt); if ($vmmge_count > 0) { $row=mysqli_fetch_row($rslt); if (strlen($row[0])>0) {$leave_vm_message_group_exists = $row[0];} } } } if ( ($screen_labels != '--SYSTEM-SETTINGS--') and (strlen($screen_labels)>1) ) { $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,label_lead_id,label_list_id,label_entry_date,label_gmt_offset_now,label_source_id,label_called_since_last_reset,label_status,label_user,label_date_of_birth,label_country_code,label_last_local_call_time,label_called_count,label_rank,label_owner,label_entry_list_id from vicidial_screen_labels where label_id='$screen_labels' and active='Y' limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01073',$VD_login,$server_ip,$session_name,$one_mysql_log);} $screenlabels_count = mysqli_num_rows($rslt); if ($screenlabels_count > 0) { $row=mysqli_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]; $hide_gender=0;} 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];} if (strlen($row[19])>0) {$label_lead_id = $row[19];} if (strlen($row[20])>0) {$label_list_id = $row[20];} if (strlen($row[21])>0) {$label_entry_date = $row[21];} if (strlen($row[22])>0) {$label_gmt_offset_now = $row[22];} if (strlen($row[23])>0) {$label_source_id = $row[23];} if (strlen($row[24])>0) {$label_called_since_last_reset = $row[24];} if (strlen($row[25])>0) {$label_status = $row[25];} if (strlen($row[26])>0) {$label_user = $row[26];} if (strlen($row[27])>0) {$label_date_of_birth = $row[27];} if (strlen($row[28])>0) {$label_country_code = $row[28];} if (strlen($row[29])>0) {$label_last_local_call_time = $row[29];} if (strlen($row[30])>0) {$label_called_count = $row[30];} if (strlen($row[31])>0) {$label_rank = $row[31];} if (strlen($row[32])>0) {$label_owner = $row[32];} if (strlen($row[33])>0) {$label_entry_list_id = $row[33];} ### END find any custom field labels ### if ($label_gender == '---HIDE---') {$hide_gender=1;} } } $launch_scb_force_dial=0; if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) { $scheduled_callbacks='1'; # check for any existing triggered USERONLY Scheduled Callbacks if ($scheduled_callbacks_force_dial == 'Y') { $campaignCBsql = ''; $campaignCBhoursSQL = ''; $campaignCBdisplaydaysSQL = ''; if ($agentonly_callback_campaign_lock > 0) {$campaignCBsql = "and campaign_id='$VD_campaign'";} if ($callback_hours_block > 0) { $x_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-$callback_hours_block,date("i"),date("s"),date("m"),date("d"),date("Y"))); $campaignCBhoursSQL = "and entry_time < \"$x_hours_ago\""; } if ($callback_display_days > 0) { $x_days_from_now = date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")+$callback_display_days,date("Y"))); $campaignCBdisplaydaysSQL = "and callback_time < \"$x_days_from_now\""; } $stmt = "SELECT count(*) from vicidial_callbacks where recipient='USERONLY' and user='$VD_login' $campaignCBsql $campaignCBhoursSQL $campaignCBdisplaydaysSQL and status IN('LIVE');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01091',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $launch_scb_force_dial=$row[0]; } } $hide_dispo_list=0; if ( ($disable_dispo_screen == 'DISPO_ENABLED') or ($disable_dispo_screen == 'DISPO_SELECT_DISABLED') or (strlen($disable_dispo_status) < 1) ) { if ($disable_dispo_screen == 'DISPO_SELECT_DISABLED') {$hide_dispo_list=1;} $disable_dispo_screen=0; $disable_dispo_status=''; } if ( ($disable_dispo_screen == 'DISPO_DISABLED') and (strlen($disable_dispo_status) > 0) ) {$disable_dispo_screen=1;} if ( ($VU_agent_lead_search_override == 'ENABLED') or ($VU_agent_lead_search_override == 'LIVE_CALL_INBOUND') or ($VU_agent_lead_search_override == 'LIVE_CALL_INBOUND_AND_MANUAL') or ($VU_agent_lead_search_override == 'DISABLED') ) {$agent_lead_search = $VU_agent_lead_search_override;} $AllowManualQueueCalls=1; $AllowManualQueueCallsChoice=0; if ($api_manual_dial == 'QUEUE') { $AllowManualQueueCalls=0; $AllowManualQueueCallsChoice=1; } if ($manual_preview_dial == 'DISABLED') {$manual_dial_preview = 0;} if ( ($manual_dial_override == 'ALLOW_ALL') and ($agentcall_manual < 1) ) {$agentcall_manual = 1;} if ($manual_dial_override == 'DISABLE_ALL') {$agentcall_manual = 0;} if ($user_territories_active < 1) {$agent_select_territories = 0;} if (preg_match("/Y/",$agent_select_territories)) {$agent_select_territories=1;} else {$agent_select_territories=0;} if (preg_match("/Y/",$agent_display_dialable_leads)) {$agent_display_dialable_leads=1;} else {$agent_display_dialable_leads=0;} if (preg_match("/Y/",$no_hopper_dialing)) {$no_hopper_dialing=1;} else {$no_hopper_dialing=0;} if ( (preg_match("/Y/",$call_requeue_button)) and ($auto_dial_level > 0) ) {$call_requeue_button=1;} else {$call_requeue_button=0;} if ( (preg_match("/AUTO/",$view_calls_in_queue_launch)) and ($auto_dial_level > 0) ) {$view_calls_in_queue_launch=1;} else {$view_calls_in_queue_launch=0;} if ( (!preg_match("/NONE/",$view_calls_in_queue)) and ($auto_dial_level > 0) ) {$view_calls_in_queue=1;} else {$view_calls_in_queue=0;} if (preg_match("/Y/",$pause_after_each_call)) {$dispo_check_all_pause=1;} $quick_transfer_button_enabled=0; $quick_transfer_button_locked=0; if (preg_match("/IN_GROUP|PRESET_1|PRESET_2|PRESET_3|PRESET_4|PRESET_5/",$quick_transfer_button)) {$quick_transfer_button_enabled=1;} if (preg_match("/LOCKED/",$quick_transfer_button)) {$quick_transfer_button_locked=1;} $custom_3way_button_transfer_enabled=0; $custom_3way_button_transfer_park=0; $custom_3way_button_transfer_view=0; $custom_3way_button_transfer_contacts=0; if (preg_match("/PRESET_|FIELD_/",$custom_3way_button_transfer)) {$custom_3way_button_transfer_enabled=1;} if (preg_match("/PARK_/",$custom_3way_button_transfer)) {$custom_3way_button_transfer_park=1; $custom_3way_button_transfer_enabled=1;} if (preg_match("/VIEW_PRESET/",$custom_3way_button_transfer)) {$custom_3way_button_transfer_view=1; $custom_3way_button_transfer_enabled=1;} if ( (preg_match("/VIEW_CONTACTS/",$custom_3way_button_transfer)) and ($enable_xfer_presets == 'CONTACTS') and ($VU_preset_contact_search != 'DISABLED') ) {$custom_3way_button_transfer_contacts=1; $custom_3way_button_transfer_enabled=1;} $preset_populate=''; $prepopulate_transfer_preset_enabled=0; if (preg_match("/PRESET_1|PRESET_2|PRESET_3|PRESET_4|PRESET_5/",$prepopulate_transfer_preset)) { $prepopulate_transfer_preset_enabled=1; if (preg_match("/PRESET_1/",$prepopulate_transfer_preset)) {$preset_populate = $xferconf_a_number;} if (preg_match("/PRESET_2/",$prepopulate_transfer_preset)) {$preset_populate = $xferconf_b_number;} if (preg_match("/PRESET_3/",$prepopulate_transfer_preset)) {$preset_populate = $xferconf_c_number;} if (preg_match("/PRESET_4/",$prepopulate_transfer_preset)) {$preset_populate = $xferconf_d_number;} if (preg_match("/PRESET_5/",$prepopulate_transfer_preset)) {$preset_populate = $xferconf_e_number;} } $VARpreset_names=''; $VARpreset_numbers=''; $VARpreset_dtmfs=''; $VARpreset_hide_numbers=''; if ($enable_xfer_presets == 'ENABLED') { ##### grab the presets for this campaign $stmt="SELECT preset_name,preset_number,preset_dtmf,preset_hide_number FROM vicidial_xfer_presets WHERE campaign_id='$VD_campaign' order by preset_name limit 500;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01067',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_presets = mysqli_num_rows($rslt); $j=0; while ($j < $VD_presets) { $row=mysqli_fetch_row($rslt); $preset_names[$j] = $row[0]; $preset_numbers[$j] = $row[1]; $preset_dtmfs[$j] = $row[2]; $preset_hide_numbers[$j] = $row[3]; $VARpreset_names = "$VARpreset_names'$preset_names[$j]',"; $VARpreset_numbers = "$VARpreset_numbers'$preset_numbers[$j]',"; $VARpreset_dtmfs = "$VARpreset_dtmfs'$preset_dtmfs[$j]',"; $VARpreset_hide_numbers = "$VARpreset_hide_numbers'$preset_hide_numbers[$j]',"; $j++; } $VARpreset_names = substr("$VARpreset_names", 0, -1); $VARpreset_numbers = substr("$VARpreset_numbers", 0, -1); $VARpreset_dtmfs = substr("$VARpreset_dtmfs", 0, -1); $VARpreset_hide_numbers = substr("$VARpreset_hide_numbers", 0, -1); $VD_preset_names_ct = $j; if ($j < 1) {$enable_xfer_presets='DISABLED';} } $default_group_alias_cid=''; if (strlen($default_group_alias)>1) { $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias' $LOGadmin_viewable_groupsSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} $VDIG_cidnum_ct = mysqli_num_rows($rslt); if ($VDIG_cidnum_ct > 0) { $row=mysqli_fetch_row($rslt); $default_group_alias_cid = $row[0]; } } $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} $VDIG_cidogwv = mysqli_num_rows($rslt); if ($VDIG_cidogwv > 0) { $row=mysqli_fetch_row($rslt); $default_web_vars = $row[0]; } if ( (!preg_match('/DISABLED/',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) { $campaign_recording = $VU_vicidial_recording_override; echo "\n"; } if ($VU_vicidial_recording=='0') {$campaign_recording='NEVER';} if ($VU_alter_custphone_override=='ALLOW_ALTER') {$disable_alter_custphone='N';} if (strlen($manual_dial_prefix) < 1) {$manual_dial_prefix = $dial_prefix;} if (strlen($three_way_dial_prefix) < 1) {$three_way_dial_prefix = $dial_prefix;} if ( ($alt_number_dialing=='Y') or ($alt_number_dialing=='SELECTED') or ($alt_number_dialing=='SELECTED_TIMER_ALT') or ($alt_number_dialing=='SELECTED_TIMER_ADDR3') or ($alt_number_dialing=='UNSELECTED') or ($alt_number_dialing=='UNSELECTED_TIMER_ALT') or ($alt_number_dialing=='UNSELECTED_TIMER_ADDR3') ) {$alt_phone_dialing='1';} else { $alt_phone_dialing='0'; $DefaulTAlTDiaL='0'; } if ($display_queue_count=='N') {$callholdstatus='0';} if ( ($dial_method == 'INBOUND_MAN') or ($outbound_autodial_active < 1) ) {$VU_closer_default_blended=0;} # Gather list of In-Groups for this user that have hit the daily limit, so we can exclude them $stmt="SELECT group_id FROM vicidial_inbound_group_agents WHERE user='$VD_login' and ( (daily_limit > -1) and (daily_limit <= calls_today) ) limit 1000;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01108',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_hit_limit_ingroups_ct = mysqli_num_rows($rslt); $VD_hit_limit_ingroups="'',"; $jx=0; while ($jx < $VD_hit_limit_ingroups_ct) { $row=mysqli_fetch_row($rslt); $VD_hit_limit_ingroups .= "'$row[0]',"; $jx++; } $VD_hit_limit_ingroups = substr("$VD_hit_limit_ingroups", 0, -1); $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $ADcloser_campaigns = preg_replace("/'/",'',$closer_campaigns); $closer_campaigns = "'$closer_campaigns'"; $ADcloser_campaignsARY = explode(',',$ADcloser_campaigns); $ADcloser_campaignsARYct = count($ADcloser_campaignsARY); $ADc=0; $ADcloser_campaigns=''; while ($ADc < $ADcloser_campaignsARYct) { if (preg_match("/AGENTDIRECT/i",$ADcloser_campaignsARY[$ADc])) {$ADcloser_campaigns .= "'$ADcloser_campaignsARY[$ADc]',";} $ADc++; } if (strlen($ADcloser_campaigns) > 3) {$ADcloser_campaigns = preg_replace("/,$/","",$ADcloser_campaigns);} if ( (preg_match('/Y/',$agent_pause_codes_active)) or (preg_match('/FORCE/',$agent_pause_codes_active)) ) { ##### grab the pause codes for this campaign $stmt="SELECT pause_code,pause_code_name,require_mgr_approval FROM vicidial_pause_codes WHERE campaign_id='$VD_campaign' order by pause_code limit 100;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_pause_codes = mysqli_num_rows($rslt); $j=0; $mgrapr_ct=0; while ($j < $VD_pause_codes) { $row=mysqli_fetch_row($rslt); $pause_codes[$i] = $row[0]; $pause_code_names[$i] = $row[1]; $pause_code_mgrapr[$i] = $row[2]; $VARpause_codes = "$VARpause_codes'$pause_codes[$i]',"; $VARpause_code_names = "$VARpause_code_names'$pause_code_names[$i]',"; $VARpause_code_mgrapr = "$VARpause_code_mgrapr'$pause_code_mgrapr[$i]',"; if ($pause_code_mgrapr[$i] == 'YES') {$mgrapr_ct++;} $i++; $j++; } $VD_pause_codes_ct = ($VD_pause_codes_ct+$VD_pause_codes); $VARpause_codes = substr("$VARpause_codes", 0, -1); $VARpause_code_names = substr("$VARpause_code_names", 0, -1); $VARpause_code_mgrapr = substr("$VARpause_code_mgrapr", 0, -1); } ##### grab the inbound groups to choose from if campaign contains CLOSER $VARingroups="''"; $VARingroup_handlers="''"; $VARphonegroups="''"; $VARemailgroups="''"; $VARchatgroups="''"; if ( ($campaign_allow_inbound == 'Y') and ($dial_method != 'MANUAL') ) { ### validate that the agent has not exceeded their max inbound calls for today if ( ($VU_max_inbound_calls > 0) or ($CP_max_inbound_calls > 0) ) { $max_inbound_calls = $CP_max_inbound_calls; if ($VU_max_inbound_calls > 0) {$max_inbound_calls = $VU_max_inbound_calls;} $stmt = "SELECT sum(calls_today),sum(calls_today_filtered) FROM vicidial_inbound_group_agents where user='$VD_login' and group_type='C';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01080',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "\n";} $vigagt_ct = mysqli_num_rows($rslt); if ($vigagt_ct > 0) { $row=mysqli_fetch_row($rslt); $max_inbound_count = $row[0]; if ($VU_max_inbound_filter_enabled > 0) {$max_inbound_count = $row[1];} if ($max_inbound_count >= $max_inbound_calls) { if (preg_match("/ALLOW_AGENTDIRECT/",$max_inbound_calls_outcome)) { $closer_campaigns = $ADcloser_campaigns; echo "\n"; } else { $closer_campaigns = "''"; echo "\n"; } } } } ### validate that the agent has inbound_credits available, if that feature is enabled if ( ($VU_inbound_credits >= 0) and ($VU_inbound_credits < 1) && ($SSinbound_credits > 0) ) { if (preg_match("/ALLOW_AGENTDIRECT/",$max_inbound_calls_outcome)) { $closer_campaigns = $ADcloser_campaigns; echo "\n"; } else { $closer_campaigns = "''"; echo "\n"; } } $VARingroups=''; $VARingroup_handlers=''; $VARphonegroups=''; $VARemailgroups=''; $VARchatgroups=''; $stmt="SELECT group_id,group_handling from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) and group_id NOT IN($VD_hit_limit_ingroups) order by group_id limit 800;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $closer_ct = mysqli_num_rows($rslt); $INgrpCT=0; $EMAILgrpCT=0; $CHATgrpCT=0; $PHONEgrpCT=0; while ($INgrpCT < $closer_ct) { $row=mysqli_fetch_row($rslt); $closer_groups[$INgrpCT] =$row[0]; $closer_group_handling[$INgrpCT] =$row[1]; // PHONE OR EMAIL OR CHAT - this is important $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; $VARingroup_handlers = "$VARingroup_handlers'$closer_group_handling[$INgrpCT]',"; if ($row[1]=="EMAIL") // Make a list of ingroups for email handling groups, chat handling groups and one for phones, so there is no overlap { $VARemailgroups = "$VARemailgroups'$closer_groups[$INgrpCT]',"; $VARemailgroupsURL = $VARemailgroupsURL."&email_group_ids[]=$closer_groups[$INgrpCT]"; $EMAILgrpCT++; } else if ($row[1]=="CHAT") { $VARchatgroups = "$VARchatgroups'$closer_groups[$INgrpCT]',"; $VARchatgroupsURL = $VARchatgroupsURL."&chat_group_ids[]=$closer_groups[$INgrpCT]"; $CHATgrpCT++; } else { $VARphonegroups = "$VARphonegroups'$closer_groups[$INgrpCT]',"; $VARphonegroupsURL = $VARphonegroupsURL."&phone_group_ids[]=$closer_groups[$INgrpCT]"; $PHONEgrpCT++; } $INgrpCT++; } $VARingroups = substr("$VARingroups", 0, -1); $VARingroup_handlers = substr("$VARingroup_handlers", 0, -1); $VARphonegroups = substr("$VARphonegroups", 0, -1); $VARemailgroups = substr("$VARemailgroups", 0, -1); $VARchatgroups = substr("$VARchatgroups", 0, -1); } else {$closer_campaigns = "''";} $in_group_dial_display=0; if ($in_group_dial != 'DISABLED') { $in_group_dial_display=1; if ($in_group_dial_select == 'CAMPAIGN_SELECTED') { $VARdialingroups=''; $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) and group_id NOT IN($VD_hit_limit_ingroups) order by group_id limit 800;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01076',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dialcloser_ct = mysqli_num_rows($rslt); $dialINgrpCT=0; while ($dialINgrpCT < $dialcloser_ct) { $row=mysqli_fetch_row($rslt); $dial_closer_groups[$dialINgrpCT] =$row[0]; $VARdialingroups = "$VARdialingroups'$dial_closer_groups[$dialINgrpCT]',"; $dialINgrpCT++; } $VARdialingroups = substr("$VARdialingroups", 0, -1); } if ($in_group_dial_select == 'ALL_USER_GROUP') { $VARdialingroups=''; $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and user_group IN('---ALL---','$VU_user_group') and group_id NOT IN($VD_hit_limit_ingroups) order by group_id limit 800;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01077',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $dialcloser_ct = mysqli_num_rows($rslt); $dialINgrpCT=0; while ($dialINgrpCT < $dialcloser_ct) { $row=mysqli_fetch_row($rslt); $dial_closer_groups[$dialINgrpCT] =$row[0]; $VARdialingroups = "$VARdialingroups'$dial_closer_groups[$dialINgrpCT]',"; $dialINgrpCT++; } $VARdialingroups = substr("$VARdialingroups", 0, -1); } } ##### gather territory listings for this agent if select territories is enabled $VARterritories=''; if ($agent_select_territories > 0) { $stmt="SELECT territory from vicidial_user_territories where user='$VD_login';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01062',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $territory_ct = mysqli_num_rows($rslt); $territoryCT=0; while ($territoryCT < $territory_ct) { $row=mysqli_fetch_row($rslt); $territories[$territoryCT] =$row[0]; $VARterritories = "$VARterritories'$territories[$territoryCT]',"; $territoryCT++; } $VARterritories = substr("$VARterritories", 0, -1); echo "\n"; } ##### grab the allowable inbound groups to choose from for transfer options $xfer_groups = preg_replace("/^ | -$/","",$xfer_groups); $xfer_groups = preg_replace("/ /","','",$xfer_groups); $xfer_groups = "'$xfer_groups'"; $VARxfergroups="''"; if ($allow_closers == 'Y') { $xfer_list_sortSQL = 'order by group_id'; if ($ig_xfer_list_sort == 'GROUP_ID_UP') {$xfer_list_sortSQL = 'order by group_id';} if ($ig_xfer_list_sort == 'GROUP_ID_DOWN') {$xfer_list_sortSQL = 'order by group_id desc';} if ($ig_xfer_list_sort == 'GROUP_NAME_UP') {$xfer_list_sortSQL = 'order by group_name';} if ($ig_xfer_list_sort == 'GROUP_NAME_DOWN') {$xfer_list_sortSQL = 'order by group_name desc';} if ($ig_xfer_list_sort == 'PRIORITY_UP') {$xfer_list_sortSQL = 'order by queue_priority';} if ($ig_xfer_list_sort == 'PRIORITY_DOWN') {$xfer_list_sortSQL = 'order by queue_priority desc';} $VARxfergroups=''; $stmt="SELECT group_id,group_name from vicidial_inbound_groups where active = 'Y' and group_id IN($xfer_groups) $xfer_list_sortSQL limit 800;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $xfer_ct = mysqli_num_rows($rslt); $XFgrpCT=0; while ($XFgrpCT < $xfer_ct) { $row=mysqli_fetch_row($rslt); $VARxfergroups = "$VARxfergroups'$row[0]',"; $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} $XFgrpCT++; } $VARxfergroups = substr("$VARxfergroups", 0, -1); $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); } if (preg_match('/Y/',$agent_allow_group_alias)) { ##### grab the active group aliases $stmt="SELECT group_alias_id,group_alias_name,caller_id_number FROM groups_alias WHERE active='Y' $LOGadmin_viewable_groupsSQL order by group_alias_id limit 1000;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $VD_group_aliases = mysqli_num_rows($rslt); $j=0; while ($j < $VD_group_aliases) { $row=mysqli_fetch_row($rslt); $group_alias_id[$i] = $row[0]; $group_alias_name[$i] = $row[1]; $caller_id_number[$i] = $row[2]; $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; $i++; $j++; } $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); } ##### grab the number of leads in the hopper for this campaign $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $row=mysqli_fetch_row($rslt); $campaign_leads_to_call = $row[0]; echo "\n"; } else { $VDloginDISPLAY=1; $VDdisplayMESSAGE = _QXZ("Campaign not active, please try again")."
"; } } else { if ($WeBRooTWritablE > 0) { fwrite ($fp, "vdweb|FAIL|$date|$browser|\n"); fclose($fp); } $VDloginDISPLAY=1; $VDdisplayMESSAGE = _QXZ("Login incorrect, please try again")."
"; if ($auth_message == 'LOCK') {$VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes")."
";} if ($auth_message == 'ERRNETWORK') {$VDdisplayMESSAGE = _QXZ("Too many network errors, please contact your administrator")."
";} if ($auth_message == 'ERRSERVERS') {$VDdisplayMESSAGE = _QXZ("No available servers, please contact your administrator")."
";} if ($auth_message == 'ERRPHONES') {$VDdisplayMESSAGE = _QXZ("No available phones, please contact your administrator")."
";} if ($auth_message == 'ERRDUPLICATE') {$VDdisplayMESSAGE = _QXZ("You are already logged in, please log out of your other session first")."
";} if ($auth_message == 'ERRAGENTS') {$VDdisplayMESSAGE = _QXZ("Too many agents logged in, please contact your administrator")."
";} if ($auth_message == 'ERRCAMPAGENTS') {$VDdisplayMESSAGE = _QXZ("Too many agents logged in to this campaign, please contact your manager")."
";} if ($auth_message == 'ERRCASE') {$VDdisplayMESSAGE = _QXZ("Login incorrect, user names are case sensitive")."
";} if ($auth_message == 'IPBLOCK') {$VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed").": $ip
";} } } if ($VDloginDISPLAY) { echo ""._QXZ("Agent web client: Campaign Login")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."$grey_link
\n";} echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "

$VDdisplayMESSAGE

"; echo ""; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; if ($login_submit_once > 0) {echo "\n"; echo "\n"; echo "
\"Agent "._QXZ("Campaign Login")."
 
"._QXZ("User Login").":
"._QXZ("User Password:")."
"._QXZ("Campaign:")." $camp_form_code
  \n";} else {echo "
  \n";} echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } $original_phone_login = $phone_login; # code for parsing load-balanced agent phone allocation where agent interface # will send multiple phones-table logins so that the script can determine the # server that has the fewest agents logged into it. # login: ca101,cb101,cc101 $alias_found=0; $stmt="select count(*) from phones_alias where alias_id = '$phone_login';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} $alias_ct = mysqli_num_rows($rslt); if ($alias_ct > 0) { $row=mysqli_fetch_row($rslt); $alias_found = $row[0]; } if ($alias_found > 0) { $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} $alias_ct = mysqli_num_rows($rslt); if ($alias_ct > 0) { $row=mysqli_fetch_row($rslt); $alias_name = $row[0]; $phone_login = $row[1]; } } $pa=0; if ( (preg_match('/,/i',$phone_login)) and (strlen($phone_login) > 2) ) { $phoneSQL = "("; $phones_auto = explode(',',$phone_login); $phones_auto_ct = count($phones_auto); while($pa < $phones_auto_ct) { if ($pa > 0) {$phoneSQL .= " or ";} $desc = ($phones_auto_ct - $pa - 1); # traverse in reverse order $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')"; $pa++; } $phoneSQL .= ")"; } else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";} $authphone=0; #$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; $active_agentSQL = "and active_agent_login_server='Y'"; if ($admin_test == 'YES') {$active_agentSQL='';} $stmt="SELECT count(*) from phones,servers where $phoneSQL and phones.active = 'Y' and phones.server_ip=servers.server_ip $active_agentSQL;"; if ($DB) {echo "|$stmt|\n";} echo "\n"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $authphone=$row[0]; if (!$authphone) { echo ""._QXZ("Agent web client: Phone Login Error")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."$grey_link
\n";} echo "\n"; echo "\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "


"; echo ""; echo ""; echo "\n"; echo "\n"; echo ""; echo "\n"; echo ""; echo "\n"; if ($login_submit_once > 0) {echo "\n";} echo "\n"; echo "
\"Agent "._QXZ("Login Error")."
 
"._QXZ("Sorry, your phone login and password are not active in this system, please try again:")."
 
"._QXZ("Phone Login:")."
"._QXZ("Phone Password:")."
  \n";} else {echo "

"._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } else { ##### BEGIN phone login load balancing functions ##### ### go through the phones logins list to figure out which server has ### fewest non-remote agents logged in and use that phone login account if ($pa > 0) { $pb=0; $pb_login=''; $pb_server_ip=''; $pb_count=0; $pb_log=''; $pb_valid_server_ips=''; $pb_force_set=0; while ( ($pb < $phones_auto_ct) and ($pb_force_set < 1) ) { ### find the server_ip of each phone_login $stmtn="SELECT count(*) from phones where login = '$phones_auto[$pb]';"; if ($DB) {echo "|$stmtx|\n";} if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} $rslt=mysql_to_mysqli($stmtn, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01084',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rown=mysqli_fetch_row($rslt); if ($rown[0] > 0) { $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';"; if ($DB) {echo "|$stmtx|\n";} $rslt=mysql_to_mysqli($stmtx, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowx=mysqli_fetch_row($rslt); } else {$rowx[0]='0.0.0.0';} ##### figure out which table to look for conferences in $stmt="SELECT conf_engine from servers where server_ip = '$rowx[0]';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $conf_engine = $row[0]; if ( $conf_engine == "CONFBRIDGE" ) { $conf_table = "vicidial_confbridges"; } ### get number of agents logged in to each server $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]' and extension NOT LIKE \"R%\";"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); ### find out whether the server is set to active $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y' $active_agentSQL;"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowy=mysqli_fetch_row($rslt); $stmt="SELECT count(*) FROM $conf_table where server_ip='$rowx[0]' and ((extension='') or (extension is null));"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01085',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowys=mysqli_fetch_row($rslt); ### find out if this server has a twin $twin_not_live=0; if ($rowy[0] > 0) { $stmt="SELECT active_twin_server_ip from servers where server_ip = '$rowx[0]';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01070',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowyy=mysqli_fetch_row($rslt); if (strlen($rowyy[0]) > 4) { ### find out whether the twin server_updater is running $stmt="SELECT count(*) from server_updater where server_ip = '$rowyy[0]' and last_update > '$past_minutes_date';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01071',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowyz=mysqli_fetch_row($rslt); if ($rowyz[0] < 1) {$twin_not_live=1;} } } ### find out whether the server_updater is running $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowz=mysqli_fetch_row($rslt); $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowys[0]|$rowz[0]|$twin_not_live| "; if ( ($rowy[0] > 0) and ($rowys[0] > 0) and ($rowz[0] > 0) and ($twin_not_live < 1) ) { if ( ($pllb_grouping == 'ONE_SERVER_ONLY') or ($pllb_grouping == 'CASCADING') ) { if ($pllb_grouping == 'ONE_SERVER_ONLY') { ### one-server-only plib check ### get number of agents logged in to each server $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]' and campaign_id='$VD_campaign' and extension NOT LIKE \"R%\";"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01074',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowG=mysqli_fetch_row($rslt); if ($rowG[0] > 0) { $pb_count=$row[0]; $pb_server_ip=$rowx[0]; $phone_login=$phones_auto[$pb]; $pb_force_set++; echo "\n"; } } else { ### cascading plib check ### get number of agents logged in to each server $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]' and campaign_id='$VD_campaign' and extension NOT LIKE \"R%\";"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01075',$VD_login,$server_ip,$session_name,$one_mysql_log);} $rowG=mysqli_fetch_row($rslt); echo "\n"; if ( ($rowG[0] > 0) and ($rowG[0] < $pllb_grouping_limit) and ($row[0] < $SSpllb_grouping_limit) ) { $pb_count=$row[0]; $pb_server_ip=$rowx[0]; $phone_login=$phones_auto[$pb]; $pb_force_set++; echo "\n"; } } } if ($DB > 0) {echo "($pb_count <> $row[0]) $pb|$pb_force_set|$phones_auto[$pb]|$pb_server_ip|$pb_count| -->\n";} if ($pb_force_set < 1) { if ( ($pb_count >= $row[0]) or (strlen($pb_server_ip) < 4) ) { $pb_count=$row[0]; $pb_server_ip=$rowx[0]; $phone_login=$phones_auto[$pb]; } } } $pb++; } echo "\n"; } ##### END phone login load balancing functions ##### 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,codecs_list,webphone_dialpad,phone_ring_timeout,on_hook_agent,webphone_auto_answer,webphone_dialbox,webphone_mute,webphone_volume,webphone_debug,webphone_layout,webphone_settings from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $extension=$row[0]; $dialplan_number=$row[1]; $voicemail_id=$row[2]; $phone_ip=$row[3]; $computer_ip=$row[4]; $server_ip=$row[5]; $login=$row[6]; $pass=$row[7]; $status=$row[8]; $active=$row[9]; $phone_type=$row[10]; $fullname=$row[11]; $company=$row[12]; $picture=$row[13]; $messages=$row[14]; $old_messages=$row[15]; $protocol=$row[16]; $local_gmt=$row[17]; $ASTmgrUSERNAME=$row[18]; $ASTmgrSECRET=$row[19]; $login_user=$row[20]; $login_pass=$row[21]; $login_campaign=$row[22]; $park_on_extension=$row[23]; $conf_on_extension=$row[24]; $VICIDiaL_park_on_extension=$row[25]; $VICIDiaL_park_on_filename=$row[26]; $monitor_prefix=$row[27]; $recording_exten=$row[28]; $voicemail_exten=$row[29]; $voicemail_dump_exten=$row[30]; $ext_context=$row[31]; $dtmf_send_extension=$row[32]; $call_out_number_group=$row[33]; $client_browser=$row[34]; $install_directory=$row[35]; $local_web_callerID_URL=$row[36]; $VICIDiaL_web_URL=$row[37]; $AGI_call_logging_enabled=$row[38]; $user_switching_enabled=$row[39]; $conferencing_enabled=$row[40]; $admin_hangup_enabled=$row[41]; $admin_hijack_enabled=$row[42]; $admin_monitor_enabled=$row[43]; $call_parking_enabled=$row[44]; $updater_check_enabled=$row[45]; $AFLogging_enabled=$row[46]; $QUEUE_ACTION_enabled=$row[47]; $CallerID_popup_enabled=$row[48]; $voicemail_button_enabled=$row[49]; $enable_fast_refresh=$row[50]; $fast_refresh_rate=$row[51]; $enable_persistant_mysql=$row[52]; $auto_dial_next_number=$row[53]; $VDstop_rec_after_each_call=$row[54]; $DBX_server=$row[55]; $DBX_database=$row[56]; $DBX_user=$row[57]; $DBX_pass=$row[58]; $DBX_port=$row[59]; $outbound_cid=$row[65]; $enable_sipsak_messages=$row[66]; $conf_secret=$row[72]; $is_webphone=$row[73]; $use_external_server_ip=$row[74]; $codecs_list=$row[75]; $webphone_dialpad=$row[76]; $phone_ring_timeout=$row[77]; $on_hook_agent=$row[78]; $webphone_auto_answer=$row[79]; $webphone_dialbox=$row[80]; $webphone_mute=$row[81]; $webphone_volume=$row[82]; $webphone_debug=$row[83]; $webphone_layout=$row[84]; $webphone_settings=$row[85]; if (strlen($webphone_layout_override)>0) {$webphone_layout = $webphone_layout_override;} $login_context = $ext_context; if (strlen($meetme_enter_login_filename) > 0) {$login_context = 'meetme-enter-login';} if ( ($phone_login == 'nophone') or ($on_hook_agent == 'Y') ) { $no_empty_session_warnings=1; } if ($PhonESComPIP == '1') { if (strlen($computer_ip) < 4) { $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} } } if ($PhonESComPIP == '2') { $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} } if ($clientDST) { $local_gmt = ($local_gmt + $isdst); } $stmt="SELECT asterisk_version,web_socket_url,external_web_socket_url,conf_engine from servers where server_ip='$server_ip';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $asterisk_version = $row[0]; $web_socket_url = $row[1]; $external_web_socket_url = $row[2]; $conf_engine = $row[3]; if ( ($use_external_server_ip=='Y') and (strlen($external_web_socket_url) > 5) ) {$web_socket_url = $external_web_socket_url;} $major_version = explode('.',$asterisk_version); if ($major_version[0] >= 13) { if ( ($volumecontrol_active > 0) and ($ast13_volume_override < 1) ) { echo "\n"; $volumecontrol_active=0; } } $login_context = $ext_context; if (strlen($meetme_enter_login_filename) > 0) { $login_context = 'meetme-enter-login'; if ( $conf_engine == "CONFBRIDGE" ) { $login_context = 'confbridge-enter-login'; } } if ($protocol == 'EXTERNAL') { $protocol = 'Local'; $extension = "$dialplan_number$AT$ext_context"; } if (preg_match("/Zap/i",$protocol)) { if (preg_match("/^1\.0|^1\.2|^1\.4\.1|^1\.4\.20|^1\.4\.21/i",$asterisk_version)) {$do_nothing=1;} else { $protocol = 'DAHDI'; } } $SIP_user = "$protocol/$extension"; $SIP_user_DiaL = "$protocol/$extension"; $qm_extension = "$extension"; if ( (preg_match('/8300/',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) { $SIP_user = "$protocol/$extension$VD_login"; $qm_extension = "$extension$VD_login"; } # If a park extension is not set, use the default one if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) { $VICIDiaL_park_on_extension = "$park_ext"; $VICIDiaL_park_on_filename = "$park_file_name"; echo "\n"; } echo "\n"; # If a web form address is not set, use the default one if (strlen($web_form_address)>0) { $VICIDiaL_web_form_address = "$web_form_address"; echo "\n"; } else { $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; print "\n"; $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); } $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); # If a web form address two is not set, use the first one if (strlen($web_form_address_two)>0) { $VICIDiaL_web_form_address_two = "$web_form_address_two"; echo "\n"; } else { $VICIDiaL_web_form_address_two = "$VICIDiaL_web_form_address"; echo "\n"; $VICIDiaL_web_form_address_two_enc = rawurlencode($VICIDiaL_web_form_address_two); } $VICIDiaL_web_form_address_two_enc = rawurlencode($VICIDiaL_web_form_address_two); # If a web form address three is not set, use the first one if (strlen($web_form_address_three)>0) { $VICIDiaL_web_form_address_three = "$web_form_address_three"; echo "\n"; } else { $VICIDiaL_web_form_address_three = "$VICIDiaL_web_form_address"; echo "\n"; $VICIDiaL_web_form_address_three_enc = rawurlencode($VICIDiaL_web_form_address_three); } $VICIDiaL_web_form_address_three_enc = rawurlencode($VICIDiaL_web_form_address_three); # If closers are allowed on this campaign if ($allow_closers=="Y") { $VICIDiaL_allow_closers = 1; echo "\n"; } else { $VICIDiaL_allow_closers = 0; echo "\n"; } $session_ext = preg_replace("/[^a-z0-9]/i", "", $extension); if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} $session_rand = (rand(1,9999999) + 10000000); $session_name = "$StarTtimE$US$session_ext$session_rand"; if ($webform_sessionname) {$webform_sessionname = "&session_name=$session_name";} else {$webform_sessionname = '';} $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ( ( ($campaign_allow_inbound == 'Y') and ($dial_method != 'MANUAL') ) || ($campaign_leads_to_call > 0) || (preg_match('/Y/',$no_hopper_leads_logins)) ) { ##### figure out which table to look for conferences in $conf_table = "vicidial_conferences"; if ( $conf_engine == "CONFBRIDGE" ) { $conf_table = "vicidial_confbridges"; } ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly $stmt="SELECT conf_exten FROM $conf_table where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $prev_login_ct = mysqli_num_rows($rslt); $i=0; while ($i < $prev_login_ct) { $row=mysqli_fetch_row($rslt); $session_id =$row[0]; $i++; } if ($prev_login_ct > 0) {echo "\n";} else { ##### grab the next available conference room and reserve it $stmt="SELECT count(*) FROM $conf_table where server_ip='$server_ip' and ((extension='') or (extension is null));"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); if ($row[0] > 0) { $stmt="UPDATE $conf_table set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="SELECT conf_exten from $conf_table where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$VD_login') );"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); $session_id = $row[0]; } echo "\n"; } ### mark leads that were not dispositioned during previous calls as ERI $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} $vlERIaffected_rows = mysqli_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_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} $vhICaffected_rows = mysqli_affected_rows($link); echo "\n"; $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} $vlaLIaffected_rows = mysqli_affected_rows($link); echo "\n"; $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} $vliaLIaffected_rows = mysqli_affected_rows($link); echo "\n"; $stmt="UPDATE routing_initiated_recordings set processed='2' where user='$VD_login' and processed='0';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01086',$VD_login,$server_ip,$session_name,$one_mysql_log);} $RIRaffected_rows = mysqli_affected_rows($link); echo "\n"; $VULhostname = php_uname('n'); $VULservername = $_SERVER['SERVER_NAME']; if (strlen($VULhostname)<1) {$VULhostname='X';} if (strlen($VULservername)<1) {$VULservername='X';} $stmt="SELECT webserver_id FROM vicidial_webservers where webserver='$VULservername' and hostname='$VULhostname' LIMIT 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01080',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $webserver_id_ct = mysqli_num_rows($rslt); if ($webserver_id_ct > 0) { $row=mysqli_fetch_row($rslt); $webserver_id = $row[0]; } else { ##### insert webserver entry $stmt="INSERT INTO vicidial_webservers (webserver,hostname) values('$VULservername','$VULhostname');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01081',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($link); $webserver_id = mysqli_insert_id($link); echo "\n"; } $stmt="SELECT url_id FROM vicidial_urls where url='$agcPAGE' LIMIT 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01082',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $url_id_ct = mysqli_num_rows($rslt); if ($url_id_ct > 0) { $row=mysqli_fetch_row($rslt); $url_id = $row[0]; } else { ##### insert url entry $stmt="INSERT INTO vicidial_urls (url) values('$agcPAGE');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01083',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($link); $url_id = mysqli_insert_id($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,phone_login,server_phone,phone_ip,webserver,login_url,browser_width,browser_height) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group','$session_id','$server_ip','$protocol/$extension','$ip','$browser','$vul_data','$original_phone_login','$phone_login','LOOKUP','$webserver_id','$url_id','$JS_browser_width','$JS_browser_height');"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($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 on phone: $SIP_user to campaign: $VD_campaign
\n"; $VICIDiaL_is_logged_in=1; ### set the callerID for manager middleware-app to connect the phone to the user $SIqueryCID = "S$CIDdate$session_id"; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pe_phone_append,queuemetrics_pause_type FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysqli_fetch_row($rslt); $enable_queuemetrics_logging = $row[0]; $queuemetrics_server_ip = $row[1]; $queuemetrics_dbname = $row[2]; $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; $vicidial_agent_disable = $row[6]; $allow_sipsak_messages = $row[7]; $queuemetrics_loginout = $row[8]; $queuemetrics_addmember_enabled = $row[9]; $queuemetrics_pe_phone_append = $row[10]; $queuemetrics_pause_type = $row[11]; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) ) { $extension = preg_replace("/\'|\"|\\\\|<|>|;/","",$extension); $phone_ip = preg_replace("/\'|\"|\\\\|<|>|;/","",$phone_ip); $SIPSAK_prefix = 'LIN-'; echo "\n"; passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$VD_campaign\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); $SIqueryCID = "$SIPSAK_prefix$VD_campaign$DS$CIDdate"; } if ($SSlogin_kickall > 0) { $local_DEF = 'Local/5555'; $local_AMP = '@'; $kick_local_channel = "$local_DEF$session_id$local_AMP$ext_context"; $queryCID = "ULKA3459$StarTtime"; $login_kickall_stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $kick_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$VD_login','$phone_login');"; if ($DB) {echo "$login_kickall_stmt\n";} $rslt=mysql_to_mysqli($login_kickall_stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01102',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($link); echo "\n"; sleep(2); } $WebPhonEurl=''; $webphone_content=''; $TEMP_SIP_user_DiaL = $SIP_user_DiaL; if ($on_hook_agent == 'Y') {$TEMP_SIP_user_DiaL = 'Local/8300@default';} ### insert a NEW record to the vicidial_manager table to be processed $session_prepend = ''; if ( $conf_engine == 'CONFBRIDGE' ) { $session_prepend = 2; } $agent_login_data="||$NOW_TIME|NEW|N|$server_ip||Originate|$SIqueryCID|Channel: $SIP_user_DiaL|Context: $login_context|Exten: $session_prepend$session_id|Priority: 1|Callerid: \"$SIqueryCID\" <$campaign_cid>|||||"; $agent_login_stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $TEMP_SIP_user_DiaL','Context: $login_context','Exten: $session_prepend$session_id','Priority: 1','Callerid: \"$SIqueryCID\" <$campaign_cid>','','','','','');"; ### log outbound call in the vicidial_user_dial_log $stmt = "INSERT INTO vicidial_user_dial_log SET caller_code='$SIqueryCID',user='$VD_login',call_date='$NOW_TIME',call_type='APL',notes='$session_id $login_context $TEMP_SIP_user_DiaL';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ( ($is_webphone != 'Y') and ($is_webphone != 'Y_API_LAUNCH') ) { if ($DB) {echo "$agent_login_stmt\n";} $rslt=mysql_to_mysqli($agent_login_stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($link); echo "\n"; } else { ### build Iframe variable content for webphone here $codecs_list = preg_replace("/ /",'',$codecs_list); $codecs_list = preg_replace("/-/",'',$codecs_list); $codecs_list = preg_replace("/&/",'',$codecs_list); $webphone_server_ip = $server_ip; if ($use_external_server_ip=='Y') { ##### find external_server_ip if enabled for this phone account $stmt="SELECT external_server_ip FROM servers where server_ip='$server_ip' LIMIT 1;"; $rslt=mysql_to_mysqli($stmt, $link); 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 = mysqli_num_rows($rslt); if ($exip_ct > 0) { $row=mysqli_fetch_row($rslt); $webphone_server_ip =$row[0]; } } if (strlen($webphone_url) < 6) { ##### find webphone_url in system_settings and generate IFRAME code for it ##### $stmt="SELECT webphone_url FROM system_settings LIMIT 1;"; $rslt=mysql_to_mysqli($stmt, $link); 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 = mysqli_num_rows($rslt); if ($wu_ct > 0) { $row=mysqli_fetch_row($rslt); $webphone_url =$row[0]; } } if (strlen($system_key) < 1) { ##### find system_key in system_settings if populated ##### $stmt="SELECT webphone_systemkey FROM system_settings LIMIT 1;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01068',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $wsk_ct = mysqli_num_rows($rslt); if ($wsk_ct > 0) { $row=mysqli_fetch_row($rslt); $system_key =$row[0]; } } $webphone_settings_scrubbed = ''; if (strlen($webphone_settings) > 0) { $stmt="SELECT container_entry FROM vicidial_settings_containers WHERE container_id='$webphone_settings';"; $rslt=mysql_to_mysqli($stmt, $link); if (mysqli_num_rows($rslt) > 0) { $row=mysqli_fetch_row($rslt); $webphone_settings_entry = $row[0]; ### scrub unnecessary characters from the settings container $webphone_settings_lines = preg_split('/\r\n|\r|\n/',$webphone_settings_entry); foreach( $webphone_settings_lines as $line ) { # remove comments if ( strpos($line, '#') === 0 ) { $line = substr($line, 0, strpos($line, '#')); } # remove whitespace outside double quotes $line = preg_replace('~"[^"]*"(*SKIP)(*F)|\s+~',"",$line); # remove blank lines if ($line != '') { $webphone_settings_scrubbed = $webphone_settings_scrubbed . $line . '\n'; # check for dialRegExten enabled if (preg_match("/dialRegExten/i",$line)) { $temp_line = $line; $temp_line = preg_replace("/.*:/","",$temp_line); $dialRegExten_enabled = preg_replace("/[^0-9]/","",$temp_line); } } } } } $webphone_options='INITIAL_LOAD'; if ($webphone_dialpad == 'Y') {$webphone_options .= "--DIALPAD_Y";} if ($webphone_dialpad == 'N') {$webphone_options .= "--DIALPAD_N";} if ($webphone_dialpad == 'TOGGLE') {$webphone_options .= "--DIALPAD_TOGGLE";} if ($webphone_dialpad == 'TOGGLE_OFF') {$webphone_options .= "--DIALPAD_OFF_TOGGLE";} if ($webphone_auto_answer == 'Y') {$webphone_options .= "--AUTOANSWER_Y";} if ($webphone_auto_answer == 'N') {$webphone_options .= "--AUTOANSWER_N";} if ($webphone_dialbox == 'Y') {$webphone_options .= "--DIALBOX_Y";} if ($webphone_dialbox == 'N') {$webphone_options .= "--DIALBOX_N";} if ($webphone_mute == 'Y') {$webphone_options .= "--MUTE_Y";} if ($webphone_mute == 'N') {$webphone_options .= "--MUTE_N";} if ($webphone_volume == 'Y') {$webphone_options .= "--VOLUME_Y";} if ($webphone_volume == 'N') {$webphone_options .= "--VOLUME_N";} if ($webphone_debug == 'Y') {$webphone_options .= "--DEBUG";} if (strlen($web_socket_url) > 5) {$webphone_options .= "--WEBSOCKETURL$web_socket_url";} if (strlen($webphone_layout) > 0) {$webphone_options .= "--WEBPHONELAYOUT$webphone_layout";} if (strlen($session_id) > 0) { $webphone_options .= "--SESSION$session_id";} if (strlen($webphone_settings_scrubbed) > 0) {$webphone_options .= "--SETTINGS$webphone_settings_scrubbed";} $webphone_url = preg_replace("/LOCALFQDN/",$FQDN,$webphone_url); ### base64 encode variables $b64_phone_login = base64_encode($extension); $b64_phone_pass = base64_encode($conf_secret); $b64_session_name = base64_encode($session_name); $b64_server_ip = base64_encode($webphone_server_ip); $b64_callerid = base64_encode($outbound_cid); $b64_protocol = base64_encode($protocol); $b64_codecs = base64_encode($codecs_list); $b64_options = base64_encode($webphone_options); $b64_system_key = base64_encode($system_key); $WebPhonEurl = "$webphone_url?phone_login=$b64_phone_login&phone_login=$b64_phone_login&phone_pass=$b64_phone_pass&server_ip=$b64_server_ip&callerid=$b64_callerid&protocol=$b64_protocol&codecs=$b64_codecs&options=$b64_options&system_key=$b64_system_key"; if ($is_webphone == 'Y') { if ($webphone_location == 'bar') { $webphone_content = ""; } else { $webphone_content = ""; } } } $stmt="DELETE from vicidial_session_data where user='$VD_login';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01078',$VD_login,$server_ip,$session_name,$one_mysql_log);} $stmt="INSERT INTO vicidial_session_data SET session_name='$session_name',user='$VD_login',campaign_id='$VD_campaign',server_ip='$server_ip',conf_exten='$session_id',extension='$extension',login_time='$NOW_TIME',webphone_url='$WebPhonEurl',agent_login_call='$agent_login_data';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01079',$VD_login,$server_ip,$session_name,$one_mysql_log);} ##### grab the campaign_weight and number of calls today on that campaign for the agent $stmt="SELECT campaign_weight,calls_today,campaign_grade FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $vca_ct = mysqli_num_rows($rslt); if ($vca_ct > 0) { $row=mysqli_fetch_row($rslt); $campaign_weight = $row[0]; $calls_today = $row[1]; $campaign_grade = $row[2]; $i++; } else { $campaign_weight = '0'; $calls_today = '0'; $campaign_grade = '1'; $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today,campaign_grade) values('$VD_login','$VD_campaign','0','0','$calls_today','$campaign_grade');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($link); echo "\n"; } if ($auto_dial_level > 0) { echo "\n"; $closer_chooser_string=''; $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today,last_state_change,outbound_autodial,manager_ingroup_set,on_hook_ring_time,on_hook_agent,last_inbound_call_time,last_inbound_call_finish,campaign_grade,pause_code,last_inbound_call_time_filtered,last_inbound_call_finish_filtered) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today','$NOW_TIME','Y','N','$phone_ring_timeout','$on_hook_agent','$NOW_TIME','$NOW_TIME','$campaign_grade','LOGIN','$NOW_TIME','$NOW_TIME');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($link); echo "\n"; $stmt="INSERT IGNORE INTO vicidial_live_agents_details set latency='0',web_ip='$ip',update_date=NOW(),user='$VD_login';"; if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03103',$user,$server_ip,$session_name,$one_mysql_log);} if ($enable_queuemetrics_logging > 0) { $QM_LOGIN = 'AGENTLOGIN'; $QM_PHONE = "$VD_login@agents"; if ( ($queuemetrics_loginout=='CALLBACK') or ($queuemetrics_loginout=='NONE') ) { $QM_LOGIN = 'AGENTCALLBACKLOGIN'; $QM_PHONE = "$SIP_user_DiaL"; } if ( (strlen($queuemetrics_server_ip)>0) and (strlen($queuemetrics_login)>0) and (strlen($queuemetrics_pass)>0) and (strlen($queuemetrics_dbname)>0) ) { $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); if (!$linkB) {die(_QXZ("Could not connect to Queuemetrics: ")."$queuemetrics_server_ip|$queuemetrics_login" . mysqli_connect_error());} } else { die(_QXZ("Invalid Queuemetrics DB Credentials").": $queuemetrics_server_ip|$queuemetrics_login|PASS|$queuemetrics_dbname"); } mysqli_select_db($linkB, "$queuemetrics_dbname"); if ( ($queuemetrics_pe_phone_append > 0) and (strlen($qm_phone_environment)>0) ) {$qm_phone_environment .= "-$qm_extension";} if ($queuemetrics_loginout!='NONE') { $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='$QM_LOGIN',data1='$QM_PHONE',serverid='$queuemetrics_log_id',data4='$qm_phone_environment';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($linkB); echo "\n"; } $pause_typeSQL=''; if ($queuemetrics_pause_type > 0) {$pause_typeSQL=",data5='AGENT'";} $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id',data4='$qm_phone_environment' $pause_typeSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($linkB); echo "\n"; if ($queuemetrics_addmember_enabled > 0) { $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='ADDMEMBER2',data1='$QM_PHONE',serverid='$queuemetrics_log_id',data4='$qm_phone_environment';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01069',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($linkB); echo "\n"; } mysqli_close($linkB); mysqli_select_db($link, "$VARDB_database"); } if ( ($campaign_allow_inbound == 'Y') and ($dial_method != 'MANUAL') ) { print "\n"; } } else { print "\n"; $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,user_level,campaign_weight,calls_today,last_state_change,outbound_autodial,manager_ingroup_set,on_hook_ring_time,on_hook_agent,campaign_grade,last_inbound_call_time_filtered,last_inbound_call_finish_filtered) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level', '$campaign_weight', '$calls_today','$NOW_TIME','N','N','$phone_ring_timeout','$on_hook_agent','$campaign_grade','$NOW_TIME','$NOW_TIME');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($link); echo "\n"; if ($enable_queuemetrics_logging > 0) { $QM_LOGIN = 'AGENTLOGIN'; $QM_PHONE = "$VD_login@agents"; if ( ($queuemetrics_loginout=='CALLBACK') or ($queuemetrics_loginout=='NONE') ) { $QM_LOGIN = 'AGENTCALLBACKLOGIN'; $QM_PHONE = "$SIP_user_DiaL"; } if ( (strlen($queuemetrics_server_ip)>0) and (strlen($queuemetrics_login)>0) and (strlen($queuemetrics_pass)>0) and (strlen($queuemetrics_dbname)>0) ) { $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); if (!$linkB) {die(_QXZ("Could not connect to Queuemetrics: ")."$queuemetrics_server_ip|$queuemetrics_login" . mysqli_connect_error());} } else { die(_QXZ("Invalid Queuemetrics DB Credentials").": $queuemetrics_server_ip|$queuemetrics_login|PASS|$queuemetrics_dbname"); } mysqli_select_db($linkB, "$queuemetrics_dbname"); if ($queuemetrics_loginout!='NONE') { $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='$QM_LOGIN',data1='$QM_PHONE',serverid='$queuemetrics_log_id',data4='$qm_phone_environment';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($linkB); echo "\n"; } $pause_typeSQL=''; if ($queuemetrics_pause_type > 0) {$pause_typeSQL=",data5='AGENT'";} $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id',data4='$qm_phone_environment' $pause_typeSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($linkB); echo "\n"; if ($queuemetrics_addmember_enabled > 0) { $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='ADDMEMBER2',data1='$QM_PHONE',serverid='$queuemetrics_log_id',data4='$qm_phone_environment';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01072',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($linkB); echo "\n"; } mysqli_close($linkB); mysqli_select_db($link, "$VARDB_database"); } } } else { echo ""._QXZ("Agent web client: Campaign Login")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."$grey_link
\n";} echo "\n"; echo "\n"; echo "
\n"; echo ""._QXZ("Sorry, there are no leads in the hopper for this campaign")."\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""._QXZ("Login:")." \n
"; echo ""._QXZ("Password:")."
\n"; echo ""._QXZ("Campaign:")." $camp_form_code
\n"; if ($login_submit_once > 0) {echo "   \n";} else {echo "   \n";} echo "\n"; echo "
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } if (strlen($session_id) < 1) { echo ""._QXZ("Agent web client: Campaign Login")."\n"; echo "\n"; echo "\n"; if ($hide_timeclock_link < 1) {echo " "._QXZ("Timeclock")."$grey_link
\n";} echo "\n"; echo "\n"; echo "
\n"; echo ""._QXZ("Sorry, there are no available sessions").": |$session_id|$server_ip|$extension|$SIP_user|\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""._QXZ("Login:")." \n
"; echo ""._QXZ("Password:")."
\n"; echo ""._QXZ("Campaign:")." $camp_form_code
\n"; if ($login_submit_once > 0) {echo "   \n";} else {echo "   \n";} echo "\n"; echo "
\n"; echo "\n\n"; echo "\n\n"; echo "$LoginLoadingBox"; echo "
\n"; echo "$INSERT_before_body_close"; echo "\n\n"; echo "\n\n"; exit; } if (preg_match('/MSIE/',$browser)) { $useIE=1; echo "\n"; } else { $useIE=0; echo "\n"; } $StarTtimE = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); ##### Agent is going to log in so insert the vicidial_agent_log entry now $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status,pause_type) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE','$VU_user_group','LOGIN','AGENT');"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($link); $agent_log_id = mysqli_insert_id($link); echo "\n"; ##### update vicidial_campaigns to show agent has logged in $stmt="UPDATE vicidial_campaigns set campaign_logindate='$NOW_TIME' where campaign_id='$VD_campaign';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01064',$VD_login,$server_ip,$session_name,$one_mysql_log);} $VCaffected_rows = mysqli_affected_rows($link); echo "\n"; if ($enable_queuemetrics_logging > 0) { $StarTtimEpause = ($StarTtimE + 1); if ( (strlen($queuemetrics_server_ip)>0) and (strlen($queuemetrics_login)>0) and (strlen($queuemetrics_pass)>0) and (strlen($queuemetrics_dbname)>0) ) { $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); if (!$linkB) {die(_QXZ("Could not connect to Queuemetrics: ")."$queuemetrics_server_ip|$queuemetrics_login" . mysqli_connect_error());} } else { die(_QXZ("Invalid Queuemetrics DB Credentials").": $queuemetrics_server_ip|$queuemetrics_login|PASS|$queuemetrics_dbname"); } mysqli_select_db($linkB, "$queuemetrics_dbname"); $pause_typeSQL=''; if ($queuemetrics_pause_type > 0) {$pause_typeSQL=",data5='AGENT'";} $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimEpause',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEREASON',data1='LOGIN',data3='$QM_PHONE',serverid='$queuemetrics_log_id'$pause_typeSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $linkB); if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01063',$VD_login,$server_ip,$session_name,$one_mysql_log);} $affected_rows = mysqli_affected_rows($linkB); echo "\n"; mysqli_close($linkB); mysqli_select_db($link, "$VARDB_database"); } $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id' where user='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01061',$VD_login,$server_ip,$session_name,$one_mysql_log);} $VLAaffected_rows_update = mysqli_affected_rows($link); $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} $VUaffected_rows = mysqli_affected_rows($link); $S='*'; $D_s_ip = explode('.', $server_ip); if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; ##### grab the datails of all active scripts in the system $stmt="SELECT script_id,script_name,script_color FROM vicidial_scripts WHERE active='Y' order by script_id limit 1000;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $MM_scripts = mysqli_num_rows($rslt); $e=0; while ($e < $MM_scripts) { $row=mysqli_fetch_row($rslt); $MMscriptid[$e] =$row[0]; $MMscriptname[$e] = urlencode($row[1]); $MMscriptcolor[$e] = urlencode($row[2]); $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; $MMscriptcolors = "$MMscriptcolors'$MMscriptcolor[$e]',"; $e++; } $MMscriptids = substr("$MMscriptids", 0, -1); $MMscriptnames = substr("$MMscriptnames", 0, -1); $MMscriptcolors = substr("$MMscriptcolors", 0, -1); ##### BEGIN vicidial_list FIELD LENGTH LOOKUP ##### $MAXvendor_lead_code = '20'; $MAXphone_code = '10'; $MAXphone_number = '18'; $MAXtitle = '4'; $MAXfirst_name = '30'; $MAXmiddle_initial = '1'; $MAXlast_name = '30'; $MAXaddress1 = '100'; $MAXaddress2 = '100'; $MAXaddress3 = '100'; $MAXcity = '50'; $MAXstate = '2'; $MAXprovince = '50'; $MAXpostal_code = '10'; $MAXalt_phone = '12'; $MAXemail = '70'; $MAXsecurity_phrase = '100'; $stmt = "SHOW COLUMNS FROM vicidial_list;"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01087',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $scvl_ct = mysqli_num_rows($rslt); $s=0; while ($scvl_ct > $s) { $row=mysqli_fetch_row($rslt); $vl_field = $row[0]; $vl_type = preg_replace("/[^0-9]/",'',$row[1]); if (strlen($vl_type) > 0) { if ( ($vl_field == 'vendor_lead_code') and ($MAXvendor_lead_code != $vl_type) ) {$MAXvendor_lead_code = $vl_type;} if ( ($vl_field == 'phone_code') and ($MAXphone_code != $vl_type) ) {$MAXphone_code = $vl_type;} if ( ($vl_field == 'phone_number') and ($MAXphone_number != $vl_type) ) {$MAXphone_number = $vl_type;} if ( ($vl_field == 'title') and ($MAXtitle != $vl_type) ) {$MAXtitle = $vl_type;} if ( ($vl_field == 'first_name') and ($MAXfirst_name != $vl_type) ) {$MAXfirst_name = $vl_type;} if ( ($vl_field == 'middle_initial') and ($MAXmiddle_initial != $vl_type) ) {$MAXmiddle_initial = $vl_type;} if ( ($vl_field == 'last_name') and ($MAXlast_name != $vl_type) ) {$MAXlast_name = $vl_type;} if ( ($vl_field == 'address1') and ($MAXaddress1 != $vl_type) ) {$MAXaddress1 = $vl_type;} if ( ($vl_field == 'address2') and ($MAXaddress2 != $vl_type) ) {$MAXaddress2 = $vl_type;} if ( ($vl_field == 'address3') and ($MAXaddress3 != $vl_type) ) {$MAXaddress3 = $vl_type;} if ( ($vl_field == 'city') and ($MAXcity != $vl_type) ) {$MAXcity = $vl_type;} if ( ($vl_field == 'state') and ($MAXstate != $vl_type) ) {$MAXstate = $vl_type;} if ( ($vl_field == 'province') and ($MAXprovince != $vl_type) ) {$MAXprovince = $vl_type;} if ( ($vl_field == 'postal_code') and ($MAXpostal_code != $vl_type) ) {$MAXpostal_code = $vl_type;} if ( ($vl_field == 'alt_phone') and ($MAXalt_phone != $vl_type) ) {$MAXalt_phone = $vl_type;} if ( ($vl_field == 'email') and ($MAXemail != $vl_type) ) {$MAXemail = $vl_type;} if ( ($vl_field == 'security_phrase') and ($MAXsecurity_phrase != $vl_type) ) {$MAXsecurity_phrase = $vl_type;} } $s++; } ##### END vicidial_list FIELD LENGTH LOOKUP ##### } } ### SCREEN WIDTH AND HEIGHT CALCULATIONS ### ### DO NOT EDIT! ### if ($stretch_dimensions > 0) { if ($agent_status_view < 1) { if ($JS_browser_width >= 510) {$BROWSER_WIDTH = ($JS_browser_width - 80);} } else { if ($JS_browser_width >= 730) {$BROWSER_WIDTH = ($JS_browser_width - 300);} } 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';} if ($MASTERheight < 300) {$MASTERheight = '300';} if ($per_call_notes == 'ENABLED') { if ($MASTERheight < 340) {$MASTERheight = '340';} } else {$force_per_call_notes='DISABLED'; $force_per_call_notes_minimum=0;} if ($webphone_location == 'bar') {$MASTERwidth = ($MASTERwidth + $webphone_height);} $CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) $SBwidth = ($MASTERwidth + 331); # 761 - SideBar starting point $MNwidth = ($MASTERwidth + 330); # 760 - main frame $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks $CQwidth = ($MASTERwidth + 300); # 730 - calls in queue listings $AMwidth = ($MASTERwidth + 270); # 700 - refresh links $SCwidth = ($MASTERwidth + 230); # 670 - live call seconds counter, sidebar link $PDwidth = ($MASTERwidth + 210); # 650 - preset-dial links $MUwidth = ($MASTERwidth + 180); # 610 - agent mute $SSwidth = ($MASTERwidth + 176); # 606 - scroll form/email/chat panels $SPwidth = ($MASTERwidth + 176); # 606 - scroll script panels $SDwidth = ($MASTERwidth + 170); # 600 - customer data and calls-in-session $SEwidth = ($MASTERwidth + 170); # 600 - scroll script contents $HKwidth = ($MASTERwidth + 20); # 450 - Hotkeys button $HSwidth = ($MASTERwidth + 1); # 431 - Header spacer $PBwidth = ($MASTERwidth + 0); # 430 - Presets list $CLwidth = ($MASTERwidth - 120); # 310 - Calls in queue link $GHheight = ($MASTERheight + 1260);# 1560 - Gender Hide span $DBheight = ($MASTERheight + 260); # 560 - Debug span $WRheight = ($MASTERheight + 210); # 510 - Warning boxes $CQheight = ($MASTERheight + 140); # 440 - Calls in queue section $SLheight = ($MASTERheight + 122); # 422 - SideBar link, Agents view link $QLheight = ($MASTERheight + 112); # 412 - Calls in queue link $HKheight = ($MASTERheight + 105); # 405 - HotKey active Button $AMheight = ($MASTERheight + 100); # 400 - Agent mute buttons $PBheight = ($MASTERheight + 90); # 390 - preset dial links $MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons $SDLheight = ($MASTERheight + 67); # 367 - Show Dialable Leads $CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status $SSheight = ($MASTERheight + 31); # 331 - script content $HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey $BPheight = ($MASTERheight - 250); # 50 - bottom buffer, Agent Xfer Span $SCheight = 49; # 49 - seconds on call display $SFheight = 65; # 65 - height of the script and form contents $SRheight = 69; # 69 - height of the script and form refrech links $CHheight = ($JS_browser_height - 50); $HKheightS = $HKheight; # HotKey active Button when SCRIPT tab is visible $HTheightS = $HTheight; # hotkey panel when SCRIPT tab is visible if ($webphone_location == 'bar') { $SCheight = ($SCheight + $webphone_height); # $SFheight = ($SFheight + $webphone_height); $SRheight = ($SRheight + $webphone_height); } if ($state_descriptions_banner > 0) { # $SCheight = ($SCheight + $banner_height); # $SFheight = ($SFheight + $banner_height); $SRheight = ($SRheight + $banner_height); } if ( ($script_tab_height >= 331) and ($script_tab_height <= 3000) ) { $SSheight = $script_tab_height; $HKheightS = ($SSheight + 84); # HotKey active Button $HTheightS = ($SSheight - 11); # HotKey panel } $AVTheight = '0'; if ($is_webphone) {$AVTheight = '20';} if ($script_tab_frame_size == 'LEFT_EDGE') { $SPwidth = ($SPwidth + 154); $SEwidth = ($SEwidth + 154); } $start_recording_GIF = 'vdc_LB_startrecording.gif'; $start_recording_GIF_off = 'vdc_LB_startrecording_OFF.gif'; $stop_recording_GIF = 'vdc_LB_stoprecording.gif'; $stop_recording_GIF_off = 'vdc_LB_stoprecording_OFF.gif'; $STstart_recording_GIF = 'vdc_LB_STstartrecording.gif'; $STstart_recording_GIF_off = 'vdc_LB_STstartrecording_OFF.gif'; $STstop_recording_GIF = 'vdc_LB_STstoprecording.gif'; $STstop_recording_GIF_off = 'vdc_LB_STstoprecording_OFF.gif'; if (preg_match("/RECORDING/",$SSrecording_buttons)) { if (preg_match("/2xHEIGHT/",$SSrecording_buttons)) { $start_recording_GIF = 'vdc_LB_startrecording_altx2.gif'; $start_recording_GIF_off = 'vdc_LB_startrecording_altx2_OFF.gif'; $stop_recording_GIF = 'vdc_LB_stoprecording_altx2.gif'; $stop_recording_GIF_off = 'vdc_LB_stoprecording_altx2_OFF.gif'; $STstart_recording_GIF = 'vdc_LB_STstartrecording_altx2.gif'; $STstart_recording_GIF_off = 'vdc_LB_STstartrecording_altx2_OFF.gif'; $STstop_recording_GIF = 'vdc_LB_STstoprecording_altx2.gif'; $STstop_recording_GIF_off = 'vdc_LB_STstoprecording_altx2_OFF.gif'; } else { $start_recording_GIF = 'vdc_LB_startrecording_alt.gif'; $start_recording_GIF_off = 'vdc_LB_startrecording_alt_OFF.gif'; $stop_recording_GIF = 'vdc_LB_stoprecording_alt.gif'; $stop_recording_GIF_off = 'vdc_LB_stoprecording_alt_OFF.gif'; $STstart_recording_GIF = 'vdc_LB_STstartrecording_alt.gif'; $STstart_recording_GIF_off = 'vdc_LB_STstartrecording_alt_OFF.gif'; $STstop_recording_GIF = 'vdc_LB_STstoprecording_alt.gif'; $STstop_recording_GIF_off = 'vdc_LB_STstoprecording_alt_OFF.gif'; } } ################################################################ ### BEGIN - build the callback calendar (12 months) ### ################################################################ define ('ADAY', (60*60*24)); $CdayARY = getdate(); $Cmon = $CdayARY['mon']; $Cyear = $CdayARY['year']; $CTODAY = date("Y-m"); $CTODAYmday = date("j"); $CINC=0; $live_days=0; $limit_days=999; if ($callback_days_limit > 0) {$limit_days=$callback_days_limit;} $cb_display_days=999; if ($callback_display_days > 0) {$cb_display_days=$callback_display_days;} # gather any holidays associated with the Local Call Time that is set for this campaign $ct_holidays=''; $ct_holiday_dates='|'; $ct_holiday_dateARY=array(); $ct_holiday_nameARY=array(); $stmt = "SELECT ct_holidays FROM vicidial_call_times where call_time_id='$local_call_time';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01097',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} $ct_conf_ct = mysqli_num_rows($rslt); if ($ct_conf_ct > 0) { $row=mysqli_fetch_row($rslt); $ct_holidays = $row[0]; $ct_holidays = preg_replace("/^\||\|$/","','",$ct_holidays); $ct_holidays = preg_replace("/\|/","','",$ct_holidays); $ct_holidays = "'$ct_holidays'"; } if (strlen($ct_holidays) > 2) { $stmt = "SELECT holiday_date,holiday_name FROM vicidial_call_time_holidays where holiday_id IN($ct_holidays) and holiday_status='ACTIVE';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01098',$VD_login,$server_ip,$session_name,$one_mysql_log);} $hd_conf_ct = mysqli_num_rows($rslt); if ($DB) {echo "$hd_conf_ct|$stmt\n";} $hd_ct=0; while ($hd_conf_ct > $hd_ct) { $row=mysqli_fetch_row($rslt); $ct_holiday_dates .= "$row[0]|"; $ct_holiday_dateARY[$hd_ct]=$row[0]; $ct_holiday_nameARY[$hd_ct]=$row[1]; $hd_ct++; } echo "\n"; } $Cmonths = Array('0',_QXZ('January'),_QXZ('February'),_QXZ('March'),_QXZ('April'),_QXZ('May'),_QXZ('June'),_QXZ('July'),_QXZ('August'),_QXZ('September'),_QXZ('October'),_QXZ('November'),_QXZ('December')); $Cdays = Array(_QXZ('Sun'),_QXZ('Mon'),_QXZ('Tue'),_QXZ('Wed'),_QXZ('Thu'),_QXZ('Fri'),_QXZ('Sat')); $CCAL_OUT = ''; $CCAL_OUT .= ""; while ($CINC < 12) { if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) {$CCAL_OUT .= "";} $CCAL_OUT .= ""; if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) {$CCAL_OUT .= "";} $CINC++; } $CCAL_OUT .= "
"; $CYyear = $Cyear; $Cmonth= ($Cmon + $CINC); if ($Cmonth > 12) { $Cmonth = ($Cmonth - 12); $CYyear++; } $Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); $CfirstdayARY = getdate($Cstart); #echo "|$Cmon|$Cmonth|$CINC|\n"; $CPRNTDAY = date("Y-m", $Cstart); $hDAYcheck = date("Y-m-d", $Cstart); $temp_Cmonths = $Cmonths[$CfirstdayARY['mon']]; $temp_Cfirstday = $CfirstdayARY['year']; $future_color='#ffffff'; $holiday_bg=''; $CCAL_OUT .= ""; $CCAL_OUT .= ""; $CCAL_OUT .= ""; $CCAL_OUT .= ""; foreach($Cdays as $Cday) { $CDCLR="#ffffff"; $CCAL_OUT .= ""; } for( $Ccount=0;$Ccount<(6*7);$Ccount++) { $Cdayarray = getdate($Cstart); if((($Ccount) % 7) == 0) { if($Cdayarray['mon'] != $CfirstdayARY['mon']) break; $CCAL_OUT .= ""; } if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) { $CCAL_OUT .= ""; } else { if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) { $CPRNTmday = $Cdayarray['mday']; if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} if ($limit_days > $live_days) { $CB_date_onclick="onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\""; $CBL = ""; $CEL = ""; } else {$CBL=''; $CEL=''; $CB_date_onclick='';} $CCAL_OUT .= ""; $Cstart += ADAY; $live_days++; } else { $holiday_hover=''; $CDCLR="#ffffff"; if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) { $CDCLR="$MAIN_COLOR"; $CBL = ''; $CEL = ''; $CB_date_onclick=''; } else { $CPRNTmday = $Cdayarray['mday']; if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} if (preg_match("/\|$CPRNTDAY-$CPRNTmday\|/",$ct_holiday_dates)) { $hd_loop=0; while ($hd_loop < $hd_ct) { if ($ct_holiday_dateARY[$hd_loop] == "$CPRNTDAY-$CPRNTmday") { $holiday_hover="onMouseOver=\"holiday_display('$ct_holiday_nameARY[$hd_loop]');\"; onMouseOut=\"hideDiv('HolidayDisplayDiv');\""; } $CDCLR="#FFCC66"; $hd_loop++; } } if ($limit_days > $live_days) { $CB_date_onclick="onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\""; $CBL = ""; $CEL = ""; } else {$CBL=''; $CEL=''; $CB_date_onclick='';} $live_days++; } $CCAL_OUT .= ""; $Cstart += ADAY; } } } $CCAL_OUT .= ""; $CCAL_OUT .= "
"; $CCAL_OUT .= "
"; $CCAL_OUT .= _QXZ($temp_Cmonths)." $temp_Cfirstday"; $CCAL_OUT .= "
"; $CCAL_OUT .= "
"; $CCAL_OUT .= "
"; $CCAL_OUT .= _QXZ("$Cday", 3); $CCAL_OUT .= "
"; $CCAL_OUT .= "
 "; $CCAL_OUT .= "
"; $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; $CCAL_OUT .= "
"; $CCAL_OUT .= "
"; $CCAL_OUT .= "
"; $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; $CCAL_OUT .= "
"; $CCAL_OUT .= "
"; $CCAL_OUT .= "
"; #echo "$CCAL_OUT\n"; ################################################################ ### END - build the callback calendar (12 months) ### ################################################################ $calls_waiting_vl_oneLABEL=''; $calls_waiting_vl_twoLABEL=''; if ( ($calls_waiting_vl_one != 'DISABLED') and (strlen($calls_waiting_vl_one) > 2) ) { $calls_waiting_vl_oneLABEL = $calls_waiting_vl_one; if ($calls_waiting_vl_one == 'title') {$calls_waiting_vl_oneLABEL = $label_title;} if ($calls_waiting_vl_one == 'first_name') {$calls_waiting_vl_oneLABEL = $label_first_name;} if ($calls_waiting_vl_one == 'middle_initial') {$calls_waiting_vl_oneLABEL = $label_middle_initial;} if ($calls_waiting_vl_one == 'last_name') {$calls_waiting_vl_oneLABEL = $label_last_name;} if ($calls_waiting_vl_one == 'address1') {$calls_waiting_vl_oneLABEL = $label_address1;} if ($calls_waiting_vl_one == 'address2') {$calls_waiting_vl_oneLABEL = $label_address2;} if ($calls_waiting_vl_one == 'address3') {$calls_waiting_vl_oneLABEL = $label_address3;} if ($calls_waiting_vl_one == 'city') {$calls_waiting_vl_oneLABEL = $label_city;} if ($calls_waiting_vl_one == 'state') {$calls_waiting_vl_oneLABEL = $label_state;} if ($calls_waiting_vl_one == 'province') {$calls_waiting_vl_oneLABEL = $label_province;} if ($calls_waiting_vl_one == 'postal_code') {$calls_waiting_vl_oneLABEL = $label_postal_code;} if ($calls_waiting_vl_one == 'vendor_lead_code') {$calls_waiting_vl_oneLABEL = $label_vendor_lead_code;} if ($calls_waiting_vl_one == 'gender') {$calls_waiting_vl_oneLABEL = $label_gender;} if ($calls_waiting_vl_one == 'phone_number') {$calls_waiting_vl_oneLABEL = $label_phone_number;} if ($calls_waiting_vl_one == 'phone_code') {$calls_waiting_vl_oneLABEL = $label_phone_code;} if ($calls_waiting_vl_one == 'alt_phone') {$calls_waiting_vl_oneLABEL = $label_alt_phone;} if ($calls_waiting_vl_one == 'security_phrase') {$calls_waiting_vl_oneLABEL = $label_security_phrase;} if ($calls_waiting_vl_one == 'email') {$calls_waiting_vl_oneLABEL = $label_email;} if ($calls_waiting_vl_one == 'comments') {$calls_waiting_vl_oneLABEL = $label_comments;} if ($calls_waiting_vl_one == 'entry_date') {$calls_waiting_vl_oneLABEL = $label_entry_date;} if ($calls_waiting_vl_one == 'source_id') {$calls_waiting_vl_oneLABEL = $label_source_id;} if ($calls_waiting_vl_one == 'date_of_birth') {$calls_waiting_vl_oneLABEL = $label_date_of_birth;} if ($calls_waiting_vl_one == 'rank') {$calls_waiting_vl_oneLABEL = $label_rank;} if ($calls_waiting_vl_one == 'owner') {$calls_waiting_vl_oneLABEL = $label_owner;} if ($calls_waiting_vl_one == 'last_local_call_time') {$calls_waiting_vl_oneLABEL = $label_last_local_call_time;} if ($calls_waiting_vl_one == 'entry_list_id') {$calls_waiting_vl_oneLABEL = $label_entry_list_id;} if ($calls_waiting_vl_one == 'list_id') {$calls_waiting_vl_oneLABEL = $label_list_id;} if ($calls_waiting_vl_one == 'lead_id') {$calls_waiting_vl_oneLABEL = $label_lead_id;} if ($calls_waiting_vl_one == 'gmt_offset_now') {$calls_waiting_vl_oneLABEL = $label_gmt_offset_now;} if ($calls_waiting_vl_one == 'called_count') {$calls_waiting_vl_oneLABEL = $label_called_count;} if ($calls_waiting_vl_one == 'status') {$calls_waiting_vl_oneLABEL = $label_status;} if ($calls_waiting_vl_one == 'user') {$calls_waiting_vl_oneLABEL = $label_user;} if ($calls_waiting_vl_one == 'called_since_last_reset') {$calls_waiting_vl_oneLABEL = $label_called_since_last_reset;} if ($calls_waiting_vl_one == 'country_code') {$calls_waiting_vl_oneLABEL = $label_country_code;} $calls_waiting_vl_oneLABEL = strtoupper($calls_waiting_vl_oneLABEL); } if ( ($calls_waiting_vl_two != 'DISABLED') and (strlen($calls_waiting_vl_two) > 2) ) { $calls_waiting_vl_twoLABEL = $calls_waiting_vl_two; if ($calls_waiting_vl_two == 'title') {$calls_waiting_vl_twoLABEL = $label_title;} if ($calls_waiting_vl_two == 'first_name') {$calls_waiting_vl_twoLABEL = $label_first_name;} if ($calls_waiting_vl_two == 'middle_initial') {$calls_waiting_vl_twoLABEL = $label_middle_initial;} if ($calls_waiting_vl_two == 'last_name') {$calls_waiting_vl_twoLABEL = $label_last_name;} if ($calls_waiting_vl_two == 'address1') {$calls_waiting_vl_twoLABEL = $label_address1;} if ($calls_waiting_vl_two == 'address2') {$calls_waiting_vl_twoLABEL = $label_address2;} if ($calls_waiting_vl_two == 'address3') {$calls_waiting_vl_twoLABEL = $label_address3;} if ($calls_waiting_vl_two == 'city') {$calls_waiting_vl_twoLABEL = $label_city;} if ($calls_waiting_vl_two == 'state') {$calls_waiting_vl_twoLABEL = $label_state;} if ($calls_waiting_vl_two == 'province') {$calls_waiting_vl_twoLABEL = $label_province;} if ($calls_waiting_vl_two == 'postal_code') {$calls_waiting_vl_twoLABEL = $label_postal_code;} if ($calls_waiting_vl_two == 'vendor_lead_code') {$calls_waiting_vl_twoLABEL = $label_vendor_lead_code;} if ($calls_waiting_vl_two == 'gender') {$calls_waiting_vl_twoLABEL = $label_gender;} if ($calls_waiting_vl_two == 'phone_number') {$calls_waiting_vl_twoLABEL = $label_phone_number;} if ($calls_waiting_vl_two == 'phone_code') {$calls_waiting_vl_twoLABEL = $label_phone_code;} if ($calls_waiting_vl_two == 'alt_phone') {$calls_waiting_vl_twoLABEL = $label_alt_phone;} if ($calls_waiting_vl_two == 'security_phrase') {$calls_waiting_vl_twoLABEL = $label_security_phrase;} if ($calls_waiting_vl_two == 'email') {$calls_waiting_vl_twoLABEL = $label_email;} if ($calls_waiting_vl_two == 'comments') {$calls_waiting_vl_twoLABEL = $label_comments;} if ($calls_waiting_vl_two == 'entry_date') {$calls_waiting_vl_twoLABEL = $label_entry_date;} if ($calls_waiting_vl_two == 'source_id') {$calls_waiting_vl_twoLABEL = $label_source_id;} if ($calls_waiting_vl_two == 'date_of_birth') {$calls_waiting_vl_twoLABEL = $label_date_of_birth;} if ($calls_waiting_vl_two == 'rank') {$calls_waiting_vl_twoLABEL = $label_rank;} if ($calls_waiting_vl_two == 'owner') {$calls_waiting_vl_twoLABEL = $label_owner;} if ($calls_waiting_vl_two == 'last_local_call_time') {$calls_waiting_vl_twoLABEL = $label_last_local_call_time;} if ($calls_waiting_vl_two == 'entry_list_id') {$calls_waiting_vl_twoLABEL = $label_entry_list_id;} if ($calls_waiting_vl_two == 'list_id') {$calls_waiting_vl_twoLABEL = $label_list_id;} if ($calls_waiting_vl_two == 'lead_id') {$calls_waiting_vl_twoLABEL = $label_lead_id;} if ($calls_waiting_vl_two == 'gmt_offset_now') {$calls_waiting_vl_twoLABEL = $label_gmt_offset_now;} if ($calls_waiting_vl_two == 'called_count') {$calls_waiting_vl_twoLABEL = $label_called_count;} if ($calls_waiting_vl_two == 'status') {$calls_waiting_vl_twoLABEL = $label_status;} if ($calls_waiting_vl_two == 'user') {$calls_waiting_vl_twoLABEL = $label_user;} if ($calls_waiting_vl_two == 'called_since_last_reset') {$calls_waiting_vl_twoLABEL = $label_called_since_last_reset;} if ($calls_waiting_vl_two == 'country_code') {$calls_waiting_vl_twoLABEL = $label_country_code;} $calls_waiting_vl_twoLABEL = strtoupper($calls_waiting_vl_twoLABEL); } echo $INSERT_head_script; ?>




          " height="206px" width="206px" alt="" />

0) {echo ""._QXZ("Logged in as User")."";} else {echo ""._QXZ("Logged in as User")."";} echo _QXZ(": %1s on Phone: %2s",0,'',$VD_login,$SIP_user); if ($on_hook_agent == 'Y') {echo "("._QXZ("ring").")";} echo "  "._QXZ("to campaign").": $VD_campaign  "; ?>     0) {echo ""._QXZ("TERRITORIES")."     \n";} ?> 0) {echo ""._QXZ("GROUPS")."     \n";} ?> "._QXZ("LOGOUT")."\n"; ?>
0) {echo "\n";} ?> 0) {echo "\n";} ?> 0) {echo "\n";} ?> 0) { # INTERNAL CHAT # Always show if chat is enabled for the system echo "\n"; if ($campaign_chat_enabled=='Y') { # CUSTOMER CHAT # Only show if chat is enabled for the system AND the campaign the agent is using. echo "\n"; } } ?>
MAIN " alt="SCRIPT" width="67px" height="30px" border="0" /> \"SCRIPT\"FORM\"\"EMAIL\"\"CHAT\"\"CHAT\"     
      
" name="livecall" alt="Live Call" width="109px" height="30px" border="0" />


\n"; } ?> 0) {echo "
\"banner
\n";} $alt_phone_selected=''; if ( ($alt_number_dialing=='SELECTED') or ($alt_number_dialing=='SELECTED_TIMER_ALT') or ($alt_number_dialing=='SELECTED_TIMER_ADDR3') ) {$alt_phone_selected='CHECKED';} ?>
" border="0" alt="Dial Next Number" />

/>




" border="0" alt="Start Recording" />
0) {echo "\"Start
";} else {echo "";} if (!preg_match("/NOGAP/",$SSrecording_buttons)) {echo "
\n";} if ($SSenable_first_webform > 0) {echo "\"Web
\n";} if ($enable_second_webform > 0) {echo "\"Web
\n";} if ($enable_third_webform > 0) {echo "\"Web
\n";} ?>  
" border="0" alt="Park Call" />
\"IVR
\n";} else {echo "\n";} ?> " border="0" alt="Transfer - Conference" />
0) {echo "\"Quick
\n";} if ($custom_3way_button_transfer_enabled > 0) {echo "\"Custom
\n";} ?> 0) {echo "
\n";} ?> " width="145px" height="16px" border="0" />
" border="0" alt="Hangup Customer" />
" width="145px" height="16px" border="0" />

                         
        "._QXZ("LEAD SEARCH")."";} ?>
";} else { $title_readonly=''; if (preg_match("/---READONLY---/",$label_title)) {$title_readonly='readonly="readonly"'; $label_title = preg_replace("/---READONLY---/","",$label_title);} else { if (preg_match("/---REQUIRED---/",$label_title)) {$required_fields .= "title|"; $label_title = preg_replace("/---REQUIRED---/","",$label_title);} } echo "$label_title: "; } if ($label_first_name == '---HIDE---') {echo "  ";} else { $first_name_readonly=''; if (preg_match("/---READONLY---/",$label_first_name)) {$first_name_readonly='readonly="readonly"'; $label_first_name = preg_replace("/---READONLY---/","",$label_first_name);} else { if (preg_match("/---REQUIRED---/",$label_first_name)) {$required_fields .= "first_name|"; $label_first_name = preg_replace("/---REQUIRED---/","",$label_first_name);} } echo "  $label_first_name: "; } if ($label_middle_initial == '---HIDE---') {echo "  ";} else { $middle_initial_readonly=''; if (preg_match("/---READONLY---/",$label_middle_initial)) {$middle_initial_readonly='readonly="readonly"'; $label_middle_initial = preg_replace("/---READONLY---/","",$label_middle_initial);} else { if (preg_match("/---REQUIRED---/",$label_middle_initial)) {$required_fields .= "middle_initial|"; $label_middle_initial = preg_replace("/---REQUIRED---/","",$label_middle_initial);} } echo "  $label_middle_initial: "; } if ($label_last_name == '---HIDE---') {echo "  ";} else { $last_name_readonly=''; if (preg_match("/---READONLY---/",$label_last_name)) {$last_name_readonly='readonly="readonly"'; $label_last_name = preg_replace("/---READONLY---/","",$label_last_name);} else { if (preg_match("/---REQUIRED---/",$label_last_name)) {$required_fields .= "last_name|"; $label_last_name = preg_replace("/---REQUIRED---/","",$label_last_name);} } echo "  $label_last_name: "; } echo "
"; if ($label_address1 == '---HIDE---') {echo " ";} else { $address1_readonly=''; if (preg_match("/---READONLY---/",$label_address1)) {$address1_readonly='readonly="readonly"'; $label_address1 = preg_replace("/---READONLY---/","",$label_address1);} else { if (preg_match("/---REQUIRED---/",$label_address1)) {$required_fields .= "address1|"; $label_address1 = preg_replace("/---REQUIRED---/","",$label_address1);} } echo "$label_address1: "; } echo "
"; if ($label_address2 == '---HIDE---') {echo " ";} else { $address2_readonly=''; if (preg_match("/---READONLY---/",$label_address2)) {$address2_readonly='readonly="readonly"'; $label_address2 = preg_replace("/---READONLY---/","",$label_address2);} else { if (preg_match("/---REQUIRED---/",$label_address2)) {$required_fields .= "address2|"; $label_address2 = preg_replace("/---REQUIRED---/","",$label_address2);} } echo "$label_address2: "; } echo ""; if ($label_address3 == '---HIDE---') {echo " ";} else { $address3_readonly=''; if (preg_match("/---READONLY---/",$label_address3)) {$address3_readonly='readonly="readonly"'; $label_address3 = preg_replace("/---READONLY---/","",$label_address3);} else { if (preg_match("/---REQUIRED---/",$label_address3)) {$required_fields .= "address3|"; $label_address3 = preg_replace("/---REQUIRED---/","",$label_address3);} } echo "$label_address3: "; } echo "
"; if ($label_city == '---HIDE---') {echo " ";} else { $city_readonly=''; if (preg_match("/---READONLY---/",$label_city)) {$city_readonly='readonly="readonly"'; $label_city = preg_replace("/---READONLY---/","",$label_city);} else { if (preg_match("/---REQUIRED---/",$label_city)) {$required_fields .= "city|"; $label_city = preg_replace("/---REQUIRED---/","",$label_city);} } echo "$label_city: "; } echo ""; if ($label_state == '---HIDE---') {echo " ";} else { $state_readonly=''; if (preg_match("/---READONLY---/",$label_state)) {$state_readonly='readonly="readonly"'; $label_state = preg_replace("/---READONLY---/","",$label_state);} else { if (preg_match("/---REQUIRED---/",$label_state)) {$required_fields .= "state|"; $label_state = preg_replace("/---REQUIRED---/","",$label_state);} } echo "$label_state: "; } echo ""; if ($label_postal_code == '---HIDE---') {echo " ";} else { $postal_code_readonly=''; if (preg_match("/---READONLY---/",$label_postal_code)) {$postal_code_readonly='readonly="readonly"'; $label_postal_code = preg_replace("/---READONLY---/","",$label_postal_code);} else { if (preg_match("/---REQUIRED---/",$label_postal_code)) {$required_fields .= "postal_code|"; $label_postal_code = preg_replace("/---REQUIRED---/","",$label_postal_code);} } echo "$label_postal_code: "; } echo "
"; if ($label_province == '---HIDE---') {echo " ";} else { $province_readonly=''; if (preg_match("/---READONLY---/",$label_province)) {$province_readonly='readonly="readonly"'; $label_province = preg_replace("/---READONLY---/","",$label_province);} else { if (preg_match("/---REQUIRED---/",$label_province)) {$required_fields .= "province|"; $label_province = preg_replace("/---REQUIRED---/","",$label_province);} } echo "$label_province: "; } echo ""; if ($label_vendor_lead_code == '---HIDE---') {echo " ";} else { $vendor_lead_code_readonly=''; if (preg_match("/---READONLY---/",$label_vendor_lead_code)) {$vendor_lead_code_readonly='readonly="readonly"'; $label_vendor_lead_code = preg_replace("/---READONLY---/","",$label_vendor_lead_code);} else { if (preg_match("/---REQUIRED---/",$label_vendor_lead_code)) {$required_fields .= "vendor_lead_code|"; $label_vendor_lead_code = preg_replace("/---REQUIRED---/","",$label_vendor_lead_code);} } echo "$label_vendor_lead_code: "; } echo ""; if ($label_gender == '---HIDE---') { echo ""; } else { echo "$label_gender: "; } echo "
"; if ($label_phone_number == '---HIDE---') { echo " "; echo "   "; } else { echo "$label_phone_number: "; if ( (preg_match('/Y/',$disable_alter_custphone)) or (preg_match('/HIDE/',$disable_alter_custphone)) ) { echo "                     "; echo ""; } else { echo ""; } } echo ""; if ($label_phone_code == '---HIDE---') {echo " ";} else { $phone_code_readonly=''; if (preg_match("/---READONLY---/",$label_phone_code)) {$phone_code_readonly='readonly="readonly"'; $label_phone_code = preg_replace("/---READONLY---/","",$label_phone_code);} else { if (preg_match("/---REQUIRED---/",$label_phone_code)) {$required_fields .= "phone_code|"; $label_phone_code = preg_replace("/---REQUIRED---/","",$label_phone_code);} } echo "$label_phone_code: "; } echo ""; if ($label_alt_phone == '---HIDE---') {echo " ";} else { $alt_phone_readonly=''; if (preg_match("/---READONLY---/",$label_alt_phone)) {$alt_phone_readonly='readonly="readonly"'; $label_alt_phone = preg_replace("/---READONLY---/","",$label_alt_phone);} else { if (preg_match("/---REQUIRED---/",$label_alt_phone)) {$required_fields .= "alt_phone|"; $label_alt_phone = preg_replace("/---REQUIRED---/","",$label_alt_phone);} } echo "$label_alt_phone: "; } echo "
"; if ($label_security_phrase == '---HIDE---') {echo " ";} else { $security_phrase_readonly=''; if (preg_match("/---READONLY---/",$label_security_phrase)) {$security_phrase_readonly='readonly="readonly"'; $label_security_phrase = preg_replace("/---READONLY---/","",$label_security_phrase);} else { if (preg_match("/---REQUIRED---/",$label_security_phrase)) {$required_fields .= "security_phrase|"; $label_security_phrase = preg_replace("/---REQUIRED---/","",$label_security_phrase);} } echo "$label_security_phrase: "; } echo ""; if ($label_email == '---HIDE---') {echo " ";} else { $email_readonly=''; if (preg_match("/---READONLY---/",$label_email)) {$email_readonly='readonly="readonly"'; $label_email = preg_replace("/---READONLY---/","",$label_email);} else { if (preg_match("/---REQUIRED---/",$label_email)) {$required_fields .= "email|"; $label_email = preg_replace("/---REQUIRED---/","",$label_email);} } echo "$label_email: "; } if (strlen($agent_display_fields) > 3) { echo "
"; if (preg_match("/entry_date/",$agent_display_fields)) { echo "$label_entry_date:                       "; } if (preg_match("/source_id/",$agent_display_fields)) { echo "$label_source_id:                       "; } if (preg_match("/date_of_birth/",$agent_display_fields)) { echo "$label_date_of_birth:               "; } if (preg_match("/rank/",$agent_display_fields)) { echo "$label_rank:         "; } if (preg_match("/owner/",$agent_display_fields)) { echo "$label_owner:               "; } if (preg_match("/last_local_call_time/",$agent_display_fields)) { echo "$label_last_local_call_time:               "; } } echo "
"; if ($label_comments == '---HIDE---') { echo " "; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } else { echo "$label_comments:
"; if ( ($multi_line_comments) ) {echo "\n";} else {echo "\n";} } echo "
\n"; if ($per_call_notes == 'ENABLED') { echo _QXZ("Call Notes: "); if ($agent_call_log_view == '1') {echo "
"._QXZ("view notes")." ";} echo "
"; echo "\n"; } else { echo " \n"; } echo "\n"; ?>
 
 
         

   
                   


 
0) ) {echo ""._QXZ("Alert is ON")."";} else {echo ""._QXZ("Alert is OFF")."";} ?>
    " border="0" />
" border="0" />

"._QXZ("D1 - DIAL")."\n"; echo "   \n"; echo ""._QXZ("D2 - DIAL")."\n"; } else {echo "
\n";} ?>

 
   
 
0) { if ($view_calls_in_queue_launch > 0) {echo ""._QXZ("Hide Calls In Queue")."\n";} else {echo ""._QXZ("Show Calls In Queue")."\n";} } ?>
\n"; echo "$label_comments:
"; if ( ($multi_line_comments) ) {echo "\n";} else {echo "\n";} echo "\n"; } else { echo "\n"; } ?>
   
 
$webphone_content\n"; } else { echo "
  "._QXZ("Web Phone").":  
$webphone_content
\n"; } ?>
 
0) { echo _QXZ("Dialable Leads:")."  \n"; } ?> px;top:px;z-index:;" id="ScriptPanel">
\n";} if ($state_descriptions_banner > 0) {echo "
\n";} ?>
px;top:px;z-index:;" id="Script2Panel">
\n";} if ($state_descriptions_banner > 0) {echo "
\n";} ?>

\n";} if ($state_descriptions_banner > 0) {echo "
\n";} ?>

\n";} if ($state_descriptions_banner > 0) {echo "
\n";} ?>

\n";} if ($state_descriptions_banner > 0) {echo "
\n";} ?>

\n";} if ($state_descriptions_banner > 0) {echo "
\n";} ?>


-
0) && ($user_level>=$HKuser_level) && ($VU_hotkeys_active > 0) ) { ?> " border="0" alt="HOT KEYS INACTIVE" />
" border="0" alt="Transfer - Conference" style="vertical-align:middle" />            
" border="0" alt="LOCAL CLOSER" style="vertical-align:middle" />     " border="0" alt="Hangup Xfer Line" style="vertical-align:middle" />   " border="0" alt="Park Xfer Line" style="vertical-align:middle" />
" border="0" alt="seconds" style="vertical-align:middle" />   " border="0" alt="channel" style="vertical-align:middle" /> 0) {echo " checked";} ?>>   " border="0" alt="Hangup Both Lines" style="vertical-align:middle" />
" border="0" alt="Number to call" style="vertical-align:middle" />                         " border="0" alt="LEAVE 3-WAY CALL" style="vertical-align:middle" />
" border="0" alt="Dial Blind Transfer" style="vertical-align:middle" />   " border="0" alt="Dial With Customer" style="vertical-align:middle" />   " border="0" alt="Park Customer Dial" style="vertical-align:middle" />   " border="0" alt="Presets Button" style="vertical-align:middle" /> " border="0" alt="Contacts Button" style="vertical-align:middle" /> D1 D2 D3 D4 D5   " border="0" alt="Blind Transfer VMail Message" style="vertical-align:middle" />





























          " height="206px" width="206px" alt="" />


 
           

\n";} ?>

|



 


\n";} ?>               0) { echo ""._QXZ("Customer Timezone").": "; echo ""._QXZ("server time")."  \n"; } else { echo "  \n"; } echo "
"; if ($agentonly_callbacks) {echo " "._QXZ("MY CALLBACK ONLY")."
";} if ($comments_callback_screen != 'REPLACE_CB_NOTES') {echo _QXZ("CB Comments:")."

\n";} else {echo "
\n";} echo "
\n"; ?>



 
... px height='px' cellpadding=3 cellspacing=4>
 



     

\n";} ?>

 
To see information on one of the callbacks below, click on the INFO link. To call the customer back now, click on the DIAL link. If you click on a record below to dial it, it will be removed from the list.",0,'',$VD_login); ?>

\n";} ?>

                 



\n"; } ?>

\n"; echo " \n"; echo "
 
  \n"; echo "\n"; } ?> "; echo "
"._QXZ("Dial Lead ID:")." \n"; echo "   "._QXZ("(digits only)")."\n"; } else { echo "\n"; } $LeadLookuPXtra=''; if ($manual_dial_search_checkbox == 'SELECTED_LOCK') {$LeadLookuPXtra = 'CHECKED DISABLED ';} if ($manual_dial_search_checkbox == 'UNSELECTED_LOCK') {$LeadLookuPXtra = 'DISABLED ';} ?>
/> 


   

   




 
   

                0) { echo ""._QXZ("Preview Call")."                 \n"; } ?>


\n";} ?>
0) and ($disable_blended_checkbox < 1) and ($dial_method != 'INBOUND_MAN') and ($VU_agent_choose_blended > 0) ) { ?>
|



 


\n";} ?>
|



 
"._QXZ("MY CALLBACK ONLY")."
";} if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) or ($dial_method == 'INBOUND_MAN') or ($VU_agent_choose_blended < 1) ) {echo " "._QXZ("BLENDED CALLING")."
";} ?>
                  [X]

\n";} ?>


 
"._QXZ("AGENT TIME REPORT")." :  
"; echo " "; echo "\n"; echo "   "._QXZ("to"); echo "   "; echo "\n"; echo "   "._QXZ("GO")."           "; echo ""._QXZ("close")." [X]
"; } else { echo "\n"; echo "\n"; } ?>


 
                  close [X]

\n";} ?>

Contact search requests are all logged in the system."); ?>


           


 
                  [X]

\n";} ?>


 
                  [X]

\n";} $TEMPlabel_vendor_lead_code = preg_replace("/---READONLY---|---REQUIRED---|---HIDE---/","",$label_vendor_lead_code); ?>





\n"; } echo "\n"; if ($label_first_name == '---HIDE---') {echo " \n"; } echo "\n"; if ($label_last_name == '---HIDE---') {echo " \n"; } echo "\n"; if ($label_city == '---HIDE---') {echo " \n"; } echo "\n"; if ($label_state == '---HIDE---') {echo " \n"; } echo "\n"; if ($label_postal_code == '---HIDE---') {echo " \n"; } echo "\n"; ?>
";} else { $label_vendor_lead_code = preg_replace("/---READONLY---|---REQUIRED---/","",$label_vendor_lead_code); echo " $label_vendor_lead_code:
";} else { $label_first_name = preg_replace("/---READONLY---|---REQUIRED---/","",$label_first_name); echo " $label_first_name:
";} else { $label_last_name = preg_replace("/---READONLY---|---REQUIRED---/","",$label_last_name); echo " $label_last_name:
";} else { $label_city = preg_replace("/---READONLY---|---REQUIRED---/","",$label_city); echo " $label_city:
";} else { $label_state = preg_replace("/---READONLY---|---REQUIRED---/","",$label_state); echo " $label_state:
";} else { $label_postal_code = preg_replace("/---READONLY---|---REQUIRED---/","",$label_postal_code); echo " $label_postal_code:

           


 
                  [X]

\n";} ?>


 
                  [X]

\n";} ?>


 
                  [X]

\n";} ?>

 


\n";} ?> 0) {echo "

* "._QXZ("These pause codes require manager approval")."\n";} ?>

 
:


\n";} ?>



:
:

   

 


\n";} ?>
:    

\n";} ?>


\n";} ?>

 


\n";} ?>

 
 
:


\n";} ?>


:

   

 

   


-->

 
 

" alt="alert" border="0">
 




 
"; echo ""; } if ( ($SSbrowser_call_alerts > 0) or ($SSagent_hidden_sound_seconds > 0) ) { $bas=0; $bas_embed_output=''; $browser_alert_sounds_listARY = explode(',',$browser_alert_sounds_list); $browser_alert_sounds_listARY_ct = count($browser_alert_sounds_listARY); while ($browser_alert_sounds_listARY_ct > $bas) { $bas_embed_output .= "\n"; $bas++; } echo "$bas_embed_output"; echo "\n"; } ?>