/LANG_www/agc_es/vicidial.php

https://github.com/h4ck3rm1k3/vicidial-asterisk-gui · PHP · 8606 lines · 6915 code · 666 blank · 1025 comment · 1427 complexity · 87c6a885b8a24530345796628442c4ab MD5 · raw file

  1. <?
  2. # vicidial.php - the web-based version of the astVICIDIAL client application
  3. #
  4. # Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
  5. #
  6. # Other scripts that this application depends on:
  7. # - vdc_db_query.php: Updates information in the database
  8. # - manager_send.php: Sends manager actions to the DB for execution
  9. # - conf_exten_check.php: time sync and status updater, calls in queue
  10. #
  11. # CHANGELOG
  12. # 50607-1426 - First Build of VICIDIAL web client basic login process finished
  13. # 50628-1620 - Added some basic formatting and worked on process flow
  14. # 50628-1715 - Startup variables mapped to javascript variables
  15. # 50629-1303 - Added Login Closer in-groups selection box and vla update
  16. # 50629-1530 - Rough layout for customer info form section and button links
  17. # 50630-1453 - Rough Manual Dial/Hangup with customer info displayed
  18. # 50701-1450 - Added vicidial_log entries on dial and hangup
  19. # 50701-1634 - Added Logout function
  20. # 50705-1259 - Added call disposition functionality
  21. # 50705-1432 - Added lead info DB update function
  22. # 50705-1658 - Added web form functionality
  23. # 50706-1043 - Added call park and pickup functions
  24. # 50706-1234 - Added Start/Stop Recording functionality
  25. # 50706-1614 - Added conference channels display option
  26. # 50711-1333 - Removed call check redundancy and fixed a span bug
  27. # 50727-1424 - Added customer channel and participant present sensing/alerts
  28. # 50804-1057 - Added SendDTMF function and reconfigured the transfer span
  29. # 50804-1224 - Added Local and Internal Closer transfer functions
  30. # 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs
  31. # 50804-1808 - Added button images for left buttons
  32. # 50815-1151 - Added 3Way calling functions to Transfer-conf frame
  33. # 50815-1602 - Added images and buttons for xfer functions
  34. # 50816-1813 - Added basic autodial outbound call pickup functions
  35. # 50817-1113 - Fixes to auto_dialing call receipt
  36. # 50817-1234 - Added inbound call receipt capability
  37. # 50817-1541 - Added customer time display
  38. # 50817-1541 - Added customer time display
  39. # 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option
  40. # 50818-1703 - Added pretty login section
  41. # 50825-1200 - Modified form field lengths, added double-click dispositions
  42. # 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER
  43. # 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug
  44. # 50903-0904 - Added preview-lead code for manual dialing
  45. # 50904-0016 - Added ability to hangup manual dials before pickup
  46. # 50906-1319 - Added override for filters on xfer calls, fixed login display bug
  47. # 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode
  48. # 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use
  49. # 50913-1212 - Added campaign_cid to 3rd party calls
  50. # 50923-1546 - Modified to work with language translation
  51. # 50926-1656 - Added campaign pull-down at login of active campaigns
  52. # 50928-1633 - Added manual dial alternate number dial option
  53. # 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs
  54. # 51004-1656 - Fixed recording filename bug and new Spanish translation
  55. # 51020-1103 - Added campaign-specific recording control abilities
  56. # 51020-1352 - Added Basic vicidial_agent_log framework
  57. # 51021-1050 - Fixed custtime display and disable Enter/Return keypresses
  58. # 51021-1718 - Allows for multi-line comments (changes \n to !N in database)
  59. # 51110-1432 - Fixed non-standard http port issue
  60. # 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial
  61. # 51118-1305 - Activate multi-line comments from $multi_line_comments var
  62. # 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view
  63. # 51121-1506 - Small PHP optimizations in many scripts and disabled globalize
  64. # 51129-1010 - Added ability to accept calls from other VICIDIAL servers
  65. # 51129-1254 - Fixed Hangups of other agents channels when customer hangs up
  66. # 51208-1732 - Created user-first login that looks for default phone info
  67. # 51219-1526 - Added variable framework for campaign and in-group scripts
  68. # 51221-1200 - Added SCRIPT tab, layout and functionality
  69. # 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup
  70. # 51222-1605 - Added VMail message blind transfer button to xfer-conf frame
  71. # 51229-1028 - Added checks on web_form_address to allow for var in the DB value
  72. # 60117-1312 - Added Transfer-conf frame toggle on button press
  73. # 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame
  74. # 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys
  75. # 60213-1210 - Added ability to sort routing of calls by user_level
  76. # 60214-0932 - Initial Callback calendar display framework
  77. # 60214-1407 - Added ability to minimize the dispo screen to see info below
  78. # 60215-1104 - Added ANYONE scheduled callbacks functionality
  79. # 60410-1116 - Added persistant pause after dispo option and change dispo text
  80. # - Added web form submit that opens new window with dispo on submit
  81. # - Added PREVIOUS CALLBACK in customer info to flag callbacks
  82. # - Added link to try to hangup the call again in the dispo screen
  83. # - Added link noone-in-session screen to call agent phone again
  84. # - Added link customer-hungup screen to go straight to dispo screen
  85. # 60410-1532 - Added agent status and campaign calls dialing display option
  86. # 60411-1547 - Add ability to set callback as USERONLY and some basic formatting
  87. # 60413-1752 - Add basic USERONLY callback frame and listings
  88. # 60414-1039 - Changed manual dial preview and alt dial checkboxes to spans
  89. # - Added beta-level USERONLY callback functionality
  90. # - Added beta-level manual dialing with lead insertion functionality
  91. # 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug
  92. # 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode
  93. # - Changed several permissions to database-defined
  94. # 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished
  95. # 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error
  96. # 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES
  97. # 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials
  98. # 60426-1058 - Added vicidial_user setting for default blended check for CLOSER
  99. # 60501-1008 - Added option to manual dial screen to manually lookup phone number
  100. # 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen
  101. # 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug
  102. # - Fixed recording filename display to not overrun 25 characters
  103. # 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo
  104. # 60608-1453 - Added CLOSER campaign allowable in-groups limitations
  105. # 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC
  106. # 60619-1047 - Added variable filters to close security holes for login form
  107. # 60804-1710 - fixed scheduled CALLBK for other languages build
  108. # 60808-1145 - Added consultative transfers with customer data
  109. # 60808-2232 - Added campaign name to pulldown for login screen
  110. # 60809-1603 - Added option to locally transfer consult xfers
  111. # 60809-1732 - Added recheck of transferred channels before customer gone mesg
  112. # 60810-1011 - Fixed CXFER leave 3way call bugs
  113. # 60816-1602 - Added ALLCALLS recording delay option allcalls_delay
  114. # 60816-1716 - Fixed customer time display bug and client DST setting
  115. # 60821-1555 - Added option to omit phone_code on dialout of leads
  116. # 60821-1628 - Added ALLFORCE recording option
  117. # 60821-1643 - Added no_delete_sessions option to not delete sessions
  118. # 60822-0512 - Changed phone number fields to be maxlength of 12
  119. # 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php
  120. # 60906-1152 - Added Previous CallBack info display span
  121. # 60906-1715 - Allow for Local phone extension conferences
  122. # 61004-1729 - Add ability to control volume per channel in "calls in this session"
  123. # 61122-1341 - Added vicidial_user_groups allowed_campaigns restrictions
  124. # 61122-1523 - Added more SCRIPT variables
  125. # 61128-2229 - Added vicidial_live_agents and vicidial_auto_calls manual dial entries
  126. # 61130-1617 - Added lead_id to MonitorConf for recording_log
  127. # 61221-1212 - Changed width to 760 to better fit 800x600 screens, widened SCRIPT
  128. # 70109-1128 - Fixed wrapup timer bug
  129. # 70109-1635 - Added option for HotKeys automatically dialing next number in manual mode
  130. # - Added option for alternate number dialing with hotkeys
  131. # 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns
  132. # 70118-1517 - Added vicidial_agent_log and vicidial_user_log logging of user_group
  133. # 70201-1249 - Added FAST DIAL option for manually dialing, added UTF8 compatible code
  134. # 70201-1703 - Fixed cursor bug for most text input fields
  135. # 70202-1453 - Added first portions of Agent Pause Codes
  136. # 70203-0108 - Finished Agent Pause Codes functionality
  137. # 70203-0930 - Added dialed_number to webform output
  138. # 70203-1010 - Added dialed_label to webform output
  139. # 70206-1201 - Fixed allow_closers bug
  140. # 70206-1332 - Added vicidial_recording_override users setting function
  141. # 70212-1252 - Fixed small issue with CXFER
  142. # 70213-1018 - Changed CXFER and AXFER to update customer information before transfer
  143. # 70214-1233 - Added queuemetrics_log_id field for server_id in queue_log
  144. # 70215-1240 - Added queuemetrics_log_id field for server_id in queue_log
  145. # 70222-1617 - Changed queue_log PAUSE/UNPAUSE to PAUSEALL/UNPAUSEALL
  146. # 70226-1252 - Added Mute/UnMute to agent screen
  147. # 70309-1035 - Allow amphersands and questions marks in comments to pass through
  148. # 70313-1052 - Allow pound signs(hash) in comments to pass through
  149. # 70316-1406 - Moved the MUTE button to be accessible during a transfer/conf
  150. # 70319-1446 - Added agent-deactive-display and disable customer info update functions
  151. # 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper
  152. # 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen
  153. # 70322-1545 - Added sipsak display ability
  154. # 70510-1319 - Added onUnload force Logout
  155. # 70806-1530 - Added Presets Dial links above agent mute button
  156. # 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE
  157. # 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM
  158. # 71022-1427 - Added formatting of the customer phone number in the main status bar
  159. # 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions
  160. # 71101-1204 - Fixed bug in callback calendar with DST
  161. # 71116-0957 - Added campaign_weight and calls_today to the vla table insertion
  162. # 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login
  163. # 71122-0256 - Added auto-pause notification
  164. # 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to
  165. # 71127-0408 - Added height and width settings for easier modification of screen size
  166. # 71129-2025 - restricted callbacks count and list to campaign only
  167. # 71223-0318 - changed logging of closer calls
  168. # 71226-1117 - added option to kick all calls from conference upon logout
  169. # 80109-1510 - added gender select list
  170. # 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused
  171. # 80317-2106 - added recording override options for inbound group calls
  172. # 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls
  173. # 80402-0121 - Fixes for manual dial transfers on some systems
  174. # 80407-2112 - Work on adding phone login load balancing across servers
  175. # 80416-0559 - Added ability to log computer_ip at login, set the $PhoneSComPIP variable
  176. # 80428-0413 - UTF8 changes and testing
  177. # 80505-0054 - Added multi-phones load-balanced alias option
  178. # 80507-0932 - Fixed Script display bug (+ instead of space)
  179. # 80519-1425 - Added calls in queue display
  180. # 80523-1630 - Added Timeclock links
  181. # 80625-0047 - Added U option for gender, added date/phone display options
  182. # 80630-2210 - Added queue_log entries for Manual Dial
  183. # 80703-0139 - Added alter customer phone permissions
  184. # 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count
  185. # 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording
  186. # 80709-0358 - Added Default alt phone dial hard-code option
  187. # 80719-1147 - Changed recording and senddtmf conf prefix
  188. # 80815-1014 - Added manual dial list restriction option
  189. # 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature)
  190. # 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls
  191. # 80909-1717 - Added support for campaign-specific DNC lists
  192. # 80915-1754 - Rewrote leave-3way functions for external calling
  193. # 81002-1908 - Fixed double-login bug in some conditions
  194. # 81007-0945 - Added three_way_call_cid option for outbound 3way calls
  195. # 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements
  196. # 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call
  197. # 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls
  198. # 81013-1644 - Fixed bug in leave 3way for manual dial fronters
  199. # 81015-0405 - Fixed bug related to hangups on 3way calls
  200. # 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available
  201. # 81020-1501 - Fixed bugs in queue_log logging
  202. # 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes
  203. # 81030-0403 - Added option to force Pause Codes on PAUSE
  204. # 81103-1427 - Added 3way call dial prefix
  205. # 81104-0140 - Added mysql error logging capability
  206. # 81104-1618 - Changed MySQL queries logging
  207. # 81106-0411 - Changedthe campaign login list behaviour
  208. # 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause
  209. # 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug
  210. # 81119-1811 - webform backslash fix
  211. # 81124-2213 - Fixes blind transfer bug
  212. # 81209-1617 - Added campaign web form target option and web form address variables
  213. # 81211-0422 - Fixed Manual dial agent_log bug
  214. # 90102-1402 - Added time sync check notification
  215. # 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only
  216. # 90120-1719 - Added API pause/resume and number dial functionality
  217. # 90126-2302 - Added Vtiger login option and agent alert option
  218. # 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup
  219. # 90202-0148 - Added option to disable BLENDED checkbox
  220. # 90209-0132 - Changed tab images and color scheme
  221. # 90303-1145 - Fixed rare manual dial live hangup bug
  222. # 90304-1333 - Added user-specific web vars option
  223. # 90305-0917 - Added prefix-choice and group-alias options for calls coming from API
  224. # 90307-1736 - Added Shift enforcement and manager override features
  225. # 90320-0309 - Fixed agent log bug when using wrapup time
  226. #
  227. $version = '2.0.5-202';
  228. $build = '90320-0309';
  229. $mel=1; # Mysql Error Log enabled = 1
  230. $mysql_log_count=60;
  231. $one_mysql_log=0;
  232. require("dbconnect.php");
  233. if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
  234. elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
  235. if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];}
  236. elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];}
  237. if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];}
  238. elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];}
  239. if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];}
  240. elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];}
  241. if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];}
  242. elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];}
  243. if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];}
  244. elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];}
  245. if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];}
  246. elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];}
  247. if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];}
  248. elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];}
  249. if (!isset($phone_login))
  250. {
  251. if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];}
  252. elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];}
  253. }
  254. if (!isset($phone_pass))
  255. {
  256. if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];}
  257. elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];}
  258. }
  259. if (isset($VD_campaign))
  260. {
  261. $VD_campaign = strtoupper($VD_campaign);
  262. $VD_campaign = eregi_replace(" ",'',$VD_campaign);
  263. }
  264. if (!isset($flag_channels))
  265. {
  266. $flag_channels=0;
  267. $flag_string='';
  268. }
  269. ### security strip all non-alphanumeric characters out of the variables ###
  270. $DB=ereg_replace("[^0-9a-z]","",$DB);
  271. $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login);
  272. $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass);
  273. $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login);
  274. $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass);
  275. $VD_campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$VD_campaign);
  276. $forever_stop=0;
  277. if ($force_logout)
  278. {
  279. echo "Usted ahora ha registrado hacia fuera. Gracias\n";
  280. exit;
  281. }
  282. $isdst = date("I");
  283. $StarTtimE = date("U");
  284. $NOW_TIME = date("Y-m-d H:i:s");
  285. $tsNOW_TIME = date("YmdHis");
  286. $FILE_TIME = date("Ymd-His");
  287. $loginDATE = date("Ymd");
  288. $CIDdate = date("ymdHis");
  289. $month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y"));
  290. $past_month_date = date("Y-m-d H:i:s",$month_old);
  291. $minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y"));
  292. $past_minutes_date = date("Y-m-d H:i:s",$minutes_old);
  293. $random = (rand(1000000, 9999999) + 10000000);
  294. #############################################
  295. ##### START SYSTEM_SETTINGS LOOKUP #####
  296. $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 FROM system_settings;";
  297. $rslt=mysql_query($stmt, $link);
  298. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  299. if ($DB) {echo "$stmt\n";}
  300. $qm_conf_ct = mysql_num_rows($rslt);
  301. $i=0;
  302. while ($i < $qm_conf_ct)
  303. {
  304. $row=mysql_fetch_row($rslt);
  305. $non_latin = $row[0];
  306. $vdc_header_date_format = $row[1];
  307. $vdc_customer_date_format = $row[2];
  308. $vdc_header_phone_format = $row[3];
  309. $WeBRooTWritablE = $row[4];
  310. $timeclock_end_of_day = $row[5];
  311. $vtiger_url = $row[6];
  312. $enable_vtiger_integration = $row[7];
  313. $outbound_autodial_active = $row[8];
  314. $i++;
  315. }
  316. ##### END SETTINGS LOOKUP #####
  317. ###########################################
  318. ##### DEFINABLE SETTINGS AND OPTIONS
  319. ###########################################
  320. $conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording
  321. $dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently
  322. $HKuser_level = '5'; # minimum vicidial user_level for HotKeys
  323. $campaign_login_list = '1'; # show drop-down list of campaigns at login
  324. $manual_dial_preview = '1'; # allow preview lead option when manual dial
  325. $multi_line_comments = '1'; # set to 1 to allow multi-line comment box
  326. $user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login
  327. $view_scripts = '1'; # set to 1 to show the SCRIPTS tab
  328. $dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo
  329. $callholdstatus = '1'; # set to 1 to show calls en hold count
  330. $agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count
  331. $campagentstatctmax = '3'; # Number of segundos for campaign call and agent stats
  332. $show_campname_pulldown = '1'; # set to 1 to show campaign name en login pulldown
  333. $webform_sessionname = '1'; # set to 1 to include the session_name in webform URL
  334. $local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server
  335. $clientDST = '1'; # set to 1 to check for DST en server for agent time
  336. $no_delete_sessions = '0'; # set to 1 to not delete sessions at logout
  337. $volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels
  338. $PreseT_DiaL_LinKs = '0'; # set to 1 to show a DIAL link for Dial Presets
  339. $LogiNAJAX = '1'; # set to 1 to do lookups en campaigns for login
  340. $HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls"
  341. $hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Colgar al Cliente
  342. $LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout
  343. $TeléfonoSComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login
  344. $DefaulTAlTDiaL = '0'; # set to 1 to enable ALT DIAL by default if enabled for the campaign
  345. $AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option
  346. $disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen
  347. $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen
  348. $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500
  349. $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770
  350. $MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6
  351. $SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0
  352. # options now set in DB:
  353. #$alt_phone_dialing = '1'; # allow agents to call alt phone numbers
  354. #$scheduled_callbacks = '1'; # set to 1 to allow agent to choose scheduled callbacks
  355. # $agentonly_callbacks = '1'; # set to 1 to allow agent to choose agent-only scheduled callbacks
  356. #$agentcall_manual = '1'; # set to 1 to allow agent to make manual calls during autodial session
  357. ### SCREEN WIDTH AND HEIGHT CALCULATIONS ###
  358. ### DO NOT EDIT! ###
  359. $MASTERwidth=($BROWSER_WIDTH - 340);
  360. $MASTERheight=($BROWSER_HEIGHT - 200);
  361. if ($MASTERwidth < 430) {$MASTERwidth = '430';}
  362. if ($MASTERheight < 300) {$MASTERheight = '300';}
  363. $CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...)
  364. $MNwidth = ($MASTERwidth + 330); # 760 - main frame
  365. $XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference
  366. $HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks
  367. $AMwidth = ($MASTERwidth + 270); # 700 - agent mute and preset-dial links
  368. $SCwidth = ($MASTERwidth + 230); # 670 - live call segundos counter
  369. $SSwidth = ($MASTERwidth + 176); # 606 - scroll script
  370. $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session
  371. $HKwidth = ($MASTERwidth + 70); # 500 - Hotkeys button
  372. $HSwidth = ($MASTERwidth + 1); # 431 - Header spacer
  373. $HKheight = ($MASTERheight + 105); # 405 - HotKey active Button
  374. $AMheight = ($MASTERheight + 100); # 400 - Agent mute and preset dial links
  375. $MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons
  376. $CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status
  377. $SSheight = ($MASTERheight + 31); # 331 - script content
  378. $HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey
  379. $BPheight = ($MASTERheight - 250); # 50 - bottom buffer
  380. $US='_';
  381. $CL=':';
  382. $AT='@';
  383. $DS='-';
  384. $date = date("r");
  385. $ip = getenv("REMOTE_ADDR");
  386. $browser = getenv("HTTP_USER_AGENT");
  387. $script_name = getenv("SCRIPT_NAME");
  388. $server_name = getenv("SERVER_NAME");
  389. $server_port = getenv("SERVER_PORT");
  390. if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
  391. else {$HTTPprotocol = 'http://';}
  392. if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
  393. else {$server_port = "$CL$server_port";}
  394. $agcPAGE = "$HTTPprotocol$server_name$server_port$script_name";
  395. $agcDIR = eregi_replace('vicidial.php','',$agcPAGE);
  396. header ("Content-type: text/html; charset=utf-8");
  397. header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
  398. header ("Pragma: no-cache"); // HTTP/1.0
  399. echo "<html>\n";
  400. echo "<head>\n";
  401. echo "<!-- VERSIÓN: $version CONSTRUCCION: $build -->\n";
  402. if ($campaign_login_list > 0)
  403. {
  404. $camp_form_code = "<select size=1 name=VD_campaign id=VD_campaign onFocus=\"login_allowable_campaigns()\">\n";
  405. $camp_form_code .= "<option value=\"\"></option>\n";
  406. $LOGallowed_campaignsSQL='';
  407. if ($relogin == 'YES')
  408. {
  409. $stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass'";
  410. if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
  411. $rslt=mysql_query($stmt, $link);
  412. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  413. $row=mysql_fetch_row($rslt);
  414. $VU_user_group=$row[0];
  415. $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';";
  416. $rslt=mysql_query($stmt, $link);
  417. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  418. $row=mysql_fetch_row($rslt);
  419. if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
  420. {
  421. $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]);
  422. $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL);
  423. $LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')";
  424. }
  425. }
  426. ### code for manager override of shift restrictions
  427. if ($MGR_override > 0)
  428. {
  429. if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];}
  430. elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];}
  431. if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];}
  432. elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];}
  433. $stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';";
  434. if ($DB) {echo "|$stmt|\n";}
  435. $rslt=mysql_query($stmt, $link);
  436. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  437. $row=mysql_fetch_row($rslt);
  438. $MGR_auth=$row[0];
  439. if($MGR_auth>0)
  440. {
  441. $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login' and pass='$VD_pass';";
  442. if ($DB) {echo "|$stmt|\n";}
  443. $rslt=mysql_query($stmt, $link);
  444. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  445. print "<!-- Shift Override entered for $VD_login by $MGR_login -->\n";
  446. ### Add a record to the vicidial_admin_log
  447. $SQL_log = "$stmt|";
  448. $SQL_log = ereg_replace(';','',$SQL_log);
  449. $SQL_log = addslashes($SQL_log);
  450. $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='GERENTE DE TRANSFERENCIA OF AGENT SHIFT ENFORCEMENT', event_sql=\"$SQL_log\", event_notes='user: $VD_login';";
  451. if ($DB) {echo "|$stmt|\n";}
  452. $rslt=mysql_query($stmt, $link);
  453. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01060',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  454. }
  455. }
  456. $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id";
  457. if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
  458. $rslt=mysql_query($stmt, $link);
  459. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  460. $camps_to_print = mysql_num_rows($rslt);
  461. $o=0;
  462. while ($camps_to_print > $o)
  463. {
  464. $rowx=mysql_fetch_row($rslt);
  465. if ($show_campname_pulldown)
  466. {$campname = " - $rowx[1]";}
  467. else
  468. {$campname = '';}
  469. if ($VD_campaign)
  470. {
  471. if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) )
  472. {$camp_form_code .= "<option value=\"$rowx[0]\" SELECTED>$rowx[0]$campname</option>\n";}
  473. else
  474. {
  475. if (!ereg('login_allowable_campaigns',$camp_form_code))
  476. {$camp_form_code .= "<option value=\"$rowx[0]\">$rowx[0]$campname</option>\n";}
  477. }
  478. }
  479. else
  480. {
  481. if (!ereg('login_allowable_campaigns',$camp_form_code))
  482. {$camp_form_code .= "<option value=\"$rowx[0]\">$rowx[0]$campname</option>\n";}
  483. }
  484. $o++;
  485. }
  486. $camp_form_code .= "</select>\n";
  487. }
  488. else
  489. {
  490. $camp_form_code = "<INPUT TYPE=TEXT NAME=VD_campaign SIZE=10 maxlength=20 VALUE=\"$VD_campaign\">\n";
  491. }
  492. if ($LogiNAJAX > 0)
  493. {
  494. ?>
  495. <script language="Javascript">
  496. // ################################################################################
  497. // Send Request for allowable campaigns to populate the campaigns pull-down
  498. function login_allowable_campaigns()
  499. {
  500. var xmlhttp=false;
  501. /*@cc_on @*/
  502. /*@if (@_jscript_version >= 5)
  503. // JScript gives us Conditional compilation, we can cope with old IE versions.
  504. // and security blocked creation of the objects.
  505. try {
  506. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  507. } catch (e) {
  508. try {
  509. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  510. } catch (E) {
  511. xmlhttp = false;
  512. }
  513. }
  514. @end @*/
  515. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  516. {
  517. xmlhttp = new XMLHttpRequest();
  518. }
  519. if (xmlhttp)
  520. {
  521. logincampaign_query = "&user=" + document.vicidial_form.VD_login.value + "&pass=" + document.vicidial_form.VD_pass.value + "&ACTION=LogiNCamPaigns&format=html";
  522. xmlhttp.open('POST', 'vdc_db_query.php');
  523. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  524. xmlhttp.send(logincampaign_query);
  525. xmlhttp.onreadystatechange = function()
  526. {
  527. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  528. {
  529. Nactiveext = null;
  530. Nactiveext = xmlhttp.responseText;
  531. // alert(logincampaign_query);
  532. // alert(xmlhttp.responseText);
  533. document.getElementById("LogiNCamPaigns").innerHTML = Nactiveext;
  534. document.getElementById("LogiNReseT").innerHTML = "<INPUT TYPE=BUTTON VALUE=\"Recarga Campaña List\" OnClick=\"login_allowable_campaigns()\">";
  535. document.getElementById("VD_campaign").focus();
  536. }
  537. }
  538. delete xmlhttp;
  539. }
  540. }
  541. </script>
  542. <?
  543. }
  544. if ($relogin == 'YES')
  545. {
  546. echo "<title>web client VICIDIAL: Conexión Otra Vez</title>\n";
  547. echo "</head>\n";
  548. echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
  549. echo "<A HREF=\"./timeclock.php?referrer=agent&pl=$phone_login&pp=$phone_pass&VD_login=$VD_login&VD_pass=$VD_pass\">Timeclock</A><BR>\n";
  550. echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
  551. echo "<!-- ILPV -->\n";
  552. echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../agc_es/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "</TR></TABLE>\n";
  553. echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
  554. echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  555. echo "<BR><BR><BR><CENTER><TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"$MAIN_COLOR\"><TR BGCOLOR=WHITE>";
  556. echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vdc_tab_vicidial.gif\" Border=0></TD>";
  557. echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Conexión Otra Vez </TD>";
  558. echo "</TR>\n";
  559. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
  560. echo "<TR><TD ALIGN=RIGHT>Conexión Del Teléfono: </TD>";
  561. echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=phone_login SIZE=10 maxlength=20 VALUE=\"$phone_login\"></TD></TR>\n";
  562. echo "<TR><TD ALIGN=RIGHT>Contraseña Del Teléfono: </TD>";
  563. echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"$phone_pass\"></TD></TR>\n";
  564. echo "<TR><TD ALIGN=RIGHT>Conexión Del Usuario: </TD>";
  565. echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=VD_login SIZE=10 maxlength=20 VALUE=\"$VD_login\"></TD></TR>\n";
  566. echo "<TR><TD ALIGN=RIGHT>Contraseña Del Usuario: </TD>";
  567. echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=VD_pass SIZE=10 maxlength=20 VALUE=\"$VD_pass\"></TD></TR>\n";
  568. echo "<TR><TD ALIGN=RIGHT>Campaña: </TD>";
  569. echo "<TD ALIGN=LEFT><span id=\"LogiNCamPaigns\">$camp_form_code</span></TD></TR>\n";
  570. echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR> &nbsp; \n";
  571. echo "<span id=\"LogiNReseT\"><INPUT TYPE=BUTTON VALUE=\"Recarga Campaña List\" OnClick=\"login_allowable_campaigns()\"></span></TD></TR>\n";
  572. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIÓN: $version &nbsp; &nbsp; &nbsp; CONSTRUCCION: $build</TD></TR>\n";
  573. echo "</TABLE>\n";
  574. echo "</FORM>\n\n";
  575. echo "</body>\n\n";
  576. echo "</html>\n\n";
  577. exit;
  578. }
  579. if ($user_login_first == 1)
  580. {
  581. if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) )
  582. {
  583. echo "<title>web client VICIDIAL: Conexión en la Campaña</title>\n";
  584. echo "</head>\n";
  585. echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
  586. echo "<A HREF=\"./timeclock.php?referrer=agent&pl=$phone_login&pp=$phone_pass&VD_login=$VD_login&VD_pass=$VD_pass\">Timeclock</A><BR>\n";
  587. echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
  588. echo "<!-- ILPV -->\n";
  589. echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../agc_es/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; echo "</TR></TABLE>\n";
  590. echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
  591. echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  592. #echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
  593. #echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
  594. echo "<CENTER><BR><B>Conexión Del Usuario</B><BR><BR>";
  595. echo "<TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"$MAIN_COLOR\"><TR BGCOLOR=WHITE>";
  596. echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vdc_tab_vicidial.gif\" Border=0></TD>";
  597. echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Conexión en la Campaña </TD>";
  598. echo "</TR>\n";
  599. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
  600. echo "<TR><TD ALIGN=RIGHT>Conexión Del Usuario: </TD>";
  601. echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=VD_login SIZE=10 maxlength=20 VALUE=\"$VD_login\"></TD></TR>\n";
  602. echo "<TR><TD ALIGN=RIGHT>Contraseña Del Usuario: </TD>";
  603. echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=VD_pass SIZE=10 maxlength=20 VALUE=\"$VD_pass\"></TD></TR>\n";
  604. echo "<TR><TD ALIGN=RIGHT>Campaña: </TD>";
  605. echo "<TD ALIGN=LEFT><span id=\"LogiNCamPaigns\">$camp_form_code</span></TD></TR>\n";
  606. echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR> &nbsp; \n";
  607. echo "<span id=\"LogiNReseT\"></span></TD></TR>\n";
  608. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIÓN: $version &nbsp; &nbsp; &nbsp; CONSTRUCCION: $build</TD></TR>\n";
  609. echo "</TABLE>\n";
  610. echo "</FORM>\n\n";
  611. echo "</body>\n\n";
  612. echo "</html>\n\n";
  613. exit;
  614. }
  615. else
  616. {
  617. if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) )
  618. {
  619. $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';";
  620. if ($DB) {echo "|$stmt|\n";}
  621. $rslt=mysql_query($stmt, $link);
  622. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  623. $row=mysql_fetch_row($rslt);
  624. $phone_login=$row[0];
  625. $phone_pass=$row[1];
  626. echo "<title>web client VICIDIAL: Conexión</title>\n";
  627. echo "</head>\n";
  628. echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
  629. echo "<A HREF=\"./timeclock.php?referrer=agent&pl=$phone_login&pp=$phone_pass&VD_login=$VD_login&VD_pass=$VD_pass\">Timeclock</A><BR>\n";
  630. echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
  631. echo "<!-- ILPV -->\n";
  632. echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../agc_es/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; echo "</TR></TABLE>\n";
  633. echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
  634. echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  635. echo "<BR><BR><BR><CENTER><TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"$MAIN_COLOR\"><TR BGCOLOR=WHITE>";
  636. echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vdc_tab_vicidial.gif\" Border=0></TD>";
  637. echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Conexión </TD>";
  638. echo "</TR>\n";
  639. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
  640. echo "<TR><TD ALIGN=RIGHT>Conexión Del Teléfono: </TD>";
  641. echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=phone_login SIZE=10 maxlength=20 VALUE=\"$phone_login\"></TD></TR>\n";
  642. echo "<TR><TD ALIGN=RIGHT>Contraseña Del Teléfono: </TD>";
  643. echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"$phone_pass\"></TD></TR>\n";
  644. echo "<TR><TD ALIGN=RIGHT>Conexión Del Usuario: </TD>";
  645. echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=VD_login SIZE=10 maxlength=20 VALUE=\"$VD_login\"></TD></TR>\n";
  646. echo "<TR><TD ALIGN=RIGHT>Contraseña Del Usuario: </TD>";
  647. echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=VD_pass SIZE=10 maxlength=20 VALUE=\"$VD_pass\"></TD></TR>\n";
  648. echo "<TR><TD ALIGN=RIGHT>Campaña: </TD>";
  649. echo "<TD ALIGN=LEFT><span id=\"LogiNCamPaigns\">$camp_form_code</span></TD></TR>\n";
  650. echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR> &nbsp; \n";
  651. echo "<span id=\"LogiNReseT\"></span></TD></TR>\n";
  652. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIÓN: $version &nbsp; &nbsp; &nbsp; CONSTRUCCION: $build</TD></TR>\n";
  653. echo "</TABLE>\n";
  654. echo "</FORM>\n\n";
  655. echo "</body>\n\n";
  656. echo "</html>\n\n";
  657. exit;
  658. }
  659. }
  660. }
  661. if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) )
  662. {
  663. echo "<title>web client VICIDIAL: Conexión Del Teléfono</title>\n";
  664. echo "</head>\n";
  665. echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
  666. echo "<A HREF=\"./timeclock.php?referrer=agent&pl=$phone_login&pp=$phone_pass&VD_login=$VD_login&VD_pass=$VD_pass\">Timeclock</A><BR>\n";
  667. echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
  668. echo "<!-- ILPV -->\n";
  669. echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../agc_es/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "</TR></TABLE>\n";
  670. echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
  671. echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  672. echo "<BR><BR><BR><CENTER><TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"$MAIN_COLOR\"><TR BGCOLOR=WHITE>";
  673. echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vdc_tab_vicidial.gif\" Border=0></TD>";
  674. echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Conexión Del Teléfono </TD>";
  675. echo "</TR>\n";
  676. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
  677. echo "<TR><TD ALIGN=RIGHT>Conexión Del Teléfono: </TD>";
  678. echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=phone_login SIZE=10 maxlength=20 VALUE=\"\"></TD></TR>\n";
  679. echo "<TR><TD ALIGN=RIGHT>Contraseña Del Teléfono: </TD>";
  680. echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"\"></TD></TR>\n";
  681. echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR> &nbsp; \n";
  682. echo "<span id=\"LogiNReseT\"></span></TD></TR>\n";
  683. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIÓN: $version &nbsp; &nbsp; &nbsp; CONSTRUCCION: $build</TD></TR>\n";
  684. echo "</TABLE>\n";
  685. echo "</FORM>\n\n";
  686. echo "</body>\n\n";
  687. echo "</html>\n\n";
  688. exit;
  689. }
  690. else
  691. {
  692. if ($WeBRooTWritablE > 0)
  693. {$fp = fopen ("./vicidial_auth_entries.txt", "a");}
  694. $VDloginDISPLAY=0;
  695. if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) )
  696. {
  697. $VDloginDISPLAY=1;
  698. }
  699. else
  700. {
  701. $stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';";
  702. if ($DB) {echo "|$stmt|\n";}
  703. $rslt=mysql_query($stmt, $link);
  704. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  705. $row=mysql_fetch_row($rslt);
  706. $auth=$row[0];
  707. if($auth>0)
  708. {
  709. $login=strtoupper($VD_login);
  710. $password=strtoupper($VD_pass);
  711. ##### grab the full name of the agent
  712. $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 from vicidial_users where user='$VD_login' and pass='$VD_pass'";
  713. $rslt=mysql_query($stmt, $link);
  714. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  715. $row=mysql_fetch_row($rslt);
  716. $LOGfullname = $row[0];
  717. $user_level = $row[1];
  718. $VU_hotkeys_active = $row[2];
  719. $VU_agent_choose_ingroups = $row[3];
  720. $VU_scheduled_callbacks = $row[4];
  721. $agentonly_callbacks = $row[5];
  722. $agentcall_manual = $row[6];
  723. $VU_vicidial_recording = $row[7];
  724. $VU_vicidial_transfers = $row[8];
  725. $VU_closer_default_blended = $row[9];
  726. $VU_user_group = $row[10];
  727. $VU_vicidial_recording_override = $row[11];
  728. $VU_alter_custphone_override = $row[12];
  729. $VU_alert_enabled = $row[13];
  730. $VU_agent_shift_enforcement_override = $row[14];
  731. $VU_shift_override_flag = $row[15];
  732. if ($VU_alert_enabled > 0) {$VU_alert_enabled = 'ON';}
  733. else {$VU_alert_enabled = 'OFF';}
  734. ### Gather timeclock and shift enforcement restriction settings
  735. $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';";
  736. $rslt=mysql_query($stmt, $link);
  737. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  738. $row=mysql_fetch_row($rslt);
  739. $forced_timeclock_login = $row[0];
  740. $shift_enforcement = $row[1];
  741. $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[2]);
  742. $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL);
  743. $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')";
  744. ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR
  745. if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) )
  746. {
  747. $last_agent_event='';
  748. $HHMM = date("Hi");
  749. $HHteod = substr($timeclock_end_of_day,0,2);
  750. $MMteod = substr($timeclock_end_of_day,2,2);
  751. if ($HHMM < $timeclock_end_of_day)
  752. {$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d")-1, date("Y"));}
  753. else
  754. {$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d"), date("Y"));}
  755. $EoDdate = date("Y-m-d H:i:s", $EoD);
  756. ##### grab timeclock logged-in time for each user #####
  757. $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;";
  758. $rslt=mysql_query($stmt, $link);
  759. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  760. $events_to_parse = mysql_num_rows($rslt);
  761. if ($events_to_parse > 0)
  762. {
  763. $rowx=mysql_fetch_row($rslt);
  764. $last_agent_event = $rowx[0];
  765. }
  766. if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";}
  767. if ( (strlen($last_agent_event)<2) or (ereg('SALIR',$last_agent_event)) )
  768. {
  769. $VDloginDISPLAY=1;
  770. $VDdisplayMESSAGE = "USTED DEBE ENTRAR A LA PRIMERA TIMECLOCK<BR>";
  771. }
  772. }
  773. ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR
  774. ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR
  775. if ( ( (ereg("COMIENZO|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("COMIENZO|ALL",$VU_agent_shift_enforcement_override)) )
  776. {
  777. $shift_ok=0;
  778. if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) )
  779. {
  780. $VDloginDISPLAY=1;
  781. $VDdisplayMESSAGE = "ERROR: No hay cambios habilitado para su grupo de usuarios<BR>";
  782. }
  783. else
  784. {
  785. $HHMM = date("Hi");
  786. $wday = date("w");
  787. $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id";
  788. $rslt=mysql_query($stmt, $link);
  789. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$user,$server_ip,$session_name,$one_mysql_log);}
  790. $shifts_to_print = mysql_num_rows($rslt);
  791. $o=0;
  792. while ( ($shifts_to_print > $o) and ($shift_ok < 1) )
  793. {
  794. $rowx=mysql_fetch_row($rslt);
  795. $shift_id = $rowx[0];
  796. $shift_start_time = $rowx[1];
  797. $shift_length = $rowx[2];
  798. $shift_weekdays = $rowx[3];
  799. if (eregi("$wday",$shift_weekdays))
  800. {
  801. $HHshift_length = substr($shift_length,0,2);
  802. $MMshift_length = substr($shift_length,3,2);
  803. $HHshift_start_time = substr($shift_start_time,0,2);
  804. $MMshift_start_time = substr($shift_start_time,2,2);
  805. $HHshift_end_time = ($HHshift_length + $HHshift_start_time);
  806. $MMshift_end_time = ($MMshift_length + $MMshift_start_time);
  807. if ($MMshift_end_time > 59)
  808. {
  809. $MMshift_end_time = ($MMshift_end_time - 60);
  810. $HHshift_end_time++;
  811. }
  812. if ($HHshift_end_time > 23)
  813. {$HHshift_end_time = ($HHshift_end_time - 24);}
  814. $HHshift_end_time = sprintf("%02s", $HHshift_end_time);
  815. $MMshift_end_time = sprintf("%02s", $MMshift_end_time);
  816. $shift_end_time = "$HHshift_end_time$MMshift_end_time";
  817. if (
  818. ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or
  819. ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or
  820. ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) )
  821. )
  822. {$shift_ok++;}
  823. }
  824. $o++;
  825. }
  826. if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) )
  827. {
  828. $VDloginDISPLAY=1;
  829. $VDdisplayMESSAGE = "ERROR: No se le permite acceder fuera de su turno<BR>";
  830. }
  831. }
  832. if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) )
  833. {
  834. $VDdisplayMESSAGE.= "<BR><BR>GERENTE DE TRANSFERENCIA:<BR>\n";
  835. $VDdisplayMESSAGE.= "<FORM ACTION=\"$PHP_SELF\" METHOD=POST>\n";
  836. $VDdisplayMESSAGE.= "<INPUT TYPE=HIDDEN NAME=MGR_override VALUE=\"1\">\n";
  837. $VDdisplayMESSAGE.= "<INPUT TYPE=HIDDEN NAME=relogin VALUE=\"YES\">\n";
  838. $VDdisplayMESSAGE.= "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  839. $VDdisplayMESSAGE.= "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
  840. $VDdisplayMESSAGE.= "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
  841. $VDdisplayMESSAGE.= "<INPUT TYPE=HIDDEN NAME=VD_login VALUE=\"$VD_login\">\n";
  842. $VDdisplayMESSAGE.= "<INPUT TYPE=HIDDEN NAME=VD_pass VALUE=\"$VD_pass\">\n";
  843. $VDdisplayMESSAGE.= "Manager Conexión: <INPUT TYPE=TEXT NAME=\"MGR_login$loginDATE\" SIZE=10 maxlength=20><br>\n";
  844. $VDdisplayMESSAGE.= "Manager Contraseña: <INPUT TYPE=PASSWORD NAME=\"MGR_pass$loginDATE\" SIZE=10 maxlength=20><br>\n";
  845. $VDdisplayMESSAGE.= "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR></FORM>\n";
  846. }
  847. }
  848. ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR
  849. if ($WeBRooTWritablE > 0)
  850. {
  851. fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n");
  852. fclose($fp);
  853. }
  854. $user_abb = "$VD_login$VD_login$VD_login$VD_login";
  855. while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
  856. {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;}
  857. $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';";
  858. $rslt=mysql_query($stmt, $link);
  859. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  860. $row=mysql_fetch_row($rslt);
  861. $LOGallowed_campaigns =$row[0];
  862. if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) )
  863. {
  864. echo "<title>web client VICIDIAL: VICIDIAL Conexión en la Campaña</title>\n";
  865. echo "</head>\n";
  866. echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
  867. echo "<A HREF=\"./timeclock.php?referrer=agent&pl=$phone_login&pp=$phone_pass&VD_login=$VD_login&VD_pass=$VD_pass\">Timeclock</A><BR>\n";
  868. echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
  869. echo "<!-- ILPV -->\n";
  870. echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../agc_es/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; echo "</TR></TABLE>\n";
  871. echo "<B>Sorry, you are not allowed to login to this campaign: $VD_campaign</B>\n";
  872. echo "<FORM ACTION=\"$PHP_SELF\" METHOD=POST>\n";
  873. echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  874. echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
  875. echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
  876. echo "Conexión: <INPUT TYPE=TEXT NAME=VD_login SIZE=10 maxlength=20 VALUE=\"$VD_login\">\n<br>";
  877. echo "Contraseña: <INPUT TYPE=PASSWORD NAME=VD_pass SIZE=10 maxlength=20 VALUE=\"$VD_pass\"><br>\n";
  878. echo "Campaña: <span id=\"LogiNCamPaigns\">$camp_form_code</span><br>\n";
  879. echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR> &nbsp; \n";
  880. echo "<span id=\"LogiNReseT\"></span>\n";
  881. echo "</FORM>\n\n";
  882. echo "</body>\n\n";
  883. echo "</html>\n\n";
  884. exit;
  885. }
  886. ##### check to see that the campaign is active
  887. $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';";
  888. if ($DB) {echo "|$stmt|\n";}
  889. $rslt=mysql_query($stmt, $link);
  890. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  891. $row=mysql_fetch_row($rslt);
  892. $CAMPactive=$row[0];
  893. if($CAMPactive>0)
  894. {
  895. if ($TEST_all_statuses > 0) {$selectableSQL = '';}
  896. else {$selectableSQL = "selectable='Y' and";}
  897. $VARstatuses='';
  898. $VARstatusnames='';
  899. ##### grab the statuses that can be used for dispositioning by an agent
  900. $stmt="SELECT status,status_name FROM vicidial_statuses WHERE $selectableSQL status != 'NEW' order by status limit 50;";
  901. $rslt=mysql_query($stmt, $link);
  902. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  903. if ($DB) {echo "$stmt\n";}
  904. $VD_statuses_ct = mysql_num_rows($rslt);
  905. $i=0;
  906. while ($i < $VD_statuses_ct)
  907. {
  908. $row=mysql_fetch_row($rslt);
  909. $statuses[$i] =$row[0];
  910. $status_names[$i] =$row[1];
  911. $VARstatuses = "$VARstatuses'$statuses[$i]',";
  912. $VARstatusnames = "$VARstatusnames'$status_names[$i]',";
  913. $i++;
  914. }
  915. ##### grab the campaign-specific statuses that can be used for dispositioning by an agent
  916. $stmt="SELECT status,status_name FROM vicidial_campaign_statuses WHERE $selectableSQL status != 'NEW' and campaign_id='$VD_campaign' order by status limit 80;";
  917. $rslt=mysql_query($stmt, $link);
  918. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  919. if ($DB) {echo "$stmt\n";}
  920. $VD_statuses_camp = mysql_num_rows($rslt);
  921. $j=0;
  922. while ($j < $VD_statuses_camp)
  923. {
  924. $row=mysql_fetch_row($rslt);
  925. $statuses[$i] =$row[0];
  926. $status_names[$i] =$row[1];
  927. $VARstatuses = "$VARstatuses'$statuses[$i]',";
  928. $VARstatusnames = "$VARstatusnames'$status_names[$i]',";
  929. $i++;
  930. $j++;
  931. }
  932. $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp);
  933. $VARstatuses = substr("$VARstatuses", 0, -1);
  934. $VARstatusnames = substr("$VARstatusnames", 0, -1);
  935. ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent
  936. $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;";
  937. $rslt=mysql_query($stmt, $link);
  938. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  939. if ($DB) {echo "$stmt\n";}
  940. $HK_statuses_camp = mysql_num_rows($rslt);
  941. $w=0;
  942. $HKboxA='';
  943. $HKboxB='';
  944. $HKboxC='';
  945. while ($w < $HK_statuses_camp)
  946. {
  947. $row=mysql_fetch_row($rslt);
  948. $HKhotkey[$w] =$row[0];
  949. $HKstatus[$w] =$row[1];
  950. $HKstatus_name[$w] =$row[2];
  951. $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',";
  952. $HKstatuses = "$HKstatuses'$HKstatus[$w]',";
  953. $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',";
  954. if ($w < 3)
  955. {$HKboxA = "$HKboxA <font class=\"skb_text\">$HKhotkey[$w]</font> - $HKstatus[$w] - $HKstatus_name[$w]<BR>";}
  956. if ( ($w >= 3) and ($w < 6) )
  957. {$HKboxB = "$HKboxB <font class=\"skb_text\">$HKhotkey[$w]</font> - $HKstatus[$w] - $HKstatus_name[$w]<BR>";}
  958. if ($w >= 6)
  959. {$HKboxC = "$HKboxC <font class=\"skb_text\">$HKhotkey[$w]</font> - $HKstatus[$w] - $HKstatus_name[$w]<BR>";}
  960. $w++;
  961. }
  962. $HKhotkeys = substr("$HKhotkeys", 0, -1);
  963. $HKstatuses = substr("$HKstatuses", 0, -1);
  964. $HKstatusnames = substr("$HKstatusnames", 0, -1);
  965. ##### grab the campaign settings
  966. $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 FROM vicidial_campaigns where campaign_id = '$VD_campaign';";
  967. $rslt=mysql_query($stmt, $link);
  968. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  969. if ($DB) {echo "$stmt\n";}
  970. $row=mysql_fetch_row($rslt);
  971. $park_ext = $row[0];
  972. $park_file_name = $row[1];
  973. $web_form_address = stripslashes($row[2]);
  974. $allow_closers = $row[3];
  975. $auto_dial_level = $row[4];
  976. $dial_timeout = $row[5];
  977. $dial_prefix = $row[6];
  978. $campaign_cid = $row[7];
  979. $campaign_vdad_exten = $row[8];
  980. $campaign_rec_exten = $row[9];
  981. $campaign_recording = $row[10];
  982. $campaign_rec_filename = $row[11];
  983. $campaign_script = $row[12];
  984. $get_call_launch = $row[13];
  985. $campaign_am_message_exten = $row[14];
  986. $xferconf_a_dtmf = $row[15];
  987. $xferconf_a_number = $row[16];
  988. $xferconf_b_dtmf = $row[17];
  989. $xferconf_b_number = $row[18];
  990. $alt_number_dialing = $row[19];
  991. $VC_scheduled_callbacks = $row[20];
  992. $wrapup_segundos = $row[21];
  993. $wrapup_message = $row[22];
  994. $closer_campaigns = $row[23];
  995. $use_internal_dnc = $row[24];
  996. $allcalls_delay = $row[25];
  997. $omit_phone_code = $row[26];
  998. $agent_pause_codes_active = $row[27];
  999. $no_hopper_leads_logins = $row[28];
  1000. $campaign_allow_inbound = $row[29];
  1001. $manual_dial_list_id = $row[30];
  1002. $default_xfer_group = $row[31];
  1003. $xfer_groups = $row[32];
  1004. $disable_alter_custphone = $row[33];
  1005. $display_queue_count = $row[34];
  1006. $manual_dial_filter = $row[35];
  1007. $CopY_tO_ClipboarD = $row[36];
  1008. $use_campaign_dnc = $row[37];
  1009. $three_way_call_cid = $row[38];
  1010. $dial_method = $row[39];
  1011. $three_way_dial_prefix = $row[40];
  1012. $web_form_target = $row[41];
  1013. $vtiger_screen_login = $row[42];
  1014. $agent_allow_group_alias = $row[43];
  1015. $default_group_alias = $row[44];
  1016. $default_group_alias_cid='';
  1017. if (strlen($default_group_alias)>1)
  1018. {
  1019. $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';";
  1020. if ($DB) {echo "$stmt\n";}
  1021. $rslt=mysql_query($stmt, $link);
  1022. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1023. $VDIG_cidnum_ct = mysql_num_rows($rslt);
  1024. if ($VDIG_cidnum_ct > 0)
  1025. {
  1026. $row=mysql_fetch_row($rslt);
  1027. $default_group_alias_cid = $row[0];
  1028. }
  1029. }
  1030. $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$user';";
  1031. if ($DB) {echo "$stmt\n";}
  1032. $rslt=mysql_query($stmt, $link);
  1033. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1034. $VDIG_cidogwv = mysql_num_rows($rslt);
  1035. if ($VDIG_cidogwv > 0)
  1036. {
  1037. $row=mysql_fetch_row($rslt);
  1038. $default_web_vars = $row[0];
  1039. }
  1040. if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) )
  1041. {
  1042. $campaign_recording = $VU_vicidial_recording_override;
  1043. print "<!-- USER GRABACIÓNING OVERRIDE: |$VU_vicidial_recording_override|$campaign_recording| -->\n";
  1044. }
  1045. if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') )
  1046. {$scheduled_callbacks='1';}
  1047. if ($VU_vicidial_recording=='0')
  1048. {$campaign_recording='NEVER';}
  1049. if ($VU_alter_custphone_override=='ALLOW_ALTER')
  1050. {$disable_alter_custphone='N';}
  1051. if (strlen($three_way_dial_prefix) < 1)
  1052. {$three_way_dial_prefix = $dial_prefix ;}
  1053. if ($alt_number_dialing=='Y')
  1054. {$alt_phone_dialing='1';}
  1055. else
  1056. {
  1057. $alt_phone_dialing='0';
  1058. $DefaulTAlTDiaL='0';
  1059. }
  1060. if ($display_queue_count=='N')
  1061. {$callholdstatus='0';}
  1062. if ( ($dial_method == 'INBOUND_MAN') or ($outbound_autodial_active < 1) )
  1063. {$VU_closer_default_blended=0;}
  1064. $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns);
  1065. $closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
  1066. $closer_campaigns = "'$closer_campaigns'";
  1067. if ( (ereg('Y',$agent_pause_codes_active)) or (ereg('FORCE',$agent_pause_codes_active)) )
  1068. {
  1069. ##### grab the pause codes for this campaign
  1070. $stmt="SELECT pause_code,pause_code_name FROM vicidial_pause_codes WHERE campaign_id='$VD_campaign' order by pause_code limit 50;";
  1071. $rslt=mysql_query($stmt, $link);
  1072. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1073. if ($DB) {echo "$stmt\n";}
  1074. $VD_pause_codes = mysql_num_rows($rslt);
  1075. $j=0;
  1076. while ($j < $VD_pause_codes)
  1077. {
  1078. $row=mysql_fetch_row($rslt);
  1079. $pause_codes[$i] =$row[0];
  1080. $pause_code_names[$i] =$row[1];
  1081. $VARpause_codes = "$VARpause_codes'$pause_codes[$i]',";
  1082. $VARpause_code_names = "$VARpause_code_names'$pause_code_names[$i]',";
  1083. $i++;
  1084. $j++;
  1085. }
  1086. $VD_pause_codes_ct = ($VD_pause_codes_ct+$VD_pause_codes);
  1087. $VARpause_codes = substr("$VARpause_codes", 0, -1);
  1088. $VARpause_code_names = substr("$VARpause_code_names", 0, -1);
  1089. }
  1090. ##### grab the inbound groups to choose from if campaign contains CLOSER
  1091. $VARingroups="''";
  1092. if ($campaign_allow_inbound == 'Y')
  1093. {
  1094. $VARingroups='';
  1095. $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 60;";
  1096. $rslt=mysql_query($stmt, $link);
  1097. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1098. if ($DB) {echo "$stmt\n";}
  1099. $closer_ct = mysql_num_rows($rslt);
  1100. $INgrpCT=0;
  1101. while ($INgrpCT < $closer_ct)
  1102. {
  1103. $row=mysql_fetch_row($rslt);
  1104. $closer_groups[$INgrpCT] =$row[0];
  1105. $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',";
  1106. $INgrpCT++;
  1107. }
  1108. $VARingroups = substr("$VARingroups", 0, -1);
  1109. }
  1110. ##### grab the allowable inbound groups to choose from for transfer options
  1111. $xfer_groups = preg_replace("/^ | -$/","",$xfer_groups);
  1112. $xfer_groups = preg_replace("/ /","','",$xfer_groups);
  1113. $xfer_groups = "'$xfer_groups'";
  1114. $VARxfergroups="''";
  1115. if ($allow_closers == 'Y')
  1116. {
  1117. $VARxfergroups='';
  1118. $stmt="select group_id,group_name from vicidial_inbound_groups where active = 'Y' and group_id IN($xfer_groups) order by group_id limit 60;";
  1119. $rslt=mysql_query($stmt, $link);
  1120. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1121. if ($DB) {echo "$stmt\n";}
  1122. $xfer_ct = mysql_num_rows($rslt);
  1123. $XFgrpCT=0;
  1124. while ($XFgrpCT < $xfer_ct)
  1125. {
  1126. $row=mysql_fetch_row($rslt);
  1127. $VARxfergroups = "$VARxfergroups'$row[0]',";
  1128. $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',";
  1129. if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];}
  1130. $XFgrpCT++;
  1131. }
  1132. $VARxfergroups = substr("$VARxfergroups", 0, -1);
  1133. $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1);
  1134. }
  1135. if (ereg('Y',$agent_allow_group_alias))
  1136. {
  1137. ##### grab the active group aliases
  1138. $stmt="SELECT group_alias_id,group_alias_name,caller_id_number FROM groups_alias WHERE active='Y' order by group_alias_id limit 1000;";
  1139. $rslt=mysql_query($stmt, $link);
  1140. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1141. if ($DB) {echo "$stmt\n";}
  1142. $VD_group_aliases = mysql_num_rows($rslt);
  1143. $j=0;
  1144. while ($j < $VD_group_aliases)
  1145. {
  1146. $row=mysql_fetch_row($rslt);
  1147. $group_alias_id[$i] = $row[0];
  1148. $group_alias_name[$i] = $row[1];
  1149. $caller_id_number[$i] = $row[2];
  1150. $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',";
  1151. $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',";
  1152. $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',";
  1153. $i++;
  1154. $j++;
  1155. }
  1156. $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases);
  1157. $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1);
  1158. $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1);
  1159. $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1);
  1160. }
  1161. ##### grab the number of leads in the hopper for this campaign
  1162. $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';";
  1163. $rslt=mysql_query($stmt, $link);
  1164. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1165. if ($DB) {echo "$stmt\n";}
  1166. $row=mysql_fetch_row($rslt);
  1167. $campaign_leads_to_call = $row[0];
  1168. print "<!-- $campaign_leads_to_call - Leads a la izquierda para llamar en Hopper -->\n";
  1169. }
  1170. else
  1171. {
  1172. $VDloginDISPLAY=1;
  1173. $VDdisplayMESSAGE = "La campaña no está activa, intentelo otra vez, por favor<BR>";
  1174. }
  1175. }
  1176. else
  1177. {
  1178. if ($WeBRooTWritablE > 0)
  1179. {
  1180. fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n");
  1181. fclose($fp);
  1182. }
  1183. $VDloginDISPLAY=1;
  1184. $VDdisplayMESSAGE = "La conexión incorrecta, intentelo otra vez, por favor<BR>";
  1185. }
  1186. }
  1187. if ($VDloginDISPLAY)
  1188. {
  1189. echo "<title>web client VICIDIAL: Conexión en la Campaña</title>\n";
  1190. echo "</head>\n";
  1191. echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
  1192. echo "<A HREF=\"./timeclock.php?referrer=agent&pl=$phone_login&pp=$phone_pass&VD_login=$VD_login&VD_pass=$VD_pass\">Timeclock</A><BR>\n";
  1193. echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
  1194. echo "<!-- ILPV -->\n";
  1195. echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../agc_es/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; echo "</TR></TABLE>\n";
  1196. echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
  1197. echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  1198. echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
  1199. echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
  1200. echo "<CENTER><BR><B>$VDdisplayMESSAGE</B><BR><BR>";
  1201. echo "<TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"$MAIN_COLOR\"><TR BGCOLOR=WHITE>";
  1202. echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vdc_tab_vicidial.gif\" Border=0></TD>";
  1203. echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Conexión en la Campaña </TD>";
  1204. echo "</TR>\n";
  1205. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1> &nbsp; </TD></TR>\n";
  1206. echo "<TR><TD ALIGN=RIGHT>Conexión Del Usuario: </TD>";
  1207. echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=VD_login SIZE=10 maxlength=20 VALUE=\"$VD_login\"></TD></TR>\n";
  1208. echo "<TR><TD ALIGN=RIGHT>Contraseña Del Usuario: </TD>";
  1209. echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=VD_pass SIZE=10 maxlength=20 VALUE=\"$VD_pass\"></TD></TR>\n";
  1210. echo "<TR><TD ALIGN=RIGHT>Campaña: </TD>";
  1211. echo "<TD ALIGN=LEFT><span id=\"LogiNCamPaigns\">$camp_form_code</span></TD></TR>\n";
  1212. echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR> &nbsp; \n";
  1213. echo "<span id=\"LogiNReseT\"></span></TD></TR>\n";
  1214. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIÓN: $version &nbsp; &nbsp; &nbsp; CONSTRUCCION: $build</TD></TR>\n";
  1215. echo "</TABLE>\n";
  1216. echo "</FORM>\n\n";
  1217. echo "</body>\n\n";
  1218. echo "</html>\n\n";
  1219. exit;
  1220. }
  1221. # code for parsing load-balanced agent phone allocation where agent interface
  1222. # will send multiple phones-table logins so that the script can determine the
  1223. # server that has the fewest agents logged into it.
  1224. # login: ca101,cb101,cc101
  1225. $alias_found=0;
  1226. $stmt="select count(*) from phones_alias where alias_id = '$phone_login';";
  1227. $rslt=mysql_query($stmt, $link);
  1228. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1229. $alias_ct = mysql_num_rows($rslt);
  1230. if ($alias_ct > 0)
  1231. {
  1232. $row=mysql_fetch_row($rslt);
  1233. $alias_found = "$row[0]";
  1234. }
  1235. if ($alias_found > 0)
  1236. {
  1237. $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;";
  1238. $rslt=mysql_query($stmt, $link);
  1239. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1240. $alias_ct = mysql_num_rows($rslt);
  1241. if ($alias_ct > 0)
  1242. {
  1243. $row=mysql_fetch_row($rslt);
  1244. $alias_name = "$row[0]";
  1245. $phone_login = "$row[1]";
  1246. }
  1247. }
  1248. $pa=0;
  1249. if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) )
  1250. {
  1251. $phoneSQL = "(";
  1252. $phones_auto = explode(',',$phone_login);
  1253. $phones_auto_ct = count($phones_auto);
  1254. while($pa < $phones_auto_ct)
  1255. {
  1256. if ($pa > 0)
  1257. {$phoneSQL .= " or ";}
  1258. $desc = ($phones_auto_ct - $pa); # traverse in reverse order
  1259. $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')";
  1260. $pa++;
  1261. }
  1262. $phoneSQL .= ")";
  1263. }
  1264. else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";}
  1265. $authphone=0;
  1266. $stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';";
  1267. if ($DB) {echo "|$stmt|\n";}
  1268. $rslt=mysql_query($stmt, $link);
  1269. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1270. $row=mysql_fetch_row($rslt);
  1271. $authphone=$row[0];
  1272. if (!$authphone)
  1273. {
  1274. echo "<title>web client VICIDIAL: Conexión Del Teléfono Error</title>\n";
  1275. echo "</head>\n";
  1276. echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
  1277. echo "<A HREF=\"./timeclock.php?referrer=agent&pl=$phone_login&pp=$phone_pass&VD_login=$VD_login&VD_pass=$VD_pass\">Timeclock</A><BR>\n";
  1278. echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
  1279. echo "<!-- ILPV -->\n";
  1280. echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../agc_es/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; echo "</TR></TABLE>\n";
  1281. echo "<FORM NAME=vicidial_form ID=vicidial_form ACTION=\"$agcPAGE\" METHOD=POST>\n";
  1282. echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  1283. echo "<INPUT TYPE=HIDDEN NAME=VD_login VALUE=\"$VD_login\">\n";
  1284. echo "<INPUT TYPE=HIDDEN NAME=VD_pass VALUE=\"$VD_pass\">\n";
  1285. echo "<INPUT TYPE=HIDDEN NAME=VD_campaign VALUE=\"$VD_campaign\">\n";
  1286. echo "<BR><BR><BR><CENTER><TABLE WIDTH=460 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\"$MAIN_COLOR\"><TR BGCOLOR=WHITE>";
  1287. echo "<TD ALIGN=LEFT VALIGN=BOTTOM><IMG SRC=\"../agc/images/vdc_tab_vicidial.gif\" Border=0></TD>";
  1288. echo "<TD ALIGN=CENTER VALIGN=MIDDLE> Conexión Error</TD>";
  1289. echo "</TR>\n";
  1290. echo "<TR><TD ALIGN=CENTER COLSPAN=2><font size=1> &nbsp; <BR><FONT SIZE=3>Disculpe, la conexión del teléfono y contraseña no están activos en este sistema, intentelo otra vez por favor: <BR> &nbsp;</TD></TR>\n";
  1291. echo "<TR><TD ALIGN=RIGHT>Conexión Del Teléfono: </TD>";
  1292. echo "<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=phone_login SIZE=10 maxlength=20 VALUE=\"$phone_login\"></TD></TR>\n";
  1293. echo "<TR><TD ALIGN=RIGHT>Contraseña Del Teléfono: </TD>";
  1294. echo "<TD ALIGN=LEFT><INPUT TYPE=PASSWORD NAME=phone_pass SIZE=10 maxlength=20 VALUE=\"$phone_pass\"></TD></TR>\n";
  1295. echo "<TR><TD ALIGN=CENTER COLSPAN=2><INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR></TD></TR>\n";
  1296. echo "<TR><TD ALIGN=LEFT COLSPAN=2><font size=1><BR>VERSIÓN: $version &nbsp; &nbsp; &nbsp; CONSTRUCCION: $build</TD></TR>\n";
  1297. echo "</TABLE>\n";
  1298. echo "</FORM>\n\n";
  1299. echo "</body>\n\n";
  1300. echo "</html>\n\n";
  1301. exit;
  1302. }
  1303. else
  1304. {
  1305. ### go through the entered phones to figure out which server has fewest agents
  1306. ### logged in and use that phone login account
  1307. if ($pa > 0)
  1308. {
  1309. $pb=0;
  1310. $pb_login='';
  1311. $pb_server_ip='';
  1312. $pb_count=0;
  1313. $pb_log='';
  1314. while($pb < $phones_auto_ct)
  1315. {
  1316. ### find the server_ip of each phone_login
  1317. $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';";
  1318. if ($DB) {echo "|$stmtx|\n";}
  1319. if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
  1320. $rslt=mysql_query($stmtx, $link);
  1321. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1322. $rowx=mysql_fetch_row($rslt);
  1323. ### get number of agents logged in to each server
  1324. $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]';";
  1325. if ($DB) {echo "|$stmt|\n";}
  1326. $rslt=mysql_query($stmt, $link);
  1327. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1328. $row=mysql_fetch_row($rslt);
  1329. ### find out whether the server is set to active
  1330. $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y';";
  1331. if ($DB) {echo "|$stmt|\n";}
  1332. $rslt=mysql_query($stmt, $link);
  1333. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1334. $rowy=mysql_fetch_row($rslt);
  1335. ### find out whether the server_updater is running
  1336. $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';";
  1337. if ($DB) {echo "|$stmt|\n";}
  1338. $rslt=mysql_query($stmt, $link);
  1339. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1340. $rowz=mysql_fetch_row($rslt);
  1341. $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowz[0]| ";
  1342. if ( ($rowy[0] > 0) && ($rowz[0] > 0) )
  1343. {
  1344. if ( ($pb_count >= $row[0]) || (strlen($pb_server_ip) < 4) )
  1345. {
  1346. $pb_count=$row[0];
  1347. $pb_server_ip=$rowx[0];
  1348. $phone_login=$phones_auto[$pb];
  1349. }
  1350. }
  1351. $pb++;
  1352. }
  1353. echo "<!-- Teléfonos balance selection: $phone_login|$pb_server_ip|$past_minutes_date| |$pb_log -->\n";
  1354. }
  1355. echo "<title>web client VICIDIAL</title>\n";
  1356. $stmt="SELECT * from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';";
  1357. if ($DB) {echo "|$stmt|\n";}
  1358. $rslt=mysql_query($stmt, $link);
  1359. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1360. $row=mysql_fetch_row($rslt);
  1361. $extension=$row[0];
  1362. $dialplan_number=$row[1];
  1363. $voicemail_id=$row[2];
  1364. $phone_ip=$row[3];
  1365. $computer_ip=$row[4];
  1366. $server_ip=$row[5];
  1367. $login=$row[6];
  1368. $pass=$row[7];
  1369. $status=$row[8];
  1370. $active=$row[9];
  1371. $phone_type=$row[10];
  1372. $fullname=$row[11];
  1373. $company=$row[12];
  1374. $picture=$row[13];
  1375. $messages=$row[14];
  1376. $old_messages=$row[15];
  1377. $protocol=$row[16];
  1378. $local_gmt=$row[17];
  1379. $ASTmgrUSERNAME=$row[18];
  1380. $ASTmgrSECRET=$row[19];
  1381. $login_user=$row[20];
  1382. $login_pass=$row[21];
  1383. $login_campaign=$row[22];
  1384. $park_on_extension=$row[23];
  1385. $conf_on_extension=$row[24];
  1386. $VICIDiaL_park_on_extension=$row[25];
  1387. $VICIDiaL_park_on_filename=$row[26];
  1388. $monitor_prefix=$row[27];
  1389. $recording_exten=$row[28];
  1390. $voicemail_exten=$row[29];
  1391. $voicemail_dump_exten=$row[30];
  1392. $ext_context=$row[31];
  1393. $dtmf_send_extension=$row[32];
  1394. $call_out_number_group=$row[33];
  1395. $client_browser=$row[34];
  1396. $install_directory=$row[35];
  1397. $local_web_callerID_URL=$row[36];
  1398. $VICIDiaL_web_URL=$row[37];
  1399. $AGI_call_logging_enabled=$row[38];
  1400. $user_switching_enabled=$row[39];
  1401. $conferencing_enabled=$row[40];
  1402. $admin_hangup_enabled=$row[41];
  1403. $admin_hijack_enabled=$row[42];
  1404. $admin_monitor_enabled=$row[43];
  1405. $call_parking_enabled=$row[44];
  1406. $updater_check_enabled=$row[45];
  1407. $AFLogging_enabled=$row[46];
  1408. $QUEUE_ACTION_enabled=$row[47];
  1409. $LlamadorID_popup_enabled=$row[48];
  1410. $voicemail_button_enabled=$row[49];
  1411. $enable_fast_refresh=$row[50];
  1412. $fast_refresh_rate=$row[51];
  1413. $enable_persistant_mysql=$row[52];
  1414. $auto_dial_next_number=$row[53];
  1415. $VDstop_rec_after_each_call=$row[54];
  1416. $DBX_server=$row[55];
  1417. $DBX_database=$row[56];
  1418. $DBX_user=$row[57];
  1419. $DBX_pass=$row[58];
  1420. $DBX_port=$row[59];
  1421. $outbound_cid=$row[65];
  1422. $enable_sipsak_messages=$row[66];
  1423. if ($TeléfonoSComPIP == '1')
  1424. {
  1425. if (strlen($computer_ip) < 4)
  1426. {
  1427. $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';";
  1428. if ($DB) {echo "|$stmt|\n";}
  1429. $rslt=mysql_query($stmt, $link);
  1430. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1431. }
  1432. }
  1433. if ($TeléfonoSComPIP == '2')
  1434. {
  1435. $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';";
  1436. if ($DB) {echo "|$stmt|\n";}
  1437. $rslt=mysql_query($stmt, $link);
  1438. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1439. }
  1440. if ($clientDST)
  1441. {
  1442. $local_gmt = ($local_gmt + $isdst);
  1443. }
  1444. if ($protocol == 'EXTERNAL')
  1445. {
  1446. $protocol = 'Local';
  1447. $extension = "$dialplan_number$AT$ext_context";
  1448. }
  1449. $SIP_user = "$protocol/$extension";
  1450. $SIP_user_DiaL = "$protocol/$extension";
  1451. if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') )
  1452. {
  1453. $SIP_user = "$protocol/$extension$VD_login";
  1454. }
  1455. $stmt="SELECT asterisk_version from servers where server_ip='$server_ip';";
  1456. if ($DB) {echo "|$stmt|\n";}
  1457. $rslt=mysql_query($stmt, $link);
  1458. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1459. $row=mysql_fetch_row($rslt);
  1460. $asterisk_version=$row[0];
  1461. # If a park extension is not set, use the default one
  1462. if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) )
  1463. {
  1464. $VICIDiaL_park_on_extension = "$park_ext";
  1465. $VICIDiaL_park_on_filename = "$park_file_name";
  1466. print "<!-- PARKINGING PERSONALIZADO DE LA CAMPAÑA: |$VICIDiaL_park_on_extension|$VICIDiaL_park_on_filename| -->\n";
  1467. }
  1468. print "<!-- PARKINGING POR DEFECTO DE LA CAMPAñA: |$VICIDiaL_park_on_extension|$VICIDiaL_park_on_filename| -->\n";
  1469. # If a web form address is not set, use the default one
  1470. if (strlen($web_form_address)>0)
  1471. {
  1472. $VICIDiaL_web_form_address = "$web_form_address";
  1473. print "<!-- FORMULARIO WEB PERSONALIZADO DE LA CAMPAÑA: |$VICIDiaL_web_form_address| -->\n";
  1474. }
  1475. else
  1476. {
  1477. $VICIDiaL_web_form_address = "$VICIDiaL_web_URL";
  1478. print "<!-- FORMULARIO WEB POR DEFECTO DE LA CAMPAÑA: |$VICIDiaL_web_form_address| -->\n";
  1479. $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address);
  1480. }
  1481. $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address);
  1482. # If closers are allowed en this campaign
  1483. if ($allow_closers=="Y")
  1484. {
  1485. $VICIDiaL_allow_closers = 1;
  1486. print "<!-- LA CAMPAÑA PERMITE CLOSERS: |$VICIDiaL_allow_closers| -->\n";
  1487. }
  1488. else
  1489. {
  1490. $VICIDiaL_allow_closers = 0;
  1491. print "<!-- LA CAMPAÑA NO PERMITE CLOSERS: |$VICIDiaL_allow_closers| -->\n";
  1492. }
  1493. $session_ext = eregi_replace("[^a-z0-9]", "", $extension);
  1494. if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);}
  1495. $session_rand = (rand(1,9999999) + 10000000);
  1496. $session_name = "$StarTtimE$US$session_ext$session_rand";
  1497. if ($webform_sessionname)
  1498. {$webform_sessionname = "&session_name=$session_name";}
  1499. else
  1500. {$webform_sessionname = '';}
  1501. $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';";
  1502. if ($DB) {echo "|$stmt|\n";}
  1503. $rslt=mysql_query($stmt, $link);
  1504. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1505. $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');";
  1506. if ($DB) {echo "|$stmt|\n";}
  1507. $rslt=mysql_query($stmt, $link);
  1508. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1509. if ( ($campaign_allow_inbound == 'Y') || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) )
  1510. {
  1511. ### insert an entry into the user log for the login event
  1512. $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group')";
  1513. if ($DB) {echo "|$stmt|\n";}
  1514. $rslt=mysql_query($stmt, $link);
  1515. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1516. ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly
  1517. $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;";
  1518. $rslt=mysql_query($stmt, $link);
  1519. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1520. if ($DB) {echo "$stmt\n";}
  1521. $prev_login_ct = mysql_num_rows($rslt);
  1522. $i=0;
  1523. while ($i < $prev_login_ct)
  1524. {
  1525. $row=mysql_fetch_row($rslt);
  1526. $session_id =$row[0];
  1527. $i++;
  1528. }
  1529. if ($prev_login_ct > 0)
  1530. {print "<!-- USAR EL SITIO ANTERIOR DE MEETME - $session_id - $NOW_TIME - $SIP_user -->\n";}
  1531. else
  1532. {
  1533. ##### grab the next available vicidial_conference room and reserve it
  1534. $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));";
  1535. if ($DB) {echo "$stmt\n";}
  1536. $rslt=mysql_query($stmt, $link);
  1537. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1538. $row=mysql_fetch_row($rslt);
  1539. if ($row[0] > 0)
  1540. {
  1541. $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;";
  1542. if ($format=='debug') {echo "\n<!-- $stmt -->";}
  1543. $rslt=mysql_query($stmt, $link);
  1544. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1545. $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$user') );";
  1546. if ($format=='debug') {echo "\n<!-- $stmt -->";}
  1547. $rslt=mysql_query($stmt, $link);
  1548. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1549. $row=mysql_fetch_row($rslt);
  1550. $session_id = $row[0];
  1551. }
  1552. print "<!-- USAR EL NUEVO SITIO DE MEETME - $session_id - $NOW_TIME - $SIP_user -->\n";
  1553. }
  1554. ### mark leads that were not dispositioned during previous calls as ERI
  1555. $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';";
  1556. if ($DB) {echo "$stmt\n";}
  1557. $rslt=mysql_query($stmt, $link);
  1558. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1559. $affected_rows = mysql_affected_rows($link);
  1560. print "<!-- vieja COLA y lista invertida INCALL: |$affected_rows| -->\n";
  1561. $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';";
  1562. if ($DB) {echo "$stmt\n";}
  1563. $rslt=mysql_query($stmt, $link);
  1564. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1565. $affected_rows = mysql_affected_rows($link);
  1566. print "<!-- vieja COLA y tolva invertida INCALL: |$affected_rows| -->\n";
  1567. $stmt="DELETE from vicidial_live_agents where user ='$VD_login';";
  1568. if ($DB) {echo "$stmt\n";}
  1569. $rslt=mysql_query($stmt, $link);
  1570. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1571. $affected_rows = mysql_affected_rows($link);
  1572. print "<!-- viejos expedientes de los vicidial_live_agents despejados: |$affected_rows| -->\n";
  1573. $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';";
  1574. if ($DB) {echo "$stmt\n";}
  1575. $rslt=mysql_query($stmt, $link);
  1576. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1577. $affected_rows = mysql_affected_rows($link);
  1578. print "<!-- old vicidial_live_inbound_agents records cleared: |$affected_rows| -->\n";
  1579. # print "<B>You have logged in as user: $VD_login en phone: $SIP_user a la campaña: $VD_campaign</B><BR>\n";
  1580. $VICIDiaL_is_logged_in=1;
  1581. ### set the callerID for manager middleware-app to connect the phone to the user
  1582. $SIqueryCID = "S$CIDdate$session_id";
  1583. #############################################
  1584. ##### COMIENZO SYSTEM_SETTINGS LOOKUP #####
  1585. $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages FROM system_settings;";
  1586. $rslt=mysql_query($stmt, $link);
  1587. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1588. if ($DB) {echo "$stmt\n";}
  1589. $qm_conf_ct = mysql_num_rows($rslt);
  1590. if ($qm_conf_ct > 0)
  1591. {
  1592. $row=mysql_fetch_row($rslt);
  1593. $enable_queuemetrics_logging = $row[0];
  1594. $queuemetrics_server_ip = $row[1];
  1595. $queuemetrics_dbname = $row[2];
  1596. $queuemetrics_login = $row[3];
  1597. $queuemetrics_pass = $row[4];
  1598. $queuemetrics_log_id = $row[5];
  1599. $vicidial_agent_disable = $row[6];
  1600. $allow_sipsak_messages = $row[7];
  1601. }
  1602. ##### END QUEUEMETRICS LOGGING LOOKUP #####
  1603. ###########################################
  1604. if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (eregi("SIP",$protocol)) )
  1605. {
  1606. $SIPSAK_prefix = 'LIN-';
  1607. print "<!-- sending login sipsak message: $SIPSAK_prefix$VD_campaign -->\n";
  1608. passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$VD_campaign\" -r 5060 -s sip:$extension@$phone_ip > /dev/null");
  1609. $SIqueryCID = "$SIPSAK_prefix$VD_campaign$DS$CIDdate";
  1610. }
  1611. ### insert a NUEVO record to the vicidial_manager table to be processed
  1612. $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $SIP_user_DiaL','Context: $ext_context','Exten: $session_id','Priority: 1','Callerid: $SIqueryCID','','','','','');";
  1613. if ($DB) {echo "$stmt\n";}
  1614. $rslt=mysql_query($stmt, $link);
  1615. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1616. $affected_rows = mysql_affected_rows($link);
  1617. print "<!-- call placed to session_id: $session_id from phone: $SIP_user $SIP_user_DiaL -->\n";
  1618. if ($auto_dial_level > 0)
  1619. {
  1620. print "<!-- la campaña se fija al auto_dial_level: $auto_dial_level -->\n";
  1621. ##### grab the campaign_weight and number of calls today en that campaign for the agent
  1622. $stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';";
  1623. $rslt=mysql_query($stmt, $link);
  1624. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1625. if ($DB) {echo "$stmt\n";}
  1626. $vca_ct = mysql_num_rows($rslt);
  1627. if ($vca_ct > 0)
  1628. {
  1629. $row=mysql_fetch_row($rslt);
  1630. $campaign_weight = $row[0];
  1631. $calls_today = $row[1];
  1632. $i++;
  1633. }
  1634. else
  1635. {
  1636. $campaign_weight = '0';
  1637. $calls_today = '0';
  1638. $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');";
  1639. if ($DB) {echo "$stmt\n";}
  1640. $rslt=mysql_query($stmt, $link);
  1641. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1642. $affected_rows = mysql_affected_rows($link);
  1643. print "<!-- new vicidial_campaign_agents record inserted: |$affected_rows| -->\n";
  1644. }
  1645. $closer_chooser_string='';
  1646. $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) 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');";
  1647. if ($DB) {echo "$stmt\n";}
  1648. $rslt=mysql_query($stmt, $link);
  1649. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1650. $affected_rows = mysql_affected_rows($link);
  1651. print "<!-- Insertadas las grabaciones nueva de los vicidial_live_agents: |$affected_rows| -->\n";
  1652. if ($enable_queuemetrics_logging > 0)
  1653. {
  1654. $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
  1655. mysql_select_db("$queuemetrics_dbname", $linkB);
  1656. $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';";
  1657. if ($DB) {echo "$stmt\n";}
  1658. $rslt=mysql_query($stmt, $linkB);
  1659. if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1660. $affected_rows = mysql_affected_rows($linkB);
  1661. print "<!-- queue_log AGENTLOGIN entry added: $VD_login|$affected_rows -->\n";
  1662. $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';";
  1663. if ($DB) {echo "$stmt\n";}
  1664. $rslt=mysql_query($stmt, $linkB);
  1665. if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1666. $affected_rows = mysql_affected_rows($linkB);
  1667. print "<!-- queue_log PAUSE entry added: $VD_login|$affected_rows -->\n";
  1668. mysql_close($linkB);
  1669. mysql_select_db("$VARDB_database", $link);
  1670. }
  1671. if ($campaign_allow_inbound == 'Y')
  1672. {
  1673. print "<!-- CLOSER-type campaign -->\n";
  1674. }
  1675. }
  1676. else
  1677. {
  1678. print "<!-- la campaña está configurada con marcaje manual: $auto_dial_level -->\n";
  1679. $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) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level');";
  1680. if ($DB) {echo "$stmt\n";}
  1681. $rslt=mysql_query($stmt, $link);
  1682. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1683. $affected_rows = mysql_affected_rows($link);
  1684. print "<!-- Insertadas las grabaciones nueva de los vicidial_live_agents: |$affected_rows| -->\n";
  1685. if ($enable_queuemetrics_logging > 0)
  1686. {
  1687. $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
  1688. mysql_select_db("$queuemetrics_dbname", $linkB);
  1689. $stmt = "INSERT INTO queue_log SET partition='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='AGENTLOGIN',data1='$VD_login@agents',serverid='$queuemetrics_log_id';";
  1690. if ($DB) {echo "$stmt\n";}
  1691. $rslt=mysql_query($stmt, $linkB);
  1692. if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1693. $affected_rows = mysql_affected_rows($linkB);
  1694. print "<!-- queue_log AGENTLOGIN entry added: $VD_login|$affected_rows -->\n";
  1695. $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';";
  1696. if ($DB) {echo "$stmt\n";}
  1697. $rslt=mysql_query($stmt, $linkB);
  1698. if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1699. $affected_rows = mysql_affected_rows($linkB);
  1700. print "<!-- queue_log PAUSE entry added: $VD_login|$affected_rows -->\n";
  1701. mysql_close($linkB);
  1702. mysql_select_db("$VARDB_database", $link);
  1703. }
  1704. }
  1705. }
  1706. else
  1707. {
  1708. echo "<title>web client VICIDIAL: VICIDIAL Conexión en la Campaña</title>\n";
  1709. echo "</head>\n";
  1710. echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
  1711. echo "<A HREF=\"./timeclock.php?referrer=agent&pl=$phone_login&pp=$phone_pass&VD_login=$VD_login&VD_pass=$VD_pass\">Timeclock</A><BR>\n";
  1712. echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
  1713. echo "<!-- ILPV -->\n";
  1714. echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../agc_es/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; echo "</TR></TABLE>\n";
  1715. echo "<B>Lo siento, no hay leads en el hopper de esta campaña</B>\n";
  1716. echo "<FORM ACTION=\"$PHP_SELF\" METHOD=POST>\n";
  1717. echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  1718. echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
  1719. echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
  1720. echo "Conexión: <INPUT TYPE=TEXT NAME=VD_login SIZE=10 maxlength=20 VALUE=\"$VD_login\">\n<br>";
  1721. echo "Contraseña: <INPUT TYPE=PASSWORD NAME=VD_pass SIZE=10 maxlength=20 VALUE=\"$VD_pass\"><br>\n";
  1722. echo "Campaña: <span id=\"LogiNCamPaigns\">$camp_form_code</span><br>\n";
  1723. echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR> &nbsp; \n";
  1724. echo "<span id=\"LogiNReseT\"></span>\n";
  1725. echo "</FORM>\n\n";
  1726. echo "</body>\n\n";
  1727. echo "</html>\n\n";
  1728. exit;
  1729. }
  1730. if (strlen($session_id) < 1)
  1731. {
  1732. echo "<title>web client VICIDIAL: VICIDIAL Conexión en la Campaña</title>\n";
  1733. echo "</head>\n";
  1734. echo "<BODY BGCOLOR=WHITE MARGINHEIGHT=0 MARGINWIDTH=0>\n";
  1735. echo "<A HREF=\"./timeclock.php?referrer=agent&pl=$phone_login&pp=$phone_pass&VD_login=$VD_login&VD_pass=$VD_pass\">Timeclock</A><BR>\n";
  1736. echo "<TABLE WIDTH=100%><TR><TD></TD>\n";
  1737. echo "<!-- ILPV -->\n";
  1738. echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP NOWRAP><a href=\"../agc_en/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">English <img src=\"../agc/images/en.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n";echo "<TD WIDTH=100 ALIGN=RIGHT VALIGN=TOP BGCOLOR=\"#CCFFCC\" NOWRAP><a href=\"../agc_es/vicidial.php?relogin=YES&VD_login=$VD_login&VD_campaign=$VD_campaign&phone_login=$phone_login&phone_pass=$phone_pass&VD_pass=$VD_pass\">Español <img src=\"../agc/images/es.gif\" BORDER=0 HEIGHT=14 WIDTH=20></a></TD>\n"; echo "</TR></TABLE>\n";
  1739. echo "<B>Sorry, there are no available sessions</B>\n";
  1740. echo "<FORM ACTION=\"$PHP_SELF\" METHOD=POST>\n";
  1741. echo "<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
  1742. echo "<INPUT TYPE=HIDDEN NAME=phone_login VALUE=\"$phone_login\">\n";
  1743. echo "<INPUT TYPE=HIDDEN NAME=phone_pass VALUE=\"$phone_pass\">\n";
  1744. echo "Conexión: <INPUT TYPE=TEXT NAME=VD_login SIZE=10 maxlength=20 VALUE=\"$VD_login\">\n<br>";
  1745. echo "Contraseña: <INPUT TYPE=PASSWORD NAME=VD_pass SIZE=10 maxlength=20 VALUE=\"$VD_pass\"><br>\n";
  1746. echo "Campaña: <span id=\"LogiNCamPaigns\">$camp_form_code</span><br>\n";
  1747. echo "<INPUT TYPE=Submit NAME=ENVIAR VALUE=ENVIAR> &nbsp; \n";
  1748. echo "<span id=\"LogiNReseT\"></span>\n";
  1749. echo "</FORM>\n\n";
  1750. echo "</body>\n\n";
  1751. echo "</html>\n\n";
  1752. exit;
  1753. }
  1754. if (ereg('MSIE',$browser))
  1755. {
  1756. $useIE=1;
  1757. print "<!-- client web browser used: MSIE |$browser|$useIE| -->\n";
  1758. }
  1759. else
  1760. {
  1761. $useIE=0;
  1762. print "<!-- client web browser used: W3C-Compliant |$browser|$useIE| -->\n";
  1763. }
  1764. $StarTtimE = date("U");
  1765. $NOW_TIME = date("Y-m-d H:i:s");
  1766. ##### Agent is going to log in so insert the vicidial_agent_log entry now
  1767. $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE','$VU_user_group','LOGIN');";
  1768. if ($DB) {echo "$stmt\n";}
  1769. $rslt=mysql_query($stmt, $link);
  1770. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1771. $affected_rows = mysql_affected_rows($link);
  1772. $agent_log_id = mysql_insert_id($link);
  1773. print "<!-- vicidial_agent_log record inserted: |$affected_rows|$agent_log_id| -->\n";
  1774. $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';";
  1775. if ($DB) {echo "$stmt\n";}
  1776. $rslt=mysql_query($stmt, $link);
  1777. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1778. $VUaffected_rows = mysql_affected_rows($link);
  1779. $S='*';
  1780. $D_s_ip = explode('.', $server_ip);
  1781. if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";}
  1782. if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";}
  1783. if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";}
  1784. if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";}
  1785. if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";}
  1786. if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";}
  1787. if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";}
  1788. if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";}
  1789. $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S";
  1790. ##### grab the datails of all active scripts in the system
  1791. $stmt="SELECT script_id,script_name,script_text FROM vicidial_scripts WHERE active='Y' order by script_id limit 100;";
  1792. $rslt=mysql_query($stmt, $link);
  1793. if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);}
  1794. if ($DB) {echo "$stmt\n";}
  1795. $MM_scripts = mysql_num_rows($rslt);
  1796. $e=0;
  1797. while ($e < $MM_scripts)
  1798. {
  1799. $row=mysql_fetch_row($rslt);
  1800. $MMscriptid[$e] =$row[0];
  1801. $MMscriptname[$e] = urlencode($row[1]);
  1802. $MMscripttext[$e] = urlencode($row[2]);
  1803. $MMscriptids = "$MMscriptids'$MMscriptid[$e]',";
  1804. $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',";
  1805. $MMscripttexts = "$MMscripttexts'$MMscripttext[$e]',";
  1806. $e++;
  1807. }
  1808. $MMscriptids = substr("$MMscriptids", 0, -1);
  1809. $MMscriptnames = substr("$MMscriptnames", 0, -1);
  1810. $MMscripttexts = substr("$MMscripttexts", 0, -1);
  1811. }
  1812. }
  1813. ################################################################
  1814. ### BEGIN - build the callback calendar (12 months) ###
  1815. ################################################################
  1816. define ('ADAY', (60*60*24));
  1817. $CdayARY = getdate();
  1818. $Cmon = $CdayARY['mon'];
  1819. $Cyear = $CdayARY['year'];
  1820. $CTODAY = date("Y-m");
  1821. $CTODAYmday = date("j");
  1822. $CINC=0;
  1823. $Cmonths = Array('Enero','February','Marcha','Abril','Puede','Junio',
  1824. 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre');
  1825. $Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
  1826. $CCAL_OUT = '';
  1827. $CCAL_OUT .= "<table border=0 cellpadding=2 cellspacing=2>";
  1828. while ($CINC < 12)
  1829. {
  1830. if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) )
  1831. {$CCAL_OUT .= "<tr>";}
  1832. $CCAL_OUT .= "<td valign=top>";
  1833. $CYyear = $Cyear;
  1834. $Cmonth= ($Cmon + $CINC);
  1835. if ($Cmonth > 12)
  1836. {
  1837. $Cmonth = ($Cmonth - 12);
  1838. $CYyear++;
  1839. }
  1840. $Cstart= mktime(11,0,0,$Cmonth,1,$CYyear);
  1841. $CfirstdayARY = getdate($Cstart);
  1842. #echo "|$Cmon|$Cmonth|$CINC|\n";
  1843. $CPRNTDAY = date("Y-m", $Cstart);
  1844. $CCAL_OUT .= "<table border=1 cellpadding=1 bordercolor=\"000000\" cellspacing=\"0\" bgcolor=\"white\">";
  1845. $CCAL_OUT .= "<tr>";
  1846. $CCAL_OUT .= "<td colspan=7 bordercolor=\"#ffffff\" bgcolor=\"#FFFFCC\">";
  1847. $CCAL_OUT .= "<div align=center><font color=\"#000066\"><b><font face=\"Arial, Helvetica, sans-serif\" size=2>";
  1848. $CCAL_OUT .= "$CfirstdayARY[month] $CfirstdayARY[year]";
  1849. $CCAL_OUT .= "</font></b></font></div>";
  1850. $CCAL_OUT .= "</td>";
  1851. $CCAL_OUT .= "</tr>";
  1852. foreach($Cdays as $Cday)
  1853. {
  1854. $CDCLR="#ffffff";
  1855. $CCAL_OUT .= "<td bordercolor=\"$CDCLR\">";
  1856. $CCAL_OUT .= "<div align=center><font color=\"#000066\"><b><font face=\"Arial, Helvetica, sans-serif\" size=1>";
  1857. $CCAL_OUT .= "$Cday";
  1858. $CCAL_OUT .= "</font></b></font></div>";
  1859. $CCAL_OUT .= "</td>";
  1860. }
  1861. for( $Ccount=0;$Ccount<(6*7);$Ccount++)
  1862. {
  1863. $Cdayarray = getdate($Cstart);
  1864. if((($Ccount) % 7) == 0)
  1865. {
  1866. if($Cdayarray['mon'] != $CfirstdayARY['mon'])
  1867. break;
  1868. $CCAL_OUT .= "</tr><tr>";
  1869. }
  1870. if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth)
  1871. {
  1872. $CCAL_OUT .= "<td bordercolor=\"#ffffff\"><font color=\"#000066\"><b><font face=\"Arial, Helvetica, sans-serif\" size=\"1\">&nbsp;</font></b></font></td>";
  1873. }
  1874. else
  1875. {
  1876. if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) )
  1877. {
  1878. $CPRNTmday = $Cdayarray['mday'];
  1879. if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";}
  1880. $CBL = "<a href=\"#\" onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\">";
  1881. $CEL = "</a>";
  1882. $CCAL_OUT .= "<td bgcolor=\"#FFCCCC\" bordercolor=\"#FFCCCC\">";
  1883. $CCAL_OUT .= "<div align=center><font face=\"Arial, Helvetica, sans-serif\" size=1>";
  1884. $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL";
  1885. $CCAL_OUT .= "</font></div>";
  1886. $CCAL_OUT .= "</td>";
  1887. $Cstart += ADAY;
  1888. }
  1889. else
  1890. {
  1891. $CDCLR="#ffffff";
  1892. if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) )
  1893. {
  1894. $CDCLR="#CCCCCC";
  1895. $CBL = '';
  1896. $CEL = '';
  1897. }
  1898. else
  1899. {
  1900. $CPRNTmday = $Cdayarray['mday'];
  1901. if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";}
  1902. $CBL = "<a href=\"#\" onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\">";
  1903. $CEL = "</a>";
  1904. }
  1905. $CCAL_OUT .= "<td bgcolor=\"$CDCLR\" bordercolor=\"#ffffff\">";
  1906. $CCAL_OUT .= "<div align=center><font face=\"Arial, Helvetica, sans-serif\" size=1>";
  1907. $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL";
  1908. $CCAL_OUT .= "</font></div>";
  1909. $CCAL_OUT .= "</td>";
  1910. $Cstart += ADAY;
  1911. }
  1912. }
  1913. }
  1914. $CCAL_OUT .= "</tr>";
  1915. $CCAL_OUT .= "</table>";
  1916. $CCAL_OUT .= "</td>";
  1917. if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) )
  1918. {$CCAL_OUT .= "</tr>";}
  1919. $CINC++;
  1920. }
  1921. $CCAL_OUT .= "</table>";
  1922. #echo "$CCAL_OUT\n";
  1923. ################################################################
  1924. ### END - build the callback calendar (12 months) ###
  1925. ################################################################
  1926. ?>
  1927. <script language="Javascript">
  1928. var MTvar;
  1929. var NOW_TIME = '<? echo $NOW_TIME ?>';
  1930. var SQLdate = '<? echo $NOW_TIME ?>';
  1931. var StarTtimE = '<? echo $StarTtimE ?>';
  1932. var UnixTime = '<? echo $StarTtimE ?>';
  1933. var UnixTimeMS = 0;
  1934. var t = new Date();
  1935. var c = new Date();
  1936. LCAe = new Array('','','','','','');
  1937. LCAc = new Array('','','','','','');
  1938. LCAt = new Array('','','','','','');
  1939. LMAe = new Array('','','','','','');
  1940. var CalL_XC_a_Dtmf = '<? echo $xferconf_a_dtmf ?>';
  1941. var CalL_XC_a_NuMber = '<? echo $xferconf_a_number ?>';
  1942. var CalL_XC_b_Dtmf = '<? echo $xferconf_b_dtmf ?>';
  1943. var CalL_XC_b_NuMber = '<? echo $xferconf_b_number ?>';
  1944. var VU_hotkeys_active = '<? echo $VU_hotkeys_active ?>';
  1945. var VU_agent_choose_ingroups = '<? echo $VU_agent_choose_ingroups ?>';
  1946. var VU_agent_choose_ingroups_DV = '';
  1947. var CallBackDatETimE = '';
  1948. var CallBackrecipient = '';
  1949. var CallBackCommenTs = '';
  1950. var scheduled_callbacks = '<? echo $scheduled_callbacks ?>';
  1951. var dispo_check_all_pause = '<? echo $dispo_check_all_pause ?>';
  1952. var api_check_all_pause = '<? echo $api_check_all_pause ?>';
  1953. VARgroup_alias_ids = new Array(<? echo $VARgroup_alias_ids ?>);
  1954. VARgroup_alias_names = new Array(<? echo $VARgroup_alias_names ?>);
  1955. VARcaller_id_numbers = new Array(<? echo $VARcaller_id_numbers ?>);
  1956. var VD_group_aliases_ct = '<? echo $VD_group_aliases_ct ?>';
  1957. var agent_allow_group_alias = '<? echo $agent_allow_group_alias ?>';
  1958. var default_group_alias = '<? echo $default_group_alias ?>';
  1959. var default_group_alias_cid = '<? echo $default_group_alias_cid ?>';
  1960. var active_group_alias = '';
  1961. var agent_pause_codes_active = '<? echo $agent_pause_codes_active ?>';
  1962. VARpause_codes = new Array(<? echo $VARpause_codes ?>);
  1963. VARpause_code_names = new Array(<? echo $VARpause_code_names ?>);
  1964. var VD_pause_codes_ct = '<? echo $VD_pause_codes_ct ?>';
  1965. VARstatuses = new Array(<? echo $VARstatuses ?>);
  1966. VARstatusnames = new Array(<? echo $VARstatusnames ?>);
  1967. var VD_statuses_ct = '<? echo $VD_statuses_ct ?>';
  1968. VARingroups = new Array(<? echo $VARingroups ?>);
  1969. var INgroupCOUNT = '<? echo $INgrpCT ?>';
  1970. VARxfergroups = new Array(<? echo $VARxfergroups ?>);
  1971. VARxfergroupsnames = new Array(<? echo $VARxfergroupsnames ?>);
  1972. var XFgroupCOUNT = '<? echo $XFgrpCT ?>';
  1973. var default_xfer_group = '<? echo $default_xfer_group ?>';
  1974. var default_xfer_group_name = '<? echo $default_xfer_group_name ?>';
  1975. var LIVE_default_xfer_group = '<? echo $default_xfer_group ?>';
  1976. var HK_statuses_camp = '<? echo $HK_statuses_camp ?>';
  1977. HKhotkeys = new Array(<? echo $HKhotkeys ?>);
  1978. HKstatuses = new Array(<? echo $HKstatuses ?>);
  1979. HKstatusnames = new Array(<? echo $HKstatusnames ?>);
  1980. var hotkeys = new Array();
  1981. <? $h=0;
  1982. while ($HK_statuses_camp > $h)
  1983. {
  1984. echo "hotkeys['$HKhotkey[$h]'] = \"$HKstatus[$h] ----- $HKstatus_name[$h]\";\n";
  1985. $h++;
  1986. }
  1987. ?>
  1988. var HKdispo_display = 0;
  1989. var HKbutton_allowed = 1;
  1990. var HKfinish = 0;
  1991. var scriptnames = new Array();
  1992. <? $h=0;
  1993. while ($MM_scripts > $h)
  1994. {
  1995. echo "scriptnames['$MMscriptid[$h]'] = \"$MMscriptname[$h]\";\n";
  1996. $h++;
  1997. }
  1998. ?>
  1999. var scripttexts = new Array();
  2000. <? $h=0;
  2001. while ($MM_scripts > $h)
  2002. {
  2003. echo "scripttexts['$MMscriptid[$h]'] = \"$MMscripttext[$h]\";\n";
  2004. $h++;
  2005. }
  2006. ?>
  2007. var decoded = '';
  2008. var view_scripts = '<? echo $view_scripts ?>';
  2009. var LOGfullname = '<? echo $LOGfullname ?>';
  2010. var recLIST = '';
  2011. var filename = '';
  2012. var last_filename = '';
  2013. var LCAcount = 0;
  2014. var LMAcount = 0;
  2015. var filedate = '<? echo $FILE_TIME ?>';
  2016. var agcDIR = '<? echo $agcDIR ?>';
  2017. var agcPAGE = '<? echo $agcPAGE ?>';
  2018. var extension = '<? echo $extension ?>';
  2019. var extension_xfer = '<? echo $extension ?>';
  2020. var dialplan_number = '<? echo $dialplan_number ?>';
  2021. var ext_context = '<? echo $ext_context ?>';
  2022. var protocol = '<? echo $protocol ?>';
  2023. var agentchannel = '';
  2024. var local_gmt ='<? echo $local_gmt ?>';
  2025. var server_ip = '<? echo $server_ip ?>';
  2026. var server_ip_dialstring = '<? echo $server_ip_dialstring ?>';
  2027. var asterisk_version = '<? echo $asterisk_version ?>';
  2028. <?
  2029. if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";}
  2030. else {echo "\tvar refresh_interval = $fast_refresh_rate;\n";}
  2031. ?>
  2032. var session_id = '<? echo $session_id ?>';
  2033. var VICIDiaL_closer_login_checked = 0;
  2034. var VICIDiaL_closer_login_selected = 0;
  2035. var VICIDiaL_pause_calling = 1;
  2036. var CalLCID = '';
  2037. var MDnextCID = '';
  2038. var XDnextCID = '';
  2039. var LasTCID = '';
  2040. var lead_dial_number = '';
  2041. var MD_channel_look = 0;
  2042. var XD_channel_look = 0;
  2043. var MDuniqueid = '';
  2044. var MDchannel = '';
  2045. var MD_ring_secondS = 0;
  2046. var MDlogEPOCH = 0;
  2047. var VD_live_customer_call = 0;
  2048. var VD_live_call_secondS = 0;
  2049. var XD_live_customer_call = 0;
  2050. var XD_live_call_secondS = 0;
  2051. var open_dispo_screen = 0;
  2052. var AgentDispoing = 0;
  2053. var logout_stop_timeouts = 0;
  2054. var VICIDiaL_allow_closers = '<? echo $VICIDiaL_allow_closers ?>';
  2055. var VICIDiaL_closer_blended = '0';
  2056. var VU_closer_default_blended = '<? echo $VU_closer_default_blended ?>';
  2057. var VDstop_rec_after_each_call = '<? echo $VDstop_rec_after_each_call ?>';
  2058. var phone_login = '<? echo $phone_login ?>';
  2059. var phone_pass = '<? echo $phone_pass ?>';
  2060. var user = '<? echo $VD_login ?>';
  2061. var user_abb = '<? echo $user_abb ?>';
  2062. var pass = '<? echo $VD_pass ?>';
  2063. var campaign = '<? echo $VD_campaign ?>';
  2064. var group = '<? echo $VD_campaign ?>';
  2065. var VICIDiaL_web_form_address_enc = '<? echo $VICIDiaL_web_form_address_enc ?>';
  2066. var VICIDiaL_web_form_address = '<? echo $VICIDiaL_web_form_address ?>';
  2067. var VDIC_web_form_address = '<? echo $VICIDiaL_web_form_address ?>';
  2068. var CalL_ScripT_id = '';
  2069. var CalL_AutO_LauncH = '';
  2070. var panel_bgcolor = '<? echo $MAIN_COLOR ?>';
  2071. var CusTCB_bgcolor = '#FFFF66';
  2072. var auto_dial_level = '<? echo $auto_dial_level ?>';
  2073. var starting_dial_level = '<? echo $auto_dial_level ?>';
  2074. var dial_timeout = '<? echo $dial_timeout ?>';
  2075. var dial_prefix = '<? echo $dial_prefix ?>';
  2076. var three_way_dial_prefix = '<? echo $three_way_dial_prefix ?>';
  2077. var campaign_cid = '<? echo $campaign_cid ?>';
  2078. var campaign_vdad_exten = '<? echo $campaign_vdad_exten ?>';
  2079. var campaign_leads_to_call = '<? echo $campaign_leads_to_call ?>';
  2080. var epoch_sec = <? echo $StarTtimE ?>;
  2081. var dtmf_send_extension = '<? echo $dtmf_send_extension ?>';
  2082. var recording_exten = '<? echo $campaign_rec_exten ?>';
  2083. var campaign_recording = '<? echo $campaign_recording ?>';
  2084. var campaign_rec_filename = '<? echo $campaign_rec_filename ?>';
  2085. var LIVE_campaign_recording = '<? echo $campaign_recording ?>';
  2086. var LIVE_campaign_rec_filename = '<? echo $campaign_rec_filename ?>';
  2087. var LIVE_default_group_alias = '<? echo $default_group_alias ?>';
  2088. var LIVE_caller_id_number = '<? echo $default_group_alias_cid ?>';
  2089. var LIVE_web_vars = '<? echo $default_web_vars ?>';
  2090. var default_web_vars = '<? echo $default_web_vars ?>';
  2091. var campaign_script = '<? echo $campaign_script ?>';
  2092. var get_call_launch = '<? echo $get_call_launch ?>';
  2093. var campaign_am_message_exten = '<? echo $campaign_am_message_exten ?>';
  2094. var park_on_extension = '<? echo $VICIDiaL_park_on_extension ?>';
  2095. var park_count=0;
  2096. var customerparked=0;
  2097. var check_n = 0;
  2098. var conf_check_recheck = 0;
  2099. var lastconf='';
  2100. var lastcustchannel='';
  2101. var lastcustserverip='';
  2102. var lastxferchannel='';
  2103. var custchannellive=0;
  2104. var xferchannellive=0;
  2105. var nochannelinsession=0;
  2106. var agc_dial_prefix = '91';
  2107. var dtmf_silent_prefix = '<? echo $dtmf_silent_prefix ?>';
  2108. var conf_silent_prefix = '<? echo $conf_silent_prefix ?>';
  2109. var menuheight = 30;
  2110. var menuwidth = 30;
  2111. var menufontsize = 8;
  2112. var textareafontsize = 10;
  2113. var check_s;
  2114. var active_display = 1;
  2115. var conf_channels_xtra_display = 0;
  2116. var display_message = '';
  2117. var web_form_vars = '';
  2118. var Nactiveext;
  2119. var Nbusytrunk;
  2120. var Nbusyext;
  2121. var extvalue = extension;
  2122. var activeext_query;
  2123. var busytrunk_query;
  2124. var busyext_query;
  2125. var busytrunkhangup_query;
  2126. var busylocalhangup_query;
  2127. var activeext_order='asc';
  2128. var busytrunk_order='asc';
  2129. var busyext_order='asc';
  2130. var busytrunkhangup_order='asc';
  2131. var busylocalhangup_order='asc';
  2132. var xmlhttp=false;
  2133. var XfeR_channel = '';
  2134. var XDcheck = '';
  2135. var agent_log_id = '<? echo $agent_log_id ?>';
  2136. var session_name = '<? echo $session_name ?>';
  2137. var AutoDialReady = 0;
  2138. var AutoDialWaiting = 0;
  2139. var fronter = '';
  2140. var VDCL_group_id = '';
  2141. var previous_dispo = '';
  2142. var previous_called_count = '';
  2143. var hot_keys_active = 0;
  2144. var all_record = 'NO';
  2145. var all_record_count = 0;
  2146. var LeaDDispO = '';
  2147. var LeaDPreVDispO = '';
  2148. var AgaiNHanguPChanneL = '';
  2149. var AgaiNHanguPServeR = '';
  2150. var AgainCalLSecondS = '';
  2151. var AgaiNCalLCID = '';
  2152. var CB_count_check = 60;
  2153. var callholdstatus = '<? echo $callholdstatus ?>'
  2154. var agentcallsstatus = '<? echo $agentcallsstatus ?>'
  2155. var campagentstatctmax = '<? echo $campagentstatctmax ?>'
  2156. var campagentstatct = '0';
  2157. var manual_dial_in_progress = 0;
  2158. var auto_dial_alt_dial = 0;
  2159. var reselect_preview_dial = 0;
  2160. var reselect_alt_dial = 0;
  2161. var alt_dial_active = 0;
  2162. var alt_dial_status_display = 0;
  2163. var mdnLisT_id = '<? echo $manual_dial_list_id ?>';
  2164. var VU_vicidial_transfers = '<? echo $VU_vicidial_transfers ?>';
  2165. var agentonly_callbacks = '<? echo $agentonly_callbacks ?>';
  2166. var agentcall_manual = '<? echo $agentcall_manual ?>';
  2167. var manual_dial_preview = '<? echo $manual_dial_preview ?>';
  2168. var starting_alt_phone_dialing = '<? echo $alt_phone_dialing ?>';
  2169. var alt_phone_dialing = '<? echo $alt_phone_dialing ?>';
  2170. var DefaulTAlTDiaL = '<? echo $DefaulTAlTDiaL ?>';
  2171. var wrapup_segundos = '<? echo $wrapup_segundos ?>';
  2172. var wrapup_message = '<? echo $wrapup_message ?>';
  2173. var wrapup_counter = 0;
  2174. var wrapup_waiting = 0;
  2175. var use_internal_dnc = '<? echo $use_internal_dnc ?>';
  2176. var use_campaign_dnc = '<? echo $use_campaign_dnc ?>';
  2177. var three_way_call_cid = '<? echo $three_way_call_cid ?>';
  2178. var outbound_cid = '<? echo $outbound_cid ?>';
  2179. var threeway_cid = '';
  2180. var cid_choice = '';
  2181. var prefix_choice = '';
  2182. var agent_dialed_number='';
  2183. var agent_dialed_type='';
  2184. var allcalls_delay = '<? echo $allcalls_delay ?>';
  2185. var omit_phone_code = '<? echo $omit_phone_code ?>';
  2186. var no_delete_sessions = '<? echo $no_delete_sessions ?>';
  2187. var webform_session = '<? echo $webform_sessionname ?>';
  2188. var local_consult_xfers = '<? echo $local_consult_xfers ?>';
  2189. var vicidial_agent_disable = '<? echo $vicidial_agent_disable ?>';
  2190. var CBentry_time = '';
  2191. var CBcallback_time = '';
  2192. var CBuser = '';
  2193. var CBcomments = '';
  2194. var volumecontrol_active = '<? echo $volumecontrol_active ?>';
  2195. var PauseCode_HTML = '';
  2196. var manual_auto_hotkey = 0;
  2197. var dialed_number = '';
  2198. var dialed_label = '';
  2199. var source_id = '';
  2200. var DispO3waychannel = '';
  2201. var DispO3wayXtrAchannel = '';
  2202. var DispO3wayCalLserverip = '';
  2203. var DispO3wayCalLxfernumber = '';
  2204. var DispO3wayCalLcamptail = '';
  2205. var PausENotifYCounTer = 0;
  2206. var RedirecTxFEr = 0;
  2207. var phone_ip = '<? echo $phone_ip ?>';
  2208. var enable_sipsak_messages = '<? echo $enable_sipsak_messages ?>';
  2209. var allow_sipsak_messages = '<? echo $allow_sipsak_messages ?>';
  2210. var HidEMonitoRSessionS = '<? echo $HidEMonitoRSessionS ?>';
  2211. var LogouTKicKAlL = '<? echo $LogouTKicKAlL ?>';
  2212. var flag_channels = '<? echo $flag_channels ?>';
  2213. var flag_string = '<? echo $flag_string ?>';
  2214. var vdc_header_date_format = '<? echo $vdc_header_date_format ?>';
  2215. var vdc_customer_date_format = '<? echo $vdc_customer_date_format ?>';
  2216. var vdc_header_phone_format = '<? echo $vdc_header_phone_format ?>';
  2217. var disable_alter_custphone = '<? echo $disable_alter_custphone ?>';
  2218. var manual_dial_filter = '<? echo $manual_dial_filter ?>';
  2219. var CopY_tO_ClipboarD = '<? echo $CopY_tO_ClipboarD ?>';
  2220. var inOUT = 'OUT';
  2221. var useIE = '<? echo $useIE ?>';
  2222. var random = '<? echo $random ?>';
  2223. var threeway_end = 0;
  2224. var agentphonelive = 0;
  2225. var conf_dialed = 0;
  2226. var leaving_threeway = 0;
  2227. var blind_transfer = 0;
  2228. var hangup_all_non_reserved = '<? echo $hangup_all_non_reserved ?>';
  2229. var dial_method = '<? echo $dial_method ?>';
  2230. var web_form_target = '<? echo $web_form_target ?>';
  2231. var TEMP_VDIC_web_form_address = '';
  2232. var APIPausE_ID = '99999';
  2233. var APIDiaL_ID = '99999';
  2234. var VtigeRLogiNScripT = '<? echo $vtiger_screen_login ?>';
  2235. var VtigeRurl = '<? echo $vtiger_url ?>';
  2236. var VtigeREnableD = '<? echo $enable_vtiger_integration ?>';
  2237. var alert_enabled = '<? echo $VU_alert_enabled ?>'
  2238. var shift_logout_flag = 0;
  2239. var DiaLControl_auto_HTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume_es.gif\" border=0 alt=\"Comienzo\"></a>";
  2240. var DiaLControl_auto_HTML_ready = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"../agc/images/vdc_LB_pause_es.gif\" border=0 alt=\" Pausa \"></a><IMG SRC=\"../agc/images/vdc_LB_resume_OFF_es.gif\" border=0 alt=\"Comienzo\">";
  2241. var DiaLControl_auto_HTML_OFF = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF_es.gif\" border=0 alt=\"Comienzo\">";
  2242. var DiaLControl_manual_HTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  2243. var image_blank = new Image();
  2244. image_blank.src="../agc/images/blank.gif";
  2245. var image_livecall_OFF = new Image();
  2246. image_livecall_OFF.src="../agc/images/agc_live_call_OFF_es.gif";
  2247. var image_livecall_ON = new Image();
  2248. image_livecall_ON.src="../agc/images/agc_live_call_ON_es.gif";
  2249. var image_LB_dialnextnumber = new Image();
  2250. image_LB_dialnextnumber.src="../agc/images/vdc_LB_dialnextnumber_es.gif";
  2251. var image_LB_hangupcustomer = new Image();
  2252. image_LB_hangupcustomer.src="../agc/images/vdc_LB_hangupcustomer_es.gif";
  2253. var image_LB_transferconf = new Image();
  2254. image_LB_transferconf.src="../agc/images/vdc_LB_transferconf_es.gif";
  2255. var image_LB_grabparkedcall = new Image();
  2256. image_LB_grabparkedcall.src="../agc/images/vdc_LB_grabparkedcall_es.gif";
  2257. var image_LB_parkcall = new Image();
  2258. image_LB_parkcall.src="../agc/images/vdc_LB_parkcall_es.gif";
  2259. var image_LB_webform = new Image();
  2260. image_LB_webform.src="../agc/images/vdc_LB_webform_es.gif";
  2261. var image_LB_stoprecording = new Image();
  2262. image_LB_stoprecording.src="../agc/images/vdc_LB_stoprecording_es.gif";
  2263. var image_LB_startrecording = new Image();
  2264. image_LB_startrecording.src="../agc/images/vdc_LB_startrecording_es.gif";
  2265. var image_LB_pause = new Image();
  2266. image_LB_pause.src="../agc/images/vdc_LB_pause_es.gif";
  2267. var image_LB_resume = new Image();
  2268. image_LB_resume.src="../agc/images/vdc_LB_resume_es.gif";
  2269. var image_LB_senddtmf = new Image();
  2270. image_LB_senddtmf.src="../agc/images/vdc_LB_senddtmf_es.gif";
  2271. var image_LB_dialnextnumber_OFF = new Image();
  2272. image_LB_dialnextnumber_OFF.src="../agc/images/vdc_LB_dialnextnumber_OFF_es.gif";
  2273. var image_LB_hangupcustomer_OFF = new Image();
  2274. image_LB_hangupcustomer_OFF.src="../agc/images/vdc_LB_hangupcustomer_OFF_es.gif";
  2275. var image_LB_transferconf_OFF = new Image();
  2276. image_LB_transferconf_OFF.src="../agc/images/vdc_LB_transferconf_OFF_es.gif";
  2277. var image_LB_grabparkedcall_OFF = new Image();
  2278. image_LB_grabparkedcall_OFF.src="../agc/images/vdc_LB_grabparkedcall_OFF.gif";
  2279. var image_LB_parkcall_OFF = new Image();
  2280. image_LB_parkcall_OFF.src="../agc/images/vdc_LB_parkcall_OFF_es.gif";
  2281. var image_LB_webform_OFF = new Image();
  2282. image_LB_webform_OFF.src="../agc/images/vdc_LB_webform_OFF_es.gif";
  2283. var image_LB_stoprecording_OFF = new Image();
  2284. image_LB_stoprecording_OFF.src="../agc/images/vdc_LB_stoprecording_OFF.gif";
  2285. var image_LB_startrecording_OFF = new Image();
  2286. image_LB_startrecording_OFF.src="../agc/images/vdc_LB_startrecording_OFF.gif";
  2287. var image_LB_pause_OFF = new Image();
  2288. image_LB_pause_OFF.src="../agc/images/vdc_LB_pause_OFF_es.gif";
  2289. var image_LB_resume_OFF = new Image();
  2290. image_LB_resume_OFF.src="../agc/images/vdc_LB_resume_OFF_es.gif";
  2291. var image_LB_senddtmf_OFF = new Image();
  2292. image_LB_senddtmf_OFF.src="../agc/images/vdc_LB_senddtmf_OFF_es.gif";
  2293. // ################################################################################
  2294. // Send Hangup command for Live call connected to phone now to Manager
  2295. function livehangup_send_hangup(taskvar)
  2296. {
  2297. var xmlhttp=false;
  2298. /*@cc_on @*/
  2299. /*@if (@_jscript_version >= 5)
  2300. // JScript gives us Conditional compilation, we can cope with old IE versions.
  2301. // and security blocked creation of the objects.
  2302. try {
  2303. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  2304. } catch (e) {
  2305. try {
  2306. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  2307. } catch (E) {
  2308. xmlhttp = false;
  2309. }
  2310. }
  2311. @end @*/
  2312. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  2313. {
  2314. xmlhttp = new XMLHttpRequest();
  2315. }
  2316. if (xmlhttp)
  2317. {
  2318. var queryCID = "HLagcW" + epoch_sec + user_abb;
  2319. var hangupvalue = taskvar;
  2320. livehangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Hangup&format=text&channel=" + hangupvalue + "&queryCID=" + queryCID;
  2321. xmlhttp.open('POST', 'manager_send.php');
  2322. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  2323. xmlhttp.send(livehangup_query);
  2324. xmlhttp.onreadystatechange = function()
  2325. {
  2326. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  2327. {
  2328. Nactiveext = null;
  2329. Nactiveext = xmlhttp.responseText;
  2330. alert(xmlhttp.responseText);
  2331. }
  2332. }
  2333. delete xmlhttp;
  2334. }
  2335. }
  2336. // ################################################################################
  2337. // Send volume control command for meetme participant
  2338. function volume_control(taskdirection,taskvolchannel,taskagentmute)
  2339. {
  2340. if (taskagentmute=='AgenT')
  2341. {
  2342. taskvolchannel = agentchannel;
  2343. }
  2344. var xmlhttp=false;
  2345. /*@cc_on @*/
  2346. /*@if (@_jscript_version >= 5)
  2347. // JScript gives us Conditional compilation, we can cope with old IE versions.
  2348. // and security blocked creation of the objects.
  2349. try {
  2350. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  2351. } catch (e) {
  2352. try {
  2353. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  2354. } catch (E) {
  2355. xmlhttp = false;
  2356. }
  2357. }
  2358. @end @*/
  2359. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  2360. {
  2361. xmlhttp = new XMLHttpRequest();
  2362. }
  2363. if (xmlhttp)
  2364. {
  2365. var queryCID = "VCagcW" + epoch_sec + user_abb;
  2366. var volchanvalue = taskvolchannel;
  2367. livevolume_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=VolumeControl&format=text&channel=" + volchanvalue + "&stage=" + taskdirection + "&exten=" + session_id + "&ext_context=" + ext_context + "&queryCID=" + queryCID;
  2368. xmlhttp.open('POST', 'manager_send.php');
  2369. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  2370. xmlhttp.send(livevolume_query);
  2371. xmlhttp.onreadystatechange = function()
  2372. {
  2373. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  2374. {
  2375. Nactiveext = null;
  2376. Nactiveext = xmlhttp.responseText;
  2377. // alert(xmlhttp.responseText);
  2378. }
  2379. }
  2380. delete xmlhttp;
  2381. }
  2382. if (taskagentmute=='AgenT')
  2383. {
  2384. if (taskdirection=='MUTING')
  2385. {
  2386. document.getElementById("AgentMuteSpan").innerHTML = "<a href=\"#CHAN-" + agentchannel + "\" onclick=\"volume_control('UNMUTE','" + agentchannel + "','AgenT');return false;\"><IMG SRC=\"../agc/images/vdc_volume_UNMUTE.gif\" Border=0></a>";
  2387. }
  2388. else
  2389. {
  2390. document.getElementById("AgentMuteSpan").innerHTML = "<a href=\"#CHAN-" + agentchannel + "\" onclick=\"volume_control('MUTING','" + agentchannel + "','AgenT');return false;\"><IMG SRC=\"../agc/images/vdc_volume_MUTE.gif\" Border=0></a>";
  2391. }
  2392. }
  2393. }
  2394. // ################################################################################
  2395. // Send alert control command for agent
  2396. function alert_control(taskalert)
  2397. {
  2398. var xmlhttp=false;
  2399. /*@cc_on @*/
  2400. /*@if (@_jscript_version >= 5)
  2401. // JScript gives us Conditional compilation, we can cope with old IE versions.
  2402. // and security blocked creation of the objects.
  2403. try {
  2404. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  2405. } catch (e) {
  2406. try {
  2407. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  2408. } catch (E) {
  2409. xmlhttp = false;
  2410. }
  2411. }
  2412. @end @*/
  2413. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  2414. {
  2415. xmlhttp = new XMLHttpRequest();
  2416. }
  2417. if (xmlhttp)
  2418. {
  2419. alert_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=AlertControl&format=text&stage=" + taskalert;
  2420. xmlhttp.open('POST', 'vdc_db_query.php');
  2421. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  2422. xmlhttp.send(alert_query);
  2423. xmlhttp.onreadystatechange = function()
  2424. {
  2425. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  2426. {
  2427. Nactiveext = null;
  2428. Nactiveext = xmlhttp.responseText;
  2429. // alert(xmlhttp.responseText);
  2430. }
  2431. }
  2432. delete xmlhttp;
  2433. }
  2434. if (taskalert=='ON')
  2435. {
  2436. alert_enabled = 'ON';
  2437. document.getElementById("AgentAlertSpan").innerHTML = "<a href=\"#\" onclick=\"alert_control('OFF');return false;\">Alert is ON</a>";
  2438. }
  2439. else
  2440. {
  2441. alert_enabled = 'OFF';
  2442. document.getElementById("AgentAlertSpan").innerHTML = "<a href=\"#\" onclick=\"alert_control('ON');return false;\">Alert is OFF</a>";
  2443. }
  2444. }
  2445. // ################################################################################
  2446. // park customer and place 3way call
  2447. function xfer_park_dial()
  2448. {
  2449. conf_dialed=1;
  2450. mainxfer_send_redirect('ParK',lastcustchannel,lastcustserverip);
  2451. SendManualDial('YES');
  2452. }
  2453. // ################################################################################
  2454. // place 3way and customer into other conference and fake-hangup the lines
  2455. function leave_3way_call(tempvarattempt)
  2456. {
  2457. threeway_end=0;
  2458. leaving_threeway=1;
  2459. mainxfer_send_redirect('3WAY','','',tempvarattempt);
  2460. // if (threeway_end == '0')
  2461. // {
  2462. // document.vicidial_form.xferchannel.value = '';
  2463. // xfercall_send_hangup();
  2464. //
  2465. // document.vicidial_form.callchannel.value = '';
  2466. // document.vicidial_form.callserverip.value = '';
  2467. // dialedcall_send_hangup();
  2468. // }
  2469. if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
  2470. }
  2471. // ################################################################################
  2472. // filter manual dialstring and pass en to originate call
  2473. function SendManualDial(taskFromConf)
  2474. {
  2475. conf_dialed=1;
  2476. var sending_group_alias = 0;
  2477. if (taskFromConf == 'YES')
  2478. {
  2479. agent_dialed_number='1';
  2480. agent_dialed_type='XFER_3WAY';
  2481. document.getElementById("DialWithCustomer").innerHTML ="<IMG SRC=\"../agc/images/vdc_XB_dialwithcustomer_OFF_es.gif\" border=0 alt=\"Marcar Con El Cliente\"></a>";
  2482. document.getElementById("ParkCustomerDial").innerHTML ="<IMG SRC=\"../agc/images/vdc_XB_parkcustomerdial_OFF_es.gif\" border=0 alt=\"Dial Del Cliente Del Parque\"></a>";
  2483. var manual_number = document.vicidial_form.xfernumber.value;
  2484. var manual_string = manual_number.toString();
  2485. var dial_conf_exten = session_id;
  2486. threeway_cid = '';
  2487. if (three_way_call_cid == 'CAMPAIGN')
  2488. {threeway_cid = campaign_cid;}
  2489. if (three_way_call_cid == 'AGENT_PHONE')
  2490. {threeway_cid = outbound_cid;}
  2491. if (three_way_call_cid == 'A MEDIDAER')
  2492. {threeway_cid = document.vicidial_form.phone_number.value;}
  2493. if (three_way_call_cid == 'AGENT_CHOOSE')
  2494. {
  2495. threeway_cid = cid_choice;
  2496. if (active_group_alias.length > 1)
  2497. {var sending_group_alias = 1;}
  2498. }
  2499. }
  2500. else
  2501. {
  2502. var manual_number = document.vicidial_form.xfernumber.value;
  2503. var manual_string = manual_number.toString();
  2504. }
  2505. var regXFvars = new RegExp("XFER","g");
  2506. if (manual_string.match(regXFvars))
  2507. {
  2508. var donothing=1;
  2509. }
  2510. else
  2511. {
  2512. if (document.vicidial_form.xferoverride.checked==false)
  2513. {
  2514. if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';}
  2515. else {var temp_dial_prefix = three_way_dial_prefix;}
  2516. if (omit_phone_code == 'Y') {var temp_phone_code = '';}
  2517. else {var temp_phone_code = document.vicidial_form.phone_code.value;}
  2518. if (manual_string.length > 7)
  2519. {manual_string = temp_dial_prefix + "" + temp_phone_code + "" + manual_string;}
  2520. }
  2521. else
  2522. {agent_dialed_type='XFER_OVERRIDE';}
  2523. }
  2524. if (taskFromConf == 'YES')
  2525. {basic_originate_call(manual_string,'NO','YES',dial_conf_exten,'NO',taskFromConf,threeway_cid,sending_group_alias);}
  2526. else
  2527. {basic_originate_call(manual_string,'NO','NO','','','','1',sending_group_alias);}
  2528. MD_ring_secondS=0;
  2529. }
  2530. // ################################################################################
  2531. // Send Originate command to manager to place a phone call
  2532. function basic_originate_call(tasknum,taskprefix,taskreverse,taskdialvalue,tasknowait,taskconfxfer,taskcid,taskusegroupalias)
  2533. {
  2534. var usegroupalias=0;
  2535. var regCXFvars = new RegExp("CXFER","g");
  2536. var tasknum_string = tasknum.toString();
  2537. if (tasknum_string.match(regCXFvars))
  2538. {
  2539. var Ctasknum = tasknum_string.replace(regCXFvars, '');
  2540. if (Ctasknum.length < 2)
  2541. {Ctasknum = '990009';}
  2542. var XfeRSelecT = document.getElementById("XfeRGrouP");
  2543. tasknum = Ctasknum + "*" + XfeRSelecT.value + '*CXFER*' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*';
  2544. CustomerData_update();
  2545. }
  2546. var regAXFvars = new RegExp("AXFER","g");
  2547. if (tasknum_string.match(regAXFvars))
  2548. {
  2549. var Ctasknum = tasknum_string.replace(regAXFvars, '');
  2550. if (Ctasknum.length < 2)
  2551. {Ctasknum = '83009';}
  2552. var closerxfercamptail = '_L';
  2553. if (closerxfercamptail.length < 3)
  2554. {closerxfercamptail = 'IVR';}
  2555. tasknum = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*';
  2556. CustomerData_update();
  2557. }
  2558. var xmlhttp=false;
  2559. /*@cc_on @*/
  2560. /*@if (@_jscript_version >= 5)
  2561. // JScript gives us Conditional compilation, we can cope with old IE versions.
  2562. // and security blocked creation of the objects.
  2563. try {
  2564. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  2565. } catch (e) {
  2566. try {
  2567. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  2568. } catch (E) {
  2569. xmlhttp = false;
  2570. }
  2571. }
  2572. @end @*/
  2573. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  2574. {
  2575. xmlhttp = new XMLHttpRequest();
  2576. }
  2577. if (xmlhttp)
  2578. {
  2579. if (taskprefix == 'NO') {var call_prefix = '';}
  2580. else {var call_prefix = agc_dial_prefix;}
  2581. if (prefix_choice.length > 0)
  2582. {var call_prefix = prefix_choice;}
  2583. if (taskreverse == 'YES')
  2584. {
  2585. if (taskdialvalue.length < 2)
  2586. {var dialnum = dialplan_number;}
  2587. else
  2588. {var dialnum = taskdialvalue;}
  2589. var call_prefix = '';
  2590. var originatevalue = "Local/" + tasknum + "@" + ext_context;
  2591. }
  2592. else
  2593. {
  2594. var dialnum = tasknum;
  2595. if ( (protocol == 'EXTERNAL') || (protocol == 'Local') )
  2596. {
  2597. var protodial = 'Local';
  2598. var extendial = extension;
  2599. // var extendial = extension + "@" + ext_context;
  2600. }
  2601. else
  2602. {
  2603. var protodial = protocol;
  2604. var extendial = extension;
  2605. }
  2606. var originatevalue = protodial + "/" + extendial;
  2607. }
  2608. if (taskconfxfer == 'YES')
  2609. {var queryCID = "DCagcW" + epoch_sec + user_abb;}
  2610. else
  2611. {var queryCID = "DVagcW" + epoch_sec + user_abb;}
  2612. if (cid_choice.length > 3)
  2613. {
  2614. var call_cid = cid_choice;
  2615. usegroupalias=1;
  2616. }
  2617. else
  2618. {
  2619. if (taskcid.length > 3)
  2620. {var call_cid = taskcid;}
  2621. else
  2622. {var call_cid = campaign_cid;}
  2623. }
  2624. VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Originate&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + call_prefix + "" + dialnum + "&ext_context=" + ext_context + "&ext_priority=1&outbound_cid=" + call_cid + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type;
  2625. xmlhttp.open('POST', 'manager_send.php');
  2626. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  2627. xmlhttp.send(VMCoriginate_query);
  2628. xmlhttp.onreadystatechange = function()
  2629. {
  2630. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  2631. {
  2632. // alert(VMCoriginate_query);
  2633. // alert(xmlhttp.responseText);
  2634. if ((taskdialvalue.length > 0) && (tasknowait != 'YES'))
  2635. {
  2636. XDnextCID = queryCID;
  2637. MD_channel_look=1;
  2638. XDcheck = 'YES';
  2639. // document.getElementById("HangupXferLine").innerHTML ="<a href=\"#\" onclick=\"xfercall_send_hangup();return false;\"><IMG SRC=\"../agc/images/vdc_XB_hangupxferline_es.gif\" border=0 alt=\"Colgar Línea Xfer \"></a>";
  2640. }
  2641. }
  2642. }
  2643. delete xmlhttp;
  2644. active_group_alias='';
  2645. cid_choice='';
  2646. prefix_choice='';
  2647. agent_dialed_number='';
  2648. agent_dialed_type='';
  2649. }
  2650. }
  2651. // ################################################################################
  2652. // filter conf_dtmf send string and pass en to originate call
  2653. function SendConfDTMF(taskconfdtmf)
  2654. {
  2655. var dtmf_number = document.vicidial_form.conf_dtmf.value;
  2656. var dtmf_string = dtmf_number.toString();
  2657. var conf_dtmf_room = taskconfdtmf;
  2658. var xmlhttp=false;
  2659. /*@cc_on @*/
  2660. /*@if (@_jscript_version >= 5)
  2661. // JScript gives us Conditional compilation, we can cope with old IE versions.
  2662. // and security blocked creation of the objects.
  2663. try {
  2664. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  2665. } catch (e) {
  2666. try {
  2667. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  2668. } catch (E) {
  2669. xmlhttp = false;
  2670. }
  2671. }
  2672. @end @*/
  2673. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  2674. {
  2675. xmlhttp = new XMLHttpRequest();
  2676. }
  2677. if (xmlhttp)
  2678. {
  2679. var queryCID = dtmf_string;
  2680. VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=SysCIDOriginate&format=text&channel=" + dtmf_send_extension + "&queryCID=" + queryCID + "&exten=" + dtmf_silent_prefix + '' + conf_dtmf_room + "&ext_context=" + ext_context + "&ext_priority=1";
  2681. xmlhttp.open('POST', 'manager_send.php');
  2682. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  2683. xmlhttp.send(VMCoriginate_query);
  2684. xmlhttp.onreadystatechange = function()
  2685. {
  2686. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  2687. {
  2688. // alert(xmlhttp.responseText);
  2689. }
  2690. }
  2691. delete xmlhttp;
  2692. }
  2693. document.vicidial_form.conf_dtmf.value = '';
  2694. }
  2695. // ################################################################################
  2696. // Check to see if there are any channels live in the agent's conference meetme room
  2697. function check_for_conf_calls(taskconfnum,taskforce)
  2698. {
  2699. if (typeof(xmlhttprequestcheckconf) == "undefined") {
  2700. //alert (xmlhttprequestcheckconf == xmlhttpSendConf);
  2701. custchannellive--;
  2702. if ( (agentcallsstatus == '1') || (callholdstatus == '1') )
  2703. {
  2704. campagentstatct++;
  2705. if (campagentstatct > campagentstatctmax)
  2706. {
  2707. campagentstatct=0;
  2708. var campagentstdisp = 'YES';
  2709. }
  2710. else
  2711. {
  2712. var campagentstdisp = 'NO';
  2713. }
  2714. }
  2715. else
  2716. {
  2717. var campagentstdisp = 'NO';
  2718. }
  2719. xmlhttprequestcheckconf=false;
  2720. /*@cc_on @*/
  2721. /*@if (@_jscript_version >= 5)
  2722. // JScript gives us Conditional compilation, we can cope with old IE versions.
  2723. // and security blocked creation of the objects.
  2724. try {
  2725. xmlhttprequestcheckconf = new ActiveXObject("Msxml2.XMLHTTP");
  2726. } catch (e) {
  2727. try {
  2728. xmlhttprequestcheckconf = new ActiveXObject("Microsoft.XMLHTTP");
  2729. } catch (E) {
  2730. xmlhttprequestcheckconf = false;
  2731. }
  2732. }
  2733. @end @*/
  2734. //alert ("1");
  2735. if (!xmlhttprequestcheckconf && typeof XMLHttpRequest!='undefined')
  2736. {
  2737. xmlhttprequestcheckconf = new XMLHttpRequest();
  2738. }
  2739. if (xmlhttprequestcheckconf)
  2740. {
  2741. checkconf_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&client=vdc&conf_exten=" + taskconfnum + "&auto_dial_level=" + auto_dial_level + "&campagentstdisp=" + campagentstdisp;
  2742. xmlhttprequestcheckconf.open('POST', 'conf_exten_check.php');
  2743. xmlhttprequestcheckconf.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  2744. xmlhttprequestcheckconf.send(checkconf_query);
  2745. xmlhttprequestcheckconf.onreadystatechange = function()
  2746. {
  2747. if (xmlhttprequestcheckconf.readyState == 4 && xmlhttprequestcheckconf.status == 200)
  2748. {
  2749. var check_conf = null;
  2750. var LMAforce = taskforce;
  2751. check_conf = xmlhttprequestcheckconf.responseText;
  2752. // alert(checkconf_query);
  2753. // alert(xmlhttprequestcheckconf.responseText);
  2754. var check_ALL_array=check_conf.split("\n");
  2755. var check_time_array=check_ALL_array[0].split("|");
  2756. var Time_array = check_time_array[1].split("UnixTime: ");
  2757. UnixTime = Time_array[1];
  2758. UnixTime = parseInt(UnixTime);
  2759. UnixTimeMS = (UnixTime * 1000);
  2760. t.setTime(UnixTimeMS);
  2761. if ( (callholdstatus == '1') || (agentcallsstatus == '1') || (vicidial_agent_disable != 'NOT_ACTIVE') )
  2762. {
  2763. var Alogin_array = check_time_array[2].split("Logged-in: ");
  2764. var AGLogiN = Alogin_array[1];
  2765. var CamPCalLs_array = check_time_array[3].split("CampCalls: ");
  2766. var CamPCalLs = CamPCalLs_array[1];
  2767. var DiaLCalLs_array = check_time_array[5].split("DiaLCalls: ");
  2768. var DiaLCalLs = DiaLCalLs_array[1];
  2769. if (AGLogiN != 'N')
  2770. {
  2771. document.getElementById("AgentEstadoEstado").innerHTML = AGLogiN;
  2772. }
  2773. if (CamPCalLs != 'N')
  2774. {
  2775. document.getElementById("AgentEstadoCalls").innerHTML = CamPCalLs;
  2776. }
  2777. if (DiaLCalLs != 'N')
  2778. {
  2779. document.getElementById("AgentEstadoDiaLs").innerHTML = DiaLCalLs;
  2780. }
  2781. if ( (AGLogiN == 'DEAD_VLA') && ( (vicidial_agent_disable == 'LIVE_AGENT') || (vicidial_agent_disable == 'ALL') ) )
  2782. {
  2783. showDiv('AgenTDisablEBoX');
  2784. }
  2785. if ( (AGLogiN == 'DEAD_EXTERNAL') && ( (vicidial_agent_disable == 'EXTERNAL') || (vicidial_agent_disable == 'ALL') ) )
  2786. {
  2787. showDiv('AgenTDisablEBoX');
  2788. }
  2789. if ( (AGLogiN == 'TIME_SYNC') && (vicidial_agent_disable == 'ALL') )
  2790. {
  2791. showDiv('SysteMDisablEBoX');
  2792. }
  2793. if (AGLogiN == 'SHIFT_SALIR')
  2794. {
  2795. shift_logout_flag=1;
  2796. }
  2797. }
  2798. var VLAStatuS_array = check_time_array[4].split("Estado: ");
  2799. var VLAStatuS = VLAStatuS_array[1];
  2800. if ( (VLAStatuS == 'PAUSED') && (AutoDialWaiting == 1) )
  2801. {
  2802. if (PausENotifYCounTer > 10)
  2803. {
  2804. alert('Your session has been paused');
  2805. AutoDial_ReSume_PauSe('VDADpause');
  2806. PausENotifYCounTer=0;
  2807. }
  2808. else {PausENotifYCounTer++;}
  2809. }
  2810. else {PausENotifYCounTer=0;}
  2811. var APIHanguP_array = check_time_array[6].split("APIHanguP: ");
  2812. var APIHanguP = APIHanguP_array[1];
  2813. var APIStatuS_array = check_time_array[7].split("APIStatuS: ");
  2814. var APIStatuS = APIStatuS_array[1];
  2815. var APIPausE_array = check_time_array[8].split("APIPausE: ");
  2816. var APIPausE = APIPausE_array[1];
  2817. var APIDiaL_array = check_time_array[9].split("APIDiaL: ");
  2818. var APIDiaL = APIDiaL_array[1];
  2819. if ( (APIHanguP==1) && (VD_live_customer_call==1) )
  2820. {
  2821. hideDiv('CustomerGoneBox');
  2822. WaitingForNextStep=0;
  2823. custchannellive=0;
  2824. dialedcall_send_hangup();
  2825. }
  2826. if ( (APIStatuS.length < 10) && (APIStatuS.length > 0) && (AgentDispoing > 0) )
  2827. {
  2828. document.vicidial_form.DispoSelection.value = APIStatuS;
  2829. DispoSelect_submit();
  2830. }
  2831. if (APIPausE.length > 4)
  2832. {
  2833. var APIPausE_array = APIPausE.split("!");
  2834. if (APIPausE_ID == APIPausE_array[1])
  2835. {
  2836. // alert("PAUSE ALREADY RECEIVED");
  2837. }
  2838. else
  2839. {
  2840. APIPausE_ID = APIPausE_array[1];
  2841. if (APIPausE_array[0]=='PAUSE')
  2842. {
  2843. if (VD_live_customer_call==1)
  2844. {
  2845. // set to pause en next dispo
  2846. document.vicidial_form.DispoSelectStop.checked=true;
  2847. // alert("Setting dispo to PAUSE");
  2848. }
  2849. else
  2850. {
  2851. if (AutoDialReady==1)
  2852. {
  2853. if (auto_dial_level != '0')
  2854. {
  2855. AutoDialWaiting = 0;
  2856. AutoDial_ReSume_PauSe("VDADpause");
  2857. }
  2858. VICIDiaL_pause_calling = 1;
  2859. }
  2860. }
  2861. }
  2862. if ( (APIPausE_array[0]=='RESUME') && (AutoDialReady < 1) && (auto_dial_level > 0) )
  2863. {
  2864. AutoDialWaiting = 1;
  2865. AutoDial_ReSume_PauSe("VDADready");
  2866. }
  2867. }
  2868. }
  2869. if (APIDiaL.length > 9)
  2870. {
  2871. var APIDiaL_array_detail = APIDiaL.split("!");
  2872. if (APIDiaL_ID == APIDiaL_array_detail[6])
  2873. {
  2874. // alert("DiaL ALREADY RECEIVED: " + APIDiaL_ID + "|" + APIDiaL_array_detail[5]);
  2875. }
  2876. else
  2877. {
  2878. APIDiaL_ID = APIDiaL_array_detail[6];
  2879. document.vicidial_form.MDDiaLCodE.value = APIDiaL_array_detail[1];
  2880. document.vicidial_form.phone_code.value = APIDiaL_array_detail[1];
  2881. document.vicidial_form.MDPhonENumbeR.value = APIDiaL_array_detail[0];
  2882. document.vicidial_form.vendor_lead_code.value = APIDiaL_array_detail[5];
  2883. prefix_choice = APIDiaL_array_detail[7];
  2884. active_group_alias = APIDiaL_array_detail[8];
  2885. cid_choice = APIDiaL_array_detail[9];
  2886. // alert(APIDiaL_array_detail[1] + "-----" + APIDiaL + "-----" + document.vicidial_form.MDDiaLCodE.value + "-----" + document.vicidial_form.phone_code.value);
  2887. if (APIDiaL_array_detail[2] == 'YES') // lookup lead in system
  2888. {document.vicidial_form.LeadLookuP.checked=true;}
  2889. else
  2890. {document.vicidial_form.LeadLookuP.checked=false;}
  2891. if (APIDiaL_array_detail[4] == 'YES') // focus en vicidial agent screen
  2892. {window.focus(); alert("Placing call to:" + APIDiaL_array_detail[1] + " " + APIDiaL_array_detail[0]);}
  2893. if (APIDiaL_array_detail[3] == 'YES') // call preview
  2894. {NeWManuaLDiaLCalLSubmiT('PREVIEW');}
  2895. else
  2896. {NeWManuaLDiaLCalLSubmiT('NOW');}
  2897. }
  2898. }
  2899. // ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ above section working en API functions
  2900. var check_conf_array=check_ALL_array[1].split("|");
  2901. var live_conf_calls = check_conf_array[0];
  2902. var conf_chan_array = check_conf_array[1].split(" ~");
  2903. if ( (conf_channels_xtra_display == 1) || (conf_channels_xtra_display == 0) )
  2904. {
  2905. if (live_conf_calls > 0)
  2906. {
  2907. var loop_ct=0;
  2908. var ARY_ct=0;
  2909. var LMAalter=0;
  2910. var LMAcontent_change=0;
  2911. var LMAcontent_match=0;
  2912. agentphonelive=0;
  2913. var conv_start=-1;
  2914. var live_conf_HTML = "<font face=\"Arial,Helvetica\"><B>LLAMADAS ACTIVAS EN SU SESIÓN:</B></font><BR><TABLE WIDTH=<?=$SDwidth ?>><TR BGCOLOR=#E6E6E6><TD><font class=\"log_title\">#</TD><TD><font class=\"log_title\">CANAL REMOTO</TD><TD><font class=\"log_title\">COLGAR</TD><TD><font class=\"log_title\">VOLUMEN</TD></TR>";
  2915. if ( (LMAcount > live_conf_calls) || (LMAcount < live_conf_calls) || (LMAforce > 0))
  2916. {
  2917. LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]='';
  2918. LMAcount=0; LMAcontent_change++;
  2919. }
  2920. while (loop_ct < live_conf_calls)
  2921. {
  2922. loop_ct++;
  2923. loop_s = loop_ct.toString();
  2924. if (loop_s.match(/1$|3$|5$|7$|9$/))
  2925. {var row_color = '#DDDDFF';}
  2926. else
  2927. {var row_color = '#CCCCFF';}
  2928. var conv_ct = (loop_ct + conv_start);
  2929. var channelfieldA = conf_chan_array[conv_ct];
  2930. var regXFcred = new RegExp(flag_string,"g");
  2931. if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) )
  2932. {
  2933. var chan_name_color = 'log_text_red';
  2934. }
  2935. else
  2936. {
  2937. var chan_name_color = 'log_text';
  2938. }
  2939. if ( (HidEMonitoRSessionS==1) && (channelfieldA.match(/ASTblind/)) )
  2940. {
  2941. var hide_channel=1;
  2942. }
  2943. else
  2944. {
  2945. if (volumecontrol_active!=1)
  2946. {
  2947. live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"" + chan_name_color + "\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">COLGAR</a></td><td></td></tr>";
  2948. }
  2949. else
  2950. {
  2951. live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"" + chan_name_color + "\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">COLGAR</a></td><td><a href=\"#\" onclick=\"volume_control('UP','" + channelfieldA + "','');return false;\"><IMG SRC=\"../agc/images/vdc_volume_up.gif\" Border=0></a> &nbsp; <a href=\"#\" onclick=\"volume_control('DOWN','" + channelfieldA + "','');return false;\"><IMG SRC=\"../agc/images/vdc_volume_down.gif\" Border=0></a> &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"volume_control('MUTING','" + channelfieldA + "','');return false;\"><IMG SRC=\"../agc/images/vdc_volume_MUTE.gif\" Border=0></a> &nbsp; <a href=\"#\" onclick=\"volume_control('UNMUTE','" + channelfieldA + "','');return false;\"><IMG SRC=\"../agc/images/vdc_volume_UNMUTE.gif\" Border=0></a></td></tr>";
  2952. }
  2953. }
  2954. // var debugspan = document.getElementById("debugbottomspan").innerHTML;
  2955. if (channelfieldA == lastcustchannel) {custchannellive++;}
  2956. else
  2957. {
  2958. if(customerparked == 1)
  2959. {custchannellive++;}
  2960. // allow for no customer hungup errors if call from another server
  2961. if(server_ip == lastcustserverip)
  2962. {var nothing='';}
  2963. else
  2964. {custchannellive++;}
  2965. }
  2966. if (volumecontrol_active > 0)
  2967. {
  2968. if ( (protocol != 'EXTERNAL') && (protocol != 'Local') )
  2969. {
  2970. var regAGNTchan = new RegExp(protocol + '/' + extension,"g");
  2971. if ( (channelfieldA.match(regAGNTchan)) && (agentchannel != channelfieldA) )
  2972. {
  2973. agentchannel = channelfieldA;
  2974. document.getElementById("AgentMuteSpan").innerHTML = "<a href=\"#CHAN-" + agentchannel + "\" onclick=\"volume_control('MUTING','" + agentchannel + "','AgenT');return false;\"><IMG SRC=\"../agc/images/vdc_volume_MUTE.gif\" Border=0></a>";
  2975. }
  2976. }
  2977. else
  2978. {
  2979. if (agentchannel.length < 3)
  2980. {
  2981. agentchannel = channelfieldA;
  2982. document.getElementById("AgentMuteSpan").innerHTML = "<a href=\"#CHAN-" + agentchannel + "\" onclick=\"volume_control('MUTING','" + agentchannel + "','AgenT');return false;\"><IMG SRC=\"../agc/images/vdc_volume_MUTE.gif\" Border=0></a>";
  2983. }
  2984. }
  2985. // document.getElementById("agentchannelSPAN").innerHTML = agentchannel;
  2986. }
  2987. // document.getElementById("debugbottomspan").innerHTML = debugspan + '<BR>' + channelfieldA + '|' + lastcustchannel + '|' + custchannellive + '|' + LMAcontent_change + '|' + LMAalter;
  2988. if (!LMAe[ARY_ct])
  2989. {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;}
  2990. else
  2991. {
  2992. if (LMAe[ARY_ct].length < 1)
  2993. {LMAe[ARY_ct] = channelfieldA; LMAcontent_change++; LMAalter++;}
  2994. else
  2995. {
  2996. if (LMAe[ARY_ct] == channelfieldA) {LMAcontent_match++;}
  2997. else {LMAcontent_change++; LMAe[ARY_ct] = channelfieldA;}
  2998. }
  2999. }
  3000. if (LMAalter > 0) {LMAcount++;}
  3001. if (agentchannel == channelfieldA) {agentphonelive++;}
  3002. ARY_ct++;
  3003. }
  3004. // var debug_LMA = LMAcontent_match+"|"+LMAcontent_change+"|"+LMAcount+"|"+live_conf_calls+"|"+LMAe[0]+LMAe[1]+LMAe[2]+LMAe[3]+LMAe[4]+LMAe[5];
  3005. // document.getElementById("confdebug").innerHTML = debug_LMA + "<BR>";
  3006. if (agentphonelive < 1) {agentchannel='';}
  3007. live_conf_HTML = live_conf_HTML + "</table>";
  3008. if (LMAcontent_change > 0)
  3009. {
  3010. if (conf_channels_xtra_display == 1)
  3011. {document.getElementById("outboundcallsspan").innerHTML = live_conf_HTML;}
  3012. }
  3013. nochannelinsession=0;
  3014. }
  3015. else
  3016. {
  3017. LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]='';
  3018. LMAcount=0;
  3019. if (conf_channels_xtra_display == 1)
  3020. {
  3021. if (document.getElementById("outboundcallsspan").innerHTML.length > 2)
  3022. {
  3023. document.getElementById("outboundcallsspan").innerHTML = '';
  3024. }
  3025. }
  3026. custchannellive = -99;
  3027. nochannelinsession++;
  3028. }
  3029. }
  3030. xmlhttprequestcheckconf = undefined;
  3031. delete xmlhttprequestcheckconf;
  3032. }
  3033. }
  3034. }
  3035. }
  3036. }
  3037. // ################################################################################
  3038. // Send MonitorConf/StopMonitorConf command for recording of conferences
  3039. function conf_send_recording(taskconfrectype,taskconfrec,taskconffile)
  3040. {
  3041. if (inOUT == 'OUT')
  3042. {
  3043. var tmp_vicidial_id = document.vicidial_form.uniqueid.value;
  3044. }
  3045. else
  3046. {
  3047. var tmp_vicidial_id = 'IN';
  3048. }
  3049. var xmlhttp=false;
  3050. /*@cc_on @*/
  3051. /*@if (@_jscript_version >= 5)
  3052. // JScript gives us Conditional compilation, we can cope with old IE versions.
  3053. // and security blocked creation of the objects.
  3054. try {
  3055. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  3056. } catch (e) {
  3057. try {
  3058. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3059. } catch (E) {
  3060. xmlhttp = false;
  3061. }
  3062. }
  3063. @end @*/
  3064. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  3065. {
  3066. xmlhttp = new XMLHttpRequest();
  3067. }
  3068. if (xmlhttp)
  3069. {
  3070. if (taskconfrectype == 'MonitorConf')
  3071. {
  3072. // var campaign_recording = '<? echo $campaign_recording ?>';
  3073. // var campaign_rec_filename = '<? echo $campaign_rec_filename ?>';
  3074. // CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT
  3075. var REGrecCAMPAIGN = new RegExp("CAMPAIGN","g");
  3076. var REGrecCUSTPHONE = new RegExp("CUSTPHONE","g");
  3077. var REGrecFULLDATE = new RegExp("FULLDATE","g");
  3078. var REGrecTINYDATE = new RegExp("TINYDATE","g");
  3079. var REGrecEPOCH = new RegExp("EPOCH","g");
  3080. var REGrecAGENT = new RegExp("AGENT","g");
  3081. filename = LIVE_campaign_rec_filename;
  3082. filename = filename.replace(REGrecCAMPAIGN, campaign);
  3083. filename = filename.replace(REGrecCUSTPHONE, lead_dial_number);
  3084. filename = filename.replace(REGrecFULLDATE, filedate);
  3085. filename = filename.replace(REGrecTINYDATE, tinydate);
  3086. filename = filename.replace(REGrecEPOCH, epoch_sec);
  3087. filename = filename.replace(REGrecAGENT, user);
  3088. // filename = filedate + "_" + user_abb;
  3089. var query_recording_exten = recording_exten;
  3090. var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context;
  3091. var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('StopMonitorConf','" + taskconfrec + "','" + filename + "');return false;\"><IMG SRC=\"../agc/images/vdc_LB_stoprecording_es.gif\" border=0 alt=\"Parar La Grabación\"></a>";
  3092. if (LIVE_campaign_recording == 'ALLFORCE')
  3093. {
  3094. document.getElementById("RecorDControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_startrecording_OFF.gif\" border=0 alt=\"Comenzar La Grabación\">";
  3095. }
  3096. else
  3097. {
  3098. document.getElementById("RecorDControl").innerHTML = conf_rec_start_html;
  3099. }
  3100. }
  3101. if (taskconfrectype == 'StopMonitorConf')
  3102. {
  3103. filename = taskconffile;
  3104. var query_recording_exten = session_id;
  3105. var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context;
  3106. var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + taskconfrec + "','');return false;\"><IMG SRC=\"../agc/images/vdc_LB_startrecording_es.gif\" border=0 alt=\"Comenzar La Grabación\"></a>";
  3107. if (LIVE_campaign_recording == 'ALLFORCE')
  3108. {
  3109. document.getElementById("RecorDControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_startrecording_OFF.gif\" border=0 alt=\"Comenzar La Grabación\">";
  3110. }
  3111. else
  3112. {
  3113. document.getElementById("RecorDControl").innerHTML = conf_rec_start_html;
  3114. }
  3115. }
  3116. confmonitor_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + taskconfrectype + "&format=text&channel=" + channelrec + "&filename=" + filename + "&exten=" + query_recording_exten + "&ext_context=" + ext_context + "&lead_id=" + document.vicidial_form.lead_id.value + "&ext_priority=1&FROMvdc=YES&uniqueid=" + tmp_vicidial_id;
  3117. xmlhttp.open('POST', 'manager_send.php');
  3118. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  3119. xmlhttp.send(confmonitor_query);
  3120. xmlhttp.onreadystatechange = function()
  3121. {
  3122. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  3123. {
  3124. var RClookResponse = null;
  3125. // document.getElementById("busycallsdebug").innerHTML = confmonitor_query;
  3126. // alert(xmlhttp.responseText);
  3127. RClookResponse = xmlhttp.responseText;
  3128. var RClookResponse_array=RClookResponse.split("\n");
  3129. var RClookFILE = RClookResponse_array[1];
  3130. var RClookID = RClookResponse_array[2];
  3131. var RClookFILE_array = RClookFILE.split("Filename: ");
  3132. var RClookID_array = RClookID.split("RecorDing_ID: ");
  3133. if (RClookID_array.length > 0)
  3134. {
  3135. var RecDispNamE = RClookFILE_array[1];
  3136. if (RecDispNamE.length > 25)
  3137. {
  3138. RecDispNamE = RecDispNamE.substr(0,22);
  3139. RecDispNamE = RecDispNamE + '...';
  3140. }
  3141. document.getElementById("RecorDingFilename").innerHTML = RecDispNamE;
  3142. document.getElementById("RecorDID").innerHTML = RClookID_array[1];
  3143. }
  3144. }
  3145. }
  3146. delete xmlhttp;
  3147. }
  3148. }
  3149. // ################################################################################
  3150. // Send Redirect command for live call to Manager sends phone name where call is going to
  3151. // Covers the following types: XFER, VMAIL, ENTRY, CONF, PARKING, FROMPARKING, XfeRLOCAL, XfeRINTERNAL, XfeRBLIND, VfeRVMAIL
  3152. function mainxfer_send_redirect(taskvar,taskxferconf,taskserverip,taskdebugnote)
  3153. {
  3154. blind_transfer=1;
  3155. // conf_dialed=1;
  3156. if (auto_dial_level == 0) {RedirecTxFEr = 1;}
  3157. var xmlhttpXF=false;
  3158. /*@cc_on @*/
  3159. /*@if (@_jscript_version >= 5)
  3160. // JScript gives us Conditional compilation, we can cope with old IE versions.
  3161. // and security blocked creation of the objects.
  3162. try {
  3163. xmlhttpXF = new ActiveXObject("Msxml2.XMLHTTP");
  3164. } catch (e) {
  3165. try {
  3166. xmlhttpXF = new ActiveXObject("Microsoft.XMLHTTP");
  3167. } catch (E) {
  3168. xmlhttpXF = false;
  3169. }
  3170. }
  3171. @end @*/
  3172. if (!xmlhttpXF && typeof XMLHttpRequest!='undefined')
  3173. {
  3174. xmlhttpXF = new XMLHttpRequest();
  3175. }
  3176. if (xmlhttpXF)
  3177. {
  3178. var redirectvalue = MDchannel;
  3179. var redirectserverip = lastcustserverip;
  3180. if (redirectvalue.length < 2)
  3181. {redirectvalue = lastcustchannel}
  3182. if ( (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') )
  3183. {
  3184. var queryCID = "XBvdcW" + epoch_sec + user_abb;
  3185. var blindxferdialstring = document.vicidial_form.xfernumber.value;
  3186. var regXFvars = new RegExp("XFER","g");
  3187. if (blindxferdialstring.match(regXFvars))
  3188. {
  3189. var regAXFvars = new RegExp("AXFER","g");
  3190. if (blindxferdialstring.match(regAXFvars))
  3191. {
  3192. var Ctasknum = blindxferdialstring.replace(regAXFvars, '');
  3193. if (Ctasknum.length < 2)
  3194. {Ctasknum = '83009';}
  3195. var closerxfercamptail = '_L';
  3196. if (closerxfercamptail.length < 3)
  3197. {closerxfercamptail = 'IVR';}
  3198. blindxferdialstring = Ctasknum + '*' + document.vicidial_form.phone_number.value + '*' + document.vicidial_form.lead_id.value + '*' + campaign + '*' + closerxfercamptail + '*' + user + '*';
  3199. }
  3200. }
  3201. else
  3202. {
  3203. if (document.vicidial_form.xferoverride.checked==false)
  3204. {
  3205. if (three_way_dial_prefix == 'X') {var temp_dial_prefix = '';}
  3206. else {var temp_dial_prefix = three_way_dial_prefix;}
  3207. if (omit_phone_code == 'Y') {var temp_phone_code = '';}
  3208. else {var temp_phone_code = document.vicidial_form.phone_code.value;}
  3209. if (blindxferdialstring.length > 7)
  3210. {blindxferdialstring = temp_dial_prefix + "" + temp_phone_code + "" + blindxferdialstring;}
  3211. }
  3212. }
  3213. if (taskvar == 'XfeRVMAIL')
  3214. {var blindxferdialstring = campaign_am_message_exten;}
  3215. if (blindxferdialstring.length<'2')
  3216. {
  3217. xferredirect_query='';
  3218. taskvar = 'NOTHING';
  3219. alert("El número de la transferencia debe tener más de 1 dígito:" + blindxferdialstring);
  3220. }
  3221. else
  3222. {
  3223. xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + blindxferdialstring + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id;
  3224. }
  3225. }
  3226. if (taskvar == 'XfeRINTERNAL')
  3227. {
  3228. var closerxferinternal = '';
  3229. taskvar = 'XfeRLOCAL';
  3230. }
  3231. else
  3232. {
  3233. var closerxferinternal = '9';
  3234. }
  3235. if (taskvar == 'XfeRLOCAL')
  3236. {
  3237. var XfeRSelecT = document.getElementById("XfeRGrouP");
  3238. var queryCID = "XLvdcW" + epoch_sec + user_abb;
  3239. // "90009*$group**$lead_id**$phone_number*$user*$agent_only*";
  3240. var redirectdestination = closerxferinternal + '90009*' + XfeRSelecT.value + '**' + document.vicidial_form.lead_id.value + '**' + document.vicidial_form.phone_number.value + '*' + user + '*' + document.vicidial_form.xfernumber.value + '*';
  3241. xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectVD&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&auto_dial_level=" + auto_dial_level + "&campaign=" + campaign + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&lead_id=" + document.vicidial_form.lead_id.value + "&secondS=" + VD_live_call_secondS + "&session_id=" + session_id;
  3242. }
  3243. if (taskvar == 'XfeR')
  3244. {
  3245. var queryCID = "LRvdcW" + epoch_sec + user_abb;
  3246. var redirectdestination = document.vicidial_form.extension_xfer.value;
  3247. xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectName&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
  3248. }
  3249. if (taskvar == 'VMAIL')
  3250. {
  3251. var queryCID = "LVvdcW" + epoch_sec + user_abb;
  3252. var redirectdestination = document.vicidial_form.extension_xfer.value;
  3253. xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectNameVmail&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + voicemail_dump_exten + "&extenName=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
  3254. }
  3255. if (taskvar == 'ENTRY')
  3256. {
  3257. var queryCID = "LEvdcW" + epoch_sec + user_abb;
  3258. var redirectdestination = document.vicidial_form.extension_xfer_entry.value;
  3259. xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=Redirect&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
  3260. }
  3261. if (taskvar == '3WAY')
  3262. {
  3263. xferredirect_query='';
  3264. var queryCID = "VXvdcW" + epoch_sec + user_abb;
  3265. var redirectdestination = "NEXTAVAILABLE";
  3266. var redirectXTRAvalue = XDchannel;
  3267. var redirecttype_test = document.vicidial_form.xfernumber.value;
  3268. var XfeRSelecT = document.getElementById("XfeRGrouP");
  3269. var regRXFvars = new RegExp("CXFER","g");
  3270. if ( (redirecttype_test.match(regRXFvars)) && (local_consult_xfers > 0) )
  3271. // {var redirecttype = 'RedirectXtraCX';}
  3272. {var redirecttype = 'RedirectXtraCXNeW';}
  3273. else
  3274. // {var redirecttype = 'RedirectXtra';}
  3275. {var redirecttype = 'RedirectXtraNeW';}
  3276. DispO3waychannel = redirectvalue;
  3277. DispO3wayXtrAchannel = redirectXTRAvalue;
  3278. DispO3wayCalLserverip = redirectserverip;
  3279. DispO3wayCalLxfernumber = document.vicidial_form.xfernumber.value;
  3280. DispO3wayCalLcamptail = '';
  3281. xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=" + redirecttype + "&format=text&channel=" + redirectvalue + "&call_server_ip=" + redirectserverip + "&queryCID=" + queryCID + "&exten=" + redirectdestination + "&ext_context=" + ext_context + "&ext_priority=1&extrachannel=" + redirectXTRAvalue + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&phone_number=" + document.vicidial_form.phone_number.value + "&filename=" + taskdebugnote + "&campaign=" + XfeRSelecT.value + "&session_id=" + session_id + "&agentchannel=" + agentchannel + "&protocol=" + protocol + "&extension=" + extension + "&auto_dial_level=" + auto_dial_level;
  3282. if (taskdebugnote == 'FIRST')
  3283. {
  3284. document.getElementById("DispoSelectHAspan").innerHTML = "<a href=\"#\" onclick=\"DispoLeavE3wayAgaiN()\">Leave 3Way Call Again</a>";
  3285. }
  3286. }
  3287. if (taskvar == 'ParK')
  3288. {
  3289. blind_transfer=0;
  3290. var queryCID = "LPvdcW" + epoch_sec + user_abb;
  3291. var redirectdestination = taskxferconf;
  3292. var redirectdestserverip = taskserverip;
  3293. var parkedby = protocol + "/" + extension;
  3294. xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectToPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + park_on_extension + "&ext_context=" + ext_context + "&ext_priority=1&extenName=park&parkedby=" + parkedby + "&session_id=" + session_id;
  3295. document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('FROMParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_LB_grabparkedcall_es.gif\" border=0 alt=\"Capturar llamada en Parking\"></a>";
  3296. customerparked=1;
  3297. }
  3298. if (taskvar == 'FROMParK')
  3299. {
  3300. blind_transfer=0;
  3301. var queryCID = "FPvdcW" + epoch_sec + user_abb;
  3302. var redirectdestination = taskxferconf;
  3303. var redirectdestserverip = taskserverip;
  3304. if( (server_ip == taskserverip) && (taskserverip.length > 6) )
  3305. {var dest_dialstring = session_id;}
  3306. else
  3307. {
  3308. if(taskserverip.length > 6)
  3309. {var dest_dialstring = server_ip_dialstring + "" + session_id;}
  3310. else
  3311. {var dest_dialstring = session_id;}
  3312. }
  3313. xferredirect_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=RedirectFromPark&format=text&channel=" + redirectdestination + "&call_server_ip=" + redirectdestserverip + "&queryCID=" + queryCID + "&exten=" + dest_dialstring + "&ext_context=" + ext_context + "&ext_priority=1" + "&session_id=" + session_id;
  3314. document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + redirectdestination + "','" + redirectdestserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_LB_parkcall_es.gif\" border=0 alt=\"Aparcar llamada\"></a>";
  3315. customerparked=0;
  3316. }
  3317. var XFRDop = '';
  3318. xmlhttpXF.open('POST', 'manager_send.php');
  3319. xmlhttpXF.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  3320. xmlhttpXF.send(xferredirect_query);
  3321. xmlhttpXF.onreadystatechange = function()
  3322. {
  3323. if (xmlhttpXF.readyState == 4 && xmlhttpXF.status == 200)
  3324. {
  3325. var XfeRRedirecToutput = null;
  3326. XfeRRedirecToutput = xmlhttpXF.responseText;
  3327. var XfeRRedirecToutput_array=XfeRRedirecToutput.split("|");
  3328. var XFRDop = XfeRRedirecToutput_array[0];
  3329. if (XFRDop == "NeWSessioN")
  3330. {
  3331. threeway_end=1;
  3332. document.vicidial_form.callchannel.value = '';
  3333. document.vicidial_form.callserverip.value = '';
  3334. dialedcall_send_hangup();
  3335. document.vicidial_form.xferchannel.value = '';
  3336. xfercall_send_hangup();
  3337. session_id = XfeRRedirecToutput_array[1];
  3338. document.getElementById("sessionIDspan").innerHTML = session_id;
  3339. // alert("session_id changed to: " + session_id);
  3340. }
  3341. // alert(xferredirect_query + "\n" + xmlhttpXF.responseText);
  3342. // document.getElementById("debugbottomspan").innerHTML = xferredirect_query + "\n" + xmlhttpXF.responseText;
  3343. }
  3344. }
  3345. delete xmlhttpXF;
  3346. }
  3347. // used to send second Redirect for manual dial calls
  3348. if ( (auto_dial_level == 0) && (taskvar != '3WAY') )
  3349. {
  3350. RedirecTxFEr = 1;
  3351. var xmlhttpXF2=false;
  3352. /*@cc_on @*/
  3353. /*@if (@_jscript_version >= 5)
  3354. // JScript gives us Conditional compilation, we can cope with old IE versions.
  3355. // and security blocked creation of the objects.
  3356. try {
  3357. xmlhttpXF2 = new ActiveXObject("Msxml2.XMLHTTP");
  3358. } catch (e) {
  3359. try {
  3360. xmlhttpXF2 = new ActiveXObject("Microsoft.XMLHTTP");
  3361. } catch (E) {
  3362. xmlhttpXF2 = false;
  3363. }
  3364. }
  3365. @end @*/
  3366. if (!xmlhttpXF2 && typeof XMLHttpRequest!='undefined')
  3367. {
  3368. xmlhttpXF2 = new XMLHttpRequest();
  3369. }
  3370. if (xmlhttpXF2)
  3371. {
  3372. xmlhttpXF2.open('POST', 'manager_send.php');
  3373. xmlhttpXF2.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  3374. xmlhttpXF2.send(xferredirect_query + "&stage=2NDXfeR");
  3375. xmlhttpXF2.onreadystatechange = function()
  3376. {
  3377. if (xmlhttpXF2.readyState == 4 && xmlhttpXF2.status == 200)
  3378. {
  3379. Nactiveext = null;
  3380. Nactiveext = xmlhttpXF2.responseText;
  3381. // alert(RedirecTxFEr + "|" + xmlhttpXF2.responseText);
  3382. }
  3383. }
  3384. delete xmlhttpXF2;
  3385. }
  3386. }
  3387. if ( (taskvar == 'XfeRLOCAL') || (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') )
  3388. {
  3389. if (auto_dial_level == 0) {RedirecTxFEr = 1;}
  3390. document.vicidial_form.callchannel.value = '';
  3391. document.vicidial_form.callserverip.value = '';
  3392. if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
  3393. // alert(RedirecTxFEr + "|" + auto_dial_level);
  3394. dialedcall_send_hangup();
  3395. }
  3396. }
  3397. // ################################################################################
  3398. // Finish the alternate dialing and move en to disposition the call
  3399. function ManualDialAltDonE()
  3400. {
  3401. alt_phone_dialing=starting_alt_phone_dialing;
  3402. alt_dial_active = 0;
  3403. alt_dial_status_display = 0;
  3404. open_dispo_screen=1;
  3405. document.getElementById("MainStatuSSpan").innerHTML = "Marcar el Siguiente Número";
  3406. }
  3407. // ################################################################################
  3408. // Insert or update the vicidial_log entry for a customer call
  3409. function DialLog(taskMDstage)
  3410. {
  3411. if (taskMDstage == "start")
  3412. {
  3413. var MDlogEPOCH = 0;
  3414. var UID_test = document.vicidial_form.uniqueid.value;
  3415. if (UID_test.length < 4)
  3416. {
  3417. UID_test = epoch_sec + '.' + random;
  3418. document.vicidial_form.uniqueid.value = UID_test;
  3419. }
  3420. }
  3421. else
  3422. {
  3423. if (alt_phone_dialing == 1)
  3424. {
  3425. if (document.vicidial_form.DiaLAltPhonE.checked==true)
  3426. {
  3427. reselect_alt_dial = 1;
  3428. alt_dial_active = 1;
  3429. alt_dial_status_display = 1;
  3430. var man_status = "Marcar Número de teléfono Alt: <a href=\"#\" onclick=\"ManualDialOnly('MaiNPhonE')\"><font class=\"preview_text\">TELÉFONO PRINCIPAL</font></a> or <a href=\"#\" onclick=\"ManualDialOnly('ALTTeléfonoE')\"><font class=\"preview_text\">TELÉFONO ALT</font></a> or <a href=\"#\" onclick=\"ManualDialOnly('AddresS3')\"><font class=\"preview_text\">DIRECCIÓN3</font></a> or <a href=\"#\" onclick=\"ManualDialAltDonE()\"><font class=\"preview_text_red\">ACABAR LEAD</font></a>";
  3431. document.getElementById("MainStatuSSpan").innerHTML = man_status;
  3432. }
  3433. }
  3434. }
  3435. var xmlhttp=false;
  3436. /*@cc_on @*/
  3437. /*@if (@_jscript_version >= 5)
  3438. // JScript gives us Conditional compilation, we can cope with old IE versions.
  3439. // and security blocked creation of the objects.
  3440. try {
  3441. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  3442. } catch (e) {
  3443. try {
  3444. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3445. } catch (E) {
  3446. xmlhttp = false;
  3447. }
  3448. }
  3449. @end @*/
  3450. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  3451. {
  3452. xmlhttp = new XMLHttpRequest();
  3453. }
  3454. if (xmlhttp)
  3455. {
  3456. manDiaLlog_query = "format=text&server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlogCaLL&stage=" + taskMDstage + "&uniqueid=" + document.vicidial_form.uniqueid.value +
  3457. "&user=" + user + "&pass=" + pass + "&campaign=" + campaign +
  3458. "&lead_id=" + document.vicidial_form.lead_id.value +
  3459. "&list_id=" + document.vicidial_form.list_id.value +
  3460. "&length_in_sec=0&phone_code=" + document.vicidial_form.phone_code.value +
  3461. "&phone_number=" + lead_dial_number +
  3462. "&exten=" + extension + "&channel=" + lastcustchannel + "&start_epoch=" + MDlogEPOCH + "&auto_dial_level=" + auto_dial_level + "&VDstop_rec_after_each_call=" + VDstop_rec_after_each_call + "&conf_silent_prefix=" + conf_silent_prefix + "&protocol=" + protocol + "&extension=" + extension + "&ext_context=" + ext_context + "&conf_exten=" + session_id + "&user_abb=" + user_abb + "&agent_log_id=" + agent_log_id + "&MDnextCID=" + LasTCID + "&inOUT=" + inOUT + "&alt_dial=" + dialed_label + "&DB=0" + "&agentchannel=" + agentchannel + "&conf_dialed=" + conf_dialed + "&leaving_threeway=" + leaving_threeway + "&hangup_all_non_reserved=" + hangup_all_non_reserved + "&blind_transfer=" + blind_transfer;
  3463. xmlhttp.open('POST', 'vdc_db_query.php');
  3464. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  3465. // document.getElementById("busycallsdebug").innerHTML = "vdc_db_query.php?" + manDiaLlog_query;
  3466. xmlhttp.send(manDiaLlog_query);
  3467. xmlhttp.onreadystatechange = function()
  3468. {
  3469. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  3470. {
  3471. var MDlogResponse = null;
  3472. // alert(xmlhttp.responseText);
  3473. MDlogResponse = xmlhttp.responseText;
  3474. var MDlogResponse_array=MDlogResponse.split("\n");
  3475. MDlogLINE = MDlogResponse_array[0];
  3476. if ( (MDlogLINE == "REGISTRO NO ENTRADO") && (VDstop_rec_after_each_call != 1) )
  3477. {
  3478. // alert("error: log not entered\n");
  3479. }
  3480. else
  3481. {
  3482. MDlogEPOCH = MDlogResponse_array[1];
  3483. // alert("VICIDIAL Call log entered:\n" + document.vicidial_form.uniqueid.value);
  3484. if ( (taskMDstage != "start") && (VDstop_rec_after_each_call == 1) )
  3485. {
  3486. var conf_rec_start_html = "<a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + session_id + "','');return false;\"><IMG SRC=\"../agc/images/vdc_LB_startrecording_es.gif\" border=0 alt=\"Comenzar La Grabación\"></a>";
  3487. if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') )
  3488. {
  3489. document.getElementById("RecorDControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_startrecording_OFF.gif\" border=0 alt=\"Comenzar La Grabación\">";
  3490. }
  3491. else
  3492. {document.getElementById("RecorDControl").innerHTML = conf_rec_start_html;}
  3493. MDlogRecorDings = MDlogResponse_array[3];
  3494. if (window.MDlogRecorDings)
  3495. {
  3496. var MDlogRecorDings_array=MDlogRecorDings.split("|");
  3497. var RecDispNamE = MDlogRecorDings_array[2];
  3498. if (RecDispNamE.length > 25)
  3499. {
  3500. RecDispNamE = RecDispNamE.substr(0,22);
  3501. RecDispNamE = RecDispNamE + '...';
  3502. }
  3503. document.getElementById("RecorDingFilename").innerHTML = RecDispNamE;
  3504. document.getElementById("RecorDID").innerHTML = MDlogRecorDings_array[3];
  3505. }
  3506. }
  3507. }
  3508. }
  3509. }
  3510. delete xmlhttp;
  3511. }
  3512. RedirecTxFEr=0;
  3513. conf_dialed=0;
  3514. }
  3515. // ################################################################################
  3516. // Request number of USERONLY callbacks for this agent
  3517. function CalLBacKsCounTCheck()
  3518. {
  3519. var xmlhttp=false;
  3520. /*@cc_on @*/
  3521. /*@if (@_jscript_version >= 5)
  3522. // JScript gives us Conditional compilation, we can cope with old IE versions.
  3523. // and security blocked creation of the objects.
  3524. try {
  3525. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  3526. } catch (e) {
  3527. try {
  3528. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3529. } catch (E) {
  3530. xmlhttp = false;
  3531. }
  3532. }
  3533. @end @*/
  3534. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  3535. {
  3536. xmlhttp = new XMLHttpRequest();
  3537. }
  3538. if (xmlhttp)
  3539. {
  3540. CBcount_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKCounT&campaign=" + campaign + "&format=text";
  3541. xmlhttp.open('POST', 'vdc_db_query.php');
  3542. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  3543. xmlhttp.send(CBcount_query);
  3544. xmlhttp.onreadystatechange = function()
  3545. {
  3546. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  3547. {
  3548. // alert(xmlhttp.responseText);
  3549. var CBcounT = xmlhttp.responseText;
  3550. if (CBcounT == 0) {var CBprint = "NO";}
  3551. else {var CBprint = CBcounT;}
  3552. document.getElementById("CBstatusSpan").innerHTML ="<a href=\"#\" onclick=\"CalLBacKsLisTCheck();return false;\">" + CBprint + " SERVICIOS REPETIDOS ACTIVOS</a>";
  3553. }
  3554. }
  3555. delete xmlhttp;
  3556. }
  3557. }
  3558. // ################################################################################
  3559. // Request list of USERONLY callbacks for this agent
  3560. function CalLBacKsLisTCheck()
  3561. {
  3562. if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) )
  3563. {
  3564. alert("USTED DEBE SER DETENIDO BREVEMENTE PARA COMPROBAR SERVICIOS REPETIDOS EN MODO DE AUTO-DIAL");
  3565. }
  3566. else
  3567. {
  3568. showDiv('CallBacKsLisTBox');
  3569. var xmlhttp=false;
  3570. /*@cc_on @*/
  3571. /*@if (@_jscript_version >= 5)
  3572. // JScript gives us Conditional compilation, we can cope with old IE versions.
  3573. // and security blocked creation of the objects.
  3574. try {
  3575. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  3576. } catch (e) {
  3577. try {
  3578. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3579. } catch (E) {
  3580. xmlhttp = false;
  3581. }
  3582. }
  3583. @end @*/
  3584. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  3585. {
  3586. xmlhttp = new XMLHttpRequest();
  3587. }
  3588. if (xmlhttp)
  3589. {
  3590. var CBlist_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=CalLBacKLisT&campaign=" + campaign + "&format=text";
  3591. xmlhttp.open('POST', 'vdc_db_query.php');
  3592. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  3593. xmlhttp.send(CBlist_query);
  3594. xmlhttp.onreadystatechange = function()
  3595. {
  3596. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  3597. {
  3598. // alert(xmlhttp.responseText);
  3599. var all_CBs = null;
  3600. all_CBs = xmlhttp.responseText;
  3601. var all_CBs_array=all_CBs.split("\n");
  3602. var CB_calls = all_CBs_array[0];
  3603. var loop_ct=0;
  3604. var conv_start=0;
  3605. var CB_HTML = "<table width=610><tr bgcolor=#E6E6E6><td><font class=\"log_title\">#</td><td><font class=\"log_title\"> LLAMADABACK DATE/TIME</td><td><font class=\"log_title\">NÚMERO</td><td><font class=\"log_title\">NAME</td><td><font class=\"log_title\"> ESTADO</td><td align=right><font class=\"log_title\">CAMPAIGN</td><td><font class=\"log_title\">LAST FECHA/HORA DE LA LLAMADA</td><td align=left><font class=\"log_title\"> COMMENTS</td></tr>"
  3606. while (loop_ct < CB_calls)
  3607. {
  3608. loop_ct++;
  3609. loop_s = loop_ct.toString();
  3610. if (loop_s.match(/1$|3$|5$|7$|9$/))
  3611. {var row_color = '#DDDDFF';}
  3612. else
  3613. {var row_color = '#CCCCFF';}
  3614. var conv_ct = (loop_ct + conv_start);
  3615. var call_array = all_CBs_array[conv_ct].split(" ~");
  3616. var CB_name = call_array[0] + " " + call_array[1];
  3617. var CB_phone = call_array[2];
  3618. var CB_id = call_array[3];
  3619. var CB_lead_id = call_array[4];
  3620. var CB_campaign = call_array[5];
  3621. var CB_status = call_array[6];
  3622. var CB_lastcall_time = call_array[7];
  3623. var CB_callback_time = call_array[8];
  3624. var CB_comments = call_array[9];
  3625. CB_HTML = CB_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"log_text\">" + CB_callback_time + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"new_callback_call('" + CB_id + "','" + CB_lead_id + "');return false;\">" + CB_phone + "</a></td><td><font class=\"log_text\">" + CB_name + "</td><td><font class=\"log_text\">" + CB_status + "</td><td><font class=\"log_text\">" + CB_campaign + "</td><td align=right><font class=\"log_text\">" + CB_lastcall_time + "&nbsp;</td><td align=right><font class=\"log_text\">" + CB_comments + "&nbsp;</td></tr>";
  3626. }
  3627. CB_HTML = CB_HTML + "</table>";
  3628. document.getElementById("CallBacKsLisT").innerHTML = CB_HTML;
  3629. }
  3630. }
  3631. delete xmlhttp;
  3632. }
  3633. }
  3634. }
  3635. // ################################################################################
  3636. // Open up a callback customer record as manual dial preview mode
  3637. function new_callback_call(taskCBid,taskLEADid)
  3638. {
  3639. alt_phone_dialing=1;
  3640. auto_dial_level=0;
  3641. manual_dial_in_progress=1;
  3642. MainPanelToFront();
  3643. buildDiv('DiaLLeaDPrevieW');
  3644. buildDiv('DiaLDiaLAltPhonE');
  3645. document.vicidial_form.LeadPreview.checked=true;
  3646. document.vicidial_form.DiaLAltPhonE.checked=true;
  3647. hideDiv('CallBacKsLisTBox');
  3648. ManualDialNext(taskCBid,taskLEADid,'','','','0');
  3649. }
  3650. // ################################################################################
  3651. // Finish Callback and go back to original screen
  3652. function manual_dial_finished()
  3653. {
  3654. alt_phone_dialing=starting_alt_phone_dialing;
  3655. auto_dial_level=starting_dial_level;
  3656. MainPanelToFront();
  3657. CalLBacKsCounTCheck();
  3658. manual_dial_in_progress=0;
  3659. }
  3660. // ################################################################################
  3661. // Open page to enter details for a new manual dial lead
  3662. function NeWManuaLDiaLCalL(TVfast)
  3663. {
  3664. if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) )
  3665. {
  3666. alert("USTED DEBE SER DETENIDO BREVEMENTE Al DIAL MANUAL Un NUEVO PLOMO EN MODO De AUTO-DIAL");
  3667. }
  3668. else
  3669. {
  3670. if (TVfast=='FAST')
  3671. {
  3672. NeWManuaLDiaLCalLSubmiTfast();
  3673. }
  3674. else
  3675. {
  3676. if (agent_allow_group_alias == 'Y')
  3677. {
  3678. document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "<font size=2 face=\"Arial,Helvetica\">Grupo de Alias: " + active_group_alias + "</font>";
  3679. document.getElementById("ManuaLDiaLGrouP").innerHTML = "<a href=\"#\" onclick=\"GroupAliasSelectContent_create('0');\"><font size=1 face=\"Arial,Helvetica\">Haga clic aquí para escoger un grupo de alias</font></a>";
  3680. }
  3681. showDiv('NeWManuaLDiaLBox');
  3682. }
  3683. }
  3684. }
  3685. // ################################################################################
  3686. // Insert the new manual dial as a lead and go to manual dial screen
  3687. function NeWManuaLDiaLCalLSubmiT(tempDiaLnow)
  3688. {
  3689. hideDiv('NeWManuaLDiaLBox');
  3690. document.getElementById("debugbottomspan").innerHTML = "TESTING NOW HERE" + document.vicidial_form.MDPhonENumbeR.value + "|" + active_group_alias;
  3691. var sending_group_alias = 0;
  3692. var MDDiaLCodEform = document.vicidial_form.MDDiaLCodE.value;
  3693. var MDPhonENumbeRform = document.vicidial_form.MDPhonENumbeR.value;
  3694. var MDDiaLOverridEform = document.vicidial_form.MDDiaLOverridE.value;
  3695. var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value;
  3696. var MDLookuPLeaD = 'new';
  3697. if (document.vicidial_form.LeadLookuP.checked==true)
  3698. {MDLookuPLeaD = 'lookup';}
  3699. if (MDDiaLCodEform.length < 1)
  3700. {MDDiaLCodEform = document.vicidial_form.phone_code.value;}
  3701. if (MDDiaLOverridEform.length > 0)
  3702. {
  3703. agent_dialed_number=1;
  3704. agent_dialed_type='MANUAL_OVERRIDE';
  3705. basic_originate_call(session_id,'NO','YES',MDDiaLOverridEform,'YES','','1','0');
  3706. }
  3707. else
  3708. {
  3709. alt_phone_dialing=1;
  3710. auto_dial_level=0;
  3711. manual_dial_in_progress=1;
  3712. agent_dialed_number=1;
  3713. MainPanelToFront();
  3714. if (tempDiaLnow == 'PREVIEW')
  3715. {
  3716. agent_dialed_type='MANUAL_PREVIEW';
  3717. buildDiv('DiaLLeaDPrevieW');
  3718. buildDiv('DiaLDiaLAltPhonE');
  3719. document.vicidial_form.LeadPreview.checked=true;
  3720. document.vicidial_form.DiaLAltPhonE.checked=true;
  3721. }
  3722. else
  3723. {
  3724. agent_dialed_type='MANUAL_DIALNOW';
  3725. document.vicidial_form.LeadPreview.checked=false;
  3726. document.vicidial_form.DiaLAltPhonE.checked=false;
  3727. }
  3728. if (active_group_alias.length > 1)
  3729. {var sending_group_alias = 1;}
  3730. ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,sending_group_alias);
  3731. }
  3732. document.vicidial_form.MDPhonENumbeR.value = '';
  3733. document.vicidial_form.MDDiaLOverridE.value = '';
  3734. }
  3735. // ################################################################################
  3736. // Fast version of manual dial
  3737. function NeWManuaLDiaLCalLSubmiTfast()
  3738. {
  3739. var MDDiaLCodEform = document.vicidial_form.phone_code.value;
  3740. var MDPhonENumbeRform = document.vicidial_form.phone_number.value;
  3741. var MDVendorLeadCode = document.vicidial_form.vendor_lead_code.value;
  3742. if ( (MDDiaLCodEform.length < 1) || (MDPhonENumbeRform.length < 5) )
  3743. {
  3744. alert("USTED DEBE INTRODUCIR Un NÚMERO De TELÉFONO Y Un CÓDIGO Del DIALPARA UTILIZAR El DIAL RÁPIDO");
  3745. }
  3746. else
  3747. {
  3748. var MDLookuPLeaD = 'new';
  3749. if (document.vicidial_form.LeadLookuP.checked==true)
  3750. {MDLookuPLeaD = 'lookup';}
  3751. agent_dialed_number=1;
  3752. agent_dialed_type='MANUAL_DIALFAST';
  3753. alt_phone_dialing=1;
  3754. auto_dial_level=0;
  3755. manual_dial_in_progress=1;
  3756. MainPanelToFront();
  3757. buildDiv('DiaLLeaDPrevieW');
  3758. buildDiv('DiaLDiaLAltPhonE');
  3759. document.vicidial_form.LeadPreview.checked=false;
  3760. document.vicidial_form.DiaLAltPhonE.checked=true;
  3761. ManualDialNext("","",MDDiaLCodEform,MDPhonENumbeRform,MDLookuPLeaD,MDVendorLeadCode,'0');
  3762. }
  3763. }
  3764. // ################################################################################
  3765. // Request lookup of manual dial channel
  3766. function ManualDialCheckChanneL(taskCheckOR)
  3767. {
  3768. if (taskCheckOR == 'YES')
  3769. {
  3770. var CIDcheck = XDnextCID;
  3771. }
  3772. else
  3773. {
  3774. var CIDcheck = MDnextCID;
  3775. }
  3776. var xmlhttp=false;
  3777. /*@cc_on @*/
  3778. /*@if (@_jscript_version >= 5)
  3779. // JScript gives us Conditional compilation, we can cope with old IE versions.
  3780. // and security blocked creation of the objects.
  3781. try {
  3782. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  3783. } catch (e) {
  3784. try {
  3785. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3786. } catch (E) {
  3787. xmlhttp = false;
  3788. }
  3789. }
  3790. @end @*/
  3791. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  3792. {
  3793. xmlhttp = new XMLHttpRequest();
  3794. }
  3795. if (xmlhttp)
  3796. {
  3797. manDiaLlook_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLlookCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&MDnextCID=" + CIDcheck + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value;
  3798. xmlhttp.open('POST', 'vdc_db_query.php');
  3799. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  3800. xmlhttp.send(manDiaLlook_query);
  3801. xmlhttp.onreadystatechange = function()
  3802. {
  3803. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  3804. {
  3805. var MDlookResponse = null;
  3806. // alert(xmlhttp.responseText);
  3807. MDlookResponse = xmlhttp.responseText;
  3808. var MDlookResponse_array=MDlookResponse.split("\n");
  3809. var MDlookCID = MDlookResponse_array[0];
  3810. if (MDlookCID == "NO")
  3811. {
  3812. MD_ring_secondS++;
  3813. var dispnum = lead_dial_number;
  3814. var status_display_number = phone_number_format(dispnum);
  3815. if (alt_dial_status_display=='0')
  3816. {
  3817. // alert(document.getElementById("MainStatuSSpan").innerHTML);
  3818. document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + CIDcheck + " &nbsp; Espeerar al Ring... " + MD_ring_secondS + " segundos";
  3819. // alert("channel not found yet:\n" + campaign);
  3820. }
  3821. }
  3822. else
  3823. {
  3824. var regMDL = new RegExp("^Local","ig");
  3825. if (taskCheckOR == 'YES')
  3826. {
  3827. XDuniqueid = MDlookResponse_array[0];
  3828. XDchannel = MDlookResponse_array[1];
  3829. if ( (XDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') && (MD_ring_secondS < 10) )
  3830. {
  3831. // bad grab of Local channel, try again
  3832. MD_ring_secondS++;
  3833. }
  3834. else
  3835. {
  3836. document.vicidial_form.xferuniqueid.value = MDlookResponse_array[0];
  3837. document.vicidial_form.xferchannel.value = MDlookResponse_array[1];
  3838. lastxferchannel = MDlookResponse_array[1];
  3839. document.vicidial_form.xferlength.value = 0;
  3840. XD_live_customer_call = 1;
  3841. XD_live_call_secondS = 0;
  3842. MD_channel_look=0;
  3843. document.getElementById("MainStatuSSpan").innerHTML = " Terceros llamados: " + document.vicidial_form.xfernumber.value + " UID: " + CIDcheck;
  3844. document.getElementById("Leave3WayCall").innerHTML ="<a href=\"#\" onclick=\"leave_3way_call('FIRST');return false;\"><IMG SRC=\"../agc/images/vdc_XB_leave3waycall_es.gif\" border=0 alt=\"ABANDONAR LLAMADA 3-WAY\"></a>";
  3845. document.getElementById("DialWithCustomer").innerHTML ="<IMG SRC=\"../agc/images/vdc_XB_dialwithcustomer_OFF_es.gif\" border=0 alt=\"Marcar Con El Cliente\">";
  3846. document.getElementById("ParkCustomerDial").innerHTML ="<IMG SRC=\"../agc/images/vdc_XB_parkcustomerdial_OFF_es.gif\" border=0 alt=\"Dial Del Cliente Del Parque\">";
  3847. document.getElementById("HangupXferLine").innerHTML ="<a href=\"#\" onclick=\"xfercall_send_hangup();return false;\"><IMG SRC=\"../agc/images/vdc_XB_hangupxferline_es.gif\" border=0 alt=\"Colgar Línea Xfer \"></a>";
  3848. document.getElementById("HangupBothLines").innerHTML ="<a href=\"#\" onclick=\"bothcall_send_hangup();return false;\"><IMG SRC=\"../agc/images/vdc_XB_hangupbothlines_es.gif\" border=0 alt=\"Colgar Ambas Líneas\"></a>";
  3849. xferchannellive=1;
  3850. XDcheck = '';
  3851. }
  3852. }
  3853. else
  3854. {
  3855. MDuniqueid = MDlookResponse_array[0];
  3856. MDchannel = MDlookResponse_array[1];
  3857. if ( (MDchannel.match(regMDL)) && (asterisk_version != '1.0.8') && (asterisk_version != '1.0.9') )
  3858. {
  3859. // bad grab of Local channel, try again
  3860. MD_ring_secondS++;
  3861. }
  3862. else
  3863. {
  3864. custchannellive=1;
  3865. document.vicidial_form.uniqueid.value = MDlookResponse_array[0];
  3866. document.vicidial_form.callchannel.value = MDlookResponse_array[1];
  3867. lastcustchannel = MDlookResponse_array[1];
  3868. if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;}
  3869. document.vicidial_form.SecondS.value = 0;
  3870. document.getElementById("SecondSDISP").innerHTML = '0';
  3871. VD_live_customer_call = 1;
  3872. VD_live_call_secondS = 0;
  3873. MD_channel_look=0;
  3874. var dispnum = lead_dial_number;
  3875. var status_display_number = phone_number_format(dispnum);
  3876. document.getElementById("MainStatuSSpan").innerHTML = " Llamado: " + status_display_number + " UID: " + CIDcheck + " &nbsp;";
  3877. document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_LB_parkcall_es.gif\" border=0 alt=\"Aparcar llamada\"></a>";
  3878. document.getElementById("HangupControl").innerHTML = "<a href=\"#\" onclick=\"dialedcall_send_hangup();\"><IMG SRC=\"../agc/images/vdc_LB_hangupcustomer_es.gif\" border=0 alt=\"Colgar al Cliente\"></a>";
  3879. document.getElementById("XferControl").innerHTML = "<a href=\"#\" onclick=\"ShoWTransferMain('ON');\"><IMG SRC=\"../agc/images/vdc_LB_transferconf_es.gif\" border=0 alt=\"Transferencia - Conferencia\"></a>";
  3880. document.getElementById("LocalCloser").innerHTML = "<a href=\"#\" onclick=\"mainxfer_send_redirect('XfeRLOCAL','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_XB_localcloser_es.gif\" border=0 alt=\"CLOSER LOCAL\"></a>";
  3881. document.getElementById("DialBlindTransfer").innerHTML = "<a href=\"#\" onclick=\"mainxfer_send_redirect('XfeRBLIND','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_XB_blindtransfer_es.gif\" border=0 alt=\"Marcar Blind Transfer\"></a>";
  3882. document.getElementById("DialBlindVMail").innerHTML = "<a href=\"#\" onclick=\"mainxfer_send_redirect('XfeRVMAIL','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_XB_ammessage.gif\" border=0 alt=\"Blind Transfer VMail Message\"></a>";
  3883. document.getElementById("VolumeUpSpan").innerHTML = "<a href=\"#\" onclick=\"volume_control('UP','" + MDchannel + "','');return false;\"><IMG SRC=\"../agc/images/vdc_volume_up.gif\" Border=0></a>";
  3884. document.getElementById("VolumeDownSpan").innerHTML = "<a href=\"#\" onclick=\"volume_control('DOWN','" + MDchannel + "','');return false;\"><IMG SRC=\"../agc/images/vdc_volume_down.gif\" Border=0></a>";
  3885. // INSERT VICIDIAL_LOG ENTRY FOR THIS LLAMADA PROCESS
  3886. DialLog("start");
  3887. custchannellive=1;
  3888. }
  3889. }
  3890. }
  3891. }
  3892. }
  3893. delete xmlhttp;
  3894. }
  3895. if (MD_ring_secondS > 49)
  3896. {
  3897. MD_channel_look=0;
  3898. MD_ring_secondS=0;
  3899. alert("Tiempo de espera superado, pongase en contacto con su administrador de sistema\n");
  3900. }
  3901. }
  3902. // ################################################################################
  3903. // Send the Manual Marcar el Siguiente Número request
  3904. function ManualDialNext(mdnCBid,mdnBDleadid,mdnDiaLCodE,mdnPhonENumbeR,mdnStagE,mdVendorid,mdgroupalias)
  3905. {
  3906. inOUT = 'OUT';
  3907. all_record = 'NO';
  3908. all_record_count=0;
  3909. if (dial_method == "INBOUND_MAN")
  3910. {
  3911. auto_dial_level=0;
  3912. AutoDial_ReSume_PauSe('VDADpause');
  3913. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF_es.gif\" border=0 alt=\"Comienzo\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF_es.gif\" border=0 alt=\"Marcar el Siguiente Número\">";
  3914. }
  3915. else
  3916. {
  3917. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF_es.gif\" border=0 alt=\"Marcar el Siguiente Número\">";
  3918. }
  3919. if (document.vicidial_form.LeadPreview.checked==true)
  3920. {
  3921. reselect_preview_dial = 1;
  3922. var man_preview = 'YES';
  3923. var man_status = "Mostrar el Lead entonces <a href=\"#\" onclick=\"ManualDialOnly()\"><font class=\"preview_text\"> MARCAR LEAD</font></a> or <a href=\"#\" onclick=\"ManualDialSkip()\"><font class=\"preview_text\">SALTAR LEAD</font></a>";
  3924. }
  3925. else
  3926. {
  3927. reselect_preview_dial = 0;
  3928. var man_preview = 'NO';
  3929. var man_status = "Espeerar al Ring...";
  3930. }
  3931. var xmlhttp=false;
  3932. /*@cc_on @*/
  3933. /*@if (@_jscript_version >= 5)
  3934. // JScript gives us Conditional compilation, we can cope with old IE versions.
  3935. // and security blocked creation of the objects.
  3936. try {
  3937. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  3938. } catch (e) {
  3939. try {
  3940. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  3941. } catch (E) {
  3942. xmlhttp = false;
  3943. }
  3944. }
  3945. @end @*/
  3946. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  3947. {
  3948. xmlhttp = new XMLHttpRequest();
  3949. }
  3950. if (xmlhttp)
  3951. {
  3952. if (cid_choice.length > 3)
  3953. {var call_cid = cid_choice;}
  3954. else
  3955. {var call_cid = campaign_cid;}
  3956. if (prefix_choice.length > 0)
  3957. {var call_prefix = prefix_choice;}
  3958. else
  3959. {var call_prefix = dial_prefix;}
  3960. manDiaLnext_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLnextCaLL&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&preview=" + man_preview + "&agent_log_id=" + agent_log_id + "&callback_id=" + mdnCBid + "&lead_id=" + mdnBDleadid + "&phone_code=" + mdnDiaLCodE + "&phone_number=" + mdnPhonENumbeR + "&list_id=" + mdnLisT_id + "&stage=" + mdnStagE + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&omit_phone_code=" + omit_phone_code + "&manual_dial_filter=" + manual_dial_filter + "&vendor_lead_code=" + mdVendorid + "&usegroupalias=" + mdgroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type;
  3961. // alert(manual_dial_filter + "\n" +manDiaLnext_query);
  3962. xmlhttp.open('POST', 'vdc_db_query.php');
  3963. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  3964. xmlhttp.send(manDiaLnext_query);
  3965. xmlhttp.onreadystatechange = function()
  3966. {
  3967. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  3968. {
  3969. var MDnextResponse = null;
  3970. // alert(xmlhttp.responseText);
  3971. MDnextResponse = xmlhttp.responseText;
  3972. var MDnextResponse_array=MDnextResponse.split("\n");
  3973. MDnextCID = MDnextResponse_array[0];
  3974. var regMNCvar = new RegExp("HOPPER","ig");
  3975. var regMDFvarDNC = new RegExp("DNC","ig");
  3976. var regMDFvarCAMP = new RegExp("CAMPLISTS","ig");
  3977. if ( (MDnextCID.match(regMNCvar)) || (MDnextCID.match(regMDFvarDNC)) || (MDnextCID.match(regMDFvarCAMP)) )
  3978. {
  3979. var alert_displayed=0;
  3980. alt_phone_dialing=starting_alt_phone_dialing;
  3981. auto_dial_level=starting_dial_level;
  3982. MainPanelToFront();
  3983. CalLBacKsCounTCheck();
  3984. if (MDnextCID.match(regMNCvar))
  3985. {alert("No más Leads en el hopper de la campaña:\n" + campaign); alert_displayed=1;}
  3986. if (MDnextCID.match(regMDFvarDNC))
  3987. {alert("This phone number is in the DNC list:\n" + mdnPhonENumbeR); alert_displayed=1;}
  3988. if (MDnextCID.match(regMDFvarCAMP))
  3989. {alert("Este número de teléfono no está en la campaña de las listas:\n" + mdnPhonENumbeR); alert_displayed=1;}
  3990. if (alert_displayed==0)
  3991. {alert("Error no especificado:\n" + mdnPhonENumbeR + "|" + MDnextCID); alert_displayed=1;}
  3992. if (starting_dial_level == 0)
  3993. {
  3994. document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  3995. }
  3996. else
  3997. {
  3998. if (dial_method == "INBOUND_MAN")
  3999. {
  4000. auto_dial_level=starting_dial_level;
  4001. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume_es.gif\" border=0 alt=\"Comienzo\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  4002. }
  4003. else
  4004. {
  4005. document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
  4006. }
  4007. document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
  4008. reselect_alt_dial = 0;
  4009. }
  4010. }
  4011. else
  4012. {
  4013. fronter = user;
  4014. LasTCID = MDnextResponse_array[0];
  4015. document.vicidial_form.lead_id.value = MDnextResponse_array[1];
  4016. LeaDPreVDispO = MDnextResponse_array[2];
  4017. document.vicidial_form.vendor_lead_code.value = MDnextResponse_array[4];
  4018. document.vicidial_form.list_id.value = MDnextResponse_array[5];
  4019. document.vicidial_form.gmt_offset_now.value = MDnextResponse_array[6];
  4020. document.vicidial_form.phone_code.value = MDnextResponse_array[7];
  4021. if (disable_alter_custphone=='Y')
  4022. {
  4023. var tmp_pn = document.getElementById("phone_numberDISP");
  4024. tmp_pn.innerHTML = MDnextResponse_array[8];
  4025. }
  4026. document.vicidial_form.phone_number.value = MDnextResponse_array[8];
  4027. document.vicidial_form.title.value = MDnextResponse_array[9];
  4028. document.vicidial_form.first_name.value = MDnextResponse_array[10];
  4029. document.vicidial_form.middle_initial.value = MDnextResponse_array[11];
  4030. document.vicidial_form.last_name.value = MDnextResponse_array[12];
  4031. document.vicidial_form.address1.value = MDnextResponse_array[13];
  4032. document.vicidial_form.address2.value = MDnextResponse_array[14];
  4033. document.vicidial_form.address3.value = MDnextResponse_array[15];
  4034. document.vicidial_form.city.value = MDnextResponse_array[16];
  4035. document.vicidial_form.state.value = MDnextResponse_array[17];
  4036. document.vicidial_form.province.value = MDnextResponse_array[18];
  4037. document.vicidial_form.postal_code.value = MDnextResponse_array[19];
  4038. document.vicidial_form.country_code.value = MDnextResponse_array[20];
  4039. document.vicidial_form.gender.value = MDnextResponse_array[21];
  4040. document.vicidial_form.date_of_birth.value = MDnextResponse_array[22];
  4041. document.vicidial_form.alt_phone.value = MDnextResponse_array[23];
  4042. document.vicidial_form.email.value = MDnextResponse_array[24];
  4043. document.vicidial_form.security_phrase.value = MDnextResponse_array[25];
  4044. var REGcommentsNL = new RegExp("!N","g");
  4045. MDnextResponse_array[26] = MDnextResponse_array[26].replace(REGcommentsNL, "\n");
  4046. document.vicidial_form.comments.value = MDnextResponse_array[26];
  4047. document.vicidial_form.called_count.value = MDnextResponse_array[27];
  4048. previous_called_count = MDnextResponse_array[27];
  4049. previous_dispo = MDnextResponse_array[2];
  4050. CBentry_time = MDnextResponse_array[28];
  4051. CBcallback_time = MDnextResponse_array[29];
  4052. CBuser = MDnextResponse_array[30];
  4053. CBcomments = MDnextResponse_array[31];
  4054. dialed_number = MDnextResponse_array[32];
  4055. dialed_label = MDnextResponse_array[33];
  4056. source_id = MDnextResponse_array[34];
  4057. lead_dial_number = document.vicidial_form.phone_number.value;
  4058. var dispnum = document.vicidial_form.phone_number.value;
  4059. var status_display_number = phone_number_format(dispnum);
  4060. document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + MDnextCID + " &nbsp; " + man_status;
  4061. if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';}
  4062. var gIndex = 0;
  4063. if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;}
  4064. if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;}
  4065. document.getElementById("gender_list").selectedIndex = gIndex;
  4066. var genderIndex = document.getElementById("gender_list").selectedIndex;
  4067. var genderValue = document.getElementById('gender_list').options[genderIndex].value;
  4068. document.vicidial_form.gender.value = genderValue;
  4069. var regWFAcustom = new RegExp("^VAR","ig");
  4070. if (VDIC_web_form_address.match(regWFAcustom))
  4071. {
  4072. URLDecode(VDIC_web_form_address,'YES');
  4073. TEMP_VDIC_web_form_address = decoded;
  4074. TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, '');
  4075. }
  4076. else
  4077. {
  4078. web_form_vars =
  4079. "lead_id=" + document.vicidial_form.lead_id.value +
  4080. "&vendor_id=" + document.vicidial_form.vendor_lead_code.value +
  4081. "&list_id=" + document.vicidial_form.list_id.value +
  4082. "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value +
  4083. "&phone_code=" + document.vicidial_form.phone_code.value +
  4084. "&phone_number=" + document.vicidial_form.phone_number.value +
  4085. "&title=" + document.vicidial_form.title.value +
  4086. "&first_name=" + document.vicidial_form.first_name.value +
  4087. "&middle_initial=" + document.vicidial_form.middle_initial.value +
  4088. "&last_name=" + document.vicidial_form.last_name.value +
  4089. "&address1=" + document.vicidial_form.address1.value +
  4090. "&address2=" + document.vicidial_form.address2.value +
  4091. "&address3=" + document.vicidial_form.address3.value +
  4092. "&city=" + document.vicidial_form.city.value +
  4093. "&state=" + document.vicidial_form.state.value +
  4094. "&province=" + document.vicidial_form.province.value +
  4095. "&postal_code=" + document.vicidial_form.postal_code.value +
  4096. "&country_code=" + document.vicidial_form.country_code.value +
  4097. "&gender=" + document.vicidial_form.gender.value +
  4098. "&date_of_birth=" + document.vicidial_form.date_of_birth.value +
  4099. "&alt_phone=" + document.vicidial_form.alt_phone.value +
  4100. "&email=" + document.vicidial_form.email.value +
  4101. "&security_phrase=" + document.vicidial_form.security_phrase.value +
  4102. "&comments=" + document.vicidial_form.comments.value +
  4103. "&user=" + user +
  4104. "&pass=" + pass +
  4105. "&campaign=" + campaign +
  4106. "&phone_login=" + phone_login +
  4107. "&phone_pass=" + phone_pass +
  4108. "&fronter=" + fronter +
  4109. "&closer=" + user +
  4110. "&group=" + group +
  4111. "&channel_group=" + group +
  4112. "&SQLdate=" + SQLdate +
  4113. "&epoch=" + UnixTime +
  4114. "&uniqueid=" + document.vicidial_form.uniqueid.value +
  4115. "&customer_zap_channel=" + lastcustchannel +
  4116. "&customer_server_ip=" + lastcustserverip +
  4117. "&server_ip=" + server_ip +
  4118. "&SIPexten=" + extension +
  4119. "&session_id=" + session_id +
  4120. "&phone=" + document.vicidial_form.phone_number.value +
  4121. "&parked_by=" + document.vicidial_form.lead_id.value +
  4122. "&dispo=" + LeaDDispO + '' +
  4123. "&dialed_number=" + dialed_number + '' +
  4124. "&dialed_label=" + dialed_label + '' +
  4125. "&source_id=" + source_id + '' +
  4126. webform_session;
  4127. var regWFspace = new RegExp(" ","ig");
  4128. web_form_vars = web_form_vars.replace(regWF, '');
  4129. var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig");
  4130. web_form_vars = web_form_vars.replace(regWFspace, '+');
  4131. web_form_vars = web_form_vars.replace(regWF, '');
  4132. var regWFAvars = new RegExp("\\?","ig");
  4133. if (VDIC_web_form_address.match(regWFAvars))
  4134. {web_form_vars = '&' + web_form_vars}
  4135. else
  4136. {web_form_vars = '?' + web_form_vars}
  4137. TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars;
  4138. }
  4139. document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH();\"><IMG SRC=\"../agc/images/vdc_LB_webform_es.gif\" border=0 alt=\"Formulario Web\"></a>\n";
  4140. if (LeaDPreVDispO == 'CALLBK')
  4141. {
  4142. document.getElementById("CusTInfOSpaN").innerHTML = " <B> PREVIOUS LLAMADABACK </B>";
  4143. document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor;
  4144. document.getElementById("CBcommentsBoxA").innerHTML = "<b>Llamada Pasada:</b>" + CBentry_time;
  4145. document.getElementById("CBcommentsBoxB").innerHTML = "<b>Servicio repetido:</b>" + CBcallback_time;
  4146. document.getElementById("CBcommentsBoxC").innerHTML = "<b>Agente:</b>" + CBuser;
  4147. document.getElementById("CBcommentsBoxD").innerHTML = "<b>Comentarios:</b><br>" + CBcomments;
  4148. showDiv('CBcommentsBox');
  4149. }
  4150. if (document.vicidial_form.LeadPreview.checked==false)
  4151. {
  4152. reselect_preview_dial = 0;
  4153. MD_channel_look=1;
  4154. custchannellive=1;
  4155. document.getElementById("HangupControl").innerHTML = "<a href=\"#\" onclick=\"dialedcall_send_hangup();\"><IMG SRC=\"../agc/images/vdc_LB_hangupcustomer_es.gif\" border=0 alt=\"Colgar al Cliente\"></a>";
  4156. if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') )
  4157. {all_record = 'YES';}
  4158. if ( (view_scripts == 1) && (campaign_script.length > 0) )
  4159. {
  4160. // test code for scripts output
  4161. URLDecode(scriptnames[campaign_script],'NO');
  4162. var textname = decoded;
  4163. URLDecode(scripttexts[campaign_script],'YES');
  4164. var texttext = decoded;
  4165. var regWFplus = new RegExp("\\+","ig");
  4166. textname = textname.replace(regWFplus, ' ');
  4167. texttext = texttext.replace(regWFplus, ' ');
  4168. var testscript = "<B>" + textname + "</B>\n\n<BR><BR>\n\n" + texttext;
  4169. document.getElementById("ScriptContents").innerHTML = testscript;
  4170. }
  4171. if (get_call_launch == 'SCRIPT')
  4172. {
  4173. ScriptPanelToFront();
  4174. }
  4175. if (get_call_launch == 'WEBFORM')
  4176. {
  4177. window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
  4178. }
  4179. }
  4180. else
  4181. {
  4182. reselect_preview_dial = 1;
  4183. }
  4184. }
  4185. }
  4186. }
  4187. delete xmlhttp;
  4188. if (document.vicidial_form.LeadPreview.checked==false)
  4189. {
  4190. active_group_alias='';
  4191. cid_choice='';
  4192. prefix_choice='';
  4193. agent_dialed_number='';
  4194. agent_dialed_type='';
  4195. }
  4196. }
  4197. }
  4198. // ################################################################################
  4199. // Send the Manual Dial Skip
  4200. function ManualDialSkip()
  4201. {
  4202. if (manual_dial_in_progress==1)
  4203. {
  4204. alert('USTED NO PUEDE SALTAR Un SERVICIO REPETIDO O DIAL MANUAL, USTED DEBE MARCAR EL PLOMO');
  4205. }
  4206. else
  4207. {
  4208. if (dial_method == "INBOUND_MAN")
  4209. {
  4210. auto_dial_level=starting_dial_level;
  4211. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF_es.gif\" border=0 alt=\"Comienzo\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF_es.gif\" border=0 alt=\"Marcar el Siguiente Número\">";
  4212. }
  4213. else
  4214. {
  4215. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF_es.gif\" border=0 alt=\"Marcar el Siguiente Número\">";
  4216. }
  4217. var xmlhttp=false;
  4218. /*@cc_on @*/
  4219. /*@if (@_jscript_version >= 5)
  4220. // JScript gives us Conditional compilation, we can cope with old IE versions.
  4221. // and security blocked creation of the objects.
  4222. try {
  4223. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  4224. } catch (e) {
  4225. try {
  4226. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  4227. } catch (E) {
  4228. xmlhttp = false;
  4229. }
  4230. }
  4231. @end @*/
  4232. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  4233. {
  4234. xmlhttp = new XMLHttpRequest();
  4235. }
  4236. if (xmlhttp)
  4237. {
  4238. manDiaLskip_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLskip&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&stage=" + previous_dispo + "&called_count=" + previous_called_count;
  4239. xmlhttp.open('POST', 'vdc_db_query.php');
  4240. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  4241. xmlhttp.send(manDiaLskip_query);
  4242. xmlhttp.onreadystatechange = function()
  4243. {
  4244. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  4245. {
  4246. var MDSnextResponse = null;
  4247. // alert(manDiaLskip_query);
  4248. // alert(xmlhttp.responseText);
  4249. MDSnextResponse = xmlhttp.responseText;
  4250. var MDSnextResponse_array=MDSnextResponse.split("\n");
  4251. MDSnextCID = MDSnextResponse_array[0];
  4252. if (MDSnextCID == "LEAD NOT REVERTED")
  4253. {
  4254. alert("El Lead no fue invertido, hubo un error:\n" + MDSnextResponse);
  4255. }
  4256. else
  4257. {
  4258. document.vicidial_form.lead_id.value ='';
  4259. document.vicidial_form.vendor_lead_code.value='';
  4260. document.vicidial_form.list_id.value ='';
  4261. document.vicidial_form.gmt_offset_now.value ='';
  4262. document.vicidial_form.phone_code.value ='';
  4263. if (disable_alter_custphone=='Y')
  4264. {
  4265. var tmp_pn = document.getElementById("phone_numberDISP");
  4266. tmp_pn.innerHTML = ' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
  4267. }
  4268. document.vicidial_form.phone_number.value = '';
  4269. document.vicidial_form.title.value ='';
  4270. document.vicidial_form.first_name.value ='';
  4271. document.vicidial_form.middle_initial.value ='';
  4272. document.vicidial_form.last_name.value ='';
  4273. document.vicidial_form.address1.value ='';
  4274. document.vicidial_form.address2.value ='';
  4275. document.vicidial_form.address3.value ='';
  4276. document.vicidial_form.city.value ='';
  4277. document.vicidial_form.state.value ='';
  4278. document.vicidial_form.province.value ='';
  4279. document.vicidial_form.postal_code.value ='';
  4280. document.vicidial_form.country_code.value ='';
  4281. document.vicidial_form.gender.value ='';
  4282. document.vicidial_form.date_of_birth.value ='';
  4283. document.vicidial_form.alt_phone.value ='';
  4284. document.vicidial_form.email.value ='';
  4285. document.vicidial_form.security_phrase.value='';
  4286. document.vicidial_form.comments.value ='';
  4287. document.vicidial_form.called_count.value ='';
  4288. VDCL_group_id = '';
  4289. fronter = '';
  4290. previous_called_count = '';
  4291. previous_dispo = '';
  4292. custchannellive=1;
  4293. document.getElementById("MainStatuSSpan").innerHTML = " Lead skipped, go en to next lead";
  4294. if (dial_method == "INBOUND_MAN")
  4295. {
  4296. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume_es.gif\" border=0 alt=\"Comienzo\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  4297. }
  4298. else
  4299. {
  4300. document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  4301. }
  4302. }
  4303. }
  4304. }
  4305. delete xmlhttp;
  4306. active_group_alias='';
  4307. cid_choice='';
  4308. prefix_choice='';
  4309. agent_dialed_number='';
  4310. agent_dialed_type='';
  4311. }
  4312. }
  4313. }
  4314. // ################################################################################
  4315. // Send the Manual Dial Only - dial the previewed lead
  4316. function ManualDialOnly(taskaltnum)
  4317. {
  4318. inOUT = 'OUT';
  4319. alt_dial_status_display = 0;
  4320. all_record = 'NO';
  4321. all_record_count=0;
  4322. var usegroupalias=0;
  4323. if (taskaltnum == 'ALTTeléfonoE')
  4324. {
  4325. var manDiaLonly_num = document.vicidial_form.alt_phone.value;
  4326. lead_dial_number = document.vicidial_form.alt_phone.value;
  4327. dialed_number = lead_dial_number;
  4328. dialed_label = 'ALT';
  4329. WebFormRefresH('');
  4330. }
  4331. else
  4332. {
  4333. if (taskaltnum == 'AddresS3')
  4334. {
  4335. var manDiaLonly_num = document.vicidial_form.address3.value;
  4336. lead_dial_number = document.vicidial_form.address3.value;
  4337. dialed_number = lead_dial_number;
  4338. dialed_label = 'ADDR3';
  4339. WebFormRefresH('');
  4340. }
  4341. else
  4342. {
  4343. var manDiaLonly_num = document.vicidial_form.phone_number.value;
  4344. lead_dial_number = document.vicidial_form.phone_number.value;
  4345. dialed_number = lead_dial_number;
  4346. dialed_label = 'MAIN';
  4347. WebFormRefresH('');
  4348. }
  4349. }
  4350. if (dialed_label == 'ALT')
  4351. {document.getElementById("CusTInfOSpaN").innerHTML = " <B> ALT DIAL NÚMERO: ALT </B>";}
  4352. if (dialed_label == 'ADDR3')
  4353. {document.getElementById("CusTInfOSpaN").innerHTML = " <B> ALT DIAL NÚMERO: DIRECCIÓN3 </B>";}
  4354. var REGalt_dial = new RegExp("X","g");
  4355. if (dialed_label.match(REGalt_dial))
  4356. {
  4357. document.getElementById("CusTInfOSpaN").innerHTML = " <B> ALT DIAL NÚMERO: " + dialed_label + "</B>";
  4358. document.getElementById("EAcommentsBoxA").innerHTML = "<b>Código y número de teléfono: </b>" + EAphone_code + " " + EAphone_number;
  4359. var EAactive_link = '';
  4360. if (EAalt_phone_active == 'Y')
  4361. {EAactive_link = "<a href=\"#\" onclick=\"alt_phone_change('" + EAphone_number + "','" + EAalt_phone_count + "','" + document.vicidial_form.lead_id.value + "','N');\">Cambiar este número de teléfono a INACTIVAS</a>";}
  4362. else
  4363. {EAactive_link = "<a href=\"#\" onclick=\"alt_phone_change('" + EAphone_number + "','" + EAalt_phone_count + "','" + document.vicidial_form.lead_id.value + "','Y');\">Cambiar este número de teléfono a ACTIVO</a>";}
  4364. document.getElementById("EAcommentsBoxB").innerHTML = "<b>Activo:</b>" + EAalt_phone_active + "<BR>" + EAactive_link;
  4365. document.getElementById("EAcommentsBoxC").innerHTML = "<b>Alt Cuenta:</b>" + EAalt_phone_count;
  4366. document.getElementById("EAcommentsBoxD").innerHTML = "<b>Notas:</b><br>" + EAalt_phone_notes;
  4367. showDiv('EAcommentsBox');
  4368. }
  4369. var xmlhttp=false;
  4370. /*@cc_on @*/
  4371. /*@if (@_jscript_version >= 5)
  4372. // JScript gives us Conditional compilation, we can cope with old IE versions.
  4373. // and security blocked creation of the objects.
  4374. try {
  4375. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  4376. } catch (e) {
  4377. try {
  4378. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  4379. } catch (E) {
  4380. xmlhttp = false;
  4381. }
  4382. }
  4383. @end @*/
  4384. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  4385. {
  4386. xmlhttp = new XMLHttpRequest();
  4387. }
  4388. if (xmlhttp)
  4389. {
  4390. if (cid_choice.length > 3)
  4391. {
  4392. var call_cid = cid_choice;
  4393. usegroupalias=1;
  4394. }
  4395. else
  4396. {var call_cid = campaign_cid;}
  4397. if (prefix_choice.length > 0)
  4398. {var call_prefix = prefix_choice;}
  4399. else
  4400. {var call_prefix = dial_prefix;}
  4401. manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + agent_dialed_number + "&agent_dialed_type=" + agent_dialed_type;
  4402. xmlhttp.open('POST', 'vdc_db_query.php');
  4403. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  4404. xmlhttp.send(manDiaLonly_query);
  4405. xmlhttp.onreadystatechange = function()
  4406. {
  4407. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  4408. {
  4409. var MDOnextResponse = null;
  4410. // alert(manDiaLonly_query);
  4411. // alert(xmlhttp.responseText);
  4412. MDOnextResponse = xmlhttp.responseText;
  4413. var MDOnextResponse_array=MDOnextResponse.split("\n");
  4414. MDnextCID = MDOnextResponse_array[0];
  4415. if (MDnextCID == " LLAMADA NOT PLACED")
  4416. {
  4417. alert("la llamada no fue atendida, hubo un error:\n" + MDOnextResponse);
  4418. }
  4419. else
  4420. {
  4421. LasTCID = MDOnextResponse_array[0];
  4422. MD_channel_look=1;
  4423. custchannellive=1;
  4424. var dispnum = manDiaLonly_num;
  4425. var status_display_number = phone_number_format(dispnum);
  4426. if (alt_dial_status_display=='0')
  4427. {
  4428. document.getElementById("MainStatuSSpan").innerHTML = " Llamando: " + status_display_number + " UID: " + MDnextCID + " &nbsp; Espeerar al Ring...";
  4429. document.getElementById("HangupControl").innerHTML = "<a href=\"#\" onclick=\"dialedcall_send_hangup();\"><IMG SRC=\"../agc/images/vdc_LB_hangupcustomer_es.gif\" border=0 alt=\"Colgar al Cliente\"></a>";
  4430. }
  4431. if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') )
  4432. {all_record = 'YES';}
  4433. if ( (view_scripts == 1) && (campaign_script.length > 0) )
  4434. {
  4435. // test code for scripts output
  4436. URLDecode(scriptnames[campaign_script],'NO');
  4437. var textname = decoded;
  4438. URLDecode(scripttexts[campaign_script],'YES');
  4439. var texttext = decoded;
  4440. var regWFplus = new RegExp("\\+","ig");
  4441. textname = textname.replace(regWFplus, ' ');
  4442. texttext = texttext.replace(regWFplus, ' ');
  4443. var testscript = "<B>" + textname + "</B>\n\n<BR><BR>\n\n" + texttext;
  4444. document.getElementById("ScriptContents").innerHTML = testscript;
  4445. }
  4446. if (get_call_launch == 'SCRIPT')
  4447. {
  4448. ScriptPanelToFront();
  4449. }
  4450. if (get_call_launch == 'WEBFORM')
  4451. {
  4452. window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
  4453. }
  4454. }
  4455. }
  4456. }
  4457. delete xmlhttp;
  4458. active_group_alias='';
  4459. cid_choice='';
  4460. prefix_choice='';
  4461. agent_dialed_number='';
  4462. agent_dialed_type='';
  4463. }
  4464. }
  4465. // ################################################################################
  4466. // Set the client to READY and start looking for calls (VDADready, VDADpause)
  4467. function AutoDial_ReSume_PauSe(taskaction,taskagentlog,taskwrapup)
  4468. {
  4469. if (taskaction == 'VDADready')
  4470. {
  4471. var VDRP_stage = 'READY';
  4472. if (INgroupCOUNT > 0)
  4473. {
  4474. if (VICIDiaL_closer_blended == 0)
  4475. {VDRP_stage = 'CLOSER';}
  4476. else
  4477. {VDRP_stage = 'READY';}
  4478. }
  4479. AutoDialReady = 1;
  4480. AutoDialWaiting = 1;
  4481. if (dial_method == "INBOUND_MAN")
  4482. {
  4483. auto_dial_level=starting_dial_level;
  4484. document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADpause');\"><IMG SRC=\"../agc/images/vdc_LB_pause_es.gif\" border=0 alt=\" Pausa \"></a><IMG SRC=\"../agc/images/vdc_LB_resume_OFF_es.gif\" border=0 alt=\"Comienzo\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  4485. }
  4486. else
  4487. {
  4488. document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
  4489. }
  4490. }
  4491. else
  4492. {
  4493. var VDRP_stage = 'PAUSED';
  4494. AutoDialReady = 0;
  4495. AutoDialWaiting = 0;
  4496. if (dial_method == "INBOUND_MAN")
  4497. {
  4498. auto_dial_level=starting_dial_level;
  4499. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume_es.gif\" border=0 alt=\"Comienzo\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  4500. }
  4501. else
  4502. {
  4503. document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
  4504. }
  4505. if (agent_pause_codes_active=='FORCE')
  4506. {
  4507. PauseCodeSelectContent_create();
  4508. }
  4509. }
  4510. var xmlhttp=false;
  4511. /*@cc_on @*/
  4512. /*@if (@_jscript_version >= 5)
  4513. // JScript gives us Conditional compilation, we can cope with old IE versions.
  4514. // and security blocked creation of the objects.
  4515. try {
  4516. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  4517. } catch (e) {
  4518. try {
  4519. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  4520. } catch (E) {
  4521. xmlhttp = false;
  4522. }
  4523. }
  4524. @end @*/
  4525. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  4526. {
  4527. xmlhttp = new XMLHttpRequest();
  4528. }
  4529. if (xmlhttp)
  4530. {
  4531. autoDiaLready_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=" + taskaction + "&user=" + user + "&pass=" + pass + "&stage=" + VDRP_stage + "&agent_log_id=" + agent_log_id + "&agent_log=" + taskagentlog + "&wrapup=" + taskwrapup + "&campaign=" + campaign;
  4532. xmlhttp.open('POST', 'vdc_db_query.php');
  4533. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  4534. xmlhttp.send(autoDiaLready_query);
  4535. xmlhttp.onreadystatechange = function()
  4536. {
  4537. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  4538. {
  4539. var check_dispo = null;
  4540. check_dispo = xmlhttp.responseText;
  4541. var check_DS_array=check_dispo.split("\n");
  4542. // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|");
  4543. if (check_DS_array[1] == 'Next agent_log_id:')
  4544. {
  4545. agent_log_id = check_DS_array[2];
  4546. }
  4547. }
  4548. }
  4549. delete xmlhttp;
  4550. }
  4551. }
  4552. // ################################################################################
  4553. // Check to see if there is a call being sent from the auto-dialer to agent conf
  4554. function ReChecKCustoMerChaN()
  4555. {
  4556. var xmlhttp=false;
  4557. /*@cc_on @*/
  4558. /*@if (@_jscript_version >= 5)
  4559. // JScript gives us Conditional compilation, we can cope with old IE versions.
  4560. // and security blocked creation of the objects.
  4561. try {
  4562. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  4563. } catch (e) {
  4564. try {
  4565. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  4566. } catch (E) {
  4567. xmlhttp = false;
  4568. }
  4569. }
  4570. @end @*/
  4571. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  4572. {
  4573. xmlhttp = new XMLHttpRequest();
  4574. }
  4575. if (xmlhttp)
  4576. {
  4577. recheckVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADREcheckINCOMING" + "&agent_log_id=" + agent_log_id + "&lead_id=" + document.vicidial_form.lead_id.value;
  4578. xmlhttp.open('POST', 'vdc_db_query.php');
  4579. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  4580. xmlhttp.send(recheckVDAI_query);
  4581. xmlhttp.onreadystatechange = function()
  4582. {
  4583. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  4584. {
  4585. var recheck_incoming = null;
  4586. recheck_incoming = xmlhttp.responseText;
  4587. // alert(xmlhttp.responseText);
  4588. var recheck_VDIC_array=recheck_incoming.split("\n");
  4589. if (recheck_VDIC_array[0] == '1')
  4590. {
  4591. var reVDIC_data_VDAC=recheck_VDIC_array[1].split("|");
  4592. if (reVDIC_data_VDAC[3] == lastcustchannel)
  4593. {
  4594. // do nothing
  4595. }
  4596. else
  4597. {
  4598. // alert("Canal has changed from:\n" + lastcustchannel + '|' + lastcustserverip + "\nto:\n" + reVDIC_data_VDAC[3] + '|' + reVDIC_data_VDAC[4]);
  4599. document.vicidial_form.callchannel.value = reVDIC_data_VDAC[3];
  4600. lastcustchannel = reVDIC_data_VDAC[3];
  4601. document.vicidial_form.callserverip.value = reVDIC_data_VDAC[4];
  4602. lastcustserverip = reVDIC_data_VDAC[4];
  4603. custchannellive = 1;
  4604. }
  4605. }
  4606. }
  4607. }
  4608. delete xmlhttp;
  4609. }
  4610. }
  4611. // ################################################################################
  4612. // Check to see if there is a call being sent from the auto-dialer to agent conf
  4613. function alt_phone_change(APCphone,APCcount,APCleadID,APCactive)
  4614. {
  4615. var EAactive_link = '';
  4616. if (APCactive == 'Y')
  4617. {EAactive_link = "<a href=\"#\" onclick=\"alt_phone_change('" + EAphone_number + "','" + EAalt_phone_count + "','" + document.vicidial_form.lead_id.value + "','N');\">Cambiar este número de teléfono a INACTIVAS</a>";}
  4618. else
  4619. {EAactive_link = "<a href=\"#\" onclick=\"alt_phone_change('" + EAphone_number + "','" + EAalt_phone_count + "','" + document.vicidial_form.lead_id.value + "','Y');\">Cambiar este número de teléfono a ACTIVO</a>";}
  4620. document.getElementById("EAcommentsBoxB").innerHTML = "<b>Activo:</b>" + EAalt_phone_active + "<BR>" + EAactive_link;
  4621. var xmlhttp=false;
  4622. /*@cc_on @*/
  4623. /*@if (@_jscript_version >= 5)
  4624. // JScript gives us Conditional compilation, we can cope with old IE versions.
  4625. // and security blocked creation of the objects.
  4626. try {
  4627. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  4628. } catch (e) {
  4629. try {
  4630. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  4631. } catch (E) {
  4632. xmlhttp = false;
  4633. }
  4634. }
  4635. @end @*/
  4636. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  4637. {
  4638. xmlhttp = new XMLHttpRequest();
  4639. }
  4640. if (xmlhttp)
  4641. {
  4642. APC_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=alt_phone_change" + "&phone_number=" + APCphone + "&lead_id=" + APCleadID + "&called_count=" + APCcount + "&stage=" + APCactive;
  4643. xmlhttp.open('POST', 'vdc_db_query.php');
  4644. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  4645. xmlhttp.send(APC_query);
  4646. xmlhttp.onreadystatechange = function()
  4647. {
  4648. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  4649. {
  4650. // alert(xmlhttp.responseText);
  4651. }
  4652. }
  4653. delete xmlhttp;
  4654. }
  4655. }
  4656. // ################################################################################
  4657. // Check to see if there is a call being sent from the auto-dialer to agent conf
  4658. function check_for_auto_incoming()
  4659. {
  4660. if (typeof(xmlhttprequestcheckauto) == "undefined")
  4661. {
  4662. all_record = 'NO';
  4663. all_record_count=0;
  4664. document.vicidial_form.lead_id.value = '';
  4665. var xmlhttprequestcheckauto=false;
  4666. /*@cc_on @*/
  4667. /*@if (@_jscript_version >= 5)
  4668. // JScript gives us Conditional compilation, we can cope with old IE versions.
  4669. // and security blocked creation of the objects.
  4670. try {
  4671. xmlhttprequestcheckauto = new ActiveXObject("Msxml2.XMLHTTP");
  4672. } catch (e) {
  4673. try {
  4674. xmlhttprequestcheckauto = new ActiveXObject("Microsoft.XMLHTTP");
  4675. } catch (E) {
  4676. xmlhttprequestcheckauto = false;
  4677. }
  4678. }
  4679. @end @*/
  4680. if (!xmlhttprequestcheckauto && typeof XMLHttpRequest!='undefined')
  4681. {
  4682. xmlhttprequestcheckauto = new XMLHttpRequest();
  4683. }
  4684. if (xmlhttprequestcheckauto)
  4685. {
  4686. checkVDAI_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&ACTION=VDADcheckINCOMING" + "&agent_log_id=" + agent_log_id;
  4687. xmlhttprequestcheckauto.open('POST', 'vdc_db_query.php');
  4688. xmlhttprequestcheckauto.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  4689. xmlhttprequestcheckauto.send(checkVDAI_query);
  4690. xmlhttprequestcheckauto.onreadystatechange = function()
  4691. {
  4692. if (xmlhttprequestcheckauto.readyState == 4 && xmlhttprequestcheckauto.status == 200)
  4693. {
  4694. var check_incoming = null;
  4695. check_incoming = xmlhttprequestcheckauto.responseText;
  4696. // alert(checkVDAI_query);
  4697. // alert(xmlhttprequestcheckauto.responseText);
  4698. var check_VDIC_array=check_incoming.split("\n");
  4699. if (check_VDIC_array[0] == '1')
  4700. {
  4701. // alert(xmlhttprequestcheckauto.responseText);
  4702. AutoDialWaiting = 0;
  4703. var VDIC_data_VDAC=check_VDIC_array[1].split("|");
  4704. VDIC_web_form_address = VICIDiaL_web_form_address
  4705. var VDIC_fronter='';
  4706. var VDIC_data_VDIG=check_VDIC_array[2].split("|");
  4707. if (VDIC_data_VDIG[0].length > 5)
  4708. {VDIC_web_form_address = VDIC_data_VDIG[0];}
  4709. var VDCL_group_name = VDIC_data_VDIG[1];
  4710. var VDCL_group_color = VDIC_data_VDIG[2];
  4711. var VDCL_fronter_display = VDIC_data_VDIG[3];
  4712. VDCL_group_id = VDIC_data_VDIG[4];
  4713. CalL_ScripT_id = VDIC_data_VDIG[5];
  4714. CalL_AutO_LauncH = VDIC_data_VDIG[6];
  4715. CalL_XC_a_Dtmf = VDIC_data_VDIG[7];
  4716. CalL_XC_a_NuMber = VDIC_data_VDIG[8];
  4717. CalL_XC_b_Dtmf = VDIC_data_VDIG[9];
  4718. CalL_XC_b_NuMber = VDIC_data_VDIG[10];
  4719. if (VDIC_data_VDIG[11].length > 0)
  4720. {LIVE_default_xfer_group = VDIC_data_VDIG[11];}
  4721. else
  4722. {LIVE_default_xfer_group = default_xfer_group;}
  4723. if ( (VDIC_data_VDIG[12].length > 1) && (VDIC_data_VDIG[12]!='DISABLED') )
  4724. {LIVE_campaign_recording = VDIC_data_VDIG[12];}
  4725. else
  4726. {LIVE_campaign_recording = campaign_recording;}
  4727. if ( (VDIC_data_VDIG[13].length > 1) && (VDIC_data_VDIG[13]!='NONE') )
  4728. {LIVE_campaign_rec_filename = VDIC_data_VDIG[13];}
  4729. else
  4730. {LIVE_campaign_rec_filename = campaign_rec_filename;}
  4731. if ( (VDIC_data_VDIG[14].length > 1) && (VDIC_data_VDIG[14]!='NONE') )
  4732. {LIVE_default_group_alias = VDIC_data_VDIG[14];}
  4733. else
  4734. {LIVE_default_group_alias = default_group_alias;}
  4735. if ( (VDIC_data_VDIG[15].length > 1) && (VDIC_data_VDIG[15]!='NONE') )
  4736. {LIVE_caller_id_number = VDIC_data_VDIG[15];}
  4737. else
  4738. {LIVE_caller_id_number = default_group_alias_cid;}
  4739. if (VDIC_data_VDIG[16].length > 0)
  4740. {LIVE_web_vars = VDIC_data_VDIG[16];}
  4741. else
  4742. {LIVE_web_vars = default_web_vars;}
  4743. var VDIC_data_VDFR=check_VDIC_array[3].split("|");
  4744. if ( (VDIC_data_VDFR[1].length > 1) && (VDCL_fronter_display == 'Y') )
  4745. {VDIC_fronter = " Fronter: " + VDIC_data_VDFR[0] + " - " + VDIC_data_VDFR[1];}
  4746. document.vicidial_form.lead_id.value = VDIC_data_VDAC[0];
  4747. document.vicidial_form.uniqueid.value = VDIC_data_VDAC[1];
  4748. CIDcheck = VDIC_data_VDAC[2];
  4749. CalLCID = VDIC_data_VDAC[2];
  4750. document.vicidial_form.callchannel.value = VDIC_data_VDAC[3];
  4751. lastcustchannel = VDIC_data_VDAC[3];
  4752. document.vicidial_form.callserverip.value = VDIC_data_VDAC[4];
  4753. lastcustserverip = VDIC_data_VDAC[4];
  4754. if( document.images ) { document.images['livecall'].src = image_livecall_ON.src;}
  4755. document.vicidial_form.SecondS.value = 0;
  4756. document.getElementById("SecondSDISP").innerHTML = '0';
  4757. VD_live_customer_call = 1;
  4758. VD_live_call_secondS = 0;
  4759. // INSERT VICIDIAL_LOG ENTRY FOR THIS LLAMADA PROCESS
  4760. // DialLog("start");
  4761. custchannellive=1;
  4762. LasTCID = check_VDIC_array[4];
  4763. LeaDPreVDispO = check_VDIC_array[6];
  4764. fronter = check_VDIC_array[7];
  4765. document.vicidial_form.vendor_lead_code.value = check_VDIC_array[8];
  4766. document.vicidial_form.list_id.value = check_VDIC_array[9];
  4767. document.vicidial_form.gmt_offset_now.value = check_VDIC_array[10];
  4768. document.vicidial_form.phone_code.value = check_VDIC_array[11];
  4769. if (disable_alter_custphone=='Y')
  4770. {
  4771. var tmp_pn = document.getElementById("phone_numberDISP");
  4772. tmp_pn.innerHTML = check_VDIC_array[12];
  4773. }
  4774. document.vicidial_form.phone_number.value = check_VDIC_array[12];
  4775. document.vicidial_form.title.value = check_VDIC_array[13];
  4776. document.vicidial_form.first_name.value = check_VDIC_array[14];
  4777. document.vicidial_form.middle_initial.value = check_VDIC_array[15];
  4778. document.vicidial_form.last_name.value = check_VDIC_array[16];
  4779. document.vicidial_form.address1.value = check_VDIC_array[17];
  4780. document.vicidial_form.address2.value = check_VDIC_array[18];
  4781. document.vicidial_form.address3.value = check_VDIC_array[19];
  4782. document.vicidial_form.city.value = check_VDIC_array[20];
  4783. document.vicidial_form.state.value = check_VDIC_array[21];
  4784. document.vicidial_form.province.value = check_VDIC_array[22];
  4785. document.vicidial_form.postal_code.value = check_VDIC_array[23];
  4786. document.vicidial_form.country_code.value = check_VDIC_array[24];
  4787. document.vicidial_form.gender.value = check_VDIC_array[25];
  4788. document.vicidial_form.date_of_birth.value = check_VDIC_array[26];
  4789. document.vicidial_form.alt_phone.value = check_VDIC_array[27];
  4790. document.vicidial_form.email.value = check_VDIC_array[28];
  4791. document.vicidial_form.security_phrase.value = check_VDIC_array[29];
  4792. var REGcommentsNL = new RegExp("!N","g");
  4793. check_VDIC_array[30] = check_VDIC_array[30].replace(REGcommentsNL, "\n");
  4794. document.vicidial_form.comments.value = check_VDIC_array[30];
  4795. document.vicidial_form.called_count.value = check_VDIC_array[31];
  4796. CBentry_time = check_VDIC_array[32];
  4797. CBcallback_time = check_VDIC_array[33];
  4798. CBuser = check_VDIC_array[34];
  4799. CBcomments = check_VDIC_array[35];
  4800. dialed_number = check_VDIC_array[36];
  4801. dialed_label = check_VDIC_array[37];
  4802. source_id = check_VDIC_array[38];
  4803. EAphone_code = check_VDIC_array[39];
  4804. EAphone_number = check_VDIC_array[40];
  4805. EAalt_phone_notes = check_VDIC_array[41];
  4806. EAalt_phone_active = check_VDIC_array[42];
  4807. EAalt_phone_count = check_VDIC_array[43];
  4808. var gIndex = 0;
  4809. if (document.vicidial_form.gender.value == 'M') {var gIndex = 1;}
  4810. if (document.vicidial_form.gender.value == 'F') {var gIndex = 2;}
  4811. document.getElementById("gender_list").selectedIndex = gIndex;
  4812. lead_dial_number = document.vicidial_form.phone_number.value;
  4813. var dispnum = document.vicidial_form.phone_number.value;
  4814. var status_display_number = phone_number_format(dispnum);
  4815. var callnum = dialed_number;
  4816. var dial_display_number = phone_number_format(callnum);
  4817. document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + dial_display_number + " UID: " + CIDcheck + " &nbsp; " + VDIC_fronter;
  4818. if (LeaDPreVDispO == 'CALLBK')
  4819. {
  4820. document.getElementById("CusTInfOSpaN").innerHTML = " <B> PREVIOUS LLAMADABACK </B>";
  4821. document.getElementById("CusTInfOSpaN").style.background = CusTCB_bgcolor;
  4822. document.getElementById("CBcommentsBoxA").innerHTML = "<b>Llamada Pasada:</b>" + CBentry_time;
  4823. document.getElementById("CBcommentsBoxB").innerHTML = "<b>Servicio repetido:</b>" + CBcallback_time;
  4824. document.getElementById("CBcommentsBoxC").innerHTML = "<b>Agente:</b>" + CBuser;
  4825. document.getElementById("CBcommentsBoxD").innerHTML = "<b>Comentarios:</b><br>" + CBcomments;
  4826. showDiv('CBcommentsBox');
  4827. }
  4828. if (dialed_label == 'ALT')
  4829. {document.getElementById("CusTInfOSpaN").innerHTML = " <B> ALT DIAL NÚMERO: ALT </B>";}
  4830. if (dialed_label == 'ADDR3')
  4831. {document.getElementById("CusTInfOSpaN").innerHTML = " <B> ALT DIAL NÚMERO: DIRECCIÓN3 </B>";}
  4832. var REGalt_dial = new RegExp("X","g");
  4833. if (dialed_label.match(REGalt_dial))
  4834. {
  4835. document.getElementById("CusTInfOSpaN").innerHTML = " <B> ALT DIAL NÚMERO: " + dialed_label + "</B>";
  4836. document.getElementById("EAcommentsBoxA").innerHTML = "<b>Código y número de teléfono: </b>" + EAphone_code + " " + EAphone_number;
  4837. var EAactive_link = '';
  4838. if (EAalt_phone_active == 'Y')
  4839. {EAactive_link = "<a href=\"#\" onclick=\"alt_phone_change('" + EAphone_number + "','" + EAalt_phone_count + "','" + document.vicidial_form.lead_id.value + "','N');\">Cambiar este número de teléfono a INACTIVAS</a>";}
  4840. else
  4841. {EAactive_link = "<a href=\"#\" onclick=\"alt_phone_change('" + EAphone_number + "','" + EAalt_phone_count + "','" + document.vicidial_form.lead_id.value + "','Y');\">Cambiar este número de teléfono a ACTIVO</a>";}
  4842. document.getElementById("EAcommentsBoxB").innerHTML = "<b>Activo:</b>" + EAalt_phone_active + "<BR>" + EAactive_link;
  4843. document.getElementById("EAcommentsBoxC").innerHTML = "<b>Alt Cuenta:</b>" + EAalt_phone_count;
  4844. document.getElementById("EAcommentsBoxD").innerHTML = "<b>Notas:</b>" + EAalt_phone_notes;
  4845. showDiv('EAcommentsBox');
  4846. }
  4847. if (VDIC_data_VDIG[1].length > 0)
  4848. {
  4849. inOUT = 'IN';
  4850. if (VDIC_data_VDIG[2].length > 2)
  4851. {
  4852. document.getElementById("MainStatuSSpan").style.background = VDIC_data_VDIG[2];
  4853. }
  4854. var dispnum = document.vicidial_form.phone_number.value;
  4855. var status_display_number = phone_number_format(dispnum);
  4856. document.getElementById("MainStatuSSpan").innerHTML = " Entrante: " + status_display_number + " Group- " + VDIC_data_VDIG[1] + " &nbsp; " + VDIC_fronter;
  4857. }
  4858. document.getElementById("ParkControl").innerHTML ="<a href=\"#\" onclick=\"mainxfer_send_redirect('ParK','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_LB_parkcall_es.gif\" border=0 alt=\"Aparcar llamada\"></a>";
  4859. document.getElementById("HangupControl").innerHTML = "<a href=\"#\" onclick=\"dialedcall_send_hangup();\"><IMG SRC=\"../agc/images/vdc_LB_hangupcustomer_es.gif\" border=0 alt=\"Colgar al Cliente\"></a>";
  4860. document.getElementById("XferControl").innerHTML = "<a href=\"#\" onclick=\"ShoWTransferMain('ON');\"><IMG SRC=\"../agc/images/vdc_LB_transferconf_es.gif\" border=0 alt=\"Transferencia - Conferencia\"></a>";
  4861. document.getElementById("LocalCloser").innerHTML = "<a href=\"#\" onclick=\"mainxfer_send_redirect('XfeRLOCAL','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_XB_localcloser_es.gif\" border=0 alt=\"CLOSER LOCAL\"></a>";
  4862. document.getElementById("DialBlindTransfer").innerHTML = "<a href=\"#\" onclick=\"mainxfer_send_redirect('XfeRBLIND','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_XB_blindtransfer_es.gif\" border=0 alt=\"Marcar Blind Transfer\"></a>";
  4863. document.getElementById("DialBlindVMail").innerHTML = "<a href=\"#\" onclick=\"mainxfer_send_redirect('XfeRVMAIL','" + lastcustchannel + "','" + lastcustserverip + "');return false;\"><IMG SRC=\"../agc/images/vdc_XB_ammessage.gif\" border=0 alt=\"Blind Transfer VMail Message\"></a>";
  4864. if (lastcustserverip == server_ip)
  4865. {
  4866. document.getElementById("VolumeUpSpan").innerHTML = "<a href=\"#\" onclick=\"volume_control('UP','" + lastcustchannel + "','');return false;\"><IMG SRC=\"../agc/images/vdc_volume_up.gif\" Border=0></a>";
  4867. document.getElementById("VolumeDownSpan").innerHTML = "<a href=\"#\" onclick=\"volume_control('DOWN','" + lastcustchannel + "','');return false;\"><IMG SRC=\"../agc/images/vdc_volume_down.gif\" Border=0></a>";
  4868. }
  4869. if (dial_method == "INBOUND_MAN")
  4870. {
  4871. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF_es.gif\" border=0 alt=\"Comienzo\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF_es.gif\" border=0 alt=\"Marcar el Siguiente Número\">";
  4872. }
  4873. else
  4874. {
  4875. document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF;
  4876. }
  4877. if (VDCL_group_id.length > 1)
  4878. {var group = VDCL_group_id;}
  4879. else
  4880. {var group = campaign;}
  4881. if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';}
  4882. var genderIndex = document.getElementById("gender_list").selectedIndex;
  4883. var genderValue = document.getElementById('gender_list').options[genderIndex].value;
  4884. document.vicidial_form.gender.value = genderValue;
  4885. var regWFAcustom = new RegExp("^VAR","ig");
  4886. if (VDIC_web_form_address.match(regWFAcustom))
  4887. {
  4888. URLDecode(VDIC_web_form_address,'YES');
  4889. TEMP_VDIC_web_form_address = decoded;
  4890. TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, '');
  4891. }
  4892. else
  4893. {
  4894. web_form_vars =
  4895. "lead_id=" + document.vicidial_form.lead_id.value +
  4896. "&vendor_id=" + document.vicidial_form.vendor_lead_code.value +
  4897. "&list_id=" + document.vicidial_form.list_id.value +
  4898. "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value +
  4899. "&phone_code=" + document.vicidial_form.phone_code.value +
  4900. "&phone_number=" + document.vicidial_form.phone_number.value +
  4901. "&title=" + document.vicidial_form.title.value +
  4902. "&first_name=" + document.vicidial_form.first_name.value +
  4903. "&middle_initial=" + document.vicidial_form.middle_initial.value +
  4904. "&last_name=" + document.vicidial_form.last_name.value +
  4905. "&address1=" + document.vicidial_form.address1.value +
  4906. "&address2=" + document.vicidial_form.address2.value +
  4907. "&address3=" + document.vicidial_form.address3.value +
  4908. "&city=" + document.vicidial_form.city.value +
  4909. "&state=" + document.vicidial_form.state.value +
  4910. "&province=" + document.vicidial_form.province.value +
  4911. "&postal_code=" + document.vicidial_form.postal_code.value +
  4912. "&country_code=" + document.vicidial_form.country_code.value +
  4913. "&gender=" + document.vicidial_form.gender.value +
  4914. "&date_of_birth=" + document.vicidial_form.date_of_birth.value +
  4915. "&alt_phone=" + document.vicidial_form.alt_phone.value +
  4916. "&email=" + document.vicidial_form.email.value +
  4917. "&security_phrase=" + document.vicidial_form.security_phrase.value +
  4918. "&comments=" + document.vicidial_form.comments.value +
  4919. "&user=" + user +
  4920. "&pass=" + pass +
  4921. "&campaign=" + campaign +
  4922. "&phone_login=" + phone_login +
  4923. "&phone_pass=" + phone_pass +
  4924. "&fronter=" + fronter +
  4925. "&closer=" + user +
  4926. "&group=" + group +
  4927. "&channel_group=" + group +
  4928. "&SQLdate=" + SQLdate +
  4929. "&epoch=" + UnixTime +
  4930. "&uniqueid=" + document.vicidial_form.uniqueid.value +
  4931. "&customer_zap_channel=" + lastcustchannel +
  4932. "&customer_server_ip=" + lastcustserverip +
  4933. "&server_ip=" + server_ip +
  4934. "&SIPexten=" + extension +
  4935. "&session_id=" + session_id +
  4936. "&phone=" + document.vicidial_form.phone_number.value +
  4937. "&parked_by=" + document.vicidial_form.lead_id.value +
  4938. "&dispo=" + LeaDDispO + '' +
  4939. "&dialed_number=" + dialed_number + '' +
  4940. "&dialed_label=" + dialed_label + '' +
  4941. "&source_id=" + source_id + '' +
  4942. webform_session;
  4943. var regWFspace = new RegExp(" ","ig");
  4944. web_form_vars = web_form_vars.replace(regWF, '');
  4945. var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig");
  4946. web_form_vars = web_form_vars.replace(regWFspace, '+');
  4947. web_form_vars = web_form_vars.replace(regWF, '');
  4948. var regWFAvars = new RegExp("\\?","ig");
  4949. if (VDIC_web_form_address.match(regWFAvars))
  4950. {web_form_vars = '&' + web_form_vars}
  4951. else
  4952. {web_form_vars = '?' + web_form_vars}
  4953. TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars;
  4954. }
  4955. document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH();\"><IMG SRC=\"../agc/images/vdc_LB_webform_es.gif\" border=0 alt=\"Formulario Web\"></a>\n";
  4956. if ( (LIVE_campaign_recording == 'ALLCALLS') || (LIVE_campaign_recording == 'ALLFORCE') )
  4957. {all_record = 'YES';}
  4958. if ( (view_scripts == 1) && (CalL_ScripT_id.length > 0) )
  4959. {
  4960. // test code for scripts output
  4961. URLDecode(scriptnames[CalL_ScripT_id],'NO');
  4962. var textname = decoded;
  4963. URLDecode(scripttexts[CalL_ScripT_id],'YES');
  4964. var texttext = decoded;
  4965. var regWFplus = new RegExp("\\+","ig");
  4966. textname = textname.replace(regWFplus, ' ');
  4967. texttext = texttext.replace(regWFplus, ' ');
  4968. var testscript = "<B>" + textname + "</B>\n\n<BR><BR>\n\n" + texttext;
  4969. document.getElementById("ScriptContents").innerHTML = testscript;
  4970. }
  4971. if (CalL_AutO_LauncH == 'SCRIPT')
  4972. {
  4973. ScriptPanelToFront();
  4974. }
  4975. if (CalL_AutO_LauncH == 'WEBFORM')
  4976. {
  4977. window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
  4978. }
  4979. if ( (CopY_tO_ClipboarD != 'NONE') && (useIE > 0) )
  4980. {
  4981. var tmp_clip = document.getElementById(CopY_tO_ClipboarD);
  4982. window.clipboardData.setData('Text', tmp_clip.value)
  4983. }
  4984. if (alert_enabled=='ON')
  4985. {
  4986. alert(" Entrante: " + status_display_number + "\n Group- " + VDIC_data_VDIG[1] + " &nbsp; " + VDIC_fronter);
  4987. }
  4988. }
  4989. else
  4990. {
  4991. // do nothing
  4992. }
  4993. xmlhttprequestcheckauto = undefined;
  4994. delete xmlhttprequestcheckauto;
  4995. }
  4996. }
  4997. }
  4998. }
  4999. }
  5000. // ################################################################################
  5001. // refresh the content of the web form URL
  5002. function WebFormRefresH(taskrefresh,submittask)
  5003. {
  5004. if (VDCL_group_id.length > 1)
  5005. {var group = VDCL_group_id;}
  5006. else
  5007. {var group = campaign;}
  5008. if ( (dialed_label.length < 2) || (dialed_label=='NONE') ) {dialed_label='MAIN';}
  5009. if (submittask != 'YES')
  5010. {
  5011. var genderIndex = document.getElementById("gender_list").selectedIndex;
  5012. var genderValue = document.getElementById('gender_list').options[genderIndex].value;
  5013. document.vicidial_form.gender.value = genderValue;
  5014. }
  5015. var regWFAcustom = new RegExp("^VAR","ig");
  5016. if (VDIC_web_form_address.match(regWFAcustom))
  5017. {
  5018. URLDecode(VDIC_web_form_address,'YES');
  5019. TEMP_VDIC_web_form_address = decoded;
  5020. TEMP_VDIC_web_form_address = TEMP_VDIC_web_form_address.replace(regWFAcustom, '');
  5021. }
  5022. else
  5023. {
  5024. web_form_vars =
  5025. "lead_id=" + document.vicidial_form.lead_id.value +
  5026. "&vendor_id=" + document.vicidial_form.vendor_lead_code.value +
  5027. "&list_id=" + document.vicidial_form.list_id.value +
  5028. "&gmt_offset_now=" + document.vicidial_form.gmt_offset_now.value +
  5029. "&phone_code=" + document.vicidial_form.phone_code.value +
  5030. "&phone_number=" + document.vicidial_form.phone_number.value +
  5031. "&title=" + document.vicidial_form.title.value +
  5032. "&first_name=" + document.vicidial_form.first_name.value +
  5033. "&middle_initial=" + document.vicidial_form.middle_initial.value +
  5034. "&last_name=" + document.vicidial_form.last_name.value +
  5035. "&address1=" + document.vicidial_form.address1.value +
  5036. "&address2=" + document.vicidial_form.address2.value +
  5037. "&address3=" + document.vicidial_form.address3.value +
  5038. "&city=" + document.vicidial_form.city.value +
  5039. "&state=" + document.vicidial_form.state.value +
  5040. "&province=" + document.vicidial_form.province.value +
  5041. "&postal_code=" + document.vicidial_form.postal_code.value +
  5042. "&country_code=" + document.vicidial_form.country_code.value +
  5043. "&gender=" + document.vicidial_form.gender.value +
  5044. "&date_of_birth=" + document.vicidial_form.date_of_birth.value +
  5045. "&alt_phone=" + document.vicidial_form.alt_phone.value +
  5046. "&email=" + document.vicidial_form.email.value +
  5047. "&security_phrase=" + document.vicidial_form.security_phrase.value +
  5048. "&comments=" + document.vicidial_form.comments.value +
  5049. "&user=" + user +
  5050. "&pass=" + pass +
  5051. "&campaign=" + campaign +
  5052. "&phone_login=" + phone_login +
  5053. "&phone_pass=" + phone_pass +
  5054. "&fronter=" + fronter +
  5055. "&closer=" + user +
  5056. "&group=" + group +
  5057. "&channel_group=" + group +
  5058. "&SQLdate=" + SQLdate +
  5059. "&epoch=" + UnixTime +
  5060. "&uniqueid=" + document.vicidial_form.uniqueid.value +
  5061. "&customer_zap_channel=" + lastcustchannel +
  5062. "&customer_server_ip=" + lastcustserverip +
  5063. "&server_ip=" + server_ip +
  5064. "&SIPexten=" + extension +
  5065. "&session_id=" + session_id +
  5066. "&phone=" + document.vicidial_form.phone_number.value +
  5067. "&parked_by=" + document.vicidial_form.lead_id.value +
  5068. "&dispo=" + LeaDDispO + '' +
  5069. "&dialed_number=" + dialed_number + '' +
  5070. "&dialed_label=" + dialed_label + '' +
  5071. "&source_id=" + source_id + '' +
  5072. webform_session;
  5073. var regWFspace = new RegExp(" ","ig");
  5074. web_form_vars = web_form_vars.replace(regWF, '');
  5075. var regWF = new RegExp("\\`|\\~|\\:|\\;|\\#|\\'|\\\"|\\{|\\}|\\(|\\)|\\*|\\^|\\%|\\$|\\!|\\%|\\r|\\t|\\n","ig");
  5076. web_form_vars = web_form_vars.replace(regWFspace, '+');
  5077. web_form_vars = web_form_vars.replace(regWF, '');
  5078. var regWFAvars = new RegExp("\\?","ig");
  5079. if (VDIC_web_form_address.match(regWFAvars))
  5080. {web_form_vars = '&' + web_form_vars}
  5081. else
  5082. {web_form_vars = '?' + web_form_vars}
  5083. TEMP_VDIC_web_form_address = VDIC_web_form_address + "" + web_form_vars;
  5084. }
  5085. if (taskrefresh == 'OUT')
  5086. {
  5087. document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOver=\"WebFormRefresH('IN');\"><IMG SRC=\"../agc/images/vdc_LB_webform_es.gif\" border=0 alt=\"Formulario Web\"></a>\n";
  5088. }
  5089. else
  5090. {
  5091. document.getElementById("WebFormSpan").innerHTML = "<a href=\"" + TEMP_VDIC_web_form_address + "\" target=\"" + web_form_target + "\" onMouseOut=\"WebFormRefresH('OUT');\"><IMG SRC=\"../agc/images/vdc_LB_webform_es.gif\" border=0 alt=\"Formulario Web\"></a>\n";
  5092. }
  5093. }
  5094. // ################################################################################
  5095. // Send hangup a second time from the dispo screen
  5096. function DispoHanguPAgaiN()
  5097. {
  5098. form_cust_channel = AgaiNHanguPChanneL;
  5099. document.vicidial_form.callchannel.value = AgaiNHanguPChanneL;
  5100. document.vicidial_form.callserverip.value = AgaiNHanguPServeR;
  5101. lastcustchannel = AgaiNHanguPChanneL;
  5102. lastcustserverip = AgaiNHanguPServeR;
  5103. VD_live_call_secondS = AgainCalLSecondS;
  5104. CalLCID = AgaiNCalLCID;
  5105. document.getElementById("DispoSelectHAspan").innerHTML = "";
  5106. dialedcall_send_hangup();
  5107. }
  5108. // ################################################################################
  5109. // Send leave 3way call a second time from the dispo screen
  5110. function DispoLeavE3wayAgaiN()
  5111. {
  5112. XDchannel = DispO3wayXtrAchannel;
  5113. document.vicidial_form.xfernumber.value = DispO3wayCalLxfernumber;
  5114. MDchannel = DispO3waychannel;
  5115. lastcustserverip = DispO3wayCalLserverip;
  5116. document.getElementById("DispoSelectHAspan").innerHTML = "";
  5117. leave_3way_call('SECOND');
  5118. DispO3waychannel = '';
  5119. DispO3wayXtrAchannel = '';
  5120. DispO3wayCalLserverip = '';
  5121. DispO3wayCalLxfernumber = '';
  5122. DispO3wayCalLcamptail = '';
  5123. }
  5124. // ################################################################################
  5125. // Start Hangup Functions for both
  5126. function bothcall_send_hangup()
  5127. {
  5128. if (lastcustchannel.length > 3)
  5129. {dialedcall_send_hangup();}
  5130. if (lastxferchannel.length > 3)
  5131. {xfercall_send_hangup();}
  5132. }
  5133. // ################################################################################
  5134. // Send Hangup command for customer call connected to the conference now to Manager
  5135. function dialedcall_send_hangup(dispowindow,hotkeysused,altdispo)
  5136. {
  5137. if (VDCL_group_id.length > 1)
  5138. {var group = VDCL_group_id;}
  5139. else
  5140. {var group = campaign;}
  5141. var form_cust_channel = document.vicidial_form.callchannel.value;
  5142. var form_cust_serverip = document.vicidial_form.callserverip.value;
  5143. var customer_channel = lastcustchannel;
  5144. var customer_server_ip = lastcustserverip;
  5145. AgaiNHanguPChanneL = lastcustchannel;
  5146. AgaiNHanguPServeR = lastcustserverip;
  5147. AgainCalLSecondS = VD_live_call_secondS;
  5148. AgaiNCalLCID = CalLCID;
  5149. var process_post_hangup=0;
  5150. if ( (RedirecTxFEr < 1) && ( (MD_channel_look==1) || (auto_dial_level == 0) ) )
  5151. {
  5152. MD_channel_look=0;
  5153. DialTimeHangup('MAIN');
  5154. }
  5155. if (form_cust_channel.length > 3)
  5156. {
  5157. var xmlhttp=false;
  5158. /*@cc_on @*/
  5159. /*@if (@_jscript_version >= 5)
  5160. // JScript gives us Conditional compilation, we can cope with old IE versions.
  5161. // and security blocked creation of the objects.
  5162. try {
  5163. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5164. } catch (e) {
  5165. try {
  5166. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  5167. } catch (E) {
  5168. xmlhttp = false;
  5169. }
  5170. }
  5171. @end @*/
  5172. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  5173. {
  5174. xmlhttp = new XMLHttpRequest();
  5175. }
  5176. if (xmlhttp)
  5177. {
  5178. var queryCID = "HLvdcW" + epoch_sec + user_abb;
  5179. var hangupvalue = customer_channel;
  5180. // alert(auto_dial_level + "|" + CalLCID + "|" + customer_server_ip + "|" + hangupvalue + "|" + VD_live_call_secondS);
  5181. custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&call_server_ip=" + customer_server_ip + "&queryCID=" + queryCID + "&auto_dial_level=" + auto_dial_level + "&CalLCID=" + CalLCID + "&secondS=" + VD_live_call_secondS + "&exten=" + session_id + "&campaign=" + group + "&stage=CALLCOLGAR";
  5182. xmlhttp.open('POST', 'manager_send.php');
  5183. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  5184. xmlhttp.send(custhangup_query);
  5185. xmlhttp.onreadystatechange = function()
  5186. {
  5187. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  5188. {
  5189. Nactiveext = null;
  5190. Nactiveext = xmlhttp.responseText;
  5191. // alert(xmlhttp.responseText);
  5192. // var HU_debug = xmlhttp.responseText;
  5193. // var HU_debug_array=HU_debug.split(" ");
  5194. // if (HU_debug_array[0] == 'Call')
  5195. // {
  5196. // alert(xmlhttp.responseText);
  5197. // }
  5198. }
  5199. }
  5200. process_post_hangup=1;
  5201. delete xmlhttp;
  5202. }
  5203. }
  5204. else {process_post_hangup=1;}
  5205. if (process_post_hangup==1)
  5206. {
  5207. VD_live_customer_call = 0;
  5208. VD_live_call_secondS = 0;
  5209. MD_ring_secondS = 0;
  5210. CalLCID = '';
  5211. // UPDATE VICIDIAL_LOG ENTRY FOR THIS LLAMADA PROCESS
  5212. DialLog("end");
  5213. conf_dialed=0;
  5214. if (dispowindow == 'NO')
  5215. {
  5216. open_dispo_screen=0;
  5217. }
  5218. else
  5219. {
  5220. if (auto_dial_level == 0)
  5221. {
  5222. if (document.vicidial_form.DiaLAltPhonE.checked==true)
  5223. {
  5224. reselect_alt_dial = 1;
  5225. open_dispo_screen=0;
  5226. }
  5227. else
  5228. {
  5229. reselect_alt_dial = 0;
  5230. open_dispo_screen=1;
  5231. }
  5232. }
  5233. else
  5234. {
  5235. if (document.vicidial_form.DiaLAltPhonE.checked==true)
  5236. {
  5237. reselect_alt_dial = 1;
  5238. open_dispo_screen=0;
  5239. auto_dial_level=0;
  5240. manual_dial_in_progress=1;
  5241. auto_dial_alt_dial=1;
  5242. }
  5243. else
  5244. {
  5245. reselect_alt_dial = 0;
  5246. open_dispo_screen=1;
  5247. }
  5248. }
  5249. }
  5250. // DEACTIVATE CHANNEL-DEPENDANT BUTTONS AND VARIABLES
  5251. document.vicidial_form.callchannel.value = '';
  5252. document.vicidial_form.callserverip.value = '';
  5253. lastcustchannel='';
  5254. lastcustserverip='';
  5255. if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
  5256. document.getElementById("WebFormSpan").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_webform_OFF_es.gif\" border=0 alt=\"Formulario Web\">";
  5257. document.getElementById("ParkControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_parkcall_OFF_es.gif\" border=0 alt=\"Aparcar llamada\">";
  5258. document.getElementById("HangupControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_hangupcustomer_OFF_es.gif\" border=0 alt=\"Colgar al Cliente\">";
  5259. document.getElementById("XferControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_transferconf_OFF_es.gif\" border=0 alt=\"Transferencia - Conferencia\">";
  5260. document.getElementById("LocalCloser").innerHTML = "<IMG SRC=\"../agc/images/vdc_XB_localcloser_OFF_es.gif\" border=0 alt=\"CLOSER LOCAL\">";
  5261. document.getElementById("DialBlindTransfer").innerHTML = "<IMG SRC=\"../agc/images/vdc_XB_blindtransfer_OFF_es.gif\" border=0 alt=\"Marcar Blind Transfer\">";
  5262. document.getElementById("DialBlindVMail").innerHTML = "<IMG SRC=\"../agc/images/vdc_XB_ammessage_OFF.gif\" border=0 alt=\"Blind Transfer VMail Message\">";
  5263. document.getElementById("VolumeUpSpan").innerHTML = "<IMG SRC=\"../agc/images/vdc_volume_up_off.gif\" Border=0>";
  5264. document.getElementById("VolumeDownSpan").innerHTML = "<IMG SRC=\"../agc/images/vdc_volume_down_off.gif\" Border=0>";
  5265. document.vicidial_form.custdatetime.value = '';
  5266. if (auto_dial_level == 0)
  5267. {
  5268. if (document.vicidial_form.DiaLAltPhonE.checked==true)
  5269. {
  5270. reselect_alt_dial = 1;
  5271. if (altdispo == 'ALTPH2')
  5272. {
  5273. ManualDialOnly('ALTTeléfonoE');
  5274. }
  5275. else
  5276. {
  5277. if (altdispo == 'ADDR3')
  5278. {
  5279. ManualDialOnly('AddresS3');
  5280. }
  5281. else
  5282. {
  5283. if (hotkeysused == 'YES')
  5284. {
  5285. reselect_alt_dial = 0;
  5286. manual_auto_hotkey = 1;
  5287. }
  5288. }
  5289. }
  5290. }
  5291. else
  5292. {
  5293. if (hotkeysused == 'YES')
  5294. {
  5295. manual_auto_hotkey = 1;
  5296. }
  5297. else
  5298. {
  5299. document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  5300. }
  5301. reselect_alt_dial = 0;
  5302. }
  5303. }
  5304. else
  5305. {
  5306. if (document.vicidial_form.DiaLAltPhonE.checked==true)
  5307. {
  5308. reselect_alt_dial = 1;
  5309. if (altdispo == 'ALTPH2')
  5310. {
  5311. ManualDialOnly('ALTTeléfonoE');
  5312. }
  5313. else
  5314. {
  5315. if (altdispo == 'ADDR3')
  5316. {
  5317. ManualDialOnly('AddresS3');
  5318. }
  5319. else
  5320. {
  5321. if (hotkeysused == 'YES')
  5322. {
  5323. document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
  5324. document.getElementById("MainStatuSSpan").innerHTML = '';
  5325. if (dial_method == "INBOUND_MAN")
  5326. {
  5327. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF_es.gif\" border=0 alt=\"Comienzo\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF_es.gif\" border=0 alt=\"Marcar el Siguiente Número\">";
  5328. }
  5329. else
  5330. {
  5331. document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF;
  5332. }
  5333. reselect_alt_dial = 0;
  5334. }
  5335. }
  5336. }
  5337. }
  5338. else
  5339. {
  5340. document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
  5341. if (dial_method == "INBOUND_MAN")
  5342. {
  5343. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><IMG SRC=\"../agc/images/vdc_LB_resume_OFF_es.gif\" border=0 alt=\"Comienzo\"><BR><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_OFF_es.gif\" border=0 alt=\"Marcar el Siguiente Número\">";
  5344. }
  5345. else
  5346. {
  5347. document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF;
  5348. }
  5349. reselect_alt_dial = 0;
  5350. }
  5351. }
  5352. ShoWTransferMain('OFF');
  5353. }
  5354. }
  5355. // ################################################################################
  5356. // Send Hangup command for 3rd party call connected to the conference now to Manager
  5357. function xfercall_send_hangup()
  5358. {
  5359. var xferchannel = document.vicidial_form.xferchannel.value;
  5360. var xfer_channel = lastxferchannel;
  5361. var process_post_hangup=0;
  5362. if ( (MD_channel_look==1) && (leaving_threeway < 1) )
  5363. {
  5364. MD_channel_look=0;
  5365. DialTimeHangup('XFER');
  5366. }
  5367. if (xferchannel.length > 3)
  5368. {
  5369. var xmlhttp=false;
  5370. /*@cc_on @*/
  5371. /*@if (@_jscript_version >= 5)
  5372. // JScript gives us Conditional compilation, we can cope with old IE versions.
  5373. // and security blocked creation of the objects.
  5374. try {
  5375. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5376. } catch (e) {
  5377. try {
  5378. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  5379. } catch (E) {
  5380. xmlhttp = false;
  5381. }
  5382. }
  5383. @end @*/
  5384. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  5385. {
  5386. xmlhttp = new XMLHttpRequest();
  5387. }
  5388. if (xmlhttp)
  5389. {
  5390. var queryCID = "HXvdcW" + epoch_sec + user_abb;
  5391. var hangupvalue = xfer_channel;
  5392. custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=Hangup&format=text&user=" + user + "&pass=" + pass + "&channel=" + hangupvalue + "&queryCID=" + queryCID;
  5393. xmlhttp.open('POST', 'manager_send.php');
  5394. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  5395. xmlhttp.send(custhangup_query);
  5396. xmlhttp.onreadystatechange = function()
  5397. {
  5398. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  5399. {
  5400. Nactiveext = null;
  5401. Nactiveext = xmlhttp.responseText;
  5402. // alert(xmlhttp.responseText);
  5403. }
  5404. }
  5405. process_post_hangup=1;
  5406. delete xmlhttp;
  5407. }
  5408. }
  5409. else {process_post_hangup=1;}
  5410. if (process_post_hangup==1)
  5411. {
  5412. XD_live_customer_call = 0;
  5413. XD_live_call_secondS = 0;
  5414. MD_ring_secondS = 0;
  5415. MD_channel_look=0;
  5416. XDnextCID = '';
  5417. XDcheck = '';
  5418. xferchannellive=0;
  5419. // DEACTIVATE CHANNEL-DEPENDANT BUTTONS AND VARIABLES
  5420. document.vicidial_form.xferchannel.value = "";
  5421. lastxferchannel='';
  5422. // document.getElementById("Leave3WayCall").innerHTML ="<IMG SRC=\"../agc/images/vdc_XB_leave3waycall_OFF_es.gif\" border=0 alt=\"ABANDONAR LLAMADA 3-WAY\">";
  5423. document.getElementById("DialWithCustomer").innerHTML ="<a href=\"#\" onclick=\"SendManualDial('YES');return false;\"><IMG SRC=\"../agc/images/vdc_XB_dialwithcustomer_es.gif\" border=0 alt=\"Marcar Con El Cliente\"></a>";
  5424. document.getElementById("ParkCustomerDial").innerHTML ="<a href=\"#\" onclick=\"xfer_park_dial();return false;\"><IMG SRC=\"../agc/images/vdc_XB_parkcustomerdial_es.gif\" border=0 alt=\"Dial Del Cliente Del Parque\"></a>";
  5425. document.getElementById("HangupXferLine").innerHTML ="<IMG SRC=\"../agc/images/vdc_XB_hangupxferline_OFF_es.gif\" border=0 alt=\"Colgar Línea Xfer \">";
  5426. document.getElementById("HangupBothLines").innerHTML ="<a href=\"#\" onclick=\"bothcall_send_hangup();return false;\"><IMG SRC=\"../agc/images/vdc_XB_hangupbothlines_es.gif\" border=0 alt=\"Colgar Ambas Líneas\"></a>";
  5427. }
  5428. }
  5429. // ################################################################################
  5430. // Send Hangup command for any Local call that is not in the quiet(7) entry - used to stop manual dials even if no connect
  5431. function DialTimeHangup(tasktypecall)
  5432. {
  5433. if ( (RedirecTxFEr < 1) && (leaving_threeway < 1) )
  5434. {
  5435. // alert("RedirecTxFEr|" + RedirecTxFEr);
  5436. MD_channel_look=0;
  5437. var xmlhttp=false;
  5438. /*@cc_on @*/
  5439. /*@if (@_jscript_version >= 5)
  5440. // JScript gives us Conditional compilation, we can cope with old IE versions.
  5441. // and security blocked creation of the objects.
  5442. try {
  5443. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5444. } catch (e) {
  5445. try {
  5446. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  5447. } catch (E) {
  5448. xmlhttp = false;
  5449. }
  5450. }
  5451. @end @*/
  5452. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  5453. {
  5454. xmlhttp = new XMLHttpRequest();
  5455. }
  5456. if (xmlhttp)
  5457. {
  5458. var queryCID = "HTvdcW" + epoch_sec + user_abb;
  5459. custhangup_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=HangupConfDial&format=text&user=" + user + "&pass=" + pass + "&exten=" + session_id + "&ext_context=" + ext_context + "&queryCID=" + queryCID;
  5460. xmlhttp.open('POST', 'manager_send.php');
  5461. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  5462. xmlhttp.send(custhangup_query);
  5463. xmlhttp.onreadystatechange = function()
  5464. {
  5465. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  5466. {
  5467. Nactiveext = null;
  5468. Nactiveext = xmlhttp.responseText;
  5469. // alert(xmlhttp.responseText + "\n" + tasktypecall + "\n" + leaving_threeway);
  5470. }
  5471. }
  5472. delete xmlhttp;
  5473. }
  5474. }
  5475. }
  5476. // ################################################################################
  5477. // Update vicidial_list lead record with all altered values from form
  5478. function CustomerData_update()
  5479. {
  5480. var REGcommentsAMP = new RegExp('&',"g");
  5481. var REGcommentsQUES = new RegExp("\\?","g");
  5482. var REGcommentsPOUND = new RegExp("\\#","g");
  5483. var REGcommentsRESULT = document.vicidial_form.comments.value.replace(REGcommentsAMP, "--AMP--");
  5484. REGcommentsRESULT = REGcommentsRESULT.replace(REGcommentsQUES, "--QUES--");
  5485. REGcommentsRESULT = REGcommentsRESULT.replace(REGcommentsPOUND, "--POUND--");
  5486. var xmlhttp=false;
  5487. /*@cc_on @*/
  5488. /*@if (@_jscript_version >= 5)
  5489. // JScript gives us Conditional compilation, we can cope with old IE versions.
  5490. // and security blocked creation of the objects.
  5491. try {
  5492. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5493. } catch (e) {
  5494. try {
  5495. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  5496. } catch (E) {
  5497. xmlhttp = false;
  5498. }
  5499. }
  5500. @end @*/
  5501. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  5502. {
  5503. xmlhttp = new XMLHttpRequest();
  5504. }
  5505. if (xmlhttp)
  5506. {
  5507. var genderIndex = document.getElementById("gender_list").selectedIndex;
  5508. var genderValue = document.getElementById('gender_list').options[genderIndex].value;
  5509. document.vicidial_form.gender.value = genderValue;
  5510. VLupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&campaign=" + campaign + "&ACTION=updateLEAD&format=text&user=" + user + "&pass=" + pass +
  5511. "&lead_id=" + document.vicidial_form.lead_id.value +
  5512. "&vendor_lead_code=" + document.vicidial_form.vendor_lead_code.value +
  5513. "&phone_number=" + document.vicidial_form.phone_number.value +
  5514. "&title=" + document.vicidial_form.title.value +
  5515. "&first_name=" + document.vicidial_form.first_name.value +
  5516. "&middle_initial=" + document.vicidial_form.middle_initial.value +
  5517. "&last_name=" + document.vicidial_form.last_name.value +
  5518. "&address1=" + document.vicidial_form.address1.value +
  5519. "&address2=" + document.vicidial_form.address2.value +
  5520. "&address3=" + document.vicidial_form.address3.value +
  5521. "&city=" + document.vicidial_form.city.value +
  5522. "&state=" + document.vicidial_form.state.value +
  5523. "&province=" + document.vicidial_form.province.value +
  5524. "&postal_code=" + document.vicidial_form.postal_code.value +
  5525. "&country_code=" + document.vicidial_form.country_code.value +
  5526. "&gender=" + document.vicidial_form.gender.value +
  5527. "&date_of_birth=" + document.vicidial_form.date_of_birth.value +
  5528. "&alt_phone=" + document.vicidial_form.alt_phone.value +
  5529. "&email=" + document.vicidial_form.email.value +
  5530. "&security_phrase=" + document.vicidial_form.security_phrase.value +
  5531. "&comments=" + REGcommentsRESULT;
  5532. xmlhttp.open('POST', 'vdc_db_query.php');
  5533. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  5534. xmlhttp.send(VLupdate_query);
  5535. xmlhttp.onreadystatechange = function()
  5536. {
  5537. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  5538. {
  5539. // alert(xmlhttp.responseText);
  5540. }
  5541. }
  5542. delete xmlhttp;
  5543. }
  5544. }
  5545. // ################################################################################
  5546. // Generate the Call Disposition Chooser panel
  5547. function DispoSelectContent_create(taskDSgrp,taskDSstage)
  5548. {
  5549. AgentDispoing = 1;
  5550. var VD_statuses_ct_half = parseInt(VD_statuses_ct / 2);
  5551. var dispo_HTML = "<table cellpadding=5 cellspacing=5 width=500><tr><td colspan=2><B> LLAMADA DISPOSITION</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=DispoSelectA>";
  5552. var loop_ct = 0;
  5553. while (loop_ct < VD_statuses_ct)
  5554. {
  5555. if (taskDSgrp == VARstatuses[loop_ct])
  5556. {
  5557. dispo_HTML = dispo_HTML + "<font size=3 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"DispoSelect_submit();return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a></b></font><BR><BR>";
  5558. }
  5559. else
  5560. {
  5561. dispo_HTML = dispo_HTML + "<a href=\"#\" onclick=\"DispoSelectContent_create('" + VARstatuses[loop_ct] + "','ADD');return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a><BR><BR>";
  5562. }
  5563. if (loop_ct == VD_statuses_ct_half)
  5564. {dispo_HTML = dispo_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=DispoSelectB>";}
  5565. loop_ct++;
  5566. }
  5567. dispo_HTML = dispo_HTML + "</span></font></td></tr></table>";
  5568. if (taskDSstage == 'ReSET') {document.vicidial_form.DispoSelection.value = '';}
  5569. else {document.vicidial_form.DispoSelection.value = taskDSgrp;}
  5570. document.getElementById("DispoSelectContent").innerHTML = dispo_HTML;
  5571. }
  5572. // ################################################################################
  5573. // Generate the Pausa Code Chooser panel
  5574. function PauseCodeSelectContent_create()
  5575. {
  5576. if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) )
  5577. {
  5578. alert("USTED DEBE SER DETENIDO BREVEMENTE PARA INTRODUCIR Un CÓDIGO De la PAUSA EN AUTO-DIAL MODE");
  5579. }
  5580. else
  5581. {
  5582. showDiv('PauseCodeSelectBox');
  5583. WaitingForNextStep=1;
  5584. PauseCode_HTML = '';
  5585. document.vicidial_form.PauseCodeSelection.value = '';
  5586. var VD_pause_codes_ct_half = parseInt(VD_pause_codes_ct / 2);
  5587. PauseCode_HTML = "<table cellpadding=5 cellspacing=5 width=500><tr><td colspan=2><B> PAUSE CODE</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=PauseCodeSelectA>";
  5588. var loop_ct = 0;
  5589. while (loop_ct < VD_pause_codes_ct)
  5590. {
  5591. PauseCode_HTML = PauseCode_HTML + "<font size=3 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"PauseCodeSelect_submit('" + VARpause_codes[loop_ct] + "');return false;\">" + VARpause_codes[loop_ct] + " - " + VARpause_code_names[loop_ct] + "</a></b></font><BR><BR>";
  5592. loop_ct++;
  5593. if (loop_ct == VD_pause_codes_ct_half)
  5594. {PauseCode_HTML = PauseCode_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=PauseCodeSelectB>";}
  5595. }
  5596. if (agent_pause_codes_active=='FORCE')
  5597. {var Go_BacK_LinK = '';}
  5598. else
  5599. {var Go_BacK_LinK = "<font size=3 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"PauseCodeSelect_submit('');return false;\">Vaya Detrás</a>";}
  5600. PauseCode_HTML = PauseCode_HTML + "</span></font></td></tr></table><BR><BR>" + Go_BacK_LinK;
  5601. document.getElementById("PauseCodeSelectContent").innerHTML = PauseCode_HTML;
  5602. }
  5603. }
  5604. // ################################################################################
  5605. // Generate the Grupo de Alias Chooser panel
  5606. function GroupAliasSelectContent_create(task3way)
  5607. {
  5608. showDiv('GroupAliasSelectBox');
  5609. WaitingForNextStep=1;
  5610. GroupAlias_HTML = '';
  5611. document.vicidial_form.GroupAliasSelection.value = '';
  5612. var VD_group_aliases_ct_half = parseInt(VD_group_aliases_ct / 2);
  5613. GroupAlias_HTML = "<table cellpadding=5 cellspacing=5 width=500><tr><td colspan=2><B> GROUP ALIAS</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=GroupAliasSelectA>";
  5614. if (task3way > 0)
  5615. {
  5616. VD_group_aliases_ct_half = (VD_group_aliases_ct_half - 1);
  5617. GroupAlias_HTML = GroupAlias_HTML + "<font size=2 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('CAMPAIGN','" + campaign_cid + "','0');return false;\">CAMPAIGN - " + campaign_cid + "</a></b></font><BR><BR>";
  5618. GroupAlias_HTML = GroupAlias_HTML + "<font size=2 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('A MEDIDAER','" + document.vicidial_form.phone_number.value + "','0');return false;\">A MEDIDAER - " + document.vicidial_form.phone_number.value + "</a></b></font><BR><BR>";
  5619. GroupAlias_HTML = GroupAlias_HTML + "<font size=2 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('AGENT_PHONE','" + outbound_cid + "','0');return false;\">AGENT_PHONE - " + outbound_cid + "</a></b></font><BR><BR>";
  5620. }
  5621. var loop_ct = 0;
  5622. while (loop_ct < VD_group_aliases_ct)
  5623. {
  5624. GroupAlias_HTML = GroupAlias_HTML + "<font size=2 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('" + VARgroup_alias_ids[loop_ct] + "','" + VARcaller_id_numbers[loop_ct] + "','1');return false;\">" + VARgroup_alias_ids[loop_ct] + " - " + VARgroup_alias_names[loop_ct] + " - " + VARcaller_id_numbers[loop_ct] + "</a></b></font><BR><BR>";
  5625. loop_ct++;
  5626. if (loop_ct == VD_group_aliases_ct_half)
  5627. {GroupAlias_HTML = GroupAlias_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=GroupAliasSelectB>";}
  5628. }
  5629. var Go_BacK_LinK = "<font size=3 style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"GroupAliasSelect_submit('');return false;\">Vaya Detrás</a>";
  5630. GroupAlias_HTML = GroupAlias_HTML + "</span></font></td></tr></table><BR><BR>" + Go_BacK_LinK;
  5631. document.getElementById("GroupAliasSelectContent").innerHTML = GroupAlias_HTML;
  5632. }
  5633. // ################################################################################
  5634. // open web form, then submit disposition
  5635. function WeBForMDispoSelect_submit()
  5636. {
  5637. leaving_threeway=0;
  5638. blind_transfer=0;
  5639. document.vicidial_form.callchannel.value = '';
  5640. document.vicidial_form.callserverip.value = '';
  5641. document.vicidial_form.xferchannel.value = '';
  5642. document.getElementById("DialWithCustomer").innerHTML ="<a href=\"#\" onclick=\"SendManualDial('YES');return false;\"><IMG SRC=\"../agc/images/vdc_XB_dialwithcustomer_es.gif\" border=0 alt=\"Marcar Con El Cliente\"></a>";
  5643. document.getElementById("ParkCustomerDial").innerHTML ="<a href=\"#\" onclick=\"xfer_park_dial();return false;\"><IMG SRC=\"../agc/images/vdc_XB_parkcustomerdial_es.gif\" border=0 alt=\"Dial Del Cliente Del Parque\"></a>";
  5644. document.getElementById("HangupBothLines").innerHTML ="<a href=\"#\" onclick=\"bothcall_send_hangup();return false;\"><IMG SRC=\"../agc/images/vdc_XB_hangupbothlines_es.gif\" border=0 alt=\"Colgar Ambas Líneas\"></a>";
  5645. var DispoChoice = document.vicidial_form.DispoSelection.value;
  5646. if (DispoChoice.length < 1) {alert("Usted debe seleccionar una disposición");}
  5647. else
  5648. {
  5649. document.getElementById("CusTInfOSpaN").innerHTML = "";
  5650. document.getElementById("CusTInfOSpaN").style.background = panel_bgcolor;
  5651. LeaDDispO = DispoChoice;
  5652. WebFormRefresH('NO','YES');
  5653. document.getElementById("WebFormSpan").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_webform_OFF_es.gif\" border=0 alt=\"Formulario Web\">";
  5654. window.open(TEMP_VDIC_web_form_address, web_form_target, 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=640,height=450');
  5655. DispoSelect_submit();
  5656. }
  5657. }
  5658. // ################################################################################
  5659. // Update vicidial_list lead record with disposition selection
  5660. function DispoSelect_submit()
  5661. {
  5662. if (VDCL_group_id.length > 1)
  5663. {var group = VDCL_group_id;}
  5664. else
  5665. {var group = campaign;}
  5666. leaving_threeway=0;
  5667. blind_transfer=0;
  5668. document.vicidial_form.callchannel.value = '';
  5669. document.vicidial_form.callserverip.value = '';
  5670. document.vicidial_form.xferchannel.value = '';
  5671. document.getElementById("DialWithCustomer").innerHTML ="<a href=\"#\" onclick=\"SendManualDial('YES');return false;\"><IMG SRC=\"../agc/images/vdc_XB_dialwithcustomer_es.gif\" border=0 alt=\"Marcar Con El Cliente\"></a>";
  5672. document.getElementById("ParkCustomerDial").innerHTML ="<a href=\"#\" onclick=\"xfer_park_dial();return false;\"><IMG SRC=\"../agc/images/vdc_XB_parkcustomerdial_es.gif\" border=0 alt=\"Dial Del Cliente Del Parque\"></a>";
  5673. document.getElementById("HangupBothLines").innerHTML ="<a href=\"#\" onclick=\"bothcall_send_hangup();return false;\"><IMG SRC=\"../agc/images/vdc_XB_hangupbothlines_es.gif\" border=0 alt=\"Colgar Ambas Líneas\"></a>";
  5674. var DispoChoice = document.vicidial_form.DispoSelection.value;
  5675. if (DispoChoice.length < 1) {alert("Usted debe seleccionar una disposición");}
  5676. else
  5677. {
  5678. document.getElementById("CusTInfOSpaN").innerHTML = "";
  5679. document.getElementById("CusTInfOSpaN").style.background = panel_bgcolor;
  5680. if ( (DispoChoice == 'CALLBK') && (scheduled_callbacks > 0) ) {showDiv('CallBackSelectBox');}
  5681. else
  5682. {
  5683. var xmlhttp=false;
  5684. /*@cc_on @*/
  5685. /*@if (@_jscript_version >= 5)
  5686. // JScript gives us Conditional compilation, we can cope with old IE versions.
  5687. // and security blocked creation of the objects.
  5688. try {
  5689. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5690. } catch (e) {
  5691. try {
  5692. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  5693. } catch (E) {
  5694. xmlhttp = false;
  5695. }
  5696. }
  5697. @end @*/
  5698. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  5699. {
  5700. xmlhttp = new XMLHttpRequest();
  5701. }
  5702. if (xmlhttp)
  5703. {
  5704. DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&comments=" + CallBackCommenTs;
  5705. xmlhttp.open('POST', 'vdc_db_query.php');
  5706. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  5707. xmlhttp.send(DSupdate_query);
  5708. xmlhttp.onreadystatechange = function()
  5709. {
  5710. if ( (xmlhttp.readyState == 4 && xmlhttp.status == 200) && (auto_dial_level < 1) )
  5711. {
  5712. var check_dispo = null;
  5713. check_dispo = xmlhttp.responseText;
  5714. var check_DS_array=check_dispo.split("\n");
  5715. // alert(xmlhttp.responseText + "\n|" + check_DS_array[1] + "\n|" + check_DS_array[2] + "|");
  5716. if (check_DS_array[1] == 'Next agent_log_id:')
  5717. {
  5718. agent_log_id = check_DS_array[2];
  5719. }
  5720. }
  5721. }
  5722. delete xmlhttp;
  5723. }
  5724. // CLEAR ALL FORM VARIABLES
  5725. document.vicidial_form.lead_id.value ='';
  5726. document.vicidial_form.vendor_lead_code.value='';
  5727. document.vicidial_form.list_id.value ='';
  5728. document.vicidial_form.gmt_offset_now.value ='';
  5729. document.vicidial_form.phone_code.value ='';
  5730. if (disable_alter_custphone=='Y')
  5731. {
  5732. var tmp_pn = document.getElementById("phone_numberDISP");
  5733. tmp_pn.innerHTML = ' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ';
  5734. }
  5735. document.vicidial_form.phone_number.value = '';
  5736. document.vicidial_form.title.value ='';
  5737. document.vicidial_form.first_name.value ='';
  5738. document.vicidial_form.middle_initial.value ='';
  5739. document.vicidial_form.last_name.value ='';
  5740. document.vicidial_form.address1.value ='';
  5741. document.vicidial_form.address2.value ='';
  5742. document.vicidial_form.address3.value ='';
  5743. document.vicidial_form.city.value ='';
  5744. document.vicidial_form.state.value ='';
  5745. document.vicidial_form.province.value ='';
  5746. document.vicidial_form.postal_code.value ='';
  5747. document.vicidial_form.country_code.value ='';
  5748. document.vicidial_form.gender.value ='';
  5749. document.vicidial_form.date_of_birth.value ='';
  5750. document.vicidial_form.alt_phone.value ='';
  5751. document.vicidial_form.email.value ='';
  5752. document.vicidial_form.security_phrase.value='';
  5753. document.vicidial_form.comments.value ='';
  5754. document.vicidial_form.called_count.value ='';
  5755. VDCL_group_id = '';
  5756. fronter = '';
  5757. inOUT = 'OUT';
  5758. if (manual_dial_in_progress==1)
  5759. {
  5760. manual_dial_finished();
  5761. }
  5762. document.getElementById("GENDERhideFORieALT").innerHTML = '';
  5763. document.getElementById("GENDERhideFORie").innerHTML = '<select size=1 name=gender_list class="cust_form" id=gender_list><option value="U">U - Indefinido</option><option value="M">M - Male</option><option value="F">F - Female</option></select>';
  5764. hideDiv('DispoSelectBox');
  5765. hideDiv('DispoButtonHideA');
  5766. hideDiv('DispoButtonHideB');
  5767. hideDiv('DispoButtonHideC');
  5768. document.getElementById("DispoSelectBox").style.top = 1;
  5769. document.getElementById("DispoSelectMaxMin").innerHTML = "<a href=\"#\" onclick=\"DispoMinimize()\"> reduzca al mínimo </a>";
  5770. document.getElementById("DispoSelectHAspan").innerHTML = "<a href=\"#\" onclick=\"DispoHanguPAgaiN()\">Retraso Otra vez</a>";
  5771. CBcommentsBoxhide();
  5772. EAcommentsBoxhide();
  5773. AgentDispoing = 0;
  5774. if (shift_logout_flag < 1)
  5775. {
  5776. if (wrapup_waiting == 0)
  5777. {
  5778. if (document.vicidial_form.DispoSelectStop.checked==true)
  5779. {
  5780. if (auto_dial_level != '0')
  5781. {
  5782. AutoDialWaiting = 0;
  5783. AutoDial_ReSume_PauSe("VDADpause");
  5784. // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
  5785. }
  5786. VICIDiaL_pause_calling = 1;
  5787. if (dispo_check_all_pause != '1')
  5788. {
  5789. document.vicidial_form.DispoSelectStop.checked=false;
  5790. }
  5791. }
  5792. else
  5793. {
  5794. if (auto_dial_level != '0')
  5795. {
  5796. AutoDialWaiting = 1;
  5797. AutoDial_ReSume_PauSe("VDADready","NEW_ID");
  5798. // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
  5799. }
  5800. else
  5801. {
  5802. // trigger HotKeys manual dial automatically go to next lead
  5803. if (manual_auto_hotkey == '1')
  5804. {
  5805. manual_auto_hotkey = 0;
  5806. ManualDialNext('','','','','','0');
  5807. }
  5808. }
  5809. }
  5810. }
  5811. }
  5812. else
  5813. {
  5814. LogouT('SHIFT');
  5815. }
  5816. }
  5817. }
  5818. }
  5819. // ################################################################################
  5820. // Submit the Pausa Code
  5821. function PauseCodeSelect_submit(newpausecode)
  5822. {
  5823. hideDiv('PauseCodeSelectBox');
  5824. WaitingForNextStep=0;
  5825. var xmlhttp=false;
  5826. /*@cc_on @*/
  5827. /*@if (@_jscript_version >= 5)
  5828. // JScript gives us Conditional compilation, we can cope with old IE versions.
  5829. // and security blocked creation of the objects.
  5830. try {
  5831. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5832. } catch (e) {
  5833. try {
  5834. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  5835. } catch (E) {
  5836. xmlhttp = false;
  5837. }
  5838. }
  5839. @end @*/
  5840. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  5841. {
  5842. xmlhttp = new XMLHttpRequest();
  5843. }
  5844. if (xmlhttp)
  5845. {
  5846. VMCpausecode_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=PauseCodeSubmit&format=text&status=" + newpausecode + "&agent_log_id=" + agent_log_id + "&campaign=" + campaign + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages;
  5847. xmlhttp.open('POST', 'vdc_db_query.php');
  5848. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  5849. xmlhttp.send(VMCpausecode_query);
  5850. xmlhttp.onreadystatechange = function()
  5851. {
  5852. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  5853. {
  5854. // alert(xmlhttp.responseText);
  5855. }
  5856. }
  5857. delete xmlhttp;
  5858. }
  5859. }
  5860. // ################################################################################
  5861. // Submit the Grupo de Alias
  5862. function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup)
  5863. {
  5864. hideDiv('GroupAliasSelectBox');
  5865. WaitingForNextStep=0;
  5866. if (newusegroup > 0)
  5867. {
  5868. active_group_alias = newgroupalias;
  5869. document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "<font size=2 face=\"Arial,Helvetica\">Grupo de Alias: " + active_group_alias + "</font>";
  5870. document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "<font size=1 face=\"Arial,Helvetica\">Grupo de Alias: " + active_group_alias + "</font>";
  5871. }
  5872. cid_choice = newgroupcid;
  5873. }
  5874. // ################################################################################
  5875. // Populate the dtmf and xfer number for each preset link in xfer-conf frame
  5876. function DtMf_PreSet_a()
  5877. {
  5878. document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf;
  5879. document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber;
  5880. }
  5881. function DtMf_PreSet_b()
  5882. {
  5883. document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf;
  5884. document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber;
  5885. }
  5886. function DtMf_PreSet_a_DiaL()
  5887. {
  5888. document.vicidial_form.conf_dtmf.value = CalL_XC_a_Dtmf;
  5889. document.vicidial_form.xfernumber.value = CalL_XC_a_NuMber;
  5890. basic_originate_call(CalL_XC_a_NuMber,'NO','YES',session_id,'YES','','1','0');
  5891. }
  5892. function DtMf_PreSet_b_DiaL()
  5893. {
  5894. document.vicidial_form.conf_dtmf.value = CalL_XC_b_Dtmf;
  5895. document.vicidial_form.xfernumber.value = CalL_XC_b_NuMber;
  5896. basic_originate_call(CalL_XC_b_NuMber,'NO','YES',session_id,'YES','','1','0');
  5897. }
  5898. // ################################################################################
  5899. // Demostración message that customer has hungup the call before agent has
  5900. function CustomerChanneLGone()
  5901. {
  5902. showDiv('CustomerGoneBox');
  5903. document.vicidial_form.callchannel.value = '';
  5904. document.vicidial_form.callserverip.value = '';
  5905. document.getElementById("CustomerGoneChanneL").innerHTML = lastcustchannel;
  5906. if( document.images ) { document.images['livecall'].src = image_livecall_OFF.src;}
  5907. WaitingForNextStep=1;
  5908. }
  5909. function CustomerGoneOK()
  5910. {
  5911. hideDiv('CustomerGoneBox');
  5912. WaitingForNextStep=0;
  5913. custchannellive=0;
  5914. }
  5915. function CustomerGoneHangup()
  5916. {
  5917. hideDiv('CustomerGoneBox');
  5918. WaitingForNextStep=0;
  5919. custchannellive=0;
  5920. dialedcall_send_hangup();
  5921. }
  5922. // ################################################################################
  5923. // Demostración message that there are no voice channels in the VICIDIAL session
  5924. function NoneInSession()
  5925. {
  5926. showDiv('NoneInSessionBox');
  5927. document.getElementById("NoneInSessionID").innerHTML = session_id;
  5928. WaitingForNextStep=1;
  5929. }
  5930. function NoneInSessionOK()
  5931. {
  5932. hideDiv('NoneInSessionBox');
  5933. WaitingForNextStep=0;
  5934. nochannelinsession=0;
  5935. }
  5936. function NoneInSessionCalL()
  5937. {
  5938. hideDiv('NoneInSessionBox');
  5939. WaitingForNextStep=0;
  5940. nochannelinsession=0;
  5941. if ( (protocol == 'EXTERNAL') || (protocol == 'Local') )
  5942. {
  5943. var protodial = 'Local';
  5944. var extendial = extension;
  5945. // var extendial = extension + "@" + ext_context;
  5946. }
  5947. else
  5948. {
  5949. var protodial = protocol;
  5950. var extendial = extension;
  5951. }
  5952. var originatevalue = protodial + "/" + extendial;
  5953. var queryCID = "ACagcW" + epoch_sec + user_abb;
  5954. var xmlhttp=false;
  5955. /*@cc_on @*/
  5956. /*@if (@_jscript_version >= 5)
  5957. // JScript gives us Conditional compilation, we can cope with old IE versions.
  5958. // and security blocked creation of the objects.
  5959. try {
  5960. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  5961. } catch (e) {
  5962. try {
  5963. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  5964. } catch (E) {
  5965. xmlhttp = false;
  5966. }
  5967. }
  5968. @end @*/
  5969. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  5970. {
  5971. xmlhttp = new XMLHttpRequest();
  5972. }
  5973. if (xmlhttp)
  5974. {
  5975. VMCoriginate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&user=" + user + "&pass=" + pass + "&ACTION=OriginateVDRelogin&format=text&channel=" + originatevalue + "&queryCID=" + queryCID + "&exten=" + session_id + "&ext_context=" + ext_context + "&ext_priority=1" + "&extension=" + extension + "&protocol=" + protocol + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&allow_sipsak_messages=" + allow_sipsak_messages + "&campaign=" + campaign;
  5976. xmlhttp.open('POST', 'manager_send.php');
  5977. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  5978. xmlhttp.send(VMCoriginate_query);
  5979. xmlhttp.onreadystatechange = function()
  5980. {
  5981. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  5982. {
  5983. // alert(xmlhttp.responseText);
  5984. }
  5985. }
  5986. delete xmlhttp;
  5987. }
  5988. if (auto_dial_level > 0)
  5989. {
  5990. AutoDial_ReSume_PauSe("VDADpause");
  5991. }
  5992. }
  5993. // ################################################################################
  5994. // Generate the Closer In Group Chooser panel
  5995. function CloserSelectContent_create()
  5996. {
  5997. if (VU_agent_choose_ingroups == '1')
  5998. {
  5999. var live_CSC_HTML = "<table cellpadding=5 cellspacing=5 width=500><tr><td><B>GRUPOS NO SELECCIONADOS</B></td><td><B>GRUPOS SELECCIONADOS</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=CloserSelectAdd>";
  6000. var loop_ct = 0;
  6001. while (loop_ct < INgroupCOUNT)
  6002. {
  6003. live_CSC_HTML = live_CSC_HTML + "<a href=\"#\" onclick=\"CloserSelect_change('" + VARingroups[loop_ct] + "','ADD');return false;\">" + VARingroups[loop_ct] + "<BR>";
  6004. loop_ct++;
  6005. }
  6006. live_CSC_HTML = live_CSC_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=CloserSelectDelete></span></font></td></tr></table>";
  6007. document.vicidial_form.CloserSelectList.value = '';
  6008. document.getElementById("CloserSelectContent").innerHTML = live_CSC_HTML;
  6009. }
  6010. else
  6011. {
  6012. VU_agent_choose_ingroups_DV = "MGRLOCK";
  6013. var live_CSC_HTML = "Manager has selected groups for you<BR>";
  6014. document.vicidial_form.CloserSelectList.value = '';
  6015. document.getElementById("CloserSelectContent").innerHTML = live_CSC_HTML;
  6016. }
  6017. }
  6018. // ################################################################################
  6019. // Move a Closer In Group record to the selected column or reverse
  6020. function CloserSelect_change(taskCSgrp,taskCSchange)
  6021. {
  6022. var CloserSelectListValue = document.vicidial_form.CloserSelectList.value;
  6023. var CSCchange = 0;
  6024. var regCS = new RegExp(" "+taskCSgrp+" ","ig");
  6025. if ( (CloserSelectListValue.match(regCS)) && (CloserSelectListValue.length > 3) )
  6026. {
  6027. if (taskCSchange == 'DELETE') {CSCchange = 1;}
  6028. }
  6029. else
  6030. {
  6031. if (taskCSchange == 'ADD') {CSCchange = 1;}
  6032. }
  6033. // alert(taskCSgrp+"|"+taskCSchange+"|"+CloserSelectListValue.length+"|"+CSCchange+"|"+CSCcolumn)
  6034. if (CSCchange==1)
  6035. {
  6036. var loop_ct = 0;
  6037. var CSCcolumn = '';
  6038. var live_CSC_HTML_ADD = '';
  6039. var live_CSC_HTML_DELETE = '';
  6040. var live_CSC_LIST_value = " ";
  6041. while (loop_ct < INgroupCOUNT)
  6042. {
  6043. var regCSL = new RegExp(" "+VARingroups[loop_ct]+" ","ig");
  6044. if (CloserSelectListValue.match(regCSL)) {CSCcolumn = 'DELETE';}
  6045. else {CSCcolumn = 'ADD';}
  6046. if ( (VARingroups[loop_ct] == taskCSgrp) && (taskCSchange == 'DELETE') ) {CSCcolumn = 'ADD';}
  6047. if ( (VARingroups[loop_ct] == taskCSgrp) && (taskCSchange == 'ADD') ) {CSCcolumn = 'DELETE';}
  6048. if (CSCcolumn == 'DELETE')
  6049. {
  6050. live_CSC_HTML_DELETE = live_CSC_HTML_DELETE + "<a href=\"#\" onclick=\"CloserSelect_change('" + VARingroups[loop_ct] + "','DELETE');return false;\">" + VARingroups[loop_ct] + "<BR>";
  6051. live_CSC_LIST_value = live_CSC_LIST_value + VARingroups[loop_ct] + " ";
  6052. }
  6053. else
  6054. {
  6055. live_CSC_HTML_ADD = live_CSC_HTML_ADD + "<a href=\"#\" onclick=\"CloserSelect_change('" + VARingroups[loop_ct] + "','ADD');return false;\">" + VARingroups[loop_ct] + "<BR>";
  6056. }
  6057. loop_ct++;
  6058. }
  6059. document.vicidial_form.CloserSelectList.value = live_CSC_LIST_value;
  6060. document.getElementById("CloserSelectAdd").innerHTML = live_CSC_HTML_ADD;
  6061. document.getElementById("CloserSelectDelete").innerHTML = live_CSC_HTML_DELETE;
  6062. }
  6063. }
  6064. // ################################################################################
  6065. // Update vicidial_live_agents record with closer in group choices
  6066. function CloserSelect_submit()
  6067. {
  6068. if (dial_method == "INBOUND_MAN")
  6069. {document.vicidial_form.CloserSelectBlended.checked=false;}
  6070. if (document.vicidial_form.CloserSelectBlended.checked==true)
  6071. {VICIDiaL_closer_blended = 1;}
  6072. else
  6073. {VICIDiaL_closer_blended = 0;}
  6074. var CloserSelectChoices = document.vicidial_form.CloserSelectList.value;
  6075. if (VU_agent_choose_ingroups_DV == "MGRLOCK")
  6076. {CloserSelectChoices = "MGRLOCK";}
  6077. var xmlhttp=false;
  6078. /*@cc_on @*/
  6079. /*@if (@_jscript_version >= 5)
  6080. // JScript gives us Conditional compilation, we can cope with old IE versions.
  6081. // and security blocked creation of the objects.
  6082. try {
  6083. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  6084. } catch (e) {
  6085. try {
  6086. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  6087. } catch (E) {
  6088. xmlhttp = false;
  6089. }
  6090. }
  6091. @end @*/
  6092. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  6093. {
  6094. xmlhttp = new XMLHttpRequest();
  6095. }
  6096. if (xmlhttp)
  6097. {
  6098. CSCupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=regCLOSER&format=text&user=" + user + "&pass=" + pass + "&comments=" + VU_agent_choose_ingroups_DV + "&closer_blended=" + VICIDiaL_closer_blended + "&campaign=" + campaign + "&closer_choice=" + CloserSelectChoices + "-";
  6099. xmlhttp.open('POST', 'vdc_db_query.php');
  6100. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  6101. xmlhttp.send(CSCupdate_query);
  6102. xmlhttp.onreadystatechange = function()
  6103. {
  6104. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  6105. {
  6106. // alert(xmlhttp.responseText);
  6107. }
  6108. }
  6109. delete xmlhttp;
  6110. }
  6111. hideDiv('CloserSelectBox');
  6112. MainPanelToFront();
  6113. CloserSelecting = 0;
  6114. }
  6115. // ################################################################################
  6116. // Log the user out of the system when they close their browser while logged in
  6117. function BrowserCloseLogout()
  6118. {
  6119. if (logout_stop_timeouts < 1)
  6120. {
  6121. LogouT('CLOSE');
  6122. alert("PLEASE CLICK THE SALIR LINK TO LOG OUT NEXT TIME.\n");
  6123. }
  6124. }
  6125. // ################################################################################
  6126. // Log the user out of the system, if active call or active dial is occuring, don't let them.
  6127. function LogouT(tempreason)
  6128. {
  6129. if (MD_channel_look==1)
  6130. {alert("Usted no puede salir durante un intento de marcado. \nEsperar 50 segundos para que el marcado falle si no es respondido");}
  6131. else
  6132. {
  6133. if (VD_live_customer_call==1)
  6134. {
  6135. alert("TODAVÍA UNA LLAMADA ACTIVA! Colgar y luego salir.\n" + VD_live_customer_call);
  6136. }
  6137. else
  6138. {
  6139. var xmlhttp=false;
  6140. /*@cc_on @*/
  6141. /*@if (@_jscript_version >= 5)
  6142. // JScript gives us Conditional compilation, we can cope with old IE versions.
  6143. // and security blocked creation of the objects.
  6144. try {
  6145. xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  6146. } catch (e) {
  6147. try {
  6148. xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  6149. } catch (E) {
  6150. xmlhttp = false;
  6151. }
  6152. }
  6153. @end @*/
  6154. if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  6155. {
  6156. xmlhttp = new XMLHttpRequest();
  6157. }
  6158. if (xmlhttp)
  6159. {
  6160. VDlogout_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=userLOGout&format=text&user=" + user + "&pass=" + pass + "&campaign=" + campaign + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&agent_log_id=" + agent_log_id + "&no_delete_sessions=" + no_delete_sessions + "&phone_ip=" + phone_ip + "&enable_sipsak_messages=" + enable_sipsak_messages + "&LogouTKicKAlL=" + LogouTKicKAlL + "&ext_context=" + ext_context;
  6161. xmlhttp.open('POST', 'vdc_db_query.php');
  6162. xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
  6163. xmlhttp.send(VDlogout_query);
  6164. xmlhttp.onreadystatechange = function()
  6165. {
  6166. if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
  6167. {
  6168. // alert(xmlhttp.responseText);
  6169. }
  6170. }
  6171. delete xmlhttp;
  6172. }
  6173. hideDiv('MainPanel');
  6174. showDiv('LogouTBox');
  6175. var logout_content='';
  6176. if (tempreason=='SHIFT')
  6177. {logout_content='Su cambio es de más o ha cambiado, se le ha cerrado la sesión de su período de sesiones<BR><BR>';}
  6178. document.getElementById("LogouTBoxLink").innerHTML = logout_content + "<a href=\"" + agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass + "\">PINCHA AQUÍ PARA ENTRAR OTRA VEZ</a>\n";
  6179. logout_stop_timeouts = 1;
  6180. // window.location= agcPAGE + "?relogin=YES&session_epoch=" + epoch_sec + "&session_id=" + session_id + "&session_name=" + session_name + "&VD_login=" + user + "&VD_campaign=" + campaign + "&phone_login=" + phone_login + "&phone_pass=" + phone_pass + "&VD_pass=" + pass;
  6181. }
  6182. }
  6183. }
  6184. <?
  6185. if ($useIE > 0)
  6186. {
  6187. ?>
  6188. // ################################################################################
  6189. // MSIE-only hotkeypress function to bind hotkeys defined in the campaign to dispositions
  6190. function hotkeypress(evt)
  6191. {
  6192. enter_disable();
  6193. if ( (hot_keys_active==1) && (VD_live_customer_call==1) )
  6194. {
  6195. var e = evt? evt : window.event;
  6196. if(!e) return;
  6197. var key = 0;
  6198. if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which'
  6199. else if (typeof(e.which)!= 'undefined') { key = e.which; }
  6200. var HKdispo = hotkeys[String.fromCharCode(key)];
  6201. // alert("|" + key + "|" + HKdispo + "|");
  6202. if (HKdispo)
  6203. {
  6204. // document.vicidial_form.inert_button.focus();
  6205. // document.vicidial_form.inert_button.blur();
  6206. CustomerData_update();
  6207. var HKdispo_ary = HKdispo.split(" ----- ");
  6208. if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') )
  6209. {
  6210. if (document.vicidial_form.DiaLAltPhonE.checked==true)
  6211. {
  6212. dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]);
  6213. }
  6214. }
  6215. else
  6216. {
  6217. HKdispo_display = 4;
  6218. HKfinish=1;
  6219. document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1];
  6220. showDiv('HotKeyActionBox');
  6221. hideDiv('HotKeyEntriesBox');
  6222. document.vicidial_form.DispoSelection.value = HKdispo_ary[0];
  6223. dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]);
  6224. }
  6225. }
  6226. }
  6227. }
  6228. <?
  6229. }
  6230. else
  6231. {
  6232. ?>
  6233. // ################################################################################
  6234. // W3C-compliant hotkeypress function to bind hotkeys defined in the campaign to dispositions
  6235. function hotkeypress(evt)
  6236. {
  6237. enter_disable();
  6238. if ( (hot_keys_active==1) && (VD_live_customer_call==1) )
  6239. {
  6240. var e = evt? evt : window.event;
  6241. if(!e) return;
  6242. var key = 0;
  6243. if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which'
  6244. else if (typeof(e.which)!= 'undefined') { key = e.which; }
  6245. //
  6246. var HKdispo = hotkeys[String.fromCharCode(key)];
  6247. if (HKdispo)
  6248. {
  6249. document.vicidial_form.inert_button.focus();
  6250. document.vicidial_form.inert_button.blur();
  6251. CustomerData_update();
  6252. var HKdispo_ary = HKdispo.split(" ----- ");
  6253. if ( (HKdispo_ary[0] == 'ALTPH2') || (HKdispo_ary[0] == 'ADDR3') )
  6254. {
  6255. if (document.vicidial_form.DiaLAltPhonE.checked==true)
  6256. {
  6257. dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]);
  6258. }
  6259. }
  6260. else
  6261. {
  6262. HKdispo_display = 4;
  6263. HKfinish=1;
  6264. document.getElementById("HotKeyDispo").innerHTML = HKdispo_ary[0] + " - " + HKdispo_ary[1];
  6265. showDiv('HotKeyActionBox');
  6266. hideDiv('HotKeyEntriesBox');
  6267. document.vicidial_form.DispoSelection.value = HKdispo_ary[0];
  6268. dialedcall_send_hangup('NO', 'YES', HKdispo_ary[0]);
  6269. }
  6270. // DispoSelect_submit();
  6271. // AutoDialWaiting = 1;
  6272. // AutoDial_ReSume_PauSe("VDADready");
  6273. // alert(HKdispo + " - " + HKdispo_ary[0] + " - " + HKdispo_ary[1]);
  6274. }
  6275. }
  6276. }
  6277. <?
  6278. }
  6279. ### end of onkeypress functions
  6280. ?>
  6281. // ################################################################################
  6282. // disable enter/return keys to not clear out vars en customer info
  6283. function enter_disable(evt)
  6284. {
  6285. var e = evt? evt : window.event;
  6286. if(!e) return;
  6287. var key = 0;
  6288. if (e.keyCode) { key = e.keyCode; } // for moz/fb, if keyCode==0 use 'which'
  6289. else if (typeof(e.which)!= 'undefined') { key = e.which; }
  6290. return key != 13;
  6291. }
  6292. // ################################################################################
  6293. // decode the scripttext and scriptname so that it can be didsplayed
  6294. function URLDecode(encodedvar,scriptformat)
  6295. {
  6296. // Replace %ZZ with equivalent character
  6297. // Put [ERR] in output if %ZZ is invalid.
  6298. var HEXCHAR = "0123456789ABCDEFabcdef";
  6299. var encoded = encodedvar;
  6300. decoded = '';
  6301. var i = 0;
  6302. var RGnl = new RegExp("[\r]\n","g");
  6303. var RGplus = new RegExp(" ","g");
  6304. var RGiframe = new RegExp("iframe","gi");
  6305. var xtest;
  6306. xtest=unescape(encoded);
  6307. encoded=utf8_decode(xtest);
  6308. if (scriptformat == 'YES')
  6309. {
  6310. var SCvendor_lead_code = document.vicidial_form.vendor_lead_code.value;
  6311. var SCsource_id = source_id;
  6312. var SClist_id = document.vicidial_form.list_id.value;
  6313. var SCgmt_offset_now = document.vicidial_form.gmt_offset_now.value;
  6314. var SCcalled_since_last_reset = "";
  6315. var SCphone_code = document.vicidial_form.phone_code.value;
  6316. var SCphone_number = document.vicidial_form.phone_number.value;
  6317. var SCtitle = document.vicidial_form.title.value;
  6318. var SCfirst_name = document.vicidial_form.first_name.value;
  6319. var SCmiddle_initial = document.vicidial_form.middle_initial.value;
  6320. var SClast_name = document.vicidial_form.last_name.value;
  6321. var SCaddress1 = document.vicidial_form.address1.value;
  6322. var SCaddress2 = document.vicidial_form.address2.value;
  6323. var SCaddress3 = document.vicidial_form.address3.value;
  6324. var SCcity = document.vicidial_form.city.value;
  6325. var SCstate = document.vicidial_form.state.value;
  6326. var SCprovince = document.vicidial_form.province.value;
  6327. var SCpostal_code = document.vicidial_form.postal_code.value;
  6328. var SCcountry_code = document.vicidial_form.country_code.value;
  6329. var SCgender = document.vicidial_form.gender.value;
  6330. var SCdate_of_birth = document.vicidial_form.date_of_birth.value;
  6331. var SCalt_phone = document.vicidial_form.alt_phone.value;
  6332. var SCemail = document.vicidial_form.email.value;
  6333. var SCsecurity_phrase = document.vicidial_form.security_phrase.value;
  6334. var SCcomments = document.vicidial_form.comments.value;
  6335. var SCfullname = LOGfullname;
  6336. var SCfronter = fronter;
  6337. var SCuser = user;
  6338. var SCpass = pass;
  6339. var SClead_id = document.vicidial_form.lead_id.value;
  6340. var SCcampaign = campaign;
  6341. var SCphone_login = phone_login;
  6342. var SCgroup = group;
  6343. var SCchannel_group = group;
  6344. var SCSQLdate = SQLdate;
  6345. var SCepoch = UnixTime;
  6346. var SCuniqueid = document.vicidial_form.uniqueid.value;
  6347. var SCcustomer_zap_channel = lastcustchannel;
  6348. var SCserver_ip = server_ip;
  6349. var SCSIPexten = extension;
  6350. var SCsession_id = session_id;
  6351. var SCweb_vars = LIVE_web_vars;
  6352. if (encoded.match(RGiframe))
  6353. {
  6354. SCvendor_lead_code = SCvendor_lead_code.replace(RGplus,'+');
  6355. SCsource_id = SCsource_id.replace(RGplus,'+');
  6356. SClist_id = SClist_id.replace(RGplus,'+');
  6357. SCgmt_offset_now = SCgmt_offset_now.replace(RGplus,'+');
  6358. SCcalled_since_last_reset = SCcalled_since_last_reset.replace(RGplus,'+');
  6359. SCphone_code = SCphone_code.replace(RGplus,'+');
  6360. SCphone_number = SCphone_number.replace(RGplus,'+');
  6361. SCtitle = SCtitle.replace(RGplus,'+');
  6362. SCfirst_name = SCfirst_name.replace(RGplus,'+');
  6363. SCmiddle_initial = SCmiddle_initial.replace(RGplus,'+');
  6364. SClast_name = SClast_name.replace(RGplus,'+');
  6365. SCaddress1 = SCaddress1.replace(RGplus,'+');
  6366. SCaddress2 = SCaddress2.replace(RGplus,'+');
  6367. SCaddress3 = SCaddress3.replace(RGplus,'+');
  6368. SCcity = SCcity.replace(RGplus,'+');
  6369. SCstate = SCstate.replace(RGplus,'+');
  6370. SCprovince = SCprovince.replace(RGplus,'+');
  6371. SCpostal_code = SCpostal_code.replace(RGplus,'+');
  6372. SCcountry_code = SCcountry_code.replace(RGplus,'+');
  6373. SCgender = SCgender.replace(RGplus,'+');
  6374. SCdate_of_birth = SCdate_of_birth.replace(RGplus,'+');
  6375. SCalt_phone = SCalt_phone.replace(RGplus,'+');
  6376. SCemail = SCemail.replace(RGplus,'+');
  6377. SCsecurity_phrase = SCsecurity_phrase.replace(RGplus,'+');
  6378. SCcomments = SCcomments.replace(RGplus,'+');
  6379. SCfullname = SCfullname.replace(RGplus,'+');
  6380. SCfronter = SCfronter.replace(RGplus,'+');
  6381. SCuser = SCuser.replace(RGplus,'+');
  6382. SCpass = SCpass.replace(RGplus,'+');
  6383. SClead_id = SClead_id.replace(RGplus,'+');
  6384. SCcampaign = SCcampaign.replace(RGplus,'+');
  6385. SCphone_login = SCphone_login.replace(RGplus,'+');
  6386. SCgroup = SCgroup.replace(RGplus,'+');
  6387. SCchannel_group = SCchannel_group.replace(RGplus,'+');
  6388. SCSQLdate = SCSQLdate.replace(RGplus,'+');
  6389. SCuniqueid = SCuniqueid.replace(RGplus,'+');
  6390. SCcustomer_zap_channel = SCcustomer_zap_channel.replace(RGplus,'+');
  6391. SCserver_ip = SCserver_ip.replace(RGplus,'+');
  6392. SCSIPexten = SCSIPexten.replace(RGplus,'+');
  6393. SCweb_vars = SCweb_vars.replace(RGplus,'+');
  6394. }
  6395. var RGvendor_lead_code = new RegExp("--A--vendor_lead_code--B--","g");
  6396. var RGsource_id = new RegExp("--A--source_id--B--","g");
  6397. var RGlist_id = new RegExp("--A--list_id--B--","g");
  6398. var RGgmt_offset_now = new RegExp("--A--gmt_offset_now--B--","g");
  6399. var RGcalled_since_last_reset = new RegExp("--A--called_since_last_reset--B--","g");
  6400. var RGphone_code = new RegExp("--A--phone_code--B--","g");
  6401. var RGphone_number = new RegExp("--A--phone_number--B--","g");
  6402. var RGtitle = new RegExp("--A--title--B--","g");
  6403. var RGfirst_name = new RegExp("--A--first_name--B--","g");
  6404. var RGmiddle_initial = new RegExp("--A--middle_initial--B--","g");
  6405. var RGlast_name = new RegExp("--A--last_name--B--","g");
  6406. var RGaddress1 = new RegExp("--A--address1--B--","g");
  6407. var RGaddress2 = new RegExp("--A--address2--B--","g");
  6408. var RGaddress3 = new RegExp("--A--address3--B--","g");
  6409. var RGcity = new RegExp("--A--city--B--","g");
  6410. var RGstate = new RegExp("--A--state--B--","g");
  6411. var RGprovince = new RegExp("--A--province--B--","g");
  6412. var RGpostal_code = new RegExp("--A--postal_code--B--","g");
  6413. var RGcountry_code = new RegExp("--A--country_code--B--","g");
  6414. var RGgender = new RegExp("--A--gender--B--","g");
  6415. var RGdate_of_birth = new RegExp("--A--date_of_birth--B--","g");
  6416. var RGalt_phone = new RegExp("--A--alt_phone--B--","g");
  6417. var RGemail = new RegExp("--A--email--B--","g");
  6418. var RGsecurity_phrase = new RegExp("--A--security_phrase--B--","g");
  6419. var RGcomments = new RegExp("--A--comments--B--","g");
  6420. var RGfullname = new RegExp("--A--fullname--B--","g");
  6421. var RGfronter = new RegExp("--A--fronter--B--","g");
  6422. var RGuser = new RegExp("--A--user--B--","g");
  6423. var RGpass = new RegExp("--A--pass--B--","g");
  6424. var RGlead_id = new RegExp("--A--lead_id--B--","g");
  6425. var RGcampaign = new RegExp("--A--campaign--B--","g");
  6426. var RGphone_login = new RegExp("--A--phone_login--B--","g");
  6427. var RGgroup = new RegExp("--A--group--B--","g");
  6428. var RGchannel_group = new RegExp("--A--channel_group--B--","g");
  6429. var RGSQLdate = new RegExp("--A--SQLdate--B--","g");
  6430. var RGepoch = new RegExp("--A--epoch--B--","g");
  6431. var RGuniqueid = new RegExp("--A--uniqueid--B--","g");
  6432. var RGcustomer_zap_channel = new RegExp("--A--customer_zap_channel--B--","g");
  6433. var RGserver_ip = new RegExp("--A--server_ip--B--","g");
  6434. var RGSIPexten = new RegExp("--A--SIPexten--B--","g");
  6435. var RGsession_id = new RegExp("--A--session_id--B--","g");
  6436. var RGweb_vars = new RegExp("--A--web_vars--B--","g");
  6437. encoded = encoded.replace(RGvendor_lead_code, SCvendor_lead_code);
  6438. encoded = encoded.replace(RGsource_id, SCsource_id);
  6439. encoded = encoded.replace(RGlist_id, SClist_id);
  6440. encoded = encoded.replace(RGgmt_offset_now, SCgmt_offset_now);
  6441. encoded = encoded.replace(RGcalled_since_last_reset, SCcalled_since_last_reset);
  6442. encoded = encoded.replace(RGphone_code, SCphone_code);
  6443. encoded = encoded.replace(RGphone_number, SCphone_number);
  6444. encoded = encoded.replace(RGtitle, SCtitle);
  6445. encoded = encoded.replace(RGfirst_name, SCfirst_name);
  6446. encoded = encoded.replace(RGmiddle_initial, SCmiddle_initial);
  6447. encoded = encoded.replace(RGlast_name, SClast_name);
  6448. encoded = encoded.replace(RGaddress1, SCaddress1);
  6449. encoded = encoded.replace(RGaddress2, SCaddress2);
  6450. encoded = encoded.replace(RGaddress3, SCaddress3);
  6451. encoded = encoded.replace(RGcity, SCcity);
  6452. encoded = encoded.replace(RGstate, SCstate);
  6453. encoded = encoded.replace(RGprovince, SCprovince);
  6454. encoded = encoded.replace(RGpostal_code, SCpostal_code);
  6455. encoded = encoded.replace(RGcountry_code, SCcountry_code);
  6456. encoded = encoded.replace(RGgender, SCgender);
  6457. encoded = encoded.replace(RGdate_of_birth, SCdate_of_birth);
  6458. encoded = encoded.replace(RGalt_phone, SCalt_phone);
  6459. encoded = encoded.replace(RGemail, SCemail);
  6460. encoded = encoded.replace(RGsecurity_phrase, SCsecurity_phrase);
  6461. encoded = encoded.replace(RGcomments, SCcomments);
  6462. encoded = encoded.replace(RGfullname, SCfullname);
  6463. encoded = encoded.replace(RGfronter, SCfronter);
  6464. encoded = encoded.replace(RGuser, SCuser);
  6465. encoded = encoded.replace(RGpass, SCpass);
  6466. encoded = encoded.replace(RGlead_id, SClead_id);
  6467. encoded = encoded.replace(RGcampaign, SCcampaign);
  6468. encoded = encoded.replace(RGphone_login, SCphone_login);
  6469. encoded = encoded.replace(RGgroup, SCgroup);
  6470. encoded = encoded.replace(RGchannel_group, SCchannel_group);
  6471. encoded = encoded.replace(RGSQLdate, SCSQLdate);
  6472. encoded = encoded.replace(RGepoch, SCepoch);
  6473. encoded = encoded.replace(RGuniqueid, SCuniqueid);
  6474. encoded = encoded.replace(RGcustomer_zap_channel, SCcustomer_zap_channel);
  6475. encoded = encoded.replace(RGserver_ip, SCserver_ip);
  6476. encoded = encoded.replace(RGSIPexten, SCSIPexten);
  6477. encoded = encoded.replace(RGsession_id, SCsession_id);
  6478. encoded = encoded.replace(RGweb_vars, SCweb_vars);
  6479. }
  6480. decoded=encoded; // simple no ?
  6481. decoded = decoded.replace(RGnl, "<BR>");
  6482. // while (i < encoded.length) {
  6483. // var ch = encoded.charAt(i);
  6484. // if (ch == "%") {
  6485. // if (i < (encoded.length-2)
  6486. // && HEXCHAR.indexOf(encoded.charAt(i+1)) != -1
  6487. // && HEXCHAR.indexOf(encoded.charAt(i+2)) != -1 ) {
  6488. // decoded += unescape( encoded.substr(i,3) );
  6489. // i += 3;
  6490. // } else {
  6491. // alert( 'Bad escape combo near ...' + encoded.substr(i) );
  6492. // decoded += "%[ERR]";
  6493. // i++;
  6494. // }
  6495. // } else {
  6496. // decoded += ch;
  6497. // i++;
  6498. // }
  6499. // } // while
  6500. // decoded = decoded.replace(RGnl, "<BR>");
  6501. //
  6502. return false;
  6503. };
  6504. // ################################################################################
  6505. // Taken form php.net Angelos
  6506. function utf8_decode(utftext) {
  6507. var string = "";
  6508. var i = 0;
  6509. var c = c1 = c2 = 0;
  6510. while ( i < utftext.length ) {
  6511. c = utftext.charCodeAt(i);
  6512. if (c < 128) {
  6513. string += String.fromCharCode(c);
  6514. i++;
  6515. }
  6516. else if((c > 191) && (c < 224)) {
  6517. c2 = utftext.charCodeAt(i+1);
  6518. string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
  6519. i += 2;
  6520. }
  6521. else {
  6522. c2 = utftext.charCodeAt(i+1);
  6523. c3 = utftext.charCodeAt(i+2);
  6524. string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
  6525. i += 3;
  6526. }
  6527. }
  6528. return string;
  6529. };
  6530. // ################################################################################
  6531. // phone number format
  6532. function phone_number_format(formatphone) {
  6533. // customer_local_time, status date display 9999999999
  6534. // vdc_header_phone_format
  6535. // US_DASH 000-000-0000 - USA dash separated phone number<BR>
  6536. // US_PARN (000)000-0000 - USA dash separated number with area code in parenthesis<BR>
  6537. // UK_DASH 00 0000-0000 - UK dash separated phone number with space after city code<BR>
  6538. // AU_SPAC 000 000 000 - Australia space separated phone number<BR>
  6539. // IT_DASH 0000-000-000 - Italy dash separated phone number<BR>
  6540. // FR_SPAC 00 00 00 00 00 - France space separated phone number<BR>
  6541. var regUS_DASHphone = new RegExp("US_DASH","g");
  6542. var regUS_PARNphone = new RegExp("US_PARN","g");
  6543. var regUK_DASHphone = new RegExp("UK_DASH","g");
  6544. var regAU_SPACphone = new RegExp("AU_SPAC","g");
  6545. var regIT_DASHphone = new RegExp("IT_DASH","g");
  6546. var regFR_SPACphone = new RegExp("FR_SPAC","g");
  6547. var status_display_number = formatphone;
  6548. var dispnum = formatphone;
  6549. if (vdc_header_phone_format.match(regUS_DASHphone))
  6550. {
  6551. var status_display_number = dispnum.substring(0,3) + '-' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
  6552. }
  6553. if (vdc_header_phone_format.match(regUS_PARNphone))
  6554. {
  6555. var status_display_number = '(' + dispnum.substring(0,3) + ')' + dispnum.substring(3,6) + '-' + dispnum.substring(6,10);
  6556. }
  6557. if (vdc_header_phone_format.match(regUK_DASHphone))
  6558. {
  6559. var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,6) + '-' + dispnum.substring(6,10);
  6560. }
  6561. if (vdc_header_phone_format.match(regAU_SPACphone))
  6562. {
  6563. var status_display_number = dispnum.substring(0,3) + ' ' + dispnum.substring(3,6) + ' ' + dispnum.substring(6,9);
  6564. }
  6565. if (vdc_header_phone_format.match(regIT_DASHphone))
  6566. {
  6567. var status_display_number = dispnum.substring(0,4) + '-' + dispnum.substring(4,7) + '-' + dispnum.substring(8,10);
  6568. }
  6569. if (vdc_header_phone_format.match(regFR_SPACphone))
  6570. {
  6571. var status_display_number = dispnum.substring(0,2) + ' ' + dispnum.substring(2,4) + ' ' + dispnum.substring(4,6) + ' ' + dispnum.substring(6,8) + ' ' + dispnum.substring(8,10);
  6572. }
  6573. return status_display_number;
  6574. };
  6575. // ################################################################################
  6576. // Move the Dispo frame out of the way and change the link to maximize
  6577. function DispoMinimize()
  6578. {
  6579. showDiv('DispoButtonHideA');
  6580. showDiv('DispoButtonHideB');
  6581. showDiv('DispoButtonHideC');
  6582. document.getElementById("DispoSelectBox").style.top = 340;
  6583. document.getElementById("DispoSelectMaxMin").innerHTML = "<a href=\"#\" onclick=\"DispoMaximize()\"> maximice </a>";
  6584. }
  6585. // ################################################################################
  6586. // Move the Dispo frame to the top and change the link to minimize
  6587. function DispoMaximize()
  6588. {
  6589. document.getElementById("DispoSelectBox").style.top = 1;
  6590. document.getElementById("DispoSelectMaxMin").innerHTML = "<a href=\"#\" onclick=\"DispoMinimize()\"> reduzca al mínimo </a>";
  6591. hideDiv('DispoButtonHideA');
  6592. hideDiv('DispoButtonHideB');
  6593. hideDiv('DispoButtonHideC');
  6594. }
  6595. // ################################################################################
  6596. // Demostración the groups selection span
  6597. function OpeNGrouPSelectioN()
  6598. {
  6599. if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) )
  6600. {
  6601. alert("USTED DEBE CAMBIAR pausa GRUPOS");
  6602. }
  6603. else
  6604. {
  6605. showDiv('CloserSelectBox')
  6606. }
  6607. }
  6608. // ################################################################################
  6609. // Hide the CBcommentsBox span upon click
  6610. function CBcommentsBoxhide()
  6611. {
  6612. CBentry_time = '';
  6613. CBcallback_time = '';
  6614. CBuser = '';
  6615. CBcomments = '';
  6616. document.getElementById("CBcommentsBoxA").innerHTML = "";
  6617. document.getElementById("CBcommentsBoxB").innerHTML = "";
  6618. document.getElementById("CBcommentsBoxC").innerHTML = "";
  6619. document.getElementById("CBcommentsBoxD").innerHTML = "";
  6620. hideDiv('CBcommentsBox');
  6621. }
  6622. // ################################################################################
  6623. // Hide the EAcommentsBox span upon click
  6624. function EAcommentsBoxhide(minimizetask)
  6625. {
  6626. hideDiv('EAcommentsBox');
  6627. if (minimizetask=='YES')
  6628. {showDiv('EAcommentsMinBox');}
  6629. else
  6630. {hideDiv('EAcommentsMinBox');}
  6631. }
  6632. // ################################################################################
  6633. // Demostración the EAcommentsBox span upon click
  6634. function EAcommentsBoxshow()
  6635. {
  6636. showDiv('EAcommentsBox');
  6637. hideDiv('EAcommentsMinBox');
  6638. }
  6639. // ################################################################################
  6640. // Populating the date field in the callback frame prior to submission
  6641. function CB_date_pick(taskdate)
  6642. {
  6643. document.vicidial_form.CallBackDatESelectioN.value = taskdate;
  6644. document.getElementById("CallBackDatEPrinT").innerHTML = taskdate;
  6645. }
  6646. // ################################################################################
  6647. // Submitting the callback date and time to the system
  6648. function CallBackDatE_submit()
  6649. {
  6650. CallBackDatEForM = document.vicidial_form.CallBackDatESelectioN.value;
  6651. CallBackCommenTs = document.vicidial_form.CallBackCommenTsField.value;
  6652. if (CallBackDatEForM.length < 2)
  6653. {alert("Usted debe elegir una fecha");}
  6654. else
  6655. {
  6656. <?
  6657. if ($useIE > 0)
  6658. {
  6659. ?>
  6660. var CallBackTimEHouRFORM = document.getElementById('CBT_hour');
  6661. var CallBackTimEHouR = CallBackTimEHouRFORM[CallBackTimEHouRFORM.selectedIndex].text;
  6662. // var CallBackTimEHouRIDX = CallBackTimEHouRFORM.value;
  6663. var CallBackTimEMinuteSFORM = document.getElementById('CBT_minute');
  6664. var CallBackTimEMinuteS = CallBackTimEMinuteSFORM[CallBackTimEMinuteSFORM.selectedIndex].text;
  6665. // var CallBackTimEMinuteSIDX = CallBackTimEMinuteSFORM.value;
  6666. var CallBackTimEAmpMFORM = document.getElementById('CBT_ampm');
  6667. var CallBackTimEAmpM = CallBackTimEAmpMFORM[CallBackTimEAmpMFORM.selectedIndex].text;
  6668. // var CallBackTimEAmpMIDX = CallBackTimEAmpMFORM.value;
  6669. // alert (CallBackTimEHouR + "|" + CallBackTimEHouRFORM + "|" + CallBackTimEHouRIDX + "|");
  6670. // alert (CallBackTimEMinuteS + "|" + CallBackTimEMinuteSFORM + "|" + CallBackTimEMinuteSIDX + "|");
  6671. // alert (CallBackTimEAmpM + "|" + CallBackTimEAmpMFORM + "|" + CallBackTimEAmpMIDX + "|");
  6672. CallBackTimEHouRFORM.selectedIndex = '0';
  6673. CallBackTimEMinuteSFORM.selectedIndex = '0';
  6674. CallBackTimEAmpMFORM.selectedIndex = '1';
  6675. <?
  6676. }
  6677. else
  6678. {
  6679. ?>
  6680. CallBackTimEHouR = document.vicidial_form.CBT_hour.value;
  6681. CallBackTimEMinuteS = document.vicidial_form.CBT_minute.value;
  6682. CallBackTimEAmpM = document.vicidial_form.CBT_ampm.value;
  6683. document.vicidial_form.CBT_hour.value = '01';
  6684. document.vicidial_form.CBT_minute.value = '00';
  6685. document.vicidial_form.CBT_ampm.value = 'PM';
  6686. <?
  6687. }
  6688. ?>
  6689. if (CallBackTimEHouR == '12')
  6690. {
  6691. if (CallBackTimEAmpM == 'AM')
  6692. {
  6693. CallBackTimEHouR = '00';
  6694. }
  6695. }
  6696. else
  6697. {
  6698. if (CallBackTimEAmpM == 'PM')
  6699. {
  6700. CallBackTimEHouR = CallBackTimEHouR * 1;
  6701. CallBackTimEHouR = (CallBackTimEHouR + 12);
  6702. }
  6703. }
  6704. CallBackDatETimE = CallBackDatEForM + " " + CallBackTimEHouR + ":" + CallBackTimEMinuteS + ":00";
  6705. if (document.vicidial_form.CallBackOnlyMe.checked==true)
  6706. {
  6707. CallBackrecipient = 'USERONLY';
  6708. }
  6709. else
  6710. {
  6711. CallBackrecipient = 'ANYONE';
  6712. }
  6713. document.getElementById("CallBackDatEPrinT").innerHTML = "Seleccione una fecha abajo";
  6714. document.vicidial_form.CallBackOnlyMe.checked=false;
  6715. document.vicidial_form.CallBackDatESelectioN.value = '';
  6716. document.vicidial_form.CallBackCommenTsField.value = '';
  6717. // alert(CallBackDatETimE + "|" + CallBackCommenTs);
  6718. document.vicidial_form.DispoSelection.value = 'CBHOLD';
  6719. hideDiv('CallBackSelectBox');
  6720. DispoSelect_submit();
  6721. }
  6722. }
  6723. // ################################################################################
  6724. // Finish the wrapup timer early
  6725. function WrapupFinish()
  6726. {
  6727. wrapup_counter=999;
  6728. }
  6729. // ################################################################################
  6730. // GLOBAL FUNCTIONS
  6731. function begin_all_refresh()
  6732. {
  6733. <? if ( ($HK_statuses_camp > 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) {echo "document.onkeypress = hotkeypress;\n";} ?>
  6734. all_refresh();
  6735. }
  6736. function start_all_refresh()
  6737. {
  6738. if (VICIDiaL_closer_login_checked==0)
  6739. {
  6740. hideDiv('NothingBox');
  6741. hideDiv('CBcommentsBox');
  6742. hideDiv('EAcommentsBox');
  6743. hideDiv('EAcommentsMinBox');
  6744. hideDiv('HotKeyActionBox');
  6745. hideDiv('HotKeyEntriesBox');
  6746. hideDiv('MainPanel');
  6747. hideDiv('ScriptPanel');
  6748. hideDiv('DispoSelectBox');
  6749. hideDiv('LogouTBox');
  6750. hideDiv('AgenTDisablEBoX');
  6751. hideDiv('SysteMDisablEBoX');
  6752. hideDiv('CustomerGoneBox');
  6753. hideDiv('NoneInSessionBox');
  6754. hideDiv('WrapupBox');
  6755. hideDiv('TransferMain');
  6756. hideDiv('BienvenidoBoxA');
  6757. hideDiv('CallBackSelectBox');
  6758. hideDiv('DispoButtonHideA');
  6759. hideDiv('DispoButtonHideB');
  6760. hideDiv('DispoButtonHideC');
  6761. hideDiv('CallBacKsLisTBox');
  6762. hideDiv('NeWManuaLDiaLBox');
  6763. hideDiv('PauseCodeSelectBox');
  6764. hideDiv('GroupAliasSelectBox');
  6765. if (agentonly_callbacks != '1')
  6766. {hideDiv('CallbacksButtons');}
  6767. // if ( (agentcall_manual != '1') && (starting_dial_level > 0) )
  6768. if (agentcall_manual != '1')
  6769. {hideDiv('ManuaLDiaLButtons');}
  6770. if (callholdstatus != '1')
  6771. {hideDiv('AgentEstadoCalls');}
  6772. if (agentcallsstatus != '1')
  6773. {hideDiv('AgentEstadoSpan');}
  6774. if ( ( (auto_dial_level > 0) && (dial_method != "INBOUND_MAN") ) || (manual_dial_preview < 1) )
  6775. {clearDiv('DiaLLeaDPrevieW');}
  6776. if (alt_phone_dialing != 1)
  6777. {clearDiv('DiaLDiaLAltPhonE');}
  6778. if (volumecontrol_active != '1')
  6779. {hideDiv('VolumeControlSpan');}
  6780. if (DefaulTAlTDiaL == '1')
  6781. {document.vicidial_form.DiaLAltPhonE.checked=true;}
  6782. document.vicidial_form.LeadLookuP.checked=true;
  6783. if ( (agent_pause_codes_active=='Y') || (agent_pause_codes_active=='FORCE') )
  6784. {
  6785. document.getElementById("PauseCodeLinkSpan").innerHTML = "<a href=\"#\" onclick=\"PauseCodeSelectContent_create();return false;\">INTRODUZCA Un CÓDIGO De la PAUSA</a>";
  6786. }
  6787. if (VICIDiaL_allow_closers < 1)
  6788. {
  6789. document.getElementById("LocalCloser").style.visibility = 'hidden';
  6790. }
  6791. document.getElementById("sessionIDspan").innerHTML = session_id;
  6792. if ( (LIVE_campaign_recording == 'NEVER') || (LIVE_campaign_recording == 'ALLFORCE') )
  6793. {
  6794. document.getElementById("RecorDControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_startrecording_OFF.gif\" border=0 alt=\"Comenzar La Grabación\">";
  6795. }
  6796. if (INgroupCOUNT > 0)
  6797. {
  6798. if (VU_closer_default_blended == 1)
  6799. {document.vicidial_form.CloserSelectBlended.checked=true}
  6800. showDiv('CloserSelectBox');
  6801. var CloserSelecting = 1;
  6802. CloserSelectContent_create();
  6803. }
  6804. else
  6805. {
  6806. hideDiv('CloserSelectBox');
  6807. MainPanelToFront();
  6808. var CloserSelecting = 0;
  6809. if (dial_method == "INBOUND_MAN")
  6810. {
  6811. dial_method = "MANUAL";
  6812. auto_dial_level=0;
  6813. starting_dial_level=0;
  6814. document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML;
  6815. }
  6816. }
  6817. if ( (VtigeRLogiNScripT == 'Y') && (VtigeREnableD > 0) )
  6818. {
  6819. document.getElementById("ScriptContents").innerHTML = "<iframe src=\"" + VtigeRurl + "/index.php?module=Usuarios&action=Authenticate&return_module=Usuarios&return_action=Conexión&user_name=" + user + "&user_password=" + pass + "&login_theme=softed&login_language=en_us\" style=\"width:580;height:290;background-color:transparent;\" scrolling=\"auto\" frameborder=\"0\" allowtransparency=\"true\" id=\"popupFrame\" name=\"popupFrame\" width=\"460\" height=\"290\" STYLE=\"z-index:17\"> </iframe> ";
  6820. }
  6821. VICIDiaL_closer_login_checked = 1;
  6822. }
  6823. else
  6824. {
  6825. var WaitingForNextStep=0;
  6826. if (CloserSelecting==1) {WaitingForNextStep=1;}
  6827. if (open_dispo_screen==1)
  6828. {
  6829. wrapup_counter=0;
  6830. if (wrapup_segundos > 0)
  6831. {
  6832. showDiv('WrapupBox');
  6833. document.getElementById("WrapupTimer").innerHTML = wrapup_segundos;
  6834. wrapup_waiting=1;
  6835. }
  6836. CustomerData_update();
  6837. document.getElementById("GENDERhideFORie").innerHTML = '';
  6838. document.getElementById("GENDERhideFORieALT").innerHTML = '<select size=1 name=gender_list class="cust_form" id=gender_list><option value="U">U - Indefinido</option><option value="M">M - Male</option><option value="F">F - Female</option></select>';
  6839. showDiv('DispoSelectBox');
  6840. DispoSelectContent_create('','ReSET');
  6841. WaitingForNextStep=1;
  6842. open_dispo_screen=0;
  6843. LIVE_default_xfer_group = default_xfer_group;
  6844. LIVE_campaign_recording = campaign_recording;
  6845. LIVE_campaign_rec_filename = campaign_rec_filename;
  6846. document.getElementById("DispoSelectPhonE").innerHTML = document.vicidial_form.phone_number.value;
  6847. if (auto_dial_level == 0)
  6848. {
  6849. if (document.vicidial_form.DiaLAltPhonE.checked==true)
  6850. {
  6851. reselect_alt_dial = 1;
  6852. document.getElementById("DiaLControl").innerHTML = "<a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  6853. document.getElementById("MainStatuSSpan").innerHTML = "Dial Next Call";
  6854. }
  6855. else
  6856. {
  6857. reselect_alt_dial = 0;
  6858. }
  6859. }
  6860. }
  6861. if (AgentDispoing==1)
  6862. {
  6863. WaitingForNextStep=1;
  6864. check_for_conf_calls(session_id, '0');
  6865. }
  6866. if (logout_stop_timeouts==1) {WaitingForNextStep=1;}
  6867. if ( (custchannellive < -30) && (lastcustchannel.length > 3) ) {CustomerChanneLGone();}
  6868. if ( (custchannellive < -10) && (lastcustchannel.length > 3) ) {ReChecKCustoMerChaN();}
  6869. if ( (nochannelinsession > 16) && (check_n > 15) ) {NoneInSession();}
  6870. if (WaitingForNextStep==0)
  6871. {
  6872. // check for live channels in conference room and get current datetime
  6873. check_for_conf_calls(session_id, '0');
  6874. if (agentonly_callbacks == '1')
  6875. {CB_count_check++;}
  6876. if (AutoDialWaiting == 1)
  6877. {
  6878. check_for_auto_incoming();
  6879. }
  6880. // look for a channel name for the manually dialed call
  6881. if (MD_channel_look==1)
  6882. {
  6883. ManualDialCheckChanneL(XDcheck);
  6884. }
  6885. if ( (CB_count_check > 19) && (agentonly_callbacks == '1') )
  6886. {
  6887. CalLBacKsCounTCheck();
  6888. CB_count_check=0;
  6889. }
  6890. if (VD_live_customer_call==1)
  6891. {
  6892. VD_live_call_secondS++;
  6893. document.vicidial_form.SecondS.value = VD_live_call_secondS;
  6894. document.getElementById("SecondSDISP").innerHTML = VD_live_call_secondS;
  6895. }
  6896. if (XD_live_customer_call==1)
  6897. {
  6898. XD_live_call_secondS++;
  6899. document.vicidial_form.xferlength.value = XD_live_call_secondS;
  6900. }
  6901. if (HKdispo_display > 0)
  6902. {
  6903. if ( (HKdispo_display == 3) && (HKfinish==1) )
  6904. {
  6905. HKfinish=0;
  6906. DispoSelect_submit();
  6907. // AutoDialWaiting = 1;
  6908. // AutoDial_ReSume_PauSe("VDADready");
  6909. }
  6910. if (HKdispo_display == 1)
  6911. {
  6912. if (hot_keys_active==1)
  6913. {showDiv('HotKeyEntriesBox');}
  6914. hideDiv('HotKeyActionBox');
  6915. }
  6916. HKdispo_display--;
  6917. }
  6918. if (all_record == 'YES')
  6919. {
  6920. if (all_record_count < allcalls_delay)
  6921. {all_record_count++;}
  6922. else
  6923. {
  6924. conf_send_recording('MonitorConf',session_id ,'');
  6925. all_record = 'NO';
  6926. all_record_count=0;
  6927. }
  6928. }
  6929. if (active_display==1)
  6930. {
  6931. check_s = check_n.toString();
  6932. if ( (check_s.match(/00$/)) || (check_n<2) )
  6933. {
  6934. // check_for_conf_calls();
  6935. }
  6936. }
  6937. if (check_n<2)
  6938. {
  6939. }
  6940. else
  6941. {
  6942. // check_for_live_calls();
  6943. check_s = check_n.toString();
  6944. }
  6945. if (wrapup_segundos > 0)
  6946. {
  6947. document.getElementById("WrapupTimer").innerHTML = (wrapup_segundos - wrapup_counter);
  6948. wrapup_counter++;
  6949. if ( (wrapup_counter > wrapup_segundos) && (document.getElementById("WrapupBox").style.visibility == 'visible') )
  6950. {
  6951. wrapup_waiting=0;
  6952. hideDiv('WrapupBox');
  6953. if (document.vicidial_form.DispoSelectStop.checked==true)
  6954. {
  6955. if (auto_dial_level != '0')
  6956. {
  6957. AutoDialWaiting = 0;
  6958. // alert('wrapup pause');
  6959. AutoDial_ReSume_PauSe("VDADpause");
  6960. // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
  6961. }
  6962. VICIDiaL_pause_calling = 1;
  6963. if (dispo_check_all_pause != '1')
  6964. {
  6965. document.vicidial_form.DispoSelectStop.checked=false;
  6966. alert("unchecking PAUSE");
  6967. }
  6968. }
  6969. else
  6970. {
  6971. if (auto_dial_level != '0')
  6972. {
  6973. AutoDialWaiting = 1;
  6974. // alert('wrapup ready');
  6975. AutoDial_ReSume_PauSe("VDADready","NEW_ID","WRAPUP");
  6976. // document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_ready;
  6977. }
  6978. }
  6979. }
  6980. }
  6981. }
  6982. }
  6983. setTimeout("all_refresh()", refresh_interval);
  6984. }
  6985. function all_refresh()
  6986. {
  6987. epoch_sec++;
  6988. check_n++;
  6989. var year= t.getYear()
  6990. var month= t.getMonth()
  6991. month++;
  6992. var daym= t.getDate()
  6993. var hours = t.getHours();
  6994. var min = t.getMinutes();
  6995. var sec = t.getSeconds();
  6996. var regMSdate = new RegExp("MS_","g");
  6997. var regUSdate = new RegExp("US_","g");
  6998. var regEUdate = new RegExp("EU_","g");
  6999. var regALdate = new RegExp("AL_","g");
  7000. var regAMPMdate = new RegExp("AMPM","g");
  7001. if (year < 1000) {year+=1900}
  7002. if (month< 10) {month= "0" + month}
  7003. if (daym< 10) {daym= "0" + daym}
  7004. if (hours < 10) {hours = "0" + hours;}
  7005. if (min < 10) {min = "0" + min;}
  7006. if (sec < 10) {sec = "0" + sec;}
  7007. var Tyear = (year-2000);
  7008. filedate = year + "" + month + "" + daym + "-" + hours + "" + min + "" + sec;
  7009. tinydate = Tyear + "" + month + "" + daym + "" + hours + "" + min + "" + sec;
  7010. SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec;
  7011. var status_date = '';
  7012. var status_time = hours + ":" + min + ":" + sec;
  7013. if (vdc_header_date_format.match(regMSdate))
  7014. {
  7015. status_date = year + "-" + month + "-" + daym;
  7016. }
  7017. if (vdc_header_date_format.match(regUSdate))
  7018. {
  7019. status_date = month + "/" + daym + "/" + year;
  7020. }
  7021. if (vdc_header_date_format.match(regEUdate))
  7022. {
  7023. status_date = daym + "/" + month + "/" + year;
  7024. }
  7025. if (vdc_header_date_format.match(regALdate))
  7026. {
  7027. var statusmon='';
  7028. if (mon == 1) {statusmon = "ENE";}
  7029. if (mon == 2) {statusmon = "FEB";}
  7030. if (mon == 3) {statusmon = "MAR";}
  7031. if (mon == 4) {statusmon = "ABR";}
  7032. if (mon == 5) {statusmon = "PUE";}
  7033. if (mon == 6) {statusmon = "JUN";}
  7034. if (mon == 7) {statusmon = "JUL";}
  7035. if (mon == 8) {statusmon = "AGO";}
  7036. if (mon == 9) {statusmon = "SEP";}
  7037. if (mon == 10) {statusmon = "OCT";}
  7038. if (mon == 11) {statusmon = "NOV";}
  7039. if (mon == 12) {statusmon = "DIC";}
  7040. status_date = statusmon + " " + daym;
  7041. }
  7042. if (vdc_header_date_format.match(regAMPMdate))
  7043. {
  7044. var AMPM = 'AM';
  7045. if (hours == 12) {AMPM = 'PM';}
  7046. if (hours == 0) {AMPM = 'AM'; hours = '12';}
  7047. if (hours > 12) {hours = (hours - 12); AMPM = 'PM';}
  7048. status_time = hours + ":" + min + ":" + sec + " " + AMPM;
  7049. }
  7050. document.getElementById("status").innerHTML = status_date + " " + status_time + display_message;
  7051. if (VD_live_customer_call==1)
  7052. {
  7053. var customer_gmt = parseFloat(document.vicidial_form.gmt_offset_now.value);
  7054. var AMPM = 'AM';
  7055. var customer_gmt_diff = (customer_gmt - local_gmt);
  7056. var UnixTimec = (UnixTime + (3600 * customer_gmt_diff));
  7057. var UnixTimeMSc = (UnixTimec * 1000);
  7058. c.setTime(UnixTimeMSc);
  7059. var Cyear= c.getYear()
  7060. var Cmon= c.getMonth()
  7061. Cmon++;
  7062. var Cdaym= c.getDate()
  7063. var Chours = c.getHours();
  7064. var Cmin = c.getMinutes();
  7065. var Csec = c.getSeconds();
  7066. if (Cyear < 1000) {Cyear+=1900}
  7067. if (Cmon < 10) {Cmon= "0" + Cmon}
  7068. if (Cdaym < 10) {Cdaym= "0" + Cdaym}
  7069. if (Chours < 10) {Chours = "0" + Chours;}
  7070. if ( (Cmin < 10) && (Cmin.length < 2) ) {Cmin = "0" + Cmin;}
  7071. if ( (Csec < 10) && (Csec.length < 2) ) {Csec = "0" + Csec;}
  7072. if (Cmin < 10) {Cmin = "0" + Cmin;}
  7073. if (Csec < 10) {Csec = "0" + Csec;}
  7074. var customer_date = '';
  7075. var customer_time = Chours + ":" + Cmin + ":" + Csec;
  7076. if (vdc_customer_date_format.match(regMSdate))
  7077. {
  7078. customer_date = Cyear + "-" + Cmon + "-" + Cdaym;
  7079. }
  7080. if (vdc_customer_date_format.match(regUSdate))
  7081. {
  7082. customer_date = Cmon + "/" + Cdaym + "/" + Cyear;
  7083. }
  7084. if (vdc_customer_date_format.match(regEUdate))
  7085. {
  7086. customer_date = Cdaym + "/" + Cmon + "/" + Cyear;
  7087. }
  7088. if (vdc_customer_date_format.match(regALdate))
  7089. {
  7090. var customermon='';
  7091. if (Cmon == 1) {customermon = "ENE";}
  7092. if (Cmon == 2) {customermon = "FEB";}
  7093. if (Cmon == 3) {customermon = "MAR";}
  7094. if (Cmon == 4) {customermon = "ABR";}
  7095. if (Cmon == 5) {customermon = "PUE";}
  7096. if (Cmon == 6) {customermon = "JUN";}
  7097. if (Cmon == 7) {customermon = "JUL";}
  7098. if (Cmon == 8) {customermon = "AGO";}
  7099. if (Cmon == 9) {customermon = "SEP";}
  7100. if (Cmon == 10) {customermon = "OCT";}
  7101. if (Cmon == 11) {customermon = "NOV";}
  7102. if (Cmon == 12) {customermon = "DIC";}
  7103. customer_date = customermon + " " + Cdaym + " ";
  7104. }
  7105. if (vdc_customer_date_format.match(regAMPMdate))
  7106. {
  7107. var AMPM = 'AM';
  7108. if (Chours == 12) {AMPM = 'PM';}
  7109. if (Chours == 0) {AMPM = 'AM'; Chours = '12';}
  7110. if (Chours > 12) {Chours = (Chours - 12); AMPM = 'PM';}
  7111. customer_time = Chours + ":" + Cmin + ":" + Csec + " " + AMPM;
  7112. }
  7113. var customer_local_time = customer_date + " " + customer_time;
  7114. document.vicidial_form.custdatetime.value = customer_local_time;
  7115. }
  7116. start_all_refresh();
  7117. }
  7118. function pause() // Pauses the refreshing of the lists
  7119. {active_display=2; display_message=" - DISPLAY ACTIVO PAUSADO - ";}
  7120. function start() // resumes the refreshing of the lists
  7121. {active_display=1; display_message='';}
  7122. function faster() // lowers by 1000 milliseconds the time until the next refresh
  7123. {
  7124. if (refresh_interval>1001)
  7125. {refresh_interval=(refresh_interval - 1000);}
  7126. }
  7127. function slower() // raises by 1000 milliseconds the time until the next refresh
  7128. {
  7129. refresh_interval=(refresh_interval + 1000);
  7130. }
  7131. // activeext-specific functions
  7132. function activeext_force_refresh() // forces immediate refresh of list content
  7133. {getactiveext();}
  7134. function activeext_order_asc() // changes order of activeext list to ascending
  7135. {
  7136. activeext_order="asc"; getactiveext();
  7137. desc_order_HTML ='<a href="#" onclick="activeext_order_desc();return false;">ORDEN</a>';
  7138. document.getElementById("activeext_order").innerHTML = desc_order_HTML;
  7139. }
  7140. function activeext_order_desc() // changes order of activeext list to descending
  7141. {
  7142. activeext_order="desc"; getactiveext();
  7143. asc_order_HTML ='<a href="#" onclick="activeext_order_asc();return false;">ORDEN</a>';
  7144. document.getElementById("activeext_order").innerHTML = asc_order_HTML;
  7145. }
  7146. // busytrunk-specific functions
  7147. function busytrunk_force_refresh() // forces immediate refresh of list content
  7148. {getbusytrunk();}
  7149. function busytrunk_order_asc() // changes order of busytrunk list to ascending
  7150. {
  7151. busytrunk_order="asc"; getbusytrunk();
  7152. desc_order_HTML ='<a href="#" onclick="busytrunk_order_desc();return false;">ORDEN</a>';
  7153. document.getElementById("busytrunk_order").innerHTML = desc_order_HTML;
  7154. }
  7155. function busytrunk_order_desc() // changes order of busytrunk list to descending
  7156. {
  7157. busytrunk_order="desc"; getbusytrunk();
  7158. asc_order_HTML ='<a href="#" onclick="busytrunk_order_asc();return false;">ORDEN</a>';
  7159. document.getElementById("busytrunk_order").innerHTML = asc_order_HTML;
  7160. }
  7161. function busytrunkhangup_force_refresh() // forces immediate refresh of list content
  7162. {busytrunkhangup();}
  7163. // busyext-specific functions
  7164. function busyext_force_refresh() // forces immediate refresh of list content
  7165. {getbusyext();}
  7166. function busyext_order_asc() // changes order of busyext list to ascending
  7167. {
  7168. busyext_order="asc"; getbusyext();
  7169. desc_order_HTML ='<a href="#" onclick="busyext_order_desc();return false;">ORDEN</a>';
  7170. document.getElementById("busyext_order").innerHTML = desc_order_HTML;
  7171. }
  7172. function busyext_order_desc() // changes order of busyext list to descending
  7173. {
  7174. busyext_order="desc"; getbusyext();
  7175. asc_order_HTML ='<a href="#" onclick="busyext_order_asc();return false;">ORDEN</a>';
  7176. document.getElementById("busyext_order").innerHTML = asc_order_HTML;
  7177. }
  7178. function busylocalhangup_force_refresh() // forces immediate refresh of list content
  7179. {busylocalhangup();}
  7180. // functions to hide and show different DIVs
  7181. function showDiv(divvar)
  7182. {
  7183. if (document.getElementById(divvar))
  7184. {
  7185. divref = document.getElementById(divvar).style;
  7186. divref.visibility = 'visible';
  7187. }
  7188. }
  7189. function hideDiv(divvar)
  7190. {
  7191. if (document.getElementById(divvar))
  7192. {
  7193. divref = document.getElementById(divvar).style;
  7194. divref.visibility = 'hidden';
  7195. }
  7196. }
  7197. function clearDiv(divvar)
  7198. {
  7199. if (document.getElementById(divvar))
  7200. {
  7201. document.getElementById(divvar).innerHTML = '';
  7202. if (divvar == 'DiaLLeaDPrevieW')
  7203. {
  7204. var buildDivHTML = "<font class=\"preview_text\"> <input type=checkbox name=LeadPreview size=1 value=\"0\"> MOSTRAR LEAD<BR></font>";
  7205. document.getElementById("DiaLLeaDPrevieWHide").innerHTML = buildDivHTML;
  7206. }
  7207. if (divvar == 'DiaLDiaLAltPhonE')
  7208. {
  7209. var buildDivHTML = "<font class=\"preview_text\"> <input type=checkbox name=DiaLAltPhonE size=1 value=\"0\"> TELÉFONO DEL ALT<BR></font>";
  7210. document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = buildDivHTML;
  7211. }
  7212. if (DefaulTAlTDiaL == '1')
  7213. {document.vicidial_form.DiaLAltPhonE.checked=true;}
  7214. }
  7215. }
  7216. function buildDiv(divvar)
  7217. {
  7218. if (document.getElementById(divvar))
  7219. {
  7220. var buildDivHTML = "";
  7221. if (divvar == 'DiaLLeaDPrevieW')
  7222. {
  7223. document.getElementById("DiaLLeaDPrevieWHide").innerHTML = '';
  7224. var buildDivHTML = "<font class=\"preview_text\"> <input type=checkbox name=LeadPreview size=1 value=\"0\"> MOSTRAR LEAD<BR></font>";
  7225. document.getElementById(divvar).innerHTML = buildDivHTML;
  7226. if (reselect_preview_dial==1)
  7227. {document.vicidial_form.LeadPreview.checked=true}
  7228. }
  7229. if (divvar == 'DiaLDiaLAltPhonE')
  7230. {
  7231. document.getElementById("DiaLDiaLAltPhonEHide").innerHTML = '';
  7232. var buildDivHTML = "<font class=\"preview_text\"> <input type=checkbox name=DiaLAltPhonE size=1 value=\"0\"> TELÉFONO DEL ALT<BR></font>";
  7233. document.getElementById(divvar).innerHTML = buildDivHTML;
  7234. if (reselect_alt_dial==1)
  7235. {document.vicidial_form.DiaLAltPhonE.checked=true}
  7236. if (DefaulTAlTDiaL == '1')
  7237. {document.vicidial_form.DiaLAltPhonE.checked=true;}
  7238. }
  7239. }
  7240. }
  7241. function conf_channels_detail(divvar)
  7242. {
  7243. if (divvar == 'SHOW')
  7244. {
  7245. conf_channels_xtra_display = 1;
  7246. document.getElementById("busycallsdisplay").innerHTML = "<a href=\"#\" onclick=\"conf_channels_detail('HIDE');\">Ocultar la información del canal Conferencia</a>";
  7247. LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]='';
  7248. LMAcount=0;
  7249. }
  7250. else
  7251. {
  7252. conf_channels_xtra_display = 0;
  7253. document.getElementById("busycallsdisplay").innerHTML = "<a href=\"#\" onclick=\"conf_channels_detail('SHOW');\">Mostrar la información del canal Conferencia</a><BR><BR>&nbsp;";
  7254. document.getElementById("outboundcallsspan").innerHTML = '';
  7255. LMAe[0]=''; LMAe[1]=''; LMAe[2]=''; LMAe[3]=''; LMAe[4]=''; LMAe[5]='';
  7256. LMAcount=0;
  7257. }
  7258. }
  7259. function HotKeys(HKstate)
  7260. {
  7261. if ( (HKstate == 'ON') && (HKbutton_allowed == 1) )
  7262. {
  7263. showDiv('HotKeyEntriesBox');
  7264. hot_keys_active = 1;
  7265. document.getElementById("hotkeysdisplay").innerHTML = "<a href=\"#\" onMouseOut=\"HotKeys('OFF')\"><IMG SRC=\"../agc/images/vdc_XB_hotkeysactive_es.gif\" border=0 alt=\"TECLAS ACCESO RÁPIDO ACTIVAS\"></a>";
  7266. }
  7267. else
  7268. {
  7269. hideDiv('HotKeyEntriesBox');
  7270. hot_keys_active = 0;
  7271. document.getElementById("hotkeysdisplay").innerHTML = "<a href=\"#\" onMouseOver=\"HotKeys('ON')\"><IMG SRC=\"../agc/images/vdc_XB_hotkeysactive_OFF_es.gif\" border=0 alt=\"TECLAS ACCESO RÁPIDO INACTIVAS\"></a>";
  7272. }
  7273. }
  7274. function ShoWTransferMain(showxfervar,showoffvar)
  7275. {
  7276. if (VU_vicidial_transfers == '1')
  7277. {
  7278. if (showxfervar == 'ON')
  7279. {
  7280. var xfer_height = <?=$HTheight ?>;
  7281. if (alt_phone_dialing>0) {xfer_height = (xfer_height + 20);}
  7282. if ( (auto_dial_level == 0) && (manual_dial_preview == 1) ) {xfer_height = (xfer_height + 20);}
  7283. document.getElementById("TransferMain").style.top = xfer_height;
  7284. HKbutton_allowed = 0;
  7285. showDiv('TransferMain');
  7286. document.getElementById("XferControl").innerHTML = "<a href=\"#\" onclick=\"ShoWTransferMain('OFF','YES');\"><IMG SRC=\"../agc/images/vdc_LB_transferconf_es.gif\" border=0 alt=\"Transferencia - Conferencia\"></a>";
  7287. var loop_ct = 0;
  7288. var live_XfeR_HTML = '';
  7289. var XfeR_SelecT = '';
  7290. while (loop_ct < XFgroupCOUNT)
  7291. {
  7292. if (VARxfergroups[loop_ct] == LIVE_default_xfer_group)
  7293. {XfeR_SelecT = 'SELECTED ';}
  7294. else {XfeR_SelecT = '';}
  7295. live_XfeR_HTML = live_XfeR_HTML + "<option " + XfeR_SelecT + "value=\"" + VARxfergroups[loop_ct] + "\">" + VARxfergroups[loop_ct] + " - " + VARxfergroupsnames[loop_ct] + "</option>\n";
  7296. loop_ct++;
  7297. }
  7298. document.getElementById("XfeRGrouPLisT").innerHTML = "<select size=1 name=XfeRGrouP class=\"cust_form\" id=XfeRGrouP>" + live_XfeR_HTML + "</select>";
  7299. }
  7300. else
  7301. {
  7302. HKbutton_allowed = 1;
  7303. hideDiv('TransferMain');
  7304. if (showoffvar == 'YES')
  7305. {
  7306. document.getElementById("XferControl").innerHTML = "<a href=\"#\" onclick=\"ShoWTransferMain('ON');\"><IMG SRC=\"../agc/images/vdc_LB_transferconf_es.gif\" border=0 alt=\"Transferencia - Conferencia\"></a>";
  7307. }
  7308. }
  7309. if (three_way_call_cid == 'AGENT_CHOOSE')
  7310. {
  7311. if ( (active_group_alias.length < 1) && (LIVE_default_group_alias.length > 1) && (LIVE_caller_id_number.length > 3) )
  7312. {
  7313. active_group_alias = LIVE_default_group_alias;
  7314. cid_choice = LIVE_caller_id_number;
  7315. }
  7316. document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "<font size=1 face=\"Arial,Helvetica\">Grupo de Alias: " + active_group_alias + "</font>";
  7317. document.getElementById("XfeRCID").innerHTML = "<a href=\"#\" onclick=\"GroupAliasSelectContent_create('1');\"><font size=1 face=\"Arial,Helvetica\">Haga clic aquí para escoger un grupo de alias</font></a>";
  7318. }
  7319. else
  7320. {
  7321. document.getElementById("XfeRCID").innerHTML = "";
  7322. document.getElementById("XfeRDiaLGrouPSelecteD").innerHTML = "";
  7323. }
  7324. }
  7325. else
  7326. {
  7327. if (showxfervar != 'OFF')
  7328. {
  7329. alert('USTED NO TIENE PERMISOS DE TRANSFERIR LLAMADAS');
  7330. }
  7331. }
  7332. }
  7333. function MainPanelToFront(resumevar)
  7334. {
  7335. document.getElementById("MainTable").style.backgroundColor="<? echo $MAIN_COLOR ?>";
  7336. document.getElementById("MaiNfooter").style.backgroundColor="<? echo $MAIN_COLOR ?>";
  7337. hideDiv('ScriptPanel');
  7338. showDiv('MainPanel');
  7339. if (resumevar != 'NO')
  7340. {
  7341. if (alt_phone_dialing == 1)
  7342. {buildDiv('DiaLDiaLAltPhonE');}
  7343. else
  7344. {clearDiv('DiaLDiaLAltPhonE');}
  7345. if (auto_dial_level == 0)
  7346. {
  7347. if (auto_dial_alt_dial==1)
  7348. {
  7349. auto_dial_alt_dial=0;
  7350. document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML_OFF;
  7351. }
  7352. else
  7353. {
  7354. document.getElementById("DiaLControl").innerHTML = DiaLControl_manual_HTML;
  7355. if (manual_dial_preview == 1)
  7356. {buildDiv('DiaLLeaDPrevieW');}
  7357. }
  7358. }
  7359. else
  7360. {
  7361. if (dial_method == "INBOUND_MAN")
  7362. {
  7363. document.getElementById("DiaLControl").innerHTML = "<IMG SRC=\"../agc/images/vdc_LB_pause_OFF_es.gif\" border=0 alt=\" Pausa \"><a href=\"#\" onclick=\"AutoDial_ReSume_PauSe('VDADready');\"><IMG SRC=\"../agc/images/vdc_LB_resume_es.gif\" border=0 alt=\"Comienzo\"></a><BR><a href=\"#\" onclick=\"ManualDialNext('','','','','','0');\"><IMG SRC=\"../agc/images/vdc_LB_dialnextnumber_es.gif\" border=0 alt=\"Marcar el Siguiente Número\"></a>";
  7364. if (manual_dial_preview == 1)
  7365. {buildDiv('DiaLLeaDPrevieW');}
  7366. }
  7367. else
  7368. {
  7369. document.getElementById("DiaLControl").innerHTML = DiaLControl_auto_HTML;
  7370. clearDiv('DiaLLeaDPrevieW');
  7371. }
  7372. }
  7373. }
  7374. panel_bgcolor='<? echo $MAIN_COLOR ?>';
  7375. document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
  7376. }
  7377. function ScriptPanelToFront()
  7378. {
  7379. showDiv('ScriptPanel');
  7380. document.getElementById("MainTable").style.backgroundColor="<? echo $SCRIPT_COLOR ?>";
  7381. document.getElementById("MaiNfooter").style.backgroundColor="<? echo $SCRIPT_COLOR ?>";
  7382. panel_bgcolor='<? echo $SCRIPT_COLOR ?>';
  7383. document.getElementById("MainStatuSSpan").style.background = panel_bgcolor;
  7384. }
  7385. </script>
  7386. <style type="text/css">
  7387. <!--
  7388. div.scroll_callback {height: 300px; width: 620px; overflow: scroll;}
  7389. div.scroll_list {height: 400px; width: 140px; overflow: scroll;}
  7390. div.scroll_script {height: <?=$SSheight ?>px; width: <?=$SDwidth ?>px; background: #FFF5EC; overflow: scroll; font-size: 12px; font-family: sans-serif;}
  7391. div.text_input {overflow: auto; font-size: 10px; font-family: sans-serif;}
  7392. .body_text {font-size: 13px; font-family: sans-serif;}
  7393. .queue_text_red {font-size: 12px; font-family: sans-serif; font-weight: bold; color: red}
  7394. .queue_text {font-size: 12px; font-family: sans-serif; color: black}
  7395. .preview_text {font-size: 13px; font-family: sans-serif; background: #CCFFCC}
  7396. .preview_text_red {font-size: 13px; font-family: sans-serif; background: #FFCCCC}
  7397. .body_small {font-size: 11px; font-family: sans-serif;}
  7398. .body_tiny {font-size: 10px; font-family: sans-serif;}
  7399. .log_text {font-size: 11px; font-family: monospace;}
  7400. .log_text_red {font-size: 11px; font-family: monospace; font-weight: bold; background: #FF3333}
  7401. .log_title {font-size: 12px; font-family: monospace; font-weight: bold;}
  7402. .sd_text {font-size: 16px; font-family: sans-serif; font-weight: bold;}
  7403. .sh_text {font-size: 14px; font-family: sans-serif; font-weight: bold;}
  7404. .sb_text {font-size: 12px; font-family: sans-serif;}
  7405. .sk_text {font-size: 11px; font-family: sans-serif;}
  7406. .skb_text {font-size: 13px; font-family: sans-serif; font-weight: bold;}
  7407. .ON_conf {font-size: 11px; font-family: monospace; color: black; background: #FFFF99}
  7408. .OFF_conf {font-size: 11px; font-family: monospace; color: black; background: #FFCC77}
  7409. .cust_form {font-family: sans-serif; font-size: 10px; overflow: hidden}
  7410. .cust_form_text {font-family: sans-serif; font-size: 10px; overflow: auto}
  7411. -->
  7412. </style>
  7413. <?
  7414. echo "</head>\n";
  7415. ?>
  7416. <BODY onload="begin_all_refresh();" onunload="BrowserCloseLogout();">
  7417. <FORM name=vicidial_form>
  7418. <span style="position:absolute;left:0px;top:0px;z-index:2;" id="Header">
  7419. <TABLE Border=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=white WIDTH=<?=$MNwidth ?> MARGINWIDTH=0 MARGINHEIGHT=0 LEFTMARGIN=0 TOPMARGIN=0 VALIGN=TOP ALIGN=LEFT>
  7420. <TR VALIGN=TOP ALIGN=LEFT><TD COLSPAN=3 VALIGN=TOP ALIGN=LEFT>
  7421. <INPUT TYPE=HIDDEN NAME=extension>
  7422. <font class="queue_text">
  7423. <? echo "Usuario: $VD_login en Teléfono: $SIP_user a la campaña: $VD_campaign&nbsp; \n"; ?>
  7424. &nbsp; &nbsp; <span id="agentchannelSPAN"></span>
  7425. </TD><TD COLSPAN=3 VALIGN=TOP ALIGN=RIGHT><font class="body_text">
  7426. <? if ($INgrpCT > 0) {echo "<a href=\"#\" onclick=\"OpeNGrouPSelectioN();return false;\">GROUPS</a> &nbsp; &nbsp; \n";} ?>
  7427. <? echo "<a href=\"#\" onclick=\"LogouT('NORMAL');return false;\">SALIR</a>\n"; ?>
  7428. </TD></TR></TABLE>
  7429. </SPAN>
  7430. <span style="position:absolute;left:0px;top:13px;z-index:1;" id="Tabs">
  7431. <table border=0 bgcolor="#FFFFFF" width=<?=$MNwidth ?> height=30>
  7432. <TR VALIGN=TOP ALIGN=LEFT>
  7433. <TD ALIGN=LEFT WIDTH=115><A HREF="#" onclick="MainPanelToFront('NO');"><IMG SRC="../agc/images/vdc_tab_vicidial.gif" ALT="VICIDIAL" WIDTH=115 HEIGHT=30 Border=0></A></TD>
  7434. <TD ALIGN=LEFT WIDTH=105><A HREF="#" onclick="ScriptPanelToFront();"><IMG SRC="../agc/images/vdc_tab_script_es.gif" ALT="SCRIPT" WIDTH=105 HEIGHT=30 Border=0></A></TD>
  7435. <TD WIDTH=<?=$HSwidth ?> VALIGN=MIDDLE ALIGN=CENTER><font class="body_text"> &nbsp; <span id=status>LIVE</span> &nbsp; &nbsp; sesión ID: <span id=sessionIDspan></span> &nbsp; &nbsp; <span id=AgentEstadoCalls></span></TD>
  7436. <TD WIDTH=109><IMG SRC="../agc/images/agc_live_call_OFF_es.gif" NAME=livecall ALT="Llamada Activa" WIDTH=109 HEIGHT=30 Border=0></TD>
  7437. </TR></TABLE>
  7438. </span>
  7439. <span style="position:absolute;left:0px;top:0px;z-index:3;" id="BienvenidoBoxA">
  7440. <table border=0 bgcolor="#FFFFFF" width=<?=$CAwidth ?> height=<?=$HKwidth ?>><TR><TD align=center><BR><span id="BienvenidoBoxAt">VICIDIAL</span></TD></TR></TABLE>
  7441. </span>
  7442. <span style="position:absolute;left:300px;top:<?=$MBheight ?>px;z-index:12;" id="ManuaLDiaLButtons"><font class="body_text">
  7443. <span id="MDstatusSpan"><a href="#" onclick="NeWManuaLDiaLCalL('NO');return false;">MARCADO MANUAL</a></span> &nbsp; &nbsp; &nbsp; <a href="#" onclick="NeWManuaLDiaLCalL('FAST');return false;">DIAL RÁPIDO</a><BR>
  7444. </font></span>
  7445. <span style="position:absolute;left:300px;top:<?=$CBheight ?>px;z-index:13;" id="CallbacksButtons"><font class="body_text">
  7446. <span id="CBstatusSpan">X SERVICIOS REPETIDOS ACTIVOS</span> <BR>
  7447. </font></span>
  7448. <span style="position:absolute;left:500px;top:<?=$CBheight ?>px;z-index:14;" id="PauseCodeButtons"><font class="body_text">
  7449. <span id="PauseCodeLinkSpan"></span> <BR>
  7450. </font></span>
  7451. <span style="position:absolute;left:<?=$SCwidth ?>px;top:49px;z-index:18;" id="SecondSspan"><font class="body_text"> segundos:
  7452. <span id="SecondSDISP"> &nbsp; &nbsp; </span>
  7453. </font></span>
  7454. <span style="position:absolute;left:<?=$AMwidth ?>px;top:<?=$AMheight ?>px;z-index:22;" id="AgentMuteANDPreseTDiaL"><font class="body_text">
  7455. <?
  7456. if ($PreseT_DiaL_LinKs)
  7457. {
  7458. echo "<a href=\"#\" onclick=\"DtMf_PreSet_a_DiaL();return false;\"><font class=\"body_tiny\">D1 - DIAL</font></a>\n";
  7459. echo "<BR>\n";
  7460. echo "<a href=\"#\" onclick=\"DtMf_PreSet_b_DiaL();return false;\"><font class=\"body_tiny\">D2 - DIAL</font></a>\n";
  7461. }
  7462. else {echo "<BR>\n";}
  7463. ?>
  7464. <BR><BR>
  7465. <span id="AgentMuteSpan"></span> <BR>
  7466. </font></span>
  7467. <span style="position:absolute;left:0px;top:0px;z-index:39;" id="CallBacKsLisTBox">
  7468. <table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=460><TR><TD align=center VALIGN=top> SERVICIOS REPETIDOS PARA EL AGENTE <? echo $VD_login ?>:<BR>Chasque encendido un servicio repetido abajo ahora para llamar la parte posteriora del cliente. Si usted chasca encendido un expediente abajo para llamarlo, será quitado de la lista.
  7469. <BR>
  7470. <div class="scroll_callback" id="CallBacKsLisT"></div>
  7471. <BR> &nbsp;
  7472. <a href="#" onclick="CalLBacKsLisTCheck();return false;">Recarga</a>
  7473. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  7474. <a href="#" onclick="hideDiv('CallBacKsLisTBox');return false;">Vaya Detrás</a>
  7475. </TD></TR></TABLE>
  7476. </span>
  7477. <span style="position:absolute;left:0px;top:0px;z-index:40;" id="NeWManuaLDiaLBox">
  7478. <table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=460><TR><TD align=center VALIGN=top> NUEVO PLOMO MANUAL DEL DIAL PARA <? echo "$VD_login in campaign $VD_campaign" ?>:<BR><BR>Incorpore la información abajo para el nuevo plomo que usted desea llamar.
  7479. <BR>
  7480. <?
  7481. if (eregi("X",dial_prefix))
  7482. {
  7483. echo "Nota: un prefijo del dial de $dial_prefix será agregado al principio de este número<BR>\n";
  7484. }
  7485. ?>
  7486. Note: all new manual dial leads will go into list <? echo $manual_dial_list_id ?><BR><BR>
  7487. <table><tr>
  7488. <td align=right><font class="body_text"> Dial Código: </td>
  7489. <td align=left><font class="body_text"><input type=text size=7 maxlength=10 name=MDDiaLCodE class="cust_form" value="1">&nbsp; (Éste es generalmente un 1 en los U.S.A. y el Canadá)</td>
  7490. </tr><tr>
  7491. <td align=right><font class="body_text"> Teléfono Number: </td>
  7492. <td align=left><font class="body_text">
  7493. <input type=text size=14 maxlength=12 name=MDPhonENumbeR class="cust_form" value="">&nbsp; (12 digits max - digits only)
  7494. </td>
  7495. </tr><tr>
  7496. <td align=right><font class="body_text"> Plomos Existentes De la Búsqueda: </td>
  7497. <td align=left><font class="body_text"><input type=checkbox name=LeadLookuP size=1 value="0">&nbsp; (Esta opción si está comprobada procurará encontrar el número de teléfono en el sistema antes de insertarlo como nuevo plomo)</td>
  7498. </tr><tr>
  7499. <td align=left colspan=2>
  7500. <BR><BR><CENTER>
  7501. <span id="ManuaLDiaLGrouPSelecteD"></span> &nbsp; &nbsp; <span id="ManuaLDiaLGrouP"></span>
  7502. </CENTER>
  7503. <BR><BR>Si usted desea marcar un número y hacerlo no agregar como nuevo plomo, entre en dialstring exacto ese usted desean llamar en el campo de la invalidación del dial abajo. Al retraso esta llamada usted tendrá que abrir las LLAMADAS EN ESTE acoplamiento de la SESIÓN en el fondo de la pantalla y colgarlas para arriba chascando en su acoplamiento del canal allí.<BR> &nbsp; </td>
  7504. </tr><tr>
  7505. <td align=right><font class="body_text"> Inválidoación Del Dial: </td>
  7506. <td align=left><font class="body_text"><input type=text size=24 maxlength=20 name=MDDiaLOverridE class="cust_form" value="">&nbsp; (los dígitos satisfacen solamente)
  7507. </td>
  7508. </tr></table>
  7509. <BR>
  7510. <a href="#" onclick="NeWManuaLDiaLCalLSubmiT('NOW');return false;">Dial Ahora</a>
  7511. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  7512. <a href="#" onclick="NeWManuaLDiaLCalLSubmiT('PREVIEW');return false;">Vista previa de llamada</a>
  7513. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
  7514. <a href="#" onclick="hideDiv('NeWManuaLDiaLBox');return false;">Vaya Detrás</a>
  7515. </TD></TR></TABLE>
  7516. </span>
  7517. <span style="position:absolute;left:5px;top:<?=$CBheight ?>px;z-index:19;" id="VolumeControlSpan"><span id="VolumeUpSpan"><IMG SRC="../agc/images/vdc_volume_up_off.gif" Border=0></span><BR><span id="VolumeDownSpan"><IMG SRC="../agc/images/vdc_volume_down_off.gif" Border=0></span>
  7518. </font></span>
  7519. <span style="position:absolute;left:35px;top:<?=$CBheight ?>px;z-index:20;" id="AgentEstadoSpan"><font class="body_text">
  7520. Su Estado: <span id="AgentEstadoEstado"></span> <BR>Calls Dialing: <span id="AgentEstadoDiaLs"></span>
  7521. </font></span>
  7522. <span style="position:absolute;left:5px;top:<?=$HTheight ?>px;z-index:21;" id="TransferMain">
  7523. <table bgcolor="#CCCCFF" width=<?=$XFwidth ?>><tr>
  7524. <td align=left>
  7525. <div class="text_input" id="TransferMaindiv">
  7526. <font class="body_text">
  7527. <IMG SRC="../agc/images/vdc_XB_header_es.gif" border=0 alt="Transferencia - Conferencia"> &nbsp; &nbsp; &nbsp; &nbsp; <span id="XfeRDiaLGrouPSelecteD"></span> &nbsp; &nbsp; <span id="XfeRCID"></span><BR>
  7528. <span id="XfeRGrouPLisT"><select size=1 name=XfeRGrouP class="cust_form"><option>-- SELECT A GROUP TO SEND YOUR LLAMADA TO --</option></select></span>
  7529. <span STYLE="background-color: #CCCCCC" id="LocalCloser"><IMG SRC="../agc/images/vdc_XB_localcloser_OFF_es.gif" border=0 alt="CLOSER LOCAL"></span>
  7530. <span STYLE="background-color: #CCCCCC" id="HangupXferLine"><IMG SRC="../agc/images/vdc_XB_hangupxferline_OFF_es.gif" border=0 alt="Colgar Línea Xfer "></span>
  7531. <span STYLE="background-color: #CCCCCC" id="HangupBothLines"><a href="#" onclick="bothcall_send_hangup();return false;"><IMG SRC="../agc/images/vdc_XB_hangupbothlines_es.gif" border=0 alt="Colgar Ambas Líneas"></a></span>
  7532. <BR>
  7533. <IMG SRC="../agc/images/vdc_XB_number_es.gif" border=0 alt="Número a llamar"> <input type=text size=15 name=xfernumber maxlength=25 class="cust_form"> &nbsp;
  7534. <input type=hidden name=xferuniqueid>
  7535. <input type=checkbox name=xferoverride size=1 value="0"><font class="body_tiny"> INVALIDACIÓN DEL MARCADO</font> &nbsp;
  7536. <span STYLE="background-color: #CCCCCC" id="Leave3WayCall"><a href="#" onclick="leave_3way_call('FIRST');return false;"><IMG SRC="../agc/images/vdc_XB_leave3waycall_es.gif" border=0 alt="ABANDONAR LLAMADA 3-WAY"></a></span>
  7537. <span STYLE="background-color: #CCCCCC" id="DialBlindTransfer"><IMG SRC="../agc/images/vdc_XB_blindtransfer_OFF_es.gif" border=0 alt="Marcar Blind Transfer"></span>
  7538. <a href="#" onclick="DtMf_PreSet_a();return false;"><font class="body_tiny">D1</font></a>
  7539. <a href="#" onclick="DtMf_PreSet_b();return false;"><font class="body_tiny">D2</font></a>
  7540. <BR>
  7541. <IMG SRC="../agc/images/vdc_XB_segundos_es.gif" border=0 alt="segundos"> <input type=text size=2 name=xferlength maxlength=4 class="cust_form"> &nbsp;
  7542. <IMG SRC="../agc/images/vdc_XB_channel_es.gif" border=0 alt="channel"> <input type=text size=12 name=xferchannel maxlength=100 class="cust_form">
  7543. <span STYLE="background-color: #CCCCCC" id="DialWithCustomer"><a href="#" onclick="SendManualDial('YES');return false;"><IMG SRC="../agc/images/vdc_XB_dialwithcustomer_es.gif" border=0 alt="Marcar Con El Cliente"></a></span>
  7544. <span STYLE="background-color: #CCCCCC" id="ParkCustomerDial"><a href="#" onclick="xfer_park_dial();return false;"><IMG SRC="../agc/images/vdc_XB_parkcustomerdial_es.gif" border=0 alt="Dial Del Cliente Del Parque"></a></span>
  7545. <span STYLE="background-color: #CCCCCC" id="DialBlindVMail"><IMG SRC="../agc/images/vdc_XB_ammessage_OFF.gif" border=0 alt="Blind Transfer VMail Message"></span>
  7546. </font>
  7547. </div>
  7548. </td>
  7549. </tr></table>
  7550. </span>
  7551. <span style="position:absolute;left:5px;top:<?=$HTheight ?>px;z-index:23;" id="HotKeyActionBox">
  7552. <table border=0 bgcolor="#FFDD99" width=<?=$HCwidth ?> height=70>
  7553. <TR bgcolor="#FFEEBB"><TD height=70><font class="sh_text"> Lead Dispositioned Como: </font><BR><BR><CENTER>
  7554. <font class="sd_text"><span id="HotKeyDispo"> - </span></font></CENTER>
  7555. </TD>
  7556. </TR></TABLE>
  7557. </span>
  7558. <span style="position:absolute;left:5px;top:<?=$HTheight ?>px;z-index:24;" id="HotKeyEntriesBox">
  7559. <table border=0 bgcolor="#FFDD99" width=<?=$HCwidth ?> height=70>
  7560. <TR bgcolor="#FFEEBB"><TD width=200><font class="sh_text"> Teclas de acceso rápido a la Disposición: </font></td><td colspan=2>
  7561. <font class="body_small">Cuando esté activo, presione simplemente la tecla para la disposición deseada para esta llamada. La llamada después será colgada y dispositioned automáticamente:</font></td></tr><tr>
  7562. <TD width=200><font class="sk_text">
  7563. <span id="HotKeyBoxA"><? echo $HKboxA ?></span>
  7564. </font></TD>
  7565. <TD width=200><font class="sk_text">
  7566. <span id="HotKeyBoxB"><? echo $HKboxB ?></span>
  7567. </font></TD>
  7568. <TD><font class="sk_text">
  7569. <span id="HotKeyBoxC"><? echo $HKboxC ?></span>
  7570. </font></TD>
  7571. </TR></TABLE>
  7572. </span>
  7573. <span style="position:absolute;left:5px;top:<?=$HTheight ?>px;z-index:25;" id="CBcommentsBox">
  7574. <table border=0 bgcolor="#FFFFCC" width=<?=$HCwidth ?> height=70>
  7575. <TR bgcolor="#FFFF66">
  7576. <TD align=left><font class="sh_text"> Información Anterior Del Servicio repetido: </font></td>
  7577. <TD align=right><font class="sk_text"> <a href="#" onclick="CBcommentsBoxhide();return false;">close</a> </font></td>
  7578. </tr><tr>
  7579. <TD><font class="sk_text">
  7580. <span id="CBcommentsBoxA"></span><BR>
  7581. <span id="CBcommentsBoxB"></span><BR>
  7582. <span id="CBcommentsBoxC"></span><BR>
  7583. </font></TD>
  7584. <TD width=320><font class="sk_text">
  7585. <span id="CBcommentsBoxD"></span>
  7586. </font></TD>
  7587. </TR></TABLE>
  7588. </span>
  7589. <span style="position:absolute;left:5px;top:<?=$HTheight ?>px;z-index:26;" id="EAcommentsBox">
  7590. <table border=0 bgcolor="#FFFFCC" width=<?=$HCwidth ?> height=70>
  7591. <TR bgcolor="#FFFF66">
  7592. <TD align=left><font class="sh_text"> Teléfono de Información ampliado Alt:</font></td>
  7593. <TD align=right><font class="sk_text"> <a href="#" onclick="EAcommentsBoxhide('YES');return false;"> reduzca al mínimo </a> </font></td>
  7594. </tr><tr>
  7595. <TD VALIGN=top><font class="sk_text">
  7596. <span id="EAcommentsBoxC"></span><BR>
  7597. <span id="EAcommentsBoxB"></span><BR>
  7598. </font></TD>
  7599. <TD width=320 VALIGN=top><font class="sk_text">
  7600. <span id="EAcommentsBoxA"></span><BR>
  7601. <span id="EAcommentsBoxD"></span>
  7602. </font></TD>
  7603. </TR></TABLE>
  7604. </span>
  7605. <span style="position:absolute;left:695px;top:<?=$HTheight ?>px;z-index:27;" id="EAcommentsMinBox">
  7606. <table border=0 bgcolor="#FFFFCC" width=40 height=20>
  7607. <TR bgcolor="#FFFF66">
  7608. <TD align=left><font class="sk_text"><a href="#" onclick="EAcommentsBoxshow();return false;"> maximice </a> <BR>Alt Teléfono Info</font></td>
  7609. </tr></TABLE>
  7610. </span>
  7611. <span style="position:absolute;left:0px;top:12px;z-index:28;" id="NoneInSessionBox">
  7612. <table border=1 bgcolor="#CCFFFF" width=<?=$CAwidth ?> height=500><TR><TD align=center> Nadie está en su sesión: <span id="NoneInSessionID"></span><BR>
  7613. <a href="#" onclick="NoneInSessionOK();return false;">Vaya Detrás</a>
  7614. <BR><BR>
  7615. <a href="#" onclick="NoneInSessionCalL();return false;">Agente De la Llamada Otra vez</a>
  7616. </TD></TR></TABLE>
  7617. </span>
  7618. <span style="position:absolute;left:0px;top:0px;z-index:29;" id="CustomerGoneBox">
  7619. <table border=1 bgcolor="#CCFFFF" width=<?=$CAwidth ?> height=500><TR><TD align=center> El cliente ha colgado: <span id="CustomerGoneChanneL"></span><BR>
  7620. <a href="#" onclick="CustomerGoneOK();return false;">Vaya Detrás</a>
  7621. <BR><BR>
  7622. <a href="#" onclick="CustomerGoneHangup();return false;">Final y llamada de la disposición</a>
  7623. </TD></TR></TABLE>
  7624. </span>
  7625. <span style="position:absolute;left:0px;top:0px;z-index:30;" id="WrapupBox">
  7626. <table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=550><TR><TD align=center> Llamada Wrapup: <span id="WrapupTimer"></span> segundos restantes en wrapup<BR><BR>
  7627. <span id="WrapupMessage"><?=$wrapup_message ?></span>
  7628. <BR><BR>
  7629. <a href="#" onclick="WrapupFinish();return false;">Final Wrapup y movimiento encendido</a>
  7630. </TD></TR></TABLE>
  7631. </span>
  7632. <span style="position:absolute;left:0px;top:0px;z-index:31;" id="AgenTDisablEBoX">
  7633. <table border=1 bgcolor="#FFFFFF" width=<?=$CAwidth ?> height=500><TR><TD align=center>Se ha inhabilitado su sesión<BR><a href="#" onclick="LogouT('DISABLED');return false;">SALIR</a><BR><BR><a href="#" onclick="hideDiv('AgenTDisablEBoX');return false;">Vaya Detrás</a>
  7634. </TD></TR></TABLE>
  7635. </span>
  7636. <span style="position:absolute;left:0px;top:0px;z-index:32;" id="SysteMDisablEBoX">
  7637. <table border=1 bgcolor="#FFFFFF" width=<?=$CAwidth ?> height=500><TR><TD align=center>Hay un problema de sincronización de tiempo con su sistema, por favor, dígale a su administrador del sistema<BR><BR><BR><a href="#" onclick="hideDiv('SysteMDisablEBoX');return false;">Vaya Detrás</a>
  7638. </TD></TR></TABLE>
  7639. </span>
  7640. <span style="position:absolute;left:0px;top:0px;z-index:33;" id="LogouTBox">
  7641. <table border=1 bgcolor="#FFFFFF" width=<?=$CAwidth ?> height=500><TR><TD align=center><BR><span id="LogouTBoxLink">SALIR</span></TD></TR></TABLE>
  7642. </span>
  7643. <span style="position:absolute;left:0px;top:70px;z-index:34;" id="DispoButtonHideA">
  7644. <table border=0 bgcolor="#CCFFCC" width=165 height=22><TR><TD align=center VALIGN=top></TD></TR></TABLE>
  7645. </span>
  7646. <span style="position:absolute;left:0px;top:138px;z-index:35;" id="DispoButtonHideB">
  7647. <table border=0 bgcolor="#CCFFCC" width=165 height=250><TR><TD align=center VALIGN=top>&nbsp;</TD></TR></TABLE>
  7648. </span>
  7649. <span style="position:absolute;left:0px;top:0px;z-index:36;" id="DispoButtonHideC">
  7650. <table border=0 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=47><TR><TD align=center VALIGN=top>Cualquier cambio realizado al cliente que no será la información abajo en este tiempo comitted, usted debe cambiar la información del cliente antes de usted retraso la llamada. </TD></TR></TABLE>
  7651. </span>
  7652. <span style="position:absolute;left:0px;top:0px;z-index:37;" id="DispoSelectBox">
  7653. <table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=460><TR><TD align=center VALIGN=top> DISPOSITION LLAMADA :<span id="DispoSelectPhonE"></span> &nbsp; &nbsp; &nbsp; <span id="DispoSelectHAspan"><a href="#" onclick="DispoHanguPAgaiN()">Retraso Otra vez</a></span> &nbsp; &nbsp; &nbsp; <span id="DispoSelectMaxMin"><a href="#" onclick="DispoMinimize()"> reduzca al mínimo </a></span><BR>
  7654. <span id="DispoSelectContent"> selección de la disposición del End-of-call </span>
  7655. <input type=hidden name=DispoSelection><BR>
  7656. <input type=checkbox name=DispoSelectStop size=1 value="0"> PARAR LA LLAMADA <BR>
  7657. <a href="#" onclick="DispoSelectContent_create('','ReSET');return false;">REINICIAR</a> |
  7658. <a href="#" onclick="DispoSelect_submit();return false;">ENVIAR</a>
  7659. <BR><BR>
  7660. <a href="#" onclick="WeBForMDispoSelect_submit();return false;">WEB FORM ENVIAR</a>
  7661. <BR><BR> &nbsp;
  7662. </TD></TR></TABLE>
  7663. </span>
  7664. <span style="position:absolute;left:0px;top:0px;z-index:43;" id="PauseCodeSelectBox">
  7665. <table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=460><TR><TD align=center VALIGN=top> SELECCIONE Un CÓDIGO De la PAUSA :<BR>
  7666. <span id="PauseCodeSelectContent"> Pausa Code Selection </span>
  7667. <input type=hidden name=PauseCodeSelection>
  7668. <BR><BR> &nbsp;
  7669. </TD></TR></TABLE>
  7670. </span>
  7671. <span style="position:absolute;left:0px;top:0px;z-index:44;" id="GroupAliasSelectBox">
  7672. <table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=460><TR><TD align=center VALIGN=top> SELECCIONAR UN GRUPO DE ALIAS :<BR>
  7673. <span id="GroupAliasSelectContent"> Grupo de Selección de Alias </span>
  7674. <input type=hidden name=GroupAliasSelection>
  7675. <BR><BR> &nbsp;
  7676. </TD></TR></TABLE>
  7677. </span>
  7678. <span style="position:absolute;left:0px;top:1000px;z-index:45;" id="GENDERhideFORieALT"></span>
  7679. <span style="position:absolute;left:0px;top:0px;z-index:38;" id="CallBackSelectBox">
  7680. <table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=460><TR><TD align=center VALIGN=top> Seleccione una fecha del servicio repetido :<span id="CallBackDatE"></span><BR>
  7681. <input type=hidden name=CallBackDatESelectioN ID="CallBackDatESelectioN">
  7682. <input type=hidden name=CallBackTimESelectioN ID="CallBackTimESelectioN">
  7683. <span id="CallBackDatEPrinT">Seleccione una fecha abajo</span> &nbsp;
  7684. <span id="CallBackTimEPrinT"></span> &nbsp; &nbsp;
  7685. Hour:
  7686. <SELECT SIZE=1 NAME="CBT_hour" ID="CBT_hour">
  7687. <option>01</option>
  7688. <option>02</option>
  7689. <option>03</option>
  7690. <option>04</option>
  7691. <option>05</option>
  7692. <option>06</option>
  7693. <option>07</option>
  7694. <option>08</option>
  7695. <option>09</option>
  7696. <option>10</option>
  7697. <option>11</option>
  7698. <option>12</option>
  7699. </select> &nbsp;
  7700. Minutes:
  7701. <SELECT SIZE=1 NAME="CBT_minute" ID="CBT_minute">
  7702. <option>00</option>
  7703. <option>05</option>
  7704. <option>10</option>
  7705. <option>15</option>
  7706. <option>20</option>
  7707. <option>25</option>
  7708. <option>30</option>
  7709. <option>35</option>
  7710. <option>40</option>
  7711. <option>45</option>
  7712. <option>50</option>
  7713. <option>55</option>
  7714. </select> &nbsp;
  7715. <SELECT SIZE=1 NAME="CBT_ampm" ID="CBT_ampm">
  7716. <option>AM</option>
  7717. <option selected>PM</option>
  7718. </select> &nbsp;<BR>
  7719. <?
  7720. if ($agentonly_callbacks)
  7721. {echo "<input type=checkbox name=CallBackOnlyMe id=CallBackOnlyMe size=1 value=\"0\"> MI SERVICIO REPETIDO SOLAMENTE <BR>";}
  7722. ?>
  7723. Comentarios de los CBES: <input type=text name="CallBackCommenTsField" id="CallBackCommenTsField" size=50 maxlength=255><BR><BR>
  7724. <a href="#" onclick="CallBackDatE_submit();return false;">ENVIAR</a><BR><BR>
  7725. <span id="CallBackDateContent"><?echo"$CCAL_OUT"?></span>
  7726. <BR><BR> &nbsp;
  7727. </TD></TR></TABLE>
  7728. </span>
  7729. <span style="position:absolute;left:0px;top:0px;z-index:41;" id="CloserSelectBox">
  7730. <table border=1 bgcolor="#CCFFCC" width=<?=$CAwidth ?> height=460><TR><TD align=center VALIGN=top> SELECCIÓN DEL GRUPO DE ENTRANTES CLOSER <BR>
  7731. <span id="CloserSelectContent"> SELECCIÓN DEL GRUPO DE ENTRANTES CLOSER </span>
  7732. <input type=hidden name=CloserSelectList><BR>
  7733. <?
  7734. if ( ($outbound_autodial_active > 0) and ($disable_blended_checkbox < 1) )
  7735. {
  7736. ?>
  7737. <input type=checkbox name=CloserSelectBlended size=1 value="0"> BLENDED LLAMADAING(Salientes activdas) <BR>
  7738. <?
  7739. }
  7740. ?>
  7741. <a href="#" onclick="CloserSelectContent_create();return false;">REINICIAR</a> |
  7742. <a href="#" onclick="CloserSelect_submit();return false;">ENVIAR</a>
  7743. <BR><BR><BR><BR> &nbsp;
  7744. </TD></TR></TABLE>
  7745. </span>
  7746. <span style="position:absolute;left:0px;top:0px;z-index:42;" id="NothingBox">
  7747. <BUTTON Type=button name="inert_button"><img src="../agc/images/blank.gif"></BUTTON>
  7748. <span id="DiaLLeaDPrevieWHide">Canal</span>
  7749. <span id="DiaLDiaLAltPhonEHide">Canal</span>
  7750. <?
  7751. if (!$agentonly_callbacks)
  7752. {echo "<input type=checkbox name=CallBackOnlyMe size=1 value=\"0\"> MI SERVICIO REPETIDO SOLAMENTE <BR>";}
  7753. if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) )
  7754. {echo "<input type=checkbox name=CloserSelectBlended size=1 value=\"0\"> BLENDED LLAMADAING<BR>";}
  7755. ?>
  7756. </span>
  7757. <span style="position:absolute;left:154px;top:65px;z-index:17;" id="ScriptPanel">
  7758. <table border=0 bgcolor="<? echo $SCRIPT_COLOR ?>" width=<?=$SSwidth ?> height=<?=$SSheight ?>><TR><TD align=left valign=top><font class="sb_text"><div class="scroll_script" id="ScriptContents">VICIDIAL SCRIPT</div></font></TD></TR></TABLE>
  7759. </span>
  7760. <? if ( ($HK_statuses_camp > 0) && ( ($user_level>=$HKuser_level) or ($VU_hotkeys_active > 0) ) ) { ?>
  7761. <span style="position:absolute;left:<?=$HKwidth ?>px;top:<?=$HKheight ?>px;z-index:16;" id="hotkeysdisplay"><a href="#" onMouseOver="HotKeys('ON')"><IMG SRC="../agc/images/vdc_XB_hotkeysactive_OFF_es.gif" border=0 alt="TECLAS ACCESO RÁPIDO INACTIVAS"></a></span>
  7762. <? } ?>
  7763. <span style="position:absolute;left:0px;top:<?=$HKheight ?>px;z-index:15;" id="MaiNfooterspan">
  7764. <table BGCOLOR="<? echo $MAIN_COLOR ?>" id="MaiNfooter" width=<?=$MNwidth ?>><tr height=32><td height=32><font face="Arial,Helvetica" size=1>versión web client VICIDIAL: <? echo $version ?> &nbsp; &nbsp; CONSTRUCCION: <? echo $build ?> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Servidor: <? echo $server_ip ?> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font><BR>
  7765. <font class="body_small"><span id="busycallsdisplay"><a href="#" onclick="conf_channels_detail('SHOW');">Mostrar la información del canal Conferencia</a><BR><BR>&nbsp;</span></font></td><td align=right height=32>
  7766. </td></tr>
  7767. <tr><td colspan=3><span id="outboundcallsspan"></span></td></tr>
  7768. <tr><td colspan=3><font class="body_small"><span id="AgentAlertSpan">
  7769. <?
  7770. if ( (ereg('ON',$VU_alert_enabled)) and ($AgentAlert_allowed > 0) )
  7771. {echo "<a href=\"#\" onclick=\"alert_control('OFF');return false;\">Alert is ON</a>";}
  7772. else
  7773. {echo "<a href=\"#\" onclick=\"alert_control('ON');return false;\">Alert is OFF</a>";}
  7774. ?>
  7775. </span></td></tr>
  7776. <tr><td colspan=3>
  7777. <font class="body_small">
  7778. <span style="position:absolute;left:0px;top:700px;z-index:66;" id="debugbottomspan"></span>
  7779. </font>
  7780. </td></tr>
  7781. </TABLE>
  7782. </span>
  7783. <!-- BEGIN ********* Here is the main VICIDIAL display panel -->
  7784. <span style="position:absolute;left:0px;top:46px;z-index:10;" id="MainPanel">
  7785. <TABLE border=0 BGCOLOR="<? echo $MAIN_COLOR ?>" width=<?=$MNwidth ?> id="MainTable">
  7786. <TR><TD colspan=3><font class="body_text"> ESTADO: <span id="MainStatuSSpan"></span></font></TD></TR>
  7787. <tr><td colspan=3><span id="busycallsdebug"></span></td></tr>
  7788. <tr><td width=150 align=left valign=top>
  7789. <font class="body_text"><center>
  7790. <span STYLE="background-color: #CCFFCC" id="DiaLControl"><a href="#" onclick="ManualDialNext('','','','','','0');"><IMG SRC="../agc/images/vdc_LB_dialnextnumber_OFF_es.gif" border=0 alt="Marcar el Siguiente Número"></a></span><BR>
  7791. <span id="DiaLLeaDPrevieW"><font class="preview_text"> <input type=checkbox name=LeadPreview size=1 value="0"> MOSTRAR LEAD<BR></font></span>
  7792. <span id="DiaLDiaLAltPhonE"><font class="preview_text"> <input type=checkbox name=DiaLAltPhonE size=1 value="0"> TELÉFONO DEL ALT<BR></font></span>
  7793. <!--
  7794. <?
  7795. if ( ($manual_dial_preview) and ($auto_dial_level==0) )
  7796. {echo "<font class=\"preview_text\"> <input type=checkbox name=LeadPreview size=1 value=\"0\"> MOSTRAR LEAD<BR></font>";}
  7797. if ( ($alt_phone_dialing) and ($auto_dial_level==0) )
  7798. {echo "<font class=\"preview_text\"> <input type=checkbox name=DiaLAltPhonE size=1 value=\"0\"> TELÉFONO DEL ALT<BR></font>";}
  7799. ?> -->
  7800. GRABANDO ARCHIVO:<BR>
  7801. </center>
  7802. <font class="body_tiny"><span id="RecorDingFilename"></span></font><BR>
  7803. GRABACIÓN ID: <font class="body_small"><span id="RecorDID"></span></font><BR>
  7804. <center>
  7805. <!-- <a href=\"#\" onclick=\"conf_send_recording('MonitorConf','" + head_conf + "','');return false;\">Grabar</a> -->
  7806. <span STYLE="background-color: #CCCCCC" id="RecorDControl"><a href="#" onclick="conf_send_recording('MonitorConf',session_id,'');return false;"><IMG SRC="../agc/images/vdc_LB_startrecording_es.gif" border=0 alt="Comenzar La Grabación"></a></span><BR>
  7807. <span id="SpacerSpanA"><IMG SRC="../agc/images/blank.gif" width=145 height=16 border=0></span><BR>
  7808. <span STYLE="background-color: #FFFFFF" id="WebFormSpan"><IMG SRC="../agc/images/vdc_LB_webform_OFF_es.gif" border=0 alt="Formulario Web"></span><BR>
  7809. <span id="SpacerSpanB"><IMG SRC="../agc/images/blank.gif" width=145 height=16 border=0></span><BR>
  7810. <span STYLE="background-color: #CCCCCC" id="ParkControl"><IMG SRC="../agc/images/vdc_LB_parkcall_OFF_es.gif" border=0 alt="Aparcar llamada"></span><BR>
  7811. <span STYLE="background-color: #CCCCCC" id="XferControl"><IMG SRC="../agc/images/vdc_LB_transferconf_OFF_es.gif" border=0 alt="Transferencia - Conferencia"></span><BR>
  7812. <span id="SpacerSpanC"><IMG SRC="../agc/images/blank.gif" width=145 height=16 border=0></span><BR>
  7813. <span STYLE="background-color: #FFCCFF" id="HangupControl"><IMG SRC="../agc/images/vdc_LB_hangupcustomer_OFF_es.gif" border=0 alt="Colgar al Cliente"></span><BR>
  7814. <span id="SpacerSpanD"><IMG SRC="../agc/images/blank.gif" width=145 height=16 border=0></span><BR>
  7815. <div class="text_input" id="SendDTMFdiv"><span STYLE="background-color: #CCCCCC" id="SendDTMF"><a href="#" onclick="SendConfDTMF(session_id);return false;"><IMG SRC="../agc/images/vdc_LB_senddtmf_es.gif" border=0 alt="Enviar DTMF" align=bottom></a> <input type=text size=5 name=conf_dtmf class="cust_form" value="" maxlength=50></div></span><BR>
  7816. </center>
  7817. </font>
  7818. </td>
  7819. <td width=<?=$SDwidth ?> align=left valign=top>
  7820. <input type=hidden name=lead_id value="">
  7821. <input type=hidden name=list_id value="">
  7822. <input type=hidden name=called_count value="">
  7823. <input type=hidden name=gmt_offset_now value="">
  7824. <input type=hidden name=gender value="">
  7825. <input type=hidden name=date_of_birth value="">
  7826. <input type=hidden name=country_code value="">
  7827. <input type=hidden name=uniqueid value="">
  7828. <input type=hidden name=callserverip value="">
  7829. <input type=hidden name=SecondS value="">
  7830. <div class="text_input" id="MainPanelCustInfo">
  7831. <table><tr>
  7832. <td align=right></td>
  7833. <td align=left><font class="body_text">&nbsp; Customer Time: <input type=text size=27 name=custdatetime class="cust_form" value=""> &nbsp; Canal: <input type=text size=27 name=callchannel class="cust_form" value=""></td>
  7834. </tr><tr>
  7835. <td colspan=2 align=center> Información Del Cliente: <span id="CusTInfOSpaN"></span></td>
  7836. </tr><tr>
  7837. <td align=left colspan=2>
  7838. <table width=550><tr>
  7839. <td align=right><font class="body_text"> Título: </td>
  7840. <td align=left colspan=5><font class="body_text"><input type=text size=4 name=title maxlength=4 class="cust_form" value="">&nbsp; Primero: <input type=text size=17 name=first_name maxlength=30 class="cust_form" value="">&nbsp; IM: <input type=text size=1 name=middle_initial maxlength=1 class="cust_form" value="">&nbsp; Último: <input type=text size=23 name=last_name maxlength=30 class="cust_form" value=""></td>
  7841. </tr><tr>
  7842. <td align=right><font class="body_text"> Dirección1: </td>
  7843. <td align=left colspan=5><font class="body_text"><input type=text size=85 name=address1 maxlength=100 class="cust_form" value=""></td>
  7844. </tr><tr>
  7845. <td align=right><font class="body_text"> Dirección2: </td>
  7846. <td align=left><font class="body_text"><input type=text size=20 name=address2 maxlength=100 class="cust_form" value=""></td>
  7847. <td align=right><font class="body_text">Dirección3: </td>
  7848. <td align=left colspan=3><font class="body_text"><input type=text size=45 name=address3 maxlength=100 class="cust_form" value=""></td>
  7849. </tr><tr>
  7850. <td align=right><font class="body_text"> Ciudad: </td>
  7851. <td align=left><font class="body_text"><input type=text size=20 name=city maxlength=50 class="cust_form" value=""></td>
  7852. <td align=right><font class="body_text">Estado: </td>
  7853. <td align=left><font class="body_text"><input type=text size=4 name=state maxlength=2 class="cust_form" value=""></td>
  7854. <td align=right><font class="body_text">CódigoPostal: </td>
  7855. <td align=left><font class="body_text"><input type=text size=14 name=postal_code maxlength=10 class="cust_form" value=""></td>
  7856. </tr><tr>
  7857. <td align=right><font class="body_text"> Provincia: </td>
  7858. <td align=left><font class="body_text"><input type=text size=20 name=province maxlength=50 class="cust_form" value=""></td>
  7859. <td align=right><font class="body_text">VendedorID: </td>
  7860. <td align=left><font class="body_text"><input type=text size=15 name=vendor_lead_code maxlength=20 class="cust_form" value=""></td>
  7861. <td align=right><font class="body_text">Género:</td>
  7862. <td align=left><font class="body_text"><span id="GENDERhideFORie"><select size=1 name=gender_list class="cust_form" id=gender_list><option value="U">U - Indefinido</option><option value="M">M - Male</option><option value="F">F - Female</option></select></span></td>
  7863. </tr><tr>
  7864. <td align=right><font class="body_text"> Teléfono: </td>
  7865. <td align=left><font class="body_text">
  7866. <?
  7867. if ($disable_alter_custphone=='Y')
  7868. {
  7869. echo "<font class=\"body_text\"><span id=phone_numberDISP> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span></font>";
  7870. echo "<input type=hidden name=phone_number value=\"\">";
  7871. }
  7872. else
  7873. {
  7874. echo "<input type=text size=20 name=phone_number maxlength=16 class=\"cust_form\" value=\"\">";
  7875. }
  7876. ?>
  7877. </td>
  7878. <td align=right><font class="body_text">Código Del Dial: </td>
  7879. <td align=left><font class="body_text"><input type=text size=4 name=phone_code maxlength=10 class="cust_form" value=""></td>
  7880. <td align=right><font class="body_text">Teléfono Alt: </td>
  7881. <td align=left><font class="body_text"><input type=text size=14 name=alt_phone maxlength=16 class="cust_form" value=""></td>
  7882. </tr><tr>
  7883. <td align=right><font class="body_text"> Demostración: </td>
  7884. <td align=left><font class="body_text"><input type=text size=20 name=security_phrase maxlength=100 class="cust_form" value=""></td>
  7885. <td align=right><font class="body_text">Email: </td>
  7886. <td align=left colspan=3><font class="body_text"><input type=text size=45 name=email maxlength=70 class="cust_form" value=""></td>
  7887. </tr><tr>
  7888. <td align=right valign=top><font class="body_text"> Comentarios:</td>
  7889. <td align=left colspan=5>
  7890. <font class="body_text">
  7891. <?
  7892. if ( ($multi_line_comments) )
  7893. {echo "<TEXTAREA NAME=comments ROWS=2 COLS=85 class=\"cust_form_text\" value=\"\"></TEXTAREA>\n";}
  7894. else
  7895. {echo "<input type=text size=65 name=comments maxlength=255 class=\"cust_form\" value=\"\">\n";}
  7896. ?>
  7897. </font>
  7898. </td>
  7899. </tr></table></td>
  7900. </tr></table>
  7901. </div>
  7902. </font>
  7903. </td>
  7904. <td width=1 align=center>
  7905. </td>
  7906. </tr>
  7907. <tr><td align=left colspan=3 height=<?=$BPheight ?>>
  7908. &nbsp;</td></tr>
  7909. <tr><td align=left colspan=3>
  7910. &nbsp;</td></tr>
  7911. </td></tr>
  7912. </span>
  7913. <!-- END ********* Here is the main VICIDIAL display panel -->
  7914. </TD></TR></TABLE>
  7915. </FORM>
  7916. </body>
  7917. </html>
  7918. <?
  7919. exit;
  7920. ##### MySQL Error Logging #####
  7921. function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
  7922. {
  7923. $NOW_TIME = date("Y-m-d H:i:s");
  7924. # mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
  7925. $errno=''; $error='';
  7926. if ( ($mel > 0) or ($one_mysql_log > 0) )
  7927. {
  7928. $errno = mysql_errno($link);
  7929. if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
  7930. {
  7931. $error = mysql_error($link);
  7932. $efp = fopen ("./vicidial_mysql_errors.txt", "a");
  7933. fwrite ($efp, "$NOW_TIME|vicidial |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
  7934. fclose($efp);
  7935. }
  7936. }
  7937. $one_mysql_log=0;
  7938. return $errno;
  7939. }
  7940. ?>