Help
RSS
API
Feed
Maltego
Contact
Domain > cba.intelligentcontacts.net
×
More information on this domain is in
AlienVault OTX
Is this malicious?
Yes
No
DNS Resolutions
Date
IP Address
2024-08-17
3.227.27.92
(
ClassC
)
2025-08-02
35.174.196.69
(
ClassC
)
Port 80
HTTP/1.1 301 Moved PermanentlyServer: awselb/2.0Date: Sat, 02 Aug 2025 16:56:37 GMTContent-Type: text/htmlContent-Length: 134Connection: keep-aliveLocation: https://cba.intelligentcontacts.net:443/ html>head>title>301 Moved Permanently/title>/head>body>center>h1>301 Moved Permanently/h1>/center>/body>/html>
Port 443
HTTP/1.1 200 OKDate: Sat, 02 Aug 2025 16:56:38 GMTContent-Type: text/html; charsetUTF-8Transfer-Encoding: chunkedConnection: keep-aliveServer: nginxVary: Accept-EncodingSet-Cookie: d1a5f29cc836341fb07c9a898532ea677b08d028225d10a56a975910775; path/; secure; HttpOnlyExpires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidatePragma: no-cacheX-XSS-Protection: 1; modeblockX-Content-Type-Options: nosniffReferrer-Policy: no-referrer-when-downgradeStrict-Transport-Security: max-age31536000; includeSubdomainsX-Frame-Options: SAMEORIGINContent-Security-Policy: frame-ancestors self *.intelligentcontacts.net; !DOCTYPE html>html langen> head> title>IC Callcenter/title> meta charsetUTF-8 /> meta http-equivX-UA-Compatible contentIE10 /> base hrefhttps://cba.intelligentcontacts.net /> meta nameformat-detection contenttelephoneno/> link href/images/favicon/icon-32.png sizes32x32 relicon /> link href/images/favicon/icon-192.png sizes192x192 relicon /> link href/images/favicon/icon-180.png relapple-touch-icon-precomposed /> meta content/images/favicon/icon-270.png namemsapplication-TileImage /> script typetext/javascript src/js/jquery-3.6.0.min.js>/script> script typetext/javascript src/js/jquery-migrate-3.3.2.js>/script> script> // Set debug window.localStorage.setItem(debug, * -engine* -socket* *ERROR* *WARN*); /script> script> const EXTENSION_NAME ; const USERNAME ; const PASSWORD ; /script> script src/WebRTCCall/jssip-3.2.14.js>/script> script src/WebRTCCall/call.js>/script> audio idlocalAudio autoPlay muted>/audio> audio idremoteAudio autoPlay>/audio> audio idsounds autoPlay>/audio> link typetext/css href/js/jquery-ui-1.12.1.redmond_theme/jquery-ui.min.css relstylesheet /> link typetext/css href/js/jquery-ui-1.12.1.redmond_theme/jquery-ui.theme.min.css relstylesheet /> script typetext/javascript src/js/jquery-ui-1.12.1.redmond_theme/jquery-ui.min.js>/script> link relstylesheet typetext/css href/js/datatables/jquery.dataTables.min.css/> link relstylesheet typetext/css href/js/datatables/datatables.custom.css/> script typetext/javascript src/js/datatables/jquery.dataTables.min.js>/script> script typetext/javascript src /js/jquery.maskedinput.min.js>/script> script typetext/javascript src /js/jquery.cookie.js>/script> link typetext/css href/js/icheck/skins/minimal/blue.css relstylesheet /> link typetext/css href/js/icheck/skins/line/yellow.css relstylesheet /> link typetext/css href/js/icheck/skins/square/blue.css relstylesheet /> link typetext/css href/js/icheck/skins/minimal/minimal.css relstylesheet /> script typetext/javascript src /js/icheck/jquery.icheck.js>/script> script typetext/javascript src /js/jquery.tablesorter.js>/script> script typetext/javascript src /js/jquery.placeholder.js>/script> script typetext/javascript src /js/jquery.backstretch.min.js>/script> link typetext/css href/js/paginator/jquery.paginator.css relstylesheet /> script typetext/javascript src /js/paginator/jquery.paginator.js>/script> script typetext/javascript src /js/jmp3/jmp3.js>/script> script typetext/javascript src /js/jplayer/jquery.jplayer.js>/script> script typetext/javascript src /js/jrecorder/jRecorder.js>/script> link typetext/css href/js/qtip/jquery.qtip.css relstylesheet /> script typetext/javascript src /js/qtip/jquery.qtip.js>/script> script typetext/javascript src /js/colorpicker/jquery.colorpicker.js>/script> link typetext/css href/js/colorpicker/jquery.colorpicker.css relstylesheet /> script typetext/javascript src /js/timepicker/jquery.timepicker.js>/script> link typetext/css href/js/timepicker/jquery.timepicker.css relstylesheet /> script typetext/javascript src /js/datetime_picker/jquery.simple-dtpicker.js>/script> link typetext/css href/js/datetime_picker/jquery.simple-dtpicker.css relstylesheet /> link typetext/css href/js/toastr/toastr.css relstylesheet /> script typetext/javascript src /js/toastr/toastr.js>/script> link typetext/css href/css/style.css?1754153798 relstylesheet /> link typetext/css href/css/right_panel.css?1754153798 relstylesheet /> link typetext/css href/css/phone.css?1754153798 relstylesheet /> script typetext/javascript src /js/chosen/chosen.jquery.min.js?time>/script> link typetext/css href/js/chosen/chosen.min.css?time relstylesheet /> link typetext/css href/js/chosen/custom-chosen.min.css?time relstylesheet /> link relstylesheet typetext/css href/js/datatables/fixedHeader.dataTables.min.css> script typetext/javascript src/js/datatables/dataTables.fixedHeader.min.js>/script> script typetext/javascript src/js/easytimer/easytimer.min.js>/script> script> const SUBDOMAIN cba; const BASE_HREF https://cba.intelligentcontacts.net; const USER_ID ; /script> script typetext/javascript src /js/Updater.js?1754153798>/script> script typetext/javascript src /js/right_panel.js?1754153798>/script> script typetext/javascript src /js/ajaxfileupload.js?1754153798>/script> script typetext/javascript src/js/right_panel_missed_calls.js?1754153798>/script> script typetext/javascript src /js/inputmask/jquery.inputmask.bundle.min.js>/script> !-- Inputmask --> link typetext/css href/js/tag-it/css/jquery.tagit.css relstylesheet /> !-- Tag-it --> script typetext/javascript src /js/tag-it/tag-it.min.js>/script> link relstylesheet hrefjs/font-awesome/css/fontawesome-all.css> link typetext/css href/css/animate.min.css relstylesheet /> script typetext/javascript srcjs/datatables-plugins/sorting/natural.js>/script> !-- Global site tag (gtag.js) - Google Analytics --> script async srchttps://www.googletagmanager.com/gtag/js?idUA-106742965-4>/script> script> window.dataLayer window.dataLayer || ; function gtag(){dataLayer.push(arguments);} gtag(js, new Date()); gtag(config, UA-106742965-4); gtag(config, G-87NM4582WT); /script> script> if (!window.console) window.console {}; if (!window.console.log) window.console.log function () {}; $(function(){ $.backstretch(images/Dallas_Cityscape.jpg); }); var $buoop {vs:{i:10,f:45,o:12.1,s:5.1},c:2}; function $buo_f(){ var e document.createElement(script); e.src js/browser-update.min.js; document.body.appendChild(e); } try {document.addEventListener(DOMContentLoaded, $buo_f,false)} catch(e){window.attachEvent(onload, $buo_f)} /script> script> var env production; var LICENSE_KEY eyJhbGciOiJFUzI1NiJ9.eyJleHAiOjE3NjU0OTc1OTksImp0aSI6Ijc3OWFlMTg4LWI0NjAtNDU2YS1hNjVmLWIzOTg4ZWE0YjQ4YSIsInVzYWdlRW5kcG9pbnQiOiJodHRwczovL3Byb3h5LWV2ZW50LmNrZWRpdG9yLmNvbSIsImRpc3RyaWJ1dGlvbkNoYW5uZWwiOlsiY2xvdWQiLCJkcnVwYWwiXSwiZmVhdHVyZXMiOlsiRFJVUCIsIkJPWCJdLCJ2YyI6ImYyNDcwNDhjIn0.ozDBv-KR25LlGsZRMyWsgGQM5QKthTV8fncY6sCmUCEmP2T-dK2P3hT1OwMbDwKZHcVyuTS-Jk5XARo_yJTatQ; var scrubFields password,old_password,new_password1,new_password2,pass,pass2,pass_retype,cu_api_pass,code; var _rollbarConfig { accessToken: 0f98ba5c7bf0492884510b20965b4041, captureUncaught: true, captureUnhandledRejections: true, overwriteScrubFields: true, scrubFields: scrubFields, payload: { environment: env }, enabled: env ! local }; // Rollbar Snippet !function(r){var e{};function o(n){if(en)return en.exports;var ten{i:n,l:!1,exports:{}};return rn.call(t.exports,t,t.exports,o),t.l!0,t.exports}o.mr,o.ce,o.dfunction(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.rfunction(r){undefined!typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:Module}),Object.defineProperty(r,__esModule,{value:!0})},o.tfunction(r,e){if(1&e&&(ro(r)),8&e)return r;if(4&e&&objecttypeof r&&r&&r.__esModule)return r;var nObject.create(null);if(o.r(n),Object.defineProperty(n,default,{enumerable:!0,value:r}),2&e&&string!typeof r)for(var t in r)o.d(n,t,function(e){return re}.bind(null,t));return n},o.nfunction(r){var er&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,a,e),e},o.ofunction(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p,o(o.s0)}(function(r,e,o){use strict;var no(1),to(5);_rollbarConfig_rollbarConfig||{},_rollbarConfig.rollbarJsUrl_rollbarConfig.rollbarJsUrl||https://cdn.rollbar.com/rollbarjs/refs/tags/v2.22.0/rollbar.min.js,_rollbarConfig.asyncvoid 0_rollbarConfig.async||_rollbarConfig.async;var an.setupShim(window,_rollbarConfig),lt(_rollbarConfig);window.rollbarn.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){use strict;var no(2),to(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error(Rollbar: Internal error,r)}catch(r){}}}}var l0;function i(r,e){this.optionsr,this._rollbarOldOnErrornull;var ol++;this.shimIdfunction(){return o},undefined!typeof window&&window._rollbarShims&&(window._rollbarShimso{handler:e,messages:})}var so(4),dfunction(r,e){return new i(r,e)},cfunction(r){return new s(d,r)};function u(r){return a((function(){var ethis,oArray.prototype.slice.call(arguments,0),n{shim:e,method:r,args:o,ts:new Date};window._rollbarShimsthis.shimId().messages.push(n)}))}i.prototype.loadFullfunction(r,e,o,n,t){var l!1,ie.createElement(script),se.getElementsByTagName(script)0,ds.parentNode;i.crossOrigin,i.srcn.rollbarJsUrl,o||(i.async!0),i.onloadi.onreadystatechangea((function(){if(!(l||this.readyState&&loaded!this.readyState&&complete!this.readyState)){i.onloadi.onreadystatechangenull;try{d.removeChild(i)}catch(r){}l!0,function(){var e;if(void 0r._rollbarDidLoad){enew Error(rollbar.js did not load);for(var o,n,a,l,i0;or._rollbarShimsi++;)for(oo.messages||;no.shift();)for(an.args||,i0;ia.length;++i)if(functiontypeof(lai)){l(e);break}}functiontypeof t&&t(e)}()}})),d.insertBefore(i,s)},i.prototype.wrapfunction(r,e,o){try{var n;if(nfunctiontypeof e?e:function(){return e||{}},function!typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrappedfunction(){o&&functiontypeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var eo;throw e&&(stringtypeof e&&(enew String(e)),e._rollbarContextn()||{},e._rollbarContext._wrappedSourcer.toString(),window._rollbarWrappedErrore),e}},r._rollbar_wrapped._isWrap!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrappedtrt);return r._rollbar_wrapped}catch(e){return r}};for(var plog,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad.split(,),f0;fp.length;++f)i.prototypepfu(pf);r.exports{setupShim:function(r,e){if(r){var oe.globalAlias||Rollbar;if(objecttypeof ro)return ro;r._rollbarShims{},r._rollbarWrappedErrornull;var lnew c(e);return a((function(){e.captureUncaught&&(l._rollbarOldOnErrorr.onerror,n.captureUncaughtExceptions(r,l,!0),e.wrapGlobalEventHandlers&&t(r,l,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,l,!0);var ae.autoInstrument;return!1!e.enabled&&(void 0a||!0a||objecttypeof a&&a.network)&&r.addEventListener&&(r.addEventListener(load,l.captureLoad.bind(l)),r.addEventListener(DOMContentLoaded,l.captureDomContentLoaded.bind(l))),rol,l}))()}},Rollbar:c}},function(r,e,o){use strict;function n(r,e,o,n){r._rollbarWrappedError&&(n4||(n4r._rollbarWrappedError),n5||(n5r._rollbarWrappedError._rollbarContext),r._rollbarWrappedErrornull);var te.handleUncaughtException.apply(e,n);o&&o.apply(r,n),anonymoust&&(e.anonymousErrorsPending+1)}r.exports{captureUncaughtExceptions:function(r,e,o){if(r){var t;if(functiontypeof e._rollbarOldOnError)te._rollbarOldOnError;else if(r.onerror){for(tr.onerror;t._rollbarOldOnError;)tt._rollbarOldOnError;e._rollbarOldOnErrort}e.handleAnonymousErrors();var afunction(){var oArray.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnErrort),r.onerrora}},captureUnhandledRejections:function(r,e,o){if(r){functiontypeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener(unhandledrejection,r._rollbarURH);var nfunction(r){var o,n,t;try{or.reason}catch(r){ovoid 0}try{nr.promise}catch(r){nunhandledrejection error getting `promise` from event}try{tr.detail,!o&&t&&(ot.reason,nt.promise)}catch(r){}o||(ounhandledrejection error getting `reason` from event),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShimo,r._rollbarURHn,r.addEventListener(unhandledrejection,n)}}}},function(r,e,o){use strict;function n(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty(addEventListener)){for(var ne.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)nn._rollbarOldAdd;var tfunction(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAddn,t.belongsToShimo,e.addEventListenert;for(var ae.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)aa._rollbarOldRemove;var lfunction(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemovea,l.belongsToShimo,e.removeEventListenerl}}r.exportsfunction(r,e,o){if(r){var t,a,lEventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload.split(,);for(t0;tl.length;++t)ralt&&ra.prototype&&n(e,ra.prototype,o)}}},function(r,e,o){use strict;function n(r,e){this.implr(e,this),this.optionse,function(r){for(var efunction(r){return function(){var eArray.prototype.slice.call(arguments,0);if(this.implr)return this.implr.apply(this.impl,e)}},olog,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad.split(,),n0;no.length;n++)rone(on)}(n.prototype)}n.prototype._swapAndProcessMessagesfunction(r,e){var o,n,t;for(this.implr(this.options);oe.shift();)no.method,to.args,thisn&&functiontypeof thisn&&(captureDomContentLoadedn||captureLoadn?thisn.apply(this,t0,o.ts):thisn.apply(this,t));return this},r.exportsn},function(r,e,o){use strict;r.exportsfunction(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t(rr||{}).globalAlias||Rollbar,awindow.rollbar,lfunction(r){return new a(r)},i0;owindow._rollbarShimsi++;)n||(no.handler),o.handler._swapAndProcessMessages(l,o.messages);windowtn,window._rollbarInitialized!0}}}}); // End Rollbar Snippet /script> script>// debulked onresize handlerfunction on_resize(c,t){onresizefunction(){clearTimeout(t);tsetTimeout(c,100)};return c};function windowHeight() { var wH $(window).height()-30; $(.container > .content).css({min-height: wH, height: 100%});}function a2tip(){ $(a.tip).unbind().click(function(){return false;}).each(function() { var title $(this).data(title); var text $(this).data(text); $(this).qtip({ position: { my: left center, at: center right }, content: { title: title, text: text }, style: { classes: qtip-bootstrap qtip-bulb, width: 400px }, hide: {fixed: true, delay: 300} // do not hide tooltip when hover on it }); });}// function phone_number_format(phone)// {// if (!phone) return ; // dont convert empty numbers// if (phone.match(/a-z/g)) return phone.trim(); // dont touch raw words// phone phone.replace(/^0-9/g, ); // replace everything but digits// if (phone.length 10 && phone.charAt(0) 1) phone phone.substr(1);// var number phone.substr(0, 3);// var part2 phone.substr(3, 3);// var part3 phone.substr(6);// if (part2) number + part2;// if (part2) number + part3;// return number;// }function writeCookie(){ var the_date new Date(December 31, 2023); document.cookie users_resolution+ screen.width +x+ screen.height + ;expires + the_date.toGMTString();}function int2time(int){ // if you modify this function // please do the same and for PHP (functions.php) if (int 0) return span stylecolor:#CCC>—/span>; var hours parseInt(int / 3600); var minutes parseInt(int / 60) % 60; var seconds int % 60; if (hours) hours (hours 9) ? 0 + hours : hours; return (hours > 0 ? hours + : : ) + (minutes 10 ? 0 : ) + minutes + : + (seconds 10 ? 0 : ) + seconds;}var get_date_format null;var temp export, calls_dialed, calls_received, calls_abandoned, calls_failed, recordings, agent_calls_summary, agent_summary_campaign, agent_performance_historical, minute_usage, accesslog, access_log, acd, preview_skip, leads_called, agent_summary_team, fax, calls, agent_declines, performance, trends, messages, agent_status_log, surveys, webhook_log;var key 0;$.ajax({ async: false, type: POST, global: false, dataType: html, url: ajax/, data: {act: get_date_format}, success: function (data) { get_date_format data; }});$(function(){ /* require(es6-promise,function(es6) { es6.polyfill(); });*/ //var Promise Promise || ES6Promise.Promise; $.each(temp, function( index, value ) { if(window.location.href.indexOf(value) > -1) { if (get_date_format Y-m-d) get_date_format yy-mm-dd; if (get_date_format m/d/Y) get_date_format mm/dd/yy; if (get_date_format d/m/Y) get_date_format dd/mm/yy; key 1; } }); if(key 1){ $(.datepicker).datepicker({maxDate: 0, dateFormat: get_date_format}); $(.datepicker_yesterday).datepicker({maxDate: -1d, dateFormat: get_date_format}); }else{ $(.datepicker).datepicker({maxDate: 0, dateFormat: yy-mm-dd}); $(.datepicker_yesterday).datepicker({maxDate: -1d, dateFormat: yy-mm-dd}); } $(table.report_table) .tablesorter() .bind(sortEnd,function(e, table) { zebra(); }); a2tip(); zebra(); writeCookie(); $(input.masked_phone).mask((999) 999 9999); $(input.masked_phone2).mask(999-999-9999); $(input.masked_phone3).mask(9?9999999999); $(input.masked_zip).mask(99999, {placeholder: }); $(input.masked_dollar).inputmask($ 9{1,10}.99, { greedy: false }); if($(.page_help).length) { $(h1 .help).css({display : inline-block}); $(h1 .help).click(function(){ $(.page_help).slideToggle(fast); }); } // recalc window height on resize on_resize(function() { windowHeight(); }); windowHeight(); // NOTIFICATIONS ON INDEX PAGE $(.close_notification).click(function() { var notification_id $(this).data(notification_id); document.cookie ic_notification_+notification_id++notification_id+; expiresFri, 31 Dec 9999 23:59:59 GMT; path/; $(.un-+notification_id).hide(); $(this).parent().prev().css(border-bottom, 1px dashed #AAA); });});function zebra(){ $(.zebra > tbody > tr > td, .zebra > tr > td).css(background-color, #FFFFFF); $(.zebra > tbody > tr:visible:even > td, .zebra > tr:visible:even > td).css(background-color, #FAFAFA);}function order_by(order){ document.filter_form.order_by.value order; document.filter_form.submit(); return false;}function exxport(type, method){ $(#export_to).val(type); document.filter_form.target _blank; prevMethod document.filter_form.method; document.filter_form.method method; document.filter_form.submit(); document.filter_form.target _self; $(#export_to).val(); document.filter_form.method prevMethod; return false;}function validate_float(s) {return /^0-9*\.?0-9+$/.test(s);}function validate_float_with_commas(s) {return /^0-9.,+$/.test(s);}function validate_digits(s) {return /^0-9*$/.test(s);}function validate_email(s) {return /^(^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff+|\x22(^\x0d\x22\x5c\x80-\xff|\x5c\x00-\x7f)*\x22)(\x2e(^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff+|\x22(^\x0d\x22\x5c\x80-\xff|\x5c\x00-\x7f)*\x22))*\x40(^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff+|\x5b(^\x0d\x5b-\x5d\x80-\xff|\x5c\x00-\x7f)*\x5d)(\x2e(^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff+|\x5b(^\x0d\x5b-\x5d\x80-\xff|\x5c\x00-\x7f)*\x5d))*$/.test(s);}function validate_email2(s) {return /^((^>()\\\\.,;:\s@+(\.^>()\\\\.,;:\s@+)*)|(.+))@((\0-9{1,3}\.0-9{1,3}\.0-9{1,3}\.0-9{1,3}\)|((a-zA-Z\-0-9+\.)+a-zA-Z{2,}))$/.test(s);}function timeticker(){ $(.timeticker).each(function(){ var time $(this).text(); if(time.indexOf(:) -1) return; var time time.split(:).reverse(); time0 Number(time0) + 1; // seconds if(time0 60) { time0 0; time1 Number(time1) + 1; // minutes if(time1 60) { time1 0; if(time.length 3) time2 0; // hours time2 Number(time2) + 1; } time1 (0+time1).slice(-2); } time0 (0+time0).slice(-2); $(this).text( time.reverse().join(:) ); });}// a fix for IE, browsers who dont have window.consoleif (!window.console) window.console {log: function() {}, dir: function() {}, error: function() {} };// button-player based on jPlayer$(function() { init_button_player(body);});function init_button_player(p){ var current_button_player; $(div.button-player, $(p)).each(function() { if(!$(this).find(.play).length && !$(this).find(.time).length) { $(this).append($(div classplay/>div classtime/>)); } else { return true; } $(this).find(.play).click(function() { var was_playing $(this).hasClass(playing); // First, stop all players $(#button_jplayer).jPlayer(stop); $(div.button-player .play).removeClass(playing); $(div.button-player .time).text(); $(div.button-player .total_time).show(); $(this).closest(.button-player).find(.total_time).hide(); if(!was_playing) // start this particular player { current_button_player $(this).closest(div.button-player); var mp3 current_button_player.attr(data); $(#button_jplayer).attr(data-jpfid, current_button_player.data(jpfid)); $(#button_jplayer).attr(data-jpftype, current_button_player.data(jpftype)); $(this).addClass(playing); $(#button_jplayer) .jPlayer(stop) .jPlayer(setMedia, { mp3: mp3 }) .jPlayer(play); } }); if(!$(#button_jplayer).length) { $(body).append(div idbutton_jplayer/>); // Change the time format $.jPlayer.timeFormat.padMin true; $.jPlayer.timeFormat.padSec true; $.jPlayer.timeFormat.sepMin :; $.jPlayer.timeFormat.sepSec ; $(#button_jplayer).jPlayer({ ready: function(event) {}, timeupdate: function(event) { var file_id event.target.attributesdata-jpfid.value; var file_type event.target.attributesdata-jpftype.value; var seconds event.jPlayer.status.currentTime; var time $.jPlayer.convertTime(seconds); var hundreds Math.round((seconds - Math.floor(seconds)) * 100); if (hundreds 10) hundreds 0 + hundreds; // current_button_player.find(.time).text(parseInt(event.jPlayer.status.currentPercentAbsolute, 10) + %); if (time 00:00 && hundreds 00) $(.jp_+file_type+_+file_id).find(.time).text(); else $(.jp_+file_type+_+file_id).find(.time).text(time); }, // progress: function(event){}, // play : function(event){}, pause: function(event) { var file_id event.target.attributesdata-jpfid.value; var file_type event.target.attributesdata-jpftype.value; $(.jp_+file_type+_+file_id).find(.total_time).show(); }, ended: function(event) { var file_id event.target.attributesdata-jpfid.value; var file_type event.target.attributesdata-jpftype.value; $(.jp_+file_type+_+file_id).find(.time).text(); $(.jp_+file_type+_+file_id).find(.play).removeClass(playing); $(.jp_+file_type+_+file_id).find(.total_time).show(); }, swfPath : /js/jplayer/, supplied: mp3, wmode : window }); } });}function kick_an_agent(agent_id){ $.ajax({ url : ajax/, type: POST, dataType: JSON, data: { act:kick_an_agent, agent_id: agent_id } }) .done(function(r){ alert(Agent kicked out!); });}function yyyymmddhhiss(){ var tz_offset 300; var d new Date(); d new Date(d.getTime() + (60000*(d.getTimezoneOffset()-tz_offset))); return d.getFullYear() + - + (00 + (d.getMonth() + 1)).slice(-2) + - + (00 + d.getDate()).slice(-2) + + (00 + d.getHours()).slice(-2) + : + (00 + d.getMinutes()).slice(-2) + : + (00 + d.getSeconds()).slice(-2)}$(document).ready(function(){ $(.logout-button).click(function(e){ e.preventDefault(); // add call data when agent is in `STATUS_PREVIEW` or `STATUS_CALLBACK` (when agent see `preview block`) but clicks on `logout` button var preview_leadid $(#phone).find(> .preview).attr(data-lead_id); var preview_campid $(#phone).find(> .preview).attr(data-campid); $(#logout-form namepreview_leadid).val(preview_leadid); $(#logout-form namepreview_campid).val(preview_campid); if(confirm(Are you sure you want to logout ?)) { if (FF(sip_connection.webrtc) && Agent.is_supervisor && Agent.current_connection_method webrtc) { logout(); window.removeEventListener(beforeunload, handleUnloadEvent); } $(#logout-form).submit(); } return false; })});$.extend({ alert: function (title, message){ $(div>/div>).dialog( { buttons: { Ok: function () { $(this).dialog(close); } }, close: function (event, ui) { $(this).remove(); }, resizable: false, title: title, width: 400, modal: true }).html(message);}});// Feature Flags /** * Just write in a twig template: * if (FF(key_name) { * ... * } * * @return {boolean} */function FF(key){ if (!key) return false; var feature_result false; // Set the current result object and save it in localstorage $.ajax({ url: ajax/, method: post, dateType: json, async: false, data: { act: get_ff_result, ff_key: key } }).done(function (result) { feature_result result true; }); return feature_result;}/** * Numeric sort for Datatables * * This functionality is used for frontend only sorting to sort numeric values with non-numeric strings such as - N/A etc. * Set column type to numeric to append this functionality for Datatable column */(function($){ // Ascending sorting $.fn.dataTableExt.oSortnumeric-asc function(x, y) { if (isNaN(x) && isNaN(y)) { return ((x y) ? 1 : ((x > y) ? -1 : 0)); } if (isNaN(x)) { return -1; } if (isNaN(y)) { return 1; } x parseFloat(x); y parseFloat(y); return ((x y) ? -1 : ((x > y) ? 1 : 0)); }; // Descending sorting $.fn.dataTableExt.oSortnumeric-desc function(x, y) { if (isNaN(x) && isNaN(y)) { return ((x y) ? 1 : ((x > y) ? -1 : 0)); } if (isNaN(x)) { return 1; } if (isNaN(y)) { return -1; } x parseFloat(x); y parseFloat(y); return ((x y) ? 1 : ((x > y) ? -1 : 0)); };})(jQuery);/** * Upload size validation * * This functionality is used automatically on inputtypefile to prevent php $_FILES errors */(function($){ // Set this option to set uploading file size limit in MB var FILE_SIZE_LIMIT 10; $(document).on(change, inputtypefile, function(e) { if (this.files instanceof FileList) { for (var i0; ithis.files.length; i++) { if (this.filesi.size / 1024 / 1024 > FILE_SIZE_LIMIT) { alert(Uploading file size is more than + FILE_SIZE_LIMIT + MB); this.value ; break; } } } });})(jQuery);/** * convert time H:I to full time H:I::S * example: * 05:30am will convert to 05:30:00 * 05:30pm will convert to 17:30:00 * Clock system: * * 00:00 (midnight) 12:00 am * 01:00 1:00 am * 02:00 2:00 am * 03:00 3:00 am * 04:00 4:00 am * 05:00 5:00 am * 06:00 6:00 am * 07:00 7:00 am * 08:00 8:00 am * 09:00 9:00 am * 10:00 10:00 am * 11:00 11:00 am* * 12:00 (midday) 12:00 pm * 13:00 1:00 pm * 14:00 2:00 pm * 15:00 3:00 pm * 16:00 4:00 pm * 17:00 5:00 pm * 18:00 6:00 pm * 19:00 7:00 pm * 20:00 8:00 pm * 21:00 9:00 pm * 22:00 10:00 pm * 23:00 11:00 pm * * * @param time * @returns {string} */function timeConvert12to24(time) { var isAfterNoonTime time.toLowerCase().match(pm) ? true : false; time time.split(:); if (isAfterNoonTime) { var hour 12 + parseInt(time0, 10); var min time1.toLowerCase().replace(pm, ); if (hour 24) { hour 12; } } else { var hour time0; var min time1.toLowerCase().replace(am, ); if (hour 12) { hour 00; } } return hour + : + min + :00;}/** * convert time into seconds * example: 00:5:00 will be converted into 300 * * @param time * @returns {number} */function time2int(time) { var hms time.split(:); var hours (parseInt(hms0) * 60 * 60); var minutes (parseInt(hms1) * 60); var seconds parseInt(hms2); var totalTimeSeconds hours + minutes + seconds; return totalTimeSeconds;}/** * get current time in seconds according to time zone * * @param offset * @returns {number} */function timezoneOffsetTime(offset) { offset parseInt(offset); // check if now Daylight saving time if (isDaylightSavingTime()) { offset offset +1; } // create Date object of current location var locDate new Date(); // get UTC time in milisec: // convert to milisec and add local time zone offset var utcTime locDate.getTime() + (locDate.getTimezoneOffset() * 60000); // create new Date object for different timezone var otherTimezone new Date(utcTime + (3600000 * offset)); // return time as seconds return Math.round(otherTimezone.getTime() / 1000);}/** * generate new url without empty inputs * * @param serialisedFormData * @returns {string} */function generateNewUrl(serialisedFormData){ var arrFormData serialisedFormData.split(&); var dictCombinedKeys {}; var arrKeyValuePairs ; var hiddenKeys request, common_order_id, datefrom, dateto; // must be same as in $(#filter_form).submit(function(e){}); in reports for (var i 0; i arrFormData.length; i++) { var arrParam arrFormDatai.split(); var strKey decodeURIComponent(arrParam0); var strValue arrParam1; // remove hidden form data if (($.inArray(strKey, hiddenKeys) ! -1)) { continue; } // remove empty inputs if (strKey ! && strValue ! ) { dictCombinedKeysi ; dictCombinedKeysistrKey strValue; } } // generate new url for (var key in dictCombinedKeys) { for (var value in dictCombinedKeyskey) { // remove page1 if ((value page) && (parseInt(dictCombinedKeyskeyvalue) 1)) { continue; } arrKeyValuePairs.push(encodeURIComponent(value) + + dictCombinedKeyskeyvalue); } } return arrKeyValuePairs.join(&);}/** * get settings value * * @param key * @returns {boolean} * @constructor */function ICSettings(key){ if (!key) return false; var settings_result false; $.ajax({ url: ajax/, method: post, dateType: json, async: false, data: { act: get_settings_value, key: key } }).done(function (result) { settings_result result; }); return settings_result;}/** * check if now Daylight saving time * * @returns {boolean} */function isDaylightSavingTime() { var jan new Date(new Date().getFullYear(), 0, 1); var jul new Date(new Date().getFullYear(), 6, 1); var offset Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset()); return new Date().getTimezoneOffset() offset;}// random password generatorfunction generate_password(min, max) { var pwd_length getRandomLength(min, max); var char_sets abcdefghijklmnopqrstuvwxyz, ABCDEFGHIJKLMNOPQRSTUVWXYZ, 0123456789, !#$%&*()_+{}:/?|/, ; var all_chars char_sets.join(); var password char_sets.map( function (char_sets) { return generate_chars(char_sets, 1); } ); password.push(generate_chars(all_chars, pwd_length - password.length)); return password.join().split().sort(function () { return 0.5 - Math.random() }).join();}// get number between diapasonfunction getRandomLength(min, max) { var min Math.ceil(min); var max Math.floor(max); return Math.floor(Math.random() * (max - min + 1)) + min;}function generate_chars(chars, charsLength) { var result ; for (var i 0; i charsLength; i++) { result + charsMath.floor(Math.random() * chars.length); } return result;}/** * verify email address * * @returns {boolean} */function isEmail(email) { var regex /^(a-zA-Z0-9_\.\-\+)+\@((a-zA-Z0-9\-)+\.)+(a-zA-Z0-9{2,4})+$/; return regex.test(email);}/** * verify domain name * * @returns {boolean} */function isDomain(domain) { var regex /^a-zA-Z0-9a-zA-Z0-9-{1,61}a-zA-Z0-9(?:\.a-zA-Z{2,})+$/; return regex.test(domain);}/** * Generate Error message with current User Logs * * @param errorMessage * @param responseText * @param requestData * * @return void */function ajaxError(errorMessage, responseText, requestData) { let context { user_id: USER_ID, domain: SUBDOMAIN, app: (Agent.is_connected ? Agent : Admin) + interface, response: responseText }; if (requestData) { context.request requestData; } if (env local) { console.log(errorMessage); console.log(context); } else { Rollbar.error(errorMessage, context); }}function convert_date_to_hcc_format(timestampDate, dateFormat, includeHours false, includeMinutes false, includeSeconds false) { let dateObj new Date(parseInt(timestampDate)); if (isNaN(dateObj.getTime())) { return ; } let formattedDay hours minutes seconds ; let day String(dateObj.getDate()).padStart(2, 0); let month String(dateObj.getMonth() + 1).padStart(2, 0); let year dateObj.getFullYear(); // System default format formattedDay year + - + month + - + day; // European format if (dateFormat d/m/Y) { formattedDay day + / + month + / + year; } // American format if (dateFormat m/d/Y) { formattedDay month + / + day + / + year; } if (includeHours) { hours String(dateObj.getHours()).padStart(2, 0); } if (includeMinutes) { minutes : + String(dateObj.getMinutes()).padStart(2, 0); } if (includeSeconds) { seconds : + String(dateObj.getSeconds()).padStart(2, 0); } return formattedDay + + hours + minutes + seconds;}function showFromNameButton(id) { $(#from_name + id).show();}function changeFromNameInput(data) { if (data.type ! email) { return ; } return input + idfrom_name_input_ + data.id + + oninputshowFromNameButton( + data.id + ) + typetext + value + (data.from_name ? data.from_name : ) + + > + button + idfrom_name + data.id + + styledisplay: none; margin-left: 3px; + onclicksaveNameFrom( + data.id + ) + classfrom-name-save-btn btn button + > + Save + /button>}function saveNameFrom(id) { const value $(#from_name_input_ + id).val(); const fromName $(#from_name + id); fromName.text(Saving...); $.ajax({ method: POST, url: /email_campaigns_from/, data: { saveNameFrom : true, id : id, value : value }, dataType: json }) .done(function() { $(#from_name + id).text(Saved ✔); setTimeout(function () { fromName.hide(); fromName.text(Save); }, 1000) }) .fail(function(jqXHR, textStatus, errorThrown) { alert(Failed to complete the request.); })}/script> script>var Agent { console_log_debug : true, // writes to console.log ajax_errors : , // an array used by .ajaxError, logging AJAX errors for debugging purpose report_ajax_errors : true, // true will gather AJAX errors and email them (afte reaching 5) to developers report_success_errors: true, // true will email developers every response.error from successful AJAX calls is_connected : false, // if the device is connected is_supervisor : false, is_monitoring : false, current_connection_method : , // last connection method (softphone, deskphone, callin) status : ready, ignore_wrap_status : false, // if set, the status updater will ignore the wrap status has_manual_campaigns: false, // Hide manual block in init phone_lines : {s:-1}, {s:-1} , current_line : 0, // ? campaigns : , // will store auto-populated list of all active campaigns agents : , // will store auto-populated list of agents signed it who are Not Me extensions : , // will store auto-populated list of extensions agents_update_with_details : false, // dont update details for agents. Will update additional details if set to true call_history : , // will store calls history during current session call_results : , // call results of the current call (last loaded by ajax/get_call_results isolate_agents : false, // agents cant talk to each other, make transfers, bridges, etc log_array : , // an array used by .log(), logging interface actions for debugging purpose log_array_limit : 200, // limit of log array records call_i_just_previewed : false, transfers_we_accepted : , agent_bridged_calls : false, // if is true than the agent bridged 2 lines and we should save call result for the main channel cc-3822 (this variable is set under FF) autosubmit_wrap_form_timeout : , // variable for storing setTimeout() condition cc-272 error_wrap_situation : false, // for fixing problem cc-1512 wrap_form_autosubmited : false, // if wrap form was not autosubmited incall_lines : , // array of call ids that must be submited cc-2151 old_lines : , // array of history lines cc-2151 status_time : 0, // we need this time to know preview time CC-2226 wrap_status_display_submit_button : true, // CC-2770 this is stub, to avoid frequent ajax requests change_status_tries: 0, prevent_preview_call_show: false, accept_call_clicked: false};Agent.options function(options) { $.extend(true, Agent, options); };// logs the events and messages in memoryAgent.log function(messages){ if(typeof messages string) messages messages ; for(var i 0; i messages.length; i++){ var line yyyymmddhhiss() + - + messagesi; if(Agent.console_log_debug) console.log(line); Agent.log_array.push(line); if(Agent.log_array.length > Agent.log_array_limit) Agent.log_array.shift(); }};// // ACTIONS// Agent.place_manual_call function(number, camp_id, check_timezone, account_id null, client_id null, state null) // Place a manual call{ Agent.log(Placing manual call to # + number + campaign: + camp_id); Agent.$status.hide(); // hide status block to prevent changing agent status while placing a call CC-1171 // prevent placing a manual call within 5 seconds after previous one var time new Date().getTime(); if(5 * 1000 > (time - Agent.last_manual_call_at)) { Agent.log(Too soon! Double click? Returning); return; } Agent.last_manual_call_at time; $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/place_manual_call, camp_id: camp_id, ext: number, check_timezone: (check_timezone ? 1:0), account_id: account_id, client_id: client_id, state: state } }) .done(function(r) { if (r.notice) { $.alert(Notice, r.notice); Agent.log(Call cannot be placed: + r.notice); Agent.$status.show(); } else if (r.error) { $.alert(Error, r.error); } if (r.success) { Agent.log(Call placed.); } });};Agent.place_call_to_campaign function(camp_id) // Make an internal call into a campaign{ Agent.log(Placing manual call to a campaign ID + camp_id); // prevent placing a manual call within 5 seconds after previous one var time new Date().getTime(); if(5 * 1000 > (time - Agent.last_manual_call_at)) { Agent.log(Too soon! Double click? Returning); return; } Agent.last_manual_call_at time; $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/place_call_to_campaign, camp_id : camp_id } }) .done(function(r) { Agent.log(Call placed.); });};Agent.place_preview_call function(lead_id) // Initiate the previewed call (dial!){ Agent.prevent_preview_call_show true; Agent.log(Placing preview call to lead: + lead_id +, hiding preview box and top, showing statuses box); Agent.$phone.find(.preview).hide(); Agent.$top.hide(); Agent.resize_everything(); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/place_preview_call, lead_id : lead_id } }) .done(function (r) { if (r.error) { var errorDialogue $(div titleError> + r.error + /div>); $(body).append(errorDialogue); errorDialogue.dialog({ show: fade, hide: fade, modal: true, closeOnEscape: false, open: function() { $(.ui-dialog-titlebar-close).hide(); }, buttons: { text: Ok, click: function () { Agent.prevent_preview_call_show false; Agent.change_status(ready); $(this).dialog(close); $(this).remove(); } } }); } else { Agent.log(Preview call placed); } });};Agent.place_callback_call function(lead_id, camp_id, number) // Initiate the previewed call (dial!){ Agent.prevent_preview_call_show true; Agent.log(Placing callback call to # + number + campaign: + camp_id + lead: + lead_id); Agent.$status.hide(); // hide status block to prevent changing agent status while placing a call CC-1171 // prevent placing a callback call within 5 seconds after previous one var time new Date().getTime(); if(5 * 1000 > (time - Agent.last_callback_call_at)) { Agent.log(Too soon! Double click? Returning); return; } Agent.last_callback_call_at time; $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/place_manual_call, lead_id: lead_id, camp_id: camp_id, ext: number } }) .done(function(r) { if (r.notice) { $.alert(Notice, r.notice); Agent.log(Call cannot be placed: + r.notice); Agent.$status.show(); } else if (r.error) { $.alert(Error, r.error); } if (r.success) { Agent.log(Callback call is placed.); } });};Agent.postpone_call function(lead_id, period, camp_id) // Postpone the previewed call (to be called later){ Agent.log(Postponing preview call); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/postpone_preview_call, lead_id : lead_id, period : period, camp_id : camp_id, preview_time: Agent.status_time } }) .done(function() { Agent.call_i_just_previewed false; Agent.log(Reset last previewed call, lead_id + lead_id); Agent.log(Preview call postponed, hiding preview box and top, showing statuses box); Agent.$phone.find(.preview).hide(); Agent.$top.hide(); Agent.$status.show(); Agent.resize_everything(); Agent.change_status(notready); Agent.status_time 0; });};Agent.pause function(){ Agent.log(Pausing the agent); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/pause } }) .done(function(r) { Agent.log(Agent paused); });};Agent.accept_call function(call_id, channel_id){ Agent.log(Accepting the call, call_id + call_id); // Time bomb. In 4 seconds, check: if agent is still in Ready, pause him again. setTimeout(function(){ if(Agent.status ready) Agent.pause(); }, 4000);};// // Agent.unpause function(){ Agent.log(Unpausing the agent); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: {act: agent/unpause} }) .done(function (r) { Agent.log(Agent unpaused); });};Agent.accept function(call_id){ Agent.log(Accepting the call, call_id + call_id); Agent.unpause(); // Time bomb. In 4 seconds, check: if agent is still in Ready, pause him again. setTimeout(function(){ if(Agent.status ready) Agent.pause(); }, 4000);};Agent.decline function(call_id, decline_type){ Agent.log(Declining the call, call_id + call_id); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/decline, call_id : call_id, decline_type: decline_type } }) .done (function(r) { Agent.log(Declined: + JSON.stringify(r)); });};Agent.hangup function(channel_id) // Hangup, ending the call{ var camp_id 0; if (Agent.call.info) camp_id Agent.call.info.camp_id; var call_id Agent.phone_linesAgent.current_line.cid; Agent.log(Hanging up channel on line + Agent.current_line + on channel: + channel_id + , camp_id:+camp_id); // Here we should set correct callid for wrap form if (call_id ! Agent.call.info.call_id) { Agent.log(HANGUP: Setting correct callid to +call_id+ which was +Agent.call.info.call_id); Agent.call.info.call_id call_id; } if (channel_id ! Agent.call.info.channel_id) { Agent.log(HANGUP: Setting correct channel_id to +channel_id+ which was +Agent.call.info.channel_id); Agent.call.info.channel_id channel_id; } Agent.log(Hanging up channel + channel_id + , camp_id:+camp_id+, callid:+call_id); // collect data like channel_id and call_id CC-2141 Agent.hangup_data {channel_id : channel_id, call_id : call_id}; $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/hangup, channel_id : channel_id, camp_id : camp_id, agent_id:Agentagent_id, call_id : call_id} }) .done (function(data) { if(Agent.is_supervisor) { Agent.log(Hanged up: now going to not ready status (this is a supervisor)); Agent.change_status(notready); } else Agent.log(Hanged up successfully); });};Agent.back_to_hold_queue function(channel_id) // Place the call back into the on-hold queue{ Agent.log(Putting the call back into on-hold queue, channel + channel_id); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/onhold_queue, channel_id : channel_id } }) .done(function() { Agent.log(Call is put back into on-hold queue); });};Agent.onhold function(channel_id) // Put the call on hold{ Agent.log(Placing on hold channel + channel_id); var camp_type Agent.call.info.camp_type; $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/onhold, channel_id : channel_id, camp_type : camp_type } }) .done(function() { Agent.log(Call is put on hold); });};Agent.retrieve function(channel_id) // Retrieve the call from an hold{ Agent.log(Retrieving channel + channel_id); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/retrieve, channel_id : channel_id } }) .done(function() { Agent.log(retrieved); });};Agent.transfer_to_agent function(channel_id, ext) // Transfer the call to an agent (by extension){ Agent.log(Transferring channel + channel_id + to ext: + ext); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/transfer_to_agent, channel_id : channel_id, ext:ext } }) .done(function() { Agent.log(transferred); if(FF(fix.internal_transfer.answer)) { var index Agent.transfers_we_accepted.indexOf(channel_id); if (index > -1) { Agent.transfers_we_accepted.splice(index, 1); } } });};Agent.transfer_to_agent_with_callid function(channel_id, ext, call_id) // Transfer the call to an agent (by extension){ Agent.log(Transferring channel + channel_id + to ext: + ext); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/transfer_to_agent, channel_id : channel_id, ext:ext, call_id:call_id } }) .done(function() { Agent.log(transferred); if(FF(fix.internal_transfer.answer)) { var index Agent.transfers_we_accepted.indexOf(channel_id); if (index > -1) { Agent.transfers_we_accepted.splice(index, 1); } } });};Agent.internal_transfer_accept function() // Accept an internal transferred call{ Agent.$status.hide(); // hide status block to prevent changing agent status while accepting a call CC-1171 Agent.$phone.find(.internal_transfer).hide(); // due to the large number of simultaneous requests, we sometimes experience slowdowns in the agent interface. // as a result, we may have a case when the agent clicks on the accept button and immediately on the pickup button. // in this case, we break the logic of the agents interface. // to prevent such illogical behavior, we will prohibit clicking on the pickup button // if the agent clicked on the accept button. Agent.accept_call_clicked true; var channel_id Agent.$phone.find(.internal_transfer).data(channel_id); Agent.transfers_we_accepted.push (channel_id); if(Agent.transfers_we_accepted.length > 50) Agent.transfers_we_accepted.shift(); var channel_id_to_put_onhold Agent.$phone.find(.internal_transfer).data(channel_id_to_put_onhold); Agent.log(Accepting transfer, channel + channel_id + channel to put onhold + channel_id_to_put_onhold); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/transfer_accept, channel_id : channel_id, channel_id_to_put_onhold: channel_id_to_put_onhold } }) .done(function() { // when agent gets Accept/Decline block we should hide statuses block // and when caller finished this call before agent accept it, we should show statuses block // but if agent has another line we should not show statuses block if (Agent.phone_lines0.s 0) { Agent.$status.show(); Agent.log(caller has finished this call before agent accepted it); } Agent.log(accepted); });};Agent.internal_transfer_decline function(){ Agent.$phone.find(.internal_transfer).hide(); var channel_id Agent.$phone.find(.internal_transfer).data(channel_id); Agent.log(Declining transfer, channel + channel_id); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/transfer_decline, channel_id : channel_id } }) .done(function() { // when agent gets Accept/Decline block we should hide statuses block // and when agent declines call we should show statuses block // but if agent has another line we should not show statuses block if (Agent.phone_lines0.s 0 && Agent.status ! wrap) { Agent.$status.show(); } Agent.log(declined); });};Agent.transfer_to_campaign function(channel_id, id){ Agent.log(Transferring channel + channel_id + to campaign id: + id); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/transfer_to_campaign, channel_id : channel_id, id:id } }) .done(function() { Agent.log(transferred); if(FF(fix.internal_transfer.answer)) { var index Agent.transfers_we_accepted.indexOf(channel_id); if (index > -1) { Agent.transfers_we_accepted.splice(index, 1); } } });};Agent.transfer_to_campaign_with_callid function(channel_id, id, call_id){ Agent.log(Transferring channel + channel_id + to campaign id: + id); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/transfer_to_campaign, channel_id : channel_id, id:id, call_id:call_id } }) .done(function() { Agent.log(transferred); });};Agent.transfer_to_number function(channel_id, phone){ Agent.log(Transferring channel + channel_id + to number: + phone); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/transfer_to_number, channel_id : channel_id, phone:phone } }) .done(function() { Agent.log(transferred); if(FF(fix.internal_transfer.answer)) { var index Agent.transfers_we_accepted.indexOf(channel_id); if (index > -1) { Agent.transfers_we_accepted.splice(index, 1); } } });};Agent.transfer_to_phonenumber function(channel_id, phone, call_id, is_internal){ Agent.log(Transferring channel + channel_id + to + (is_internal ? extension : custom ) + number: + phone); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/transfer_to_phonenumber, channel_id : channel_id, phone:phone, is_internal : (is_internal ? 1:0), call_id: call_id } }) .done(function() { Agent.log(transferred); if(FF(fix.internal_transfer.answer)) { var index Agent.transfers_we_accepted.indexOf(channel_id); if (index > -1) { Agent.transfers_we_accepted.splice(index, 1); } } });};Agent.dtmf function(channel_id, n){ Agent.log(Sending DTMF: + n); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/play_dtmf, channel_id : channel_id, dtmf: n } }) .done(function() { Agent.log(DTMF sent); });};Agent.bridge function () { const line_one Agent.phone_lines0; const line_two Agent.phone_lines1; Agent.log(Bridging two calls: + line_one.c + and + line_two.c); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/bridge_calls, channel1_data: JSON.stringify(line_one), channel2_data: JSON.stringify(line_two) } }).done(function () { Agent.log(bridged); Agent.agent_bridged_calls true; });};Agent.conference function(){ var c1 Agent.phone_lines0.c; var c2 Agent.phone_lines1.c; Agent.log(Conferencing two calls: +c1+ and +c2); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/conference, channel1_id : c1, channel2_id: c2 } }) .done(function() { Agent.log(conferenced); });};Agent.conference_to_bridge function(){ Agent.log(Bridging a conference); var c1 Agent.phone_lines0.c; var c2 Agent.phone_lines1.c; $.ajax({url: ajax/, type: POST, dataType: JSON, data: {act: agent/conference_to_bridge, channel1_id : c1, channel2_id: c2 }}) .done(function () { Agent.log(conference bridged); });};Agent.change_status function (status) { if (Agent.status status) { return; } Agent.log(Changing status from: + Agent.status + to: + status); Agent.status status; Agent.$status.find(div .time).text(00:00); Agent.$status.find(div).removeClass(active); Agent.$status.find(div. + status).addClass(active); if (status ! ready) Agent.$acceptdecline.hide(); $.ajax({url: ajax/, type: POST, dataType: JSON, data: {act: agent/change_status, status: status}});};Agent.connect function(){ Agent.log(Connecting); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/connect, connection_method: Agent.current_connection_method } }) .done(function(){ Agent.log(Connected); });};Agent.disconnect function(){ Agent.log(Disconnecting); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/disconnect } }) .done(function() { Agent.log(disconnected!); })};Agent.stop_monitoring function(){ Agent.log(Stopping monitoring); $.ajax( { url : ajax/, type : POST, dataType : JSON, data : { act : supervisor/stop }, async : false }) .done(function() { Agent.log(Stopped monitoring); });};Agent.stop_helping function(){ Agent.log(Stopping helping); // panic button $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: supervisor/help_request, agentid: Agent.$phone.find(>.monitor .button).attr(data-agentid), action: stop } });};Agent.play_audio function (audio){ Agent.log(Playing audio: +audio); $.ajax( { url : ajax/, type : POST, dataType : JSON, data : { act : agent/play_audio, audio: audio } }) .done(function() { Agent.log(Audio played!); });};Agent.update_last_connection_method function (connection_method) { $.ajax({ url: ajax/, type: POST, dataType: JSON, data: {act: agent/update_last_connection_method, connection_method: connection_method} });};// // Agent.connection_dialog function(){ var already $(#connection_dialog).hasClass(ui-dialog-content); if(already) $(#connection_dialog).dialog( open ); else { $(#connection_dialog).dialog({ modal: true, closeOnEscape: false, hide: true, width: 600, position:{ my: center top, at: center top+40, of: window }, dialogClass: connection_dialog }); } Agent.Updater.stop(is_device_registered); Agent.Updater.stop(call_in_status); $(.connection_option_body).not(.dont_connect).find(.button).hide(); $(.connection_option_body) .find(.error, .connecting, .success, .offline).hide().end() .find(.status) .html(img srcimages/calling_animation.gif stylevertical-align:-2px;margin-left:10px;>) .css({color:inherit}); $(.connection_option. + Agent.current_connection_method).click();};Agent.browser_resize function(){ if(!Agent.$browser.length) return; Agent.$browser.find(iframe:visible).height( $(window).innerHeight() );};Agent.resize_everything function(){ var l Agent.$call_info.find(div.info); var r false; if(Agent.$wrap.is(:visible)) r Agent.$wrap.find(div.wrap); if(Agent.$preview_notes.is(:visible)) r Agent.$preview_notes.find(div.notes); if(r) { l.height(auto); r.height(auto); var max Math.max(l.height(), r.height()); if(l.height() max) l.css(min-height, max); if(r.height() max) r.height(max); } Agent.browser_resize();};// comparing lines, supplementary functionAgent.compare_lines_except_time function(lines1, lines2){ var l1 $.extend(true, {}, lines10), $.extend(true, {}, lines11) ; var l2 $.extend(true, {}, lines20), $.extend(true, {}, lines21) ; l10.t l11.t l20.t l21.t ; return JSON.stringify(l1) JSON.stringify(l2);};Agent.phone_redraw function(lines){ var old_lines Agent.phone_lines; Agent.phone_lines lines; // TODO: do not remove it please cc-2151 // we create array from call ids where agent took part (value will be removed after submit call) // also we get call ids from current lines and create array to store them (line will be removed after submit call) // the last step we try to find out the difference between these two arrays to know the lost call id (the call id that we must submit) // var callid_from_lines ; // lines.forEach(function(line) // { // if (($.inArray(line.cid, Agent.incall_lines) -1) && (line.s ! 0)) // { // Agent.incall_lines.push(line.cid); // Agent.old_lines.push(line); // } // callid_from_lines.push(line.cid); // }); // var lost_call Agent.incall_lines.filter(function(x) { if (callid_from_lines.indexOf(x) -1) return x; }); // // Agent.old_lines.forEach(function(old_line){ // if (old_line.cid lost_call0) { // console.log(Lost call: + lost_call0); // console.log(We must submit this call:); // console.log(old_line); // } // }); // log lines update if lines have changed since before (except the call duration .t property) //also update transfer to extensions and agents lists if( !Agent.compare_lines_except_time(old_lines, lines) ) { Agent.accept_call_clicked false; Agent.log(Lines update: + JSON.stringify(lines)); Agent.update_extensions_list(); Agent.update_agents_list(); } Agent.$phone.show(); if(!Agent.is_connected) { Agent.log(Not connected!); if(Agent.$phone.find(> .line).is(:visible)) { Agent.log(Hiding lines!); Agent.$phone.find(> .line).hide(); } if(Agent.$phone.find(> .calls).is(:visible)) { Agent.log(Hiding calls!); Agent.$phone.find(> .calls).hide(); } return; } // Showing / hiding the place manual call forms only if there is an idle line // show call blocks depending on how many active connections agent has cc-1335 var show_call_block_forms false; if (lines0.s 0 && lines1.s 0) show_call_block_forms true; // all lines are free if (lines0.s 2 && lines1.s 0) show_call_block_forms true; // first line is busy ; second is free if (old_lines0.s 2 && old_lines1.s 2) show_call_block_forms false; // all lines are busy if ( (show_call_block_forms) && (Agent.status ready || Agent.status notready || Agent.status onhold) ) { if(Agent.$manual_call.filter(.campaign).is(:hidden)) // show manual campaign call thing { // if there are campaigns this agent participates in if (Agent.campaigns) { if($.grep( Agent.campaigns, function(c){ return c.i > 0; } ).length > 0 && Agent.has_manual_campaigns) { Agent.log(Showing manual call phone box); Agent.$manual_call.filter(.campaign).show().find(input).val(); Agent.$phone.find(.no_active_campaigns).hide(); } } } if(!Agent.isolate_agents && Agent.$manual_call.filter(.internal).is(:hidden)) // show manual campaign call thing { // if there are any campaigns if(Agent.campaigns.length > 0) { Agent.log(Showing internal call phone box); Agent.$manual_call.filter(.internal).show(); } } } else { // Agent is not ready, notready or onhold // OR Agent doesnt have idle lines // > agent cant make manual calls now, sorry, hiding the manual box if(Agent.$manual_call.is(:visible)) { if (Agent.is_supervisor) { if (lines0.s 0 && lines1.s 0 && Agent.status wrap) Agent.change_status(notready); } Agent.log(Hiding manual call box, because lines: + JSON.stringify(lines) + and status: +Agent.status); Agent.$manual_call.hide(); // CC-2770 ; also check it on line ~630 // sometimes our submit button is hidden due to delays in agent status updates // and in speed of calling functions with Updater.js // in this case I try to guess step and display submit button if (Agent.wrap_status_display_submit_button) { if (Agent.status wrap) { Agent.log(Showing wrap form line718); // Do not show wrap here for bridged calls if(!Agent.agent_bridged_calls) { setTimeout(function() { Agent.$wrap.find(tr.submit).show(); }, 2000); } } } if ((lines0.s 0 && lines1.s ! 0) || (lines0.s ! 0 && lines1.s 0)) Agent.$status.hide(); // for fix CC-2744 if(lines0.s 0 && lines1.s 0 && Agent.status wrap && !Agent.$wrap.is(:visible) ) // trying to report the WRAP issue { Agent.log(ERROR: WRAP SITUATION. Trying to get this Dead Call details); Agent.$top_preloader.show(); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/get_call_details, call_id: -1 }}) .done(function(r) { Agent.$top_preloader.hide(); if (r.problem) { Agent.log(Ooops! Dead call details could not be found! Changing agent status to notready); ajaxError( Get call details returned error, r.problem ); Agent.change_status(notready); return; } Agent.log(Dead Call details received); Agent.log(r.CU_API_LOG); Agent.error_wrap_situation true; Agent.call.info r; Agent.$status.hide(); Agent.display_call_details(); Agent.display_agent_scripts(); Agent.$wrap.find(tr.submit).show(fast); // Timeout timer for Wrap form CC-272 Agent.wrap_form_timer(); Agent.resize_everything(); }); } } } // showing/hiding the bridge & conference buttons Agent.$phone.find(.between).toggle((lines0.s 1 && lines1.s 2 ) || (lines0.s 2 && lines1.s 1 )); // showing/hiding in conference band if both lines are talking Agent.$phone.find(.in_conference).toggle(lines0.s 1 && lines1.s 1); // add conference class // TODO: Commented out by Oleg, JIRA CC-1020 // if ( Agent.$phone.find(.in_conference).is(:visible) ) $(div.line).addClass(conference); Agent.$phone.find(> .line).each(function(i) { var line $(this); // if we had two active lines they have order BY `call_status`.`lineNo` DESC, `call_status`.`callId` DESC // this mean that in line0 we will have second line // if this line is hung up we will have in line0 first line, and we trying to find data from second line // in old_lines1 - this is not correct, because it was saved in old_lines0 if(Agent.phone_linesi.s 0) // line is free ? { if(line.is(:visible)) { Agent.log(Line +i+ is free, hiding it); line.hide(); } if(old_linesi.s > 0) // just freed? lets wrap it up! { Agent.call_history.push( $.extend(true, {}, old_linesi) ); Agent.log(The line +i+ just freed, showing WRAP submit button and resizing everything); Agent.hangup_data {line: i, channel_id : old_linesi.c, call_id : old_linesi.cid, show_wrap : 1}; // check if we have connection between two agents сс-1331 $.ajax({ url: ajax/, type: POST, dataType: JSON, async: false, data: { act: agent/get_call_status, channel: old_linesi.c, callsid: old_linesi.cid } }).done(function(r) { if (r.submit_call) { // We had two lines which were bridged and now they a free if(Agent.agent_bridged_calls) { if (i0) { return true; // go to next line! } // This mean that we should save call results for the main channel (with the lowest value of call_id)!!! Agent.log(FIND_LINE: WRAP form after bridging calls); // Lets find lowest value of call_id if (old_lines1.cid > old_lines0.cid) { Agent.log(FIND_LINE_BRIDGED_1: Setting correct callid for line +i+ to +old_lines0.cid+ which was +Agent.call.info.call_id); Agent.call.info.call_id old_lines0.cid; Agent.call.info.channel_id old_lines0.c; } else { // lets check if callid for wrap is incorrect and if so - update it to correct one if (Agent.call.info.call_id ! old_lines1.cid) { Agent.log(FIND_LINE_BRIDGED_2: Setting correct wrap callid for line +i+ to +old_lines1.cid+ which was +Agent.call.info.call_id); Agent.call.info.call_id old_lines1.cid; Agent.call.info.channel_id old_lines1.c; } } // Agent.agent_bridged_calls false; } else { Agent.log(FIND_LINE: Lets check if we use correct callid for wrap form); // Only one line from two was freed if (i1) { // Here we should set correct callid for wrap form // Agent.phone_lines0 has data of active call // This mean that we could find old_lines with hung up call if (old_lines1.cid Agent.phone_lines0.cid) { Agent.log(FIND_LINE_1: Setting correct callid for line +i+ to +old_lines0.cid+ which was + old_lines1.cid); Agent.call.info.call_id old_lines0.cid; Agent.call.info.channel_id old_lines0.c; } else { Agent.log(FIND_LINE_2: Setting correct callid for line +i+ to +old_lines1.cid+ which was + Agent.call.info.call_id); Agent.call.info.call_id old_lines1.cid; Agent.call.info.channel_id old_lines1.c; } } else { if (Agent.call.info.call_id ! old_lines0.cid) { Agent.log(FIND_LINE_3: Setting correct callid for line +i+ to +old_lines0.cid+ which was + Agent.call.info.call_id); Agent.call.info.call_id old_lines0.cid; Agent.call.info.channel_id old_lines0.c; } } } if (Agent.hangup_data && Agent.hangup_data.line i && Agent.hangup_data.show_wrap 1) { setTimeout(function () { if (Agent.phone_linesi 0) { Agent.$wrap.find(tr.submit).show(); } }, 2000); Agent.wrap_form_timer(); } } }); Agent.resize_everything(); if (Agent.is_supervisor) { Agent.log(We are a supervisor: change status to not ready); Agent.change_status(notready); } } return true; // go to next line! } if (Agent.phone_linesi.s ! 0) { delete (Agent.hangup_data) } // so line is busy ? Agent.current_line i; var l Agent.phone_linesi; // update name in active calls block if (old_linesi.n ! l.n) line.find(div.number span.number).html(l.n); // not first time? was busy with same call already? line has already been displayed. if (old_linesi.s l.s && old_linesi.c l.c && old_linesi.r l.r) return true; // Go to next line! // so line JUST became busy ? var call_id l.cid; Agent.log(Line + i + just went busy! Hiding the Statuses box, showing the phone line box); // show and populate phone tab with the data line.show(); // Finally! This is a real, active call! Now were talking! line.find(.buttons.call).show(); line.find(.buttons.accept-decline).hide(); Agent.$status.slideUp (fast); var statusText Talking; if (l.s 2) { statusText On Hold; line.addClass (onhold-line); } if (l.s 1) { line.addClass (current); line.removeClass (onhold-line); } else line.removeClass(current); // redraw Active calls block line.find(.dtmf_keypad, .transfer_to).hide(); line.find(div.number span.status).text(statusText); line.find(div.number span.number).html(l.n); line.find(div.number span.time).text(l.t); line.find(.buttons .hold-queue).toggle(l.q 1); // button to put the call back into onhold queue Agent.log(no hangup? +l.nh+ another agent calling? + l.a); //line.find(.buttons .hangup).toggle ( l.nh 0 || l.a 1 ); // are we allowed to hang up (per campaign settings)? // hide hang up button per campaign settings OR if call not between agents if ((parseInt(l.nh) 1) && (parseInt(l.a) 0)) line.find(.buttons .hangup).hide(); else line.find(.buttons .hangup).show(); // clear right side for the new consumers data Agent.log(Hiding top, showing preloader); Agent.$top.hide(); Agent.$top_preloader.show(); Agent.browser_resize(); if (Agent.cu_api) { Agent.log(Sending agent hit); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/CU_agent_hit, call_id: call_id }}) .done(function(r){ Agent.log(Agent hit responded: + JSON.stringify(r) ); }); } // DM9 (Titanium) screen pop //if(Agent.dm9_screen_pop) Agent.do_dm9_screen_pop(Agent.phone_linesi.aid); if (Agent.dm9_screen_pop) { if ((l.ct I) || (l.ct NI)) Agent.do_dm9_screen_pop(l.n, inbound); // if calltype is inbound, so we send phone else Agent.do_dm9_screen_pop(l.aid, outbound);// else we send account_id } Agent.log(Sending request for call details for + call_id); // Sending the call details request $.ajax({ url: ajax/, type: POST, dataType: JSON, async: false, data: {act: agent/get_call_details, call_id: call_id} }) .done(function (r) { if (r.problem) { $.alert(Ooops!, There was a network problem trying to retrieve call details.br>Please refresh your browser.br>Support team has been notified.); return; } Agent.log(Call details received for + r.call_id); Agent.log(r.CU_API_LOG); Agent.call.info r; Agent.$top_preloader.hide(); Agent.display_call_details(); Agent.display_agent_scripts(); Agent.$phone.find(.preview).hide(); if (Agent.status wrap) { // Ooops, the call was hang up! Need to set correct data for wrap form if (Agent.agent_bridged_calls) { // This mean that we should save call results for the main channel (with the lowest value of call_id)!!! Agent.log(GET_CALL_DETAILS: WRAP form after bridging calls); Agent.agent_bridged_calls false; } // lets check if one line of two was hang up if (old_lines0.s > 0 && old_lines1.s > 0 && Agent.phone_lines1.s 0) { // Lets find its callid Agent.log(GET_CALL_DETAILS: Lets find correct callid for wrap form); // Here we should set correct callid for wrap form // Agent.phone_lines0 has data of active call // This mean that we could find old_lines with hung up call if (old_lines1.cid Agent.phone_lines0.cid) { Agent.log(GET_CALL_DETAILS: Setting correct callid to + old_lines0.cid + which was + old_lines1.cid); Agent.call.info.call_id old_lines0.cid; Agent.call.info.channel_id old_lines0.c; } } setTimeout(function() { Agent.$wrap.find(tr.submit).show(); }, 1500); //Timeout timer for Wrap form CC-272 Agent.wrap_form_timer(); Agent.browser_resize(); } }); }); // CC-2770; // sometimes our submit button is hidden due to delays in agent status updates // and in speed of calling functions with Updater.js // in this case I try to guess step and display submit button if (Agent.wrap_status_display_submit_button) { if (Agent.status wrap) { setTimeout(function() { Agent.$wrap.find(tr.submit).show(); }, 2000); } } // dealing with buttons if(Agent.phone_lines0.s 2) // if the first line is on hold if(Agent.phone_lines1.s 1 ) // if the other line is talking Agent.$phone.find(.line:first .buttons).hide(); // hide the buttons on first line if(Agent.phone_lines1.s 2) // if the second line is on hold if(Agent.phone_lines0.s 1 ) // if the other line is talking Agent.$phone.find(.line:last .buttons).hide(); // hide the buttons on first line // Show the number of active calls var active_calls No active calls; if(Agent.phone_lines0.s + Agent.phone_lines1.s > 0) active_calls Active calls:; Agent.$phone.find(div.calls).show().text(active_calls); // show buttons pickup and hangup if two lines are on hold if (Agent.$phone.find(.onhold-line).length 2) { Agent.$phone.find(.buttons.call).show(); } // show buttons pickup and hangup if first line is on hold and second line is 0 if ((Agent.phone_lines0.s 2) && (Agent.phone_lines1.s 0)) Agent.$phone.find(.buttons.call).show(); //fix for situation: when agent1 make conference and put all calls on hold. when agent1 unholds one of the calls he cant unhold other. if (Agent.$phone.find(.in_conference).is(:visible)) Agent.$phone.find(.buttons.call).show();};// #####################################################################################################################Agent.display_call_details function(){ var r Agent.call.info; if (!r.camp_id) { Agent.log(Error: No camp_id!!!); ajaxError( Display call details returned error, Undefined camp_id, r ); $.alert(Ooops!, There has been a problem retrieving the call information.br>Please try refreshing the page.br>The administrators have been notified.); return; } Agent.log(Showing the top, hiding the preview notes (if any), showing the wrap form); Agent.$top.show(); Agent.$preview_notes.hide(); Agent.$wrap.show(); // build left, call info part Agent.$call_info.find(> .info).html(r.call_info); // Build wrap form //Agent.log(Building wrap form for the first time) if (Agent.allow_agents_dnc) { Agent.$wrap.find(input.icheck.dnc).iCheck(uncheck); Agent.$wrap.find(input.icheck.dnc).iCheck(enable); Agent.$wrap.find(tr.dnc div.reason).hide(); Agent.$wrap.find(tr.dnc div.reason).removeClass(require_dnc_reason); } Agent.$wrap.find(input.icheck.call_back).iCheck(uncheck); Agent.$wrap.find(input.notready).iCheck(uncheck); Agent.$wrap.find(input.icheck.call_back).iCheck(enable); Agent.$wrap.find(input.icheck.call_back_private).iCheck(uncheck); Agent.$wrap.find(span.call_back).hide(); Agent.$wrap.find(input.account_id).val(r.account_id); Agent.$wrap.find(textarea.notes).val(); Agent.$wrap.find(tr.call_result).toggle( r.show_call_results 1); Agent.$wrap.find(tr.revenue).hide(); Agent.$wrap.find(tr.custom).toggle( r.show_custom 1); Agent.$wrap.find(tr.submit).hide(fast, function(){ if (!Agent.error_wrap_situation) Agent.wrap_form_timer_reset(); }); Agent.$wrap.find(tr.custom).remove(); // reset fields to default in case of previous IRF call Agent.$wrap.find(input.account_id).prop(disabled, false); Agent.$wrap.find(input.account_id_unknown).show(); if (r.ifr_enabled && r.account_id.length) { Agent.$wrap.find(input.account_id).prop(disabled, true); Agent.$wrap.find(input.account_id_unknown).hide(); } // to fix CC-2141 // we have situation when we have two calls onHold // and when we hangup first line we cant submit form // so this fix is for displaying submit form if (Agent.hangup_data && Agent.hangup_data.show_wrap 1) { Agent.$wrap.find(tr.submit).show(); } // CC-2770 ; also check it on line ~630 // sometimes our submit button is hidden due to delays in agent status updates // and in speed of calling functions with Updater.js // in this case I try to guess step and display submit button if (Agent.wrap_status_display_submit_button) { if (Agent.status wrap) { setTimeout(function() { Agent.$wrap.find(tr.submit).show(); }, 2000); } } var select Agent.$wrap.find(tr.call_result select); select.data(required, 0); // resets previous state if(r.show_call_results 1) { Agent.call_results r.call_results; select.find(option).remove(); select.empty(); if (r.force_call_result 1) select.data(required, 1); if ((r.force_call_result 0) || (r.force_call_result 1 && r.default_result 0)) select.append(option value0 selectedselected>Choose Call Result/option>); for(var i 0; i r.call_results.length; i++) select.append(option value + r.call_resultsi.id + + (r.default_result r.call_resultsi.id ? selectedselected : ) + data-recalltime+ r.call_resultsi.recall_seconds +>+ r.call_resultsi.name +/option>); } if(r.custom_fields) { for(i0; i r.custom_fields.length; i++) { var f r.custom_fieldsi; Agent.$wrap.find(tr.notes).after(tr classcustom + data-field+ f.field + data-mandatory+ f.m + data-title+ f.title +> + td alignright stylefont-size:13px>+ f.title +:/td> + td>input typetext stylewidth:90%;font-size:13px; value+f.v+> + (f.m1?span classmandatory>*/span>:) + /td> + /tr>); } } Agent.$wrap.find(tr.call_result select).change(); // Build agent browser (bottom part, browser-like with tabs) Agent.log(Showing and populating the browser tabs); Agent.$browser.show(); Agent.$browser.find(.tabs, .tabs a, iframe).hide(); for(var i 0; i rurls.length; i++) { var url rurlsi.url; var title rurlsi.title; if (url ) continue; if (title ) title url; Agent.$browser .find(.tabs a.tab+i).show().end() .find(.tabs a.tab+i).text(title).end() .find(iframe.iframe+i).attr({src:url}); } if(rurls.length > 0){ Agent.$browser .find(.tabs).show().end() .find(.tabs a).removeClass(active).end() .find(.tabs a:first).addClass(active).end() .find(iframe:first).show(); } else Agent.$browser.hide(); Agent.resize_everything();};// Timeout timer for Wrap form CC-272Agent.timeFormWrapper new Timer();Agent.wrap_form_timer function (){ var r Agent.call.info; // refresh easytimer data Agent.$wrap.find(tr.submit #wrap_limit).val().val(r.wrap_limit); Agent.$wrap.find(tr.submit #wrap_limit_call_result).val().val(r.wrap_limit_call_result); Agent.$wrap.find(tr.submit #wrap_limit_become_not_ready).val().val(r.wrap_limit_become_not_ready); Agent.$wrap.find(tr.submit #wrap_limit_autosubmit_form).val(0); Agent.$wrap.find(tr.submit #wraptime-countdown-timer .timervalues).removeClass(wraptime-blink wraptime-blink-warning wraptime-blink-danger); // set default Call Result // var current_call_result Agent.$wrap.find(tr.call_result select option:selected).val(); // if (current_call_result 0) { // Agent.$wrap.find(tr.call_result select option).each(function () { // if ($(this).val() r.wrap_limit_call_result) $(this).attr(selected, selected); // }); // } // set status Not Ready // if (r.wrap_limit_become_not_ready 1) { // Agent.$wrap.find(tr.submit input.notready).attr(checked, checked); // Agent.$wrap.find(tr.submit input.notready).iCheck(update)0.checked; // } // hide agent script block when we submit call $(#agent_script_interface).remove(); // set autosubmit for timer Agent.$wrap.find(tr.submit #wraptime-countdown-timer).attr(data-seconds-left, r.wrap_limit); // check if campaign has option wrap limit time if (r.wrap_limit > 0) { if (Agent.$wrap.find(tr.submit #wraptime-countdown-block).is(:hidden)) { Agent.$wrap.find(tr.submit #wraptime-countdown-block).show(); // get autosubmit time interval var secondsWrap parseInt(r.wrap_limit); // init easytimer Agent.timeFormWrapper.start({ countdown: true, startValues: {seconds: secondsWrap} }); Agent.$wrap.find(tr.submit #wraptime-countdown-block .timervalues).html(Agent.timeFormWrapper.getTimeValues().toString()); // update timer and set styles for timer Agent.timeFormWrapper.addEventListener(secondsUpdated, function (e) { Agent.$wrap.find(tr.submit #wraptime-countdown-timer .timervalues).html(Agent.timeFormWrapper.getTimeValues().toString()); var secondsLeft Agent.timeFormWrapper.getTotalTimeValues().seconds; if ((secondsLeft > 4) && (secondsLeft 8)) Agent.$wrap.find(tr.submit #wraptime-countdown-timer .timervalues).addClass(wraptime-blink-warning); if (secondsLeft 5) Agent.$wrap.find(tr.submit #wraptime-countdown-timer .timervalues).removeClass(wraptime-blink-warning).addClass(wraptime-blink wraptime-blink-danger); }); // empty values when time is out Agent.timeFormWrapper.addEventListener(targetAchieved, function (e) { Agent.$wrap.find(tr.submit #wraptime-countdown-timer .timervalues).html(00:00); Agent.$wrap.find(tr.submit #wraptime-countdown-timer .timervalues).html(00:00); Agent.$wrap.find(tr.submit #wrap_limit_autosubmit_form).val(1); }); // autosubmit form Agent.autosubmit_wrap_form_timeout setTimeout(function () { Agent.log(Autosubmiting form after + r.wrap_limit + seconds); Agent.wrap_form_autosubmited true; Agent.$wrap.find(tr.submit #submit_call)0.click(); }, (secondsWrap * 1000) + 100); } }};// reset conditions for wrap timeout formAgent.wrap_form_timer_reset function (){ Agent.log(Reset autosubmiting form); clearTimeout(Agent.autosubmit_wrap_form_timeout); Agent.wrap_form_autosubmited false; Agent.error_wrap_situation false; Agent.timeFormWrapper.reset(); Agent.timeFormWrapper.stop(); Agent.timeFormWrapper.removeEventListener(secondsUpdated); Agent.timeFormWrapper.removeEventListener(targetAchieved); Agent.$wrap.find(tr.submit #wraptime-countdown-block).hide(); Agent.$wrap.find(tr.submit #wraptime-countdown-timer).attr(data-seconds-left, 0); Agent.$wrap.find(tr.submit #wraptime-countdown-timer .timervalues).html(); Agent.$wrap.find(tr.submit #wraptime-countdown-timer .timervalues).removeClass(wraptime-blink wraptime-blink-warning);}; /******************************************************************************************************************/ /************************************************** AGENT SCRIPT **************************************************/ /******************************************************************************************************************/ Agent.display_agent_scripts function() { var r Agent.call.info; // get details about the call var ag_script_html Agent.$call_info.find(> .info); // get agent script html block if(!r.agent_script_line.show) return; if (r.agent_script_line.back_line_id) var line_back_ids r.agent_script_line.back_line_id; // array of ids for back button // regenerate agent_script html block $(#agent_script_interface).remove(); ag_script_html.append(div idagent_script_interface>/div>); $(h2 classagent_script_interface_h2>SCRIPT:/h2>).appendTo(#agent_script_interface); $(div classagent_script_interface_line>/div>).appendTo(#agent_script_interface); $(div classclearfix>/div>).appendTo(#agent_script_interface); $(r.agent_script_line.text).appendTo(.agent_script_interface_line); $(r.agent_script_line.reaction).appendTo(.agent_script_interface_line); // click on reaction $(body).on(click, .asir_ + r.call_id, function() { var targetline $(this).attr(data-targetline); // next line id var line_id backline $(this).attr(data-backline); // current line id var reaction $(this).attr(data-reaction); // reaction id line_back_ids.push(backline); // add id to array to switch to previous line with reactions ajx_req true; // prevent duplicate clicks // send ajax to renew data if (ajx_req) { Agent.get_agent_script_line(targetline, backline, r.agent_script_line.script_id, reaction, r.call_id, line_id); ajx_req false; } }); // click on back button to switch to previous line with reactions $(body).on(click, #agent_script_target_back_line_+r.call_id, function() { line_back_ids.pop(); // remove last id from back list var line_id $(this).attr(data-currentline); // current line id var backline (typeof line_back_idsline_back_ids.length - 1 ! undefined) ? line_back_idsline_back_ids.length - 1 : 0 ; // get the last id from back links array var targetline $(this).attr(data-targetback); // previous line id var reaction 0; // set reaction 0 to mark in logs table that we clicked back button ajx_req true; // prevent duplicate clicks // send ajax to renew data if (ajx_req) { Agent.get_agent_script_line(targetline, backline, r.agent_script_line.script_id, reaction, r.call_id, line_id); ajx_req false; } }); } Agent.get_agent_script_line function(targetline, backline, script_id, reaction, call_id, line_id) { $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/get_agent_script_line, targetline: targetline, backline: backline, script_id: script_id, reaction: reaction, call_id: call_id, line_id: line_id } }) .done(function(res) { $(.agent_script_interface_text_block).addClass(fadeOut); $(.agent_script_interface_reactions_block).addClass(fadeOut); setTimeout(function() { $(.agent_script_interface_text_block).html(res.agent_script_line.text); $(.agent_script_interface_text_block).removeClass(fadeOut).addClass(fadeIn); $(.agent_script_interface_reactions_block).html(res.agent_script_line.reaction); $(.agent_script_interface_reactions_block).removeClass(fadeOut).addClass(fadeIn); }, 500); }); }//Agent.do_dm9_screen_pop function(account_id)Agent.do_dm9_screen_pop function(cphone, ctype){ Agent.log(Connecting to a DM9 screen pop websocket); var ws_timeout setTimeout(function() { Agent.log(DM9 WebSocket connection timeout after 5 seconds); ws.close(); }, 5000); var ws new WebSocket(wss://fico.intelligentcontacts.net:2013); ws.onopen function() { clearTimeout(ws_timeout); Agent.log(Sending a DM9 screen pop signal); //ws.send(consumer_number + account_id); if (ctype inbound) { ws.send(consumer_phone_number + cphone); Agent.log(DM9 screen pop sent: consumer_phone_number + cphone); } else { ws.send(consumer_number + cphone); Agent.log(DM9 screen pop sent: consumer_number + cphone); } ws.close(); };};// #####################################################################################################################Agent.callback_call_show function(data){ if( Agent.call_i_just_previewed && Agent.call_i_just_previewed.lead_id data.lead_id && Agent.call_i_just_previewed.lead_phone data.lead_phone && Agent.call_i_just_previewed.camp_id data.camp_id) { Agent.log(Callback call + data.lead_id + already previewed!); //return; // - uncomment if need disable second callback after first callback on the same call } Agent.call_i_just_previewed { lead_id : data.lead_id, lead_phone : data.lead_phone, camp_id : data.camp_id }; Agent.log(Set last previewed callback call, lead_id + data.lead_id); Agent.log(Callback call: hiding statuses, showing preview call box, showing top and preview notes, hiding wrap and manual call); if(Agent.cu_api) { Agent.log(Sending agent hit (by lead_id)); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/CU_agent_hit, lead_id: data.lead_id }}) .done(function(r){ Agent.log(Agent hit responded: + JSON.stringify(r) ); }); } // if(Agent.dm9_screen_pop) Agent.do_dm9_screen_pop(data.account_id); if (Agent.dm9_screen_pop) Agent.do_dm9_screen_pop(data.dm9_call_phone, data.dm9_call_type); Agent.$status.hide(); if (data.do_not_postpone) { Agent.$phone.find(> .preview).find(.buttons .postpone).hide(); } else { Agent.$phone.find(> .preview).find(.buttons .postpone).show(); } Agent.$phone.find(> .preview) .find(.title).text(data.preview_title).end() .find(.number).text(# +data.lead_phone).end() .attr(data-lead_id, data.lead_id) .attr(data-lead_phone, data.lead_phone) .attr(data-campid, data.camp_id) .show(); Agent.$call_info.find(.info).html(data.call_info); Agent.$preview_notes.find(.notes).html(data.notes); Agent.$top.show(); Agent.$wrap.hide(); Agent.$preview_notes.show(); Agent.resize_everything(); Agent.$phone.find(.manual_call).hide();};// #####################################################################################################################Agent.preview_call_show function(data){ if( Agent.call_i_just_previewed && Agent.call_i_just_previewed.lead_id data.lead_id && Agent.call_i_just_previewed.lead_phone data.lead_phone && Agent.call_i_just_previewed.camp_id data.camp_id) { Agent.log(Preview call + data.lead_id + already previewed!); return; // - uncomment if need disable second callback after first callback on the same call } Agent.call_i_just_previewed { lead_id : data.lead_id, lead_phone : data.lead_phone, camp_id : data.camp_id }; Agent.log(Set last previewed preview call, lead_id + data.lead_id); Agent.log(Preview call to lead + data.lead_id + : hiding statuses, showing preview call box, showing top and preview notes, hiding wrap and manual call); if(Agent.cu_api) { Agent.log(Sending agent hit (by lead_id)); $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/CU_agent_hit, lead_id: data.lead_id }}) .done(function(r){ Agent.log(Agent hit responded: + JSON.stringify(r) ); }); } // if(Agent.dm9_screen_pop) Agent.do_dm9_screen_pop(data.account_id); if (Agent.dm9_screen_pop) Agent.do_dm9_screen_pop(data.dm9_call_phone, data.dm9_call_type); Agent.$status.hide(); if (data.do_not_postpone) { Agent.$phone.find(> .preview).find(.buttons .postpone).hide(); } else { Agent.$phone.find(> .preview).find(.buttons .postpone).show(); } Agent.$phone.find(> .preview) .find(.title).text(Preview call waiting).end() .find(.number).text(# +data.lead_phone).end() .attr(data-lead_id, data.lead_id) .attr(data-lead_phone, data.lead_phone) .attr(data-campid, data.camp_id) .show(); Agent.$call_info.find(.info).html(data.call_info); Agent.$preview_notes.find(.notes).html(data.notes); Agent.$top.show(); Agent.$wrap.hide(); Agent.$preview_notes.show(); Agent.resize_everything(); Agent.$phone.find(.manual_call).hide();};Agent.show_internal_transfers function(data){ if(data false) { if (Agent.$phone.find(.internal_transfer).is(:visible)) { Agent.log (Hiding internal transfer box!); Agent.$phone.find(.internal_transfer).slideUp(fast); // if agent did not have time to make a decision (answer the call or decline) and caller ended call we must show statuses boxes if ((Agent.phone_lines0.s 0) && (Agent.phone_lines1.s 0)) Agent.$status.show(); } return; // no transfers } if ($.inArray (data.channel_id, Agent.transfers_we_accepted) ! -1) return true; // next transfer, already accepted this one var camp ; for(var i 0; i Agent.campaigns.length; i++) if(Agent.campaignsi.id data.camp_id) camp Agent.campaignsi.name; var can_accept false; var channel_id_to_put_onhold ; var l Agent.phone_lines; if(l0.s 0 && l1.s 0) can_accept true; if(l0.s 2 && l1.s 0) can_accept true; if(l0.s 0 && l1.s 2) can_accept true; if(l0.s 1 && l1.s 0) { can_accept true; channel_id_to_put_onhold l0.c; } if(l0.s 0 && l1.s 1) { can_accept true; channel_id_to_put_onhold l1.c; } //if (!Agent.$phone.find(.internal_transfer).is(:visible)) Agent.play_audio (beep); // Play a beep when an internal transfer happens (only when it appears first) if (!Agent.$phone.find(.internal_transfer).is(:visible)) // Play a beep when an internal transfer happens (only when it appears first) { Agent.log (Showing an internal transfer! From number +data.caller_id); Agent.play_audio (beep); } if (can_accept) { Agent.$phone.find(.internal_transfer).find(.buttons).show(); Agent.$phone.find(.internal_transfer).find(.nobuttons).hide(); } else { Agent.$phone.find(.internal_transfer).find(.buttons).hide(); Agent.$phone.find(.internal_transfer).find(.nobuttons).show(); } Agent.$phone.find(.internal_transfer) .data(channel_id, data.channel_id) .data(channel_id_to_put_onhold, channel_id_to_put_onhold) .find(.agent strong).text(data.agent_name).end() .find(.number strong).text(data.caller_id).end() .find(.campaign strong).text(camp).end() .find(.campaign).toggle(camp ! ).end() .slideDown(fast); Agent.$status.hide();};// ##################################################################################################################################################################################################################################################// ##################################################################################################################################################################################################################################################Agent.init_regular_updates function(){ // Keep agent connected Agent.Updater.add({ what : is_connected, interval : 1, done : function(connected) { var previously_connected Agent.is_connected; // saving the previous state Agent.is_connected true; if(connected no) Agent.is_connected false; Agent.$phone.find(.connected) .toggle(Agent.is_connected); Agent.$phone.find(.disconnected).toggle(!Agent.is_connected); var dialog_open $(#connection_dialog).hasClass(ui-dialog-content) && $(#connection_dialog).dialog(isOpen); // if(!connected && !dialog_open) Agent.connection_dialog(); if(!Agent.is_connected) { Agent.log(Not connected!); if(Agent.$status.is(:visible)){ Agent.log(...hiding statuses box); Agent.$status.hide(); } } if(Agent.is_connected && dialog_open) { if (Agent.is_supervisor && Agent.current_connection_method webrtc) { window.addEventListener(beforeunload, handleUnloadEvent); } Agent.log(Connected! Close connection dialog: show success, show statuses, schedule dialogue close in 1s); var $o $(.connection_option_body. + Agent.current_connection_method); $o.find(.error, .button, .connecting).hide(); $o.find(.success).show(); $o.find(.status).html(ONLINE!).css({color:#080}); Agent.Updater.stop(is_device_registered); Agent.Updater.stop(call_in_status); Agent.$status.show(); Agent.Updater.refresh(has_teams); // check team membership when agent is connected Agent.Updater.refresh(has_active_campaigns); // check active campaigns when agent is connected Agent.$top.hide(); // if agent was kicked and then he logins again, we have to hide top blocks setTimeout( function() { $( #connection_dialog ).dialog(close); }, 1000); } } }); // Check if agent has teams, every 60 second Agent.Updater.add({ what: has_teams, interval: 60, done: function(r) { Agent.update_has_teams(r); } }); // Check if agent has active campaign(s) to call, every 60 second Agent.Updater.add({ what : has_active_campaigns, interval: 60, done : function(r) { Agent.update_has_active_campaigns(r); } }); // Update campaigns list (this agent is in) every 2 minutes Agent.Updater.add({ what: campaigns, interval: 60, done: function(r) { Agent.update_campaigns(r); } }); Agent.Updater.add({ what: states, interval: 3600, done: function(r) { Agent.update_states(r); } }); // Update calls holding for this agent Agent.Updater.add ( { what: calls_holding, interval: 5, done: function (r) { if(!r) return; // do not display calls in queue var calls_holding Number(r.total); if (calls_holding 0) { Agent.$phone.find(.calls_holding).hide(); Agent.$acceptdecline.hide(); Agent.$hangupacceptdecline.hide(); return; } Agent.$phone.find(.calls_holding).show().find(span.total).text(calls_holding); if (calls_holding > 0) { Agent.$phone.find(.calls_holding a.campaigns).show(); // now, calls holding by campaign var html table cellpadding3 cellspacing0 border0>tr>th styletext-align:left>Campaign/th>th styletext-align:right>Calls/th>th styletext-align:right>Time/th>/tr>; for(i0; ir.campaigns.length; i++) { var c r.campaignsi; html + tr> + td styletext-align:left; width:110px;display: inline-block;word-break: break-all;>+ c.name+/td> + td styletext-align:right>+ c.calls +/td> + td styletext-align:right>+ c.longest_wait +s/td> + /tr>; } html + /table>; Agent.$phone.find(.calls_holding div.campaigns).html(html); } } }); // Update lines, every 1 second Agent.Updater.add({ what: lines, interval: 1, done: function(r) { Agent.phone_redraw(r); } }); // Agent status update (every second) along with preview calls and callbacks Agent.Updater.add({ what: status, interval: 1, done: function(r) { // this is tmp code ) // check if agent was logged in before in the other (new) agent application if (r.is_logged_in_before) { location.reload(); } if (Agent.status ! r.s) { if (r.s ! preview) { Agent.call_i_just_previewed false; Agent.log(Reset last previewed call after changing status.); } Agent.log(Agent status update: + r.s); } if(r.s wrap && Agent.ignore_wrap_status) { Agent.log(Status change ignored); return; } Agent.status r.s; Agent.status_time r.st; if ( r.s ready || r.s notready || r.s lunch || r.s meeting || r.s bathroom || r.s break || r.s training || r.s messaging ) { if (FF(agent_interface.fix_forcing_agents)) { if (!Agent.$status.find(div. + r.s).hasClass(active)) { Agent.change_status_tries++; if (Agent.change_status_tries > 2) { Agent.log(Showing correct status box + r.s); // TODO: commented out by Oleg, JIRA CC-935 // when agent is connected update status default not ready CC-935 // Agent.change_status(notready); if (r.s ! ready && r.s ! notready) Agent.$manual_call.slideUp(fast); Agent.$status.find(div).removeClass(active); Agent.$status.find(div. + r.s).addClass(active); Agent.change_status_tries 0; } } else { Agent.change_status_tries 0; } } else { if (!Agent.$status.find(div. + r.s).hasClass(active)) { Agent.log(Showing correct status box + r.s); // TODO: commented out by Oleg, JIRA CC-935 // when agent is connected update status default not ready CC-935 // Agent.change_status(notready); if (r.s ! ready && r.s ! notready) Agent.$manual_call.slideUp(fast); Agent.$status.find(div).removeClass(active); Agent.$status.find(div. + r.s).addClass(active); } } Agent.$status.find(div.+r.s+ .time).text(r.t); if ($(.internal_transfer).is(:not(:visible))) { Agent.$status.show(); } } // autopostpone the call for 1 minute due to agents inactivity if (r.should_postpone) { Agent.log(Preview call was postponed automatically due to agents inactivity.); Agent.postpone_call(r.postpone_data.lead_id, 60, r.postpone_data.camp_id); } if (r.hasOwnProperty(callback_call) && !Agent.prevent_preview_call_show) Agent.callback_call_show(r.callback_call); if (r.hasOwnProperty(preview_call) && !Agent.prevent_preview_call_show) Agent.preview_call_show(r.preview_call); if (Agent.is_supervisor) { // hide monitoring box if (r.stop_watching true) { Agent.stop_monitoring(); } if (r.s monitoring || r.s coaching || r.s barging) { Agent.is_monitoring true; Agent.$phone.find(>.monitor).show(); Agent.$phone.find(>.monitor .time).text(r.t); Agent.$phone.find(>.monitor .name).text(r.agent); Agent.$phone.find(>.monitor .button).attr(data-agentid, r.agentid); if(r.s monitoring) Agent.$phone.find(>.monitor .status).text(Monitoring); if(r.s coaching) Agent.$phone.find(>.monitor .status).text(Coaching); if(r.s barging) Agent.$phone.find(>.monitor .status).text(Barging); if(r.s monitoring) Agent.$phone.find(>.monitor .button).text(Stop monitoring); if(r.s coaching) Agent.$phone.find(>.monitor .button).text(Stop coaching); if(r.s barging) Agent.$phone.find(>.monitor .button).text(Stop barging); } else { Agent.is_monitoring false; Agent.$phone.find(>.monitor .button).attr(data-agentid, ); Agent.$phone.find(>.monitor).hide(); } } if (Agent.is_agent) { // start: panic button var panic_status $(.block_panic_button).attr(data-panic_status); $(divid ^ panic_button_).hide(); $(#panic_button_ + r.help_button_type).show(); if (panic_status ! r.help_request_status) { if (r.help_request_status waiting) { Agent.log(Agent is waiting for help from the supervisor); } if (r.help_request_status ignored) { Agent.log(Agents help request was ignored); } if (r.help_request_status connected) { Agent.log(Agents help request was accepted); } $(.block_panic_button).attr(data-panic_status, r.help_request_status); } // end: panic button } } }); // Update online agents list Agent.Updater.add({ what: agents, interval: 5, done: function(r) { if(JSON.stringify(r) JSON.stringify(Agent.agents)) return; // skip if nothing changed Agent.agents r; Agent.update_agents_list(); } }); // Update extensions list Agent.Updater.add({ what: extensions, interval: 60, done: function(r) { if(JSON.stringify(r) JSON.stringify(Agent.extensions)) return; // skip if nothing changed Agent.extensions r; Agent.update_extensions_list(); } }); // Update internal transfers, every 2 seconds Agent.Updater.add({ what: my_transfers, interval: 2, done: function(r) { Agent.show_internal_transfers(r); } }); // check webrtc connection for the supervisor // we need this custom validation to restore webrtc connection when supervisor changes pages if (FF(sip_connection.webrtc)) { if (Agent.is_supervisor && Agent.current_connection_method webrtc && this._ua undefined) { webrtc_login(); agent_connect(); } }};// #####################################################################################################################Agent.update_has_active_campaigns function(r){ if (Agent.status) { // hide warning block if (r hide) { Agent.$phone.find(.no_active_campaigns).hide(); if(Agent.has_manual_campaigns) { Agent.$phone.find(.manual_call.campaign).show(); } Agent.$phone.find(.manual_call.internal).show(); } // show warning block if ($.inArray(r, show_agent, show_supervisor) ! -1) { if(Agent.is_connected) { if (r show_agent) var show_warning_txt There are no active campaigns at the moment. If you have any questions, please contact your supervisor.; if (r show_supervisor) var show_warning_txt There are no active campaigns at the moment. If you have any questions, please contact system administrator.; Agent.$phone.find(.no_active_campaigns).text(show_warning_txt).show(); } Agent.$phone.find(.manual_call.campaign).hide(); Agent.$phone.find(.manual_call.internal).hide(); } }}Agent.update_has_teams function(r){ if (Agent.is_connected) { if (r hide) Agent.$phone.find(.out_of_teams).hide(); if (r show_agent) Agent.$phone.find(.out_of_teams).text(You are not assigned to any team. Please ask your supervisor to help you get assigned.).show(); if (r show_supervisor) Agent.$phone.find(.out_of_teams).text(You are not assigned to any team. Please ask system administrator to help you get assigned.).show(); }}Agent.update_campaigns function(r){ if (JSON.stringify(r) JSON.stringify(Agent.campaigns)) return; // no need to update if nothing changed Agent.campaigns r.campaigns; Agent.has_manual_campaigns r.has_manual_campaigns; var i, select, old_value; // fill the manual call campaigns drop down if (r.has_manual_campaigns) { select Agent.$phone.find(.manual_call.campaign select.campaign); if (select.data(dont-update) 1) { /* console.log(can not update campaigns, list is in use); */ } else { old_value select.val(); select.empty().prepend(option value>/option>); for (i 0; i r.campaigns.length; i++) { if (r.campaignsi.type ! MA) continue; // this is only for manual campaigns if (r.campaignsi.i 0) continue; // and only if this agent participates in it select.append( $(option>) .text(r.campaignsi.name) .val(r.campaignsi.id) ); } /* if(select.is(:visible)) */ Agent.$phone.find(.no_manual_campaigns).hide(fast); select.val(old_value); Agent.init_chosen(select, 220px, 220px); } } else { // Hide manual call box and display an error message Agent.$phone.find(.manual_call.campaign).hide(); Agent.$phone.find(.no_manual_campaigns).text(You are not assigned to any manual campaign teams. Please ask your supervisor to help you get assigned.).show(); } // fill the manual internal call campaigns drop down select Agent.$phone.find(.manual_call.internal select.campaign); if(select.data(dont-update) 1) { /* console.log(can not update campaigns, list is in use); */ } else { old_value select.val(); select.empty().prepend(option value>/option>); if (r.campaigns) { for(i 0; i r.campaigns.length; i++) { if(r.campaignsi.i 0){ // if agent is not in this campaign, then: if(r.campaignsi.id ) continue; // no calls about campaigns without camp_id (??) if(r.campaignsi.type MA) continue; // no calls about Manual campaigns agent is not in if(r.campaignsi.type P3) continue; // no calls about Preview campaigns agent is not in } select.append( $(option>) .text(r.campaignsi.name) .val (r.campaignsi.id) .data(id, r.campaignsi.id) .data(ext, r.campaignsi.ext) .data(type, r.campaignsi.type) ); } } select.val(old_value); Agent.init_chosen(select, 220px, 220px); } // fill in the transfer to campaign drop downs select Agent.$phone.find(.transfer_to tr.campaign select); if(select.data(dont-update) 1) { /* console.log(can not update campaigns, list is in use); */ } else { old_value select.val(); select.empty().prepend(option value>/option>); if (r.campaigns) { for(i0; i r.campaigns.length; i++) { if(r.campaignsi.type MA) continue; // no transfers to manual campaigns select.append( $(option>) .text(r.campaignsi.name) .val (r.campaignsi.id) ); } } select.val(old_value); Agent.init_chosen(select, 130px, 250px); }};Agent.update_states function (r){ const select Agent.$manual_call.filter(.campaign).find(select#state); select.find(option).remove(); Object.entries(r).forEach((code, state) > { select.append(option value + code + > + state + /option>); }); Agent.init_chosen(select, 220px, 220px);}Agent.update_agents_list function(camp_id){ var agents Agent.agents; // fill internal call select var select Agent.$phone.find(.manual_call.internal select.ext); if(select.data(dont-update) 1) { /* console.log(can not update agents, list is in use); */ } else { var old_value select.val(); select.find(option).not(.campaign).remove(); //select.empty(); for(var i 0; i agents.length; i++) { if(agentsi.id Agent.agent_id) continue; if (agentsi.id > 0) { // this is an agent, with name, id, and status if (camp_id && !agentsi.c?.includes(camp_id)) continue; select.append(option value + agentsi.ext + >+ agentsi.ext + - + agentsi.name + (+ agentsi.s +)/option>); } else { // this is just an extension select.append(option value + agentsi.ext + >+ agentsi.ext + - + agentsi.name +/option>); } } if(agents.length 0) select.append(option value>No agents to call !/option>); select.val(old_value); Agent.init_chosen(select, 160px, 250px); } // fill transfer call selects select Agent.$phone.find(.line .transfer_to tr.agent select); if(select.data(dont-update) 1) { /* console.log(can not update agents, list is in use); */ } else { old_value select.val(); select.empty(); for(i 0; i agents.length; i++) { if(agentsi.id Agent.agent_id) continue; //disallow call transfer to ourselves if(agentsi.id Agent.phone_linesAgent.current_line.anid) continue; //disallow call transfer to the same agent were calling if(agentsi.id > 0) { // this is an agent, with name, id, and status select.append(option value + agentsi.ext + >+ agentsi.ext + - + agentsi.name + (+ agentsi.s +)/option>); } } if(agents.length 0) select.append(option value>No agents to call !/option>); select.val(old_value); Agent.init_chosen(select, 130px, 250px); }};Agent.update_extensions_list function(){ var ext Agent.extensions; Agent.log(Updating extensions list); //// fill internal call select //var select Agent.$phone.find(.manual_call.internal select.ext); //var old_value select.val(); //select.empty(); //for(var i 0; i agents.length; i++) if(agentsi.id ! Agent.agent_id) select.append(option value + agentsi.ext + >+ agentsi.ext + - + agentsi.name + (+ agentsi.s +)/option>); //if(agents.length 0) select.append(option value>No agents to call !/option>); ///*if(select.is(:visible)) */ select.val(old_value); // fill transfer call selects select Agent.$phone.find(.line .transfer_to tr.extension select); //get extension of the agent we are conversing with var convo_partner_ext Agent.phone_linesAgent.current_line.anext; if(select.data(dont-update) 1) { console.log(can not update extensions, list is in use); } else { old_value select.val(); select.empty(); for(i0; i ext.length; i++) { //get the actual extension, without text var regex new RegExp(/^\da-zA-Z+/); var raw_extension exti.ext.match(regex)0; if (raw_extension Agent.extension) continue; if (raw_extension convo_partner_ext) continue; select.append(option value + exti.ext + > + exti.ext + /option>); } if(ext.length 0) select.append(option value>Noone to call!/option>); /* if(select.is(:visible)) */ select.val(old_value); Agent.init_chosen(select, 130px, 250px); }};Agent.update_my_team function(){ var agents Agent.my_team; var div $(.right_tab_agent_list); var status_class OTHER; div.empty(); for(var i 0; i agents.length; i++) { if (agentsi.s READY) status_class READY; if (agentsi.s NOTREADY) status_class NOTREADY; if (agentsi.s TALKING) status_class TALKING; if (agentsi.s BATHROOM) status_class BATHROOM; if (agentsi.s MEETING) status_class MEETING; if (agentsi.s LUNCH) status_class LUNCH; if (agentsi.s BREAK) status_class BREAK; if (agentsi.s WRAP) status_class WRAP; if (agentsi.s PREVIEW) status_class PREVIEW; if (agentsi.s OFFLINE) status_class OTHER; if (agentsi.s OTHER) status_class OTHER; if (agentsi.s other) status_class OTHER; if (agentsi.s TRAINING) status_class TRAINING; if (agentsi.s CALLBACK) status_class CALLBACK; if (agentsi.s MESSAGING) status_class MESSAGING; div.append(div classagent_list_box data-text>span classstatus +status_class+ title+agentsi.s+>/span> span classname>+agentsi.name+/span>/div>); var html div stylefont-size: 18px; font-weight: bold; margin-bottom: 12px;>+agentsi.name; html + br>span stylefont-size: 12px; font-weight: normal;>Status: +agentsi.s+ (Time: +agentsi.s_time+)/span>; html + /div>; html + div stylefloat: left; padding-right: 6px;>img srcimages/agent-default.png width90 height90 border0 stylemargin: 6px auto 0 auto;>; html + div styleline-height: 23px; padding-top: 5px; font-size: 14px;>Revenue: b>$+agentsi.revenue+/b>/div>; html + /div>; html + div stylefloat: left;>; html + table classtb_agents_list>+ tr>td alignright>Inbound Calls:/td>td alignleft>+agentsi.inb+/td>/tr>+ tr>td alignright>Outbound Calls:/td>td alignleft>+agentsi.out+/td>/tr>+ tr>td alignright>Manual Calls:/td>td alignleft>+agentsi.man+/td>/tr>+ tr>td alignright stylefont-weight: bold;>Total Calls:/td>td alignleft stylefont-weight: bold;>+agentsi.total_calls+/td>/tr>+ /table>br>; html + /div>; div.find(.agent_list_box:last).data(text,html); } $(.agent_list_box).each(function() { $(this).qtip({ show: { solo: true }, content:{ text: $(this).data(text) }, position:{ my: right top, at: left center }, style: { classes: qtip-bootstrap, width: 400px } }); });};Agent.init_my_team_update function(){ // Update online agents list Agent.Updater.add({ what: my_team, interval: 10, done: function(r) { if(JSON.stringify(r) JSON.stringify(Agent.agents)) return; // skip if nothing changed Agent.my_team r; Agent.update_my_team(); } });};Agent.stop_my_team_update function(){ Agent.Updater.stop(my_team);};Agent.init_my_stats_update function(){ Agent.Updater.add({ what: my_stats, // interval: 8, // ORIGINAL VALUE interval: 30, // TEMPORARY SOLUTION done: function(r) { if(!r) return; if(JSON.stringify(r) JSON.stringify(Agent.my_stats)) return; // skip if nothing changed //Agent.log(Updating my stats); Agent.my_stats r; status_class OTHER; if(-1 ! $.inArray(r.s, READY,NOTREADY,TALKING,BATHROOM,MEETING,LUNCH,BREAK,WRAP,PREVIEW, TRAINING, CALLBACK, MESSAGING)) status_class r.s; var html div stylefont-size: 18px; font-weight: bold; margin-bottom: 12px;> + r.name + br>span stylefont-size: 12px; font-weight: normal;>Status: +r.s+/span>+ /div> + // img srcimages/agent-default.png width90 height90 border0 stylemargin: 6px auto 0 auto;>+ div stylefloat: left;>+ table classtb_agents_list>+ tr>td alignright>Inbound Calls:/td>td alignleft>+r.inb+/td>/tr>+ tr>td alignright>Outbound Calls:/td>td alignleft>+r.out+/td>/tr>+ tr>td alignright>Manual Calls:/td>td alignleft>+r.man+/td>/tr>+ tr>td alignright stylefont-weight: bold;>Total Calls:/td>td alignleft stylefont-weight: bold;>+r.total_calls+/td>/tr>+ tr>td colspan2> /td>/tr>+ tr>td alignright stylefont-weight: bold;>Revenue:/td>td alignleft stylefont-weight: bold;>$+r.revenue+/td>/tr>+ /table>br>+ /div>; $(div.right_tab_my_stats).html(html); } });};Agent.stop_my_stats_update function(){ Agent.Updater.stop(my_stats);};Agent.init_call_history_update function(sortOrder null, currentPage 1) { var callHistoryUpdateAllowed true; Agent.Updater.add({ what: call_history, done: function(r) { if(!callHistoryUpdateAllowed || !r) return; Agent.call_history r; var totalRecords r.length; var html ; // Sort the call history based on the selected sort order if (sortOrder DESC || sortOrder null ) { r.sort((a, b) > b.call_time.localeCompare(a.call_time)); } else { r.sort((a, b) > a.call_time.localeCompare(b.call_time)); } var perPage 20; // Number of records per page var totalPages Math.ceil(totalRecords / perPage); var startIndex (currentPage - 1) * perPage; var endIndex startIndex + perPage; var paginatedRecords r.slice(startIndex, endIndex); html + ` select namesortorder idsortorder stylepadding-left:0px; background: #333; color: #fff; border:none; font-size: 12px;> option valueDESC ${sortOrder DESC || sortOrder null ? selected : }>Descending/option> option valueASC ${sortOrder ASC ? selected : }>Ascending/option> /select> `; // Apply pagination if (totalPages > 1) { html + div classpagination style font-size: 14px; padding: 3px 0; display: block;>; for (var i 1; i totalPages; i++) { let underline text-decoration: none;; underline i currentPage ? underline : ; html + a href# classpagination-link style + underline + color: #fff; padding: 2px 6px; text-align: center; data-page + i + > + i + /a>; } html + /div>br>; } var call_result ; var call_type ; for (var j 0; j paginatedRecords.length; j++) { if (paginatedRecordsj.call_result Unknown) { call_result + img stylemargin-right: 6px; vertical-align: -4px; srcimages/icons/flag_finish_grey_16x16.png> Unknown; } else { call_result + span classcall_result>+ paginatedRecordsj.call_result +/span>; } let call_icon paginatedRecordsj.is_inbound ? calls_received.png : calls_dialed.png; html + div> + span stylefont-size: 11px; color: #888;> + paginatedRecordsj.call_time + /span> + span title\ + paginatedRecordsj.account_id + \ stylewhite-space: nowrap; font-size: 11px; color: #888; margin-left: 5px;>Account: + paginatedRecordsj.account_id + /span>br> + span stylefont-size: 15px; font-weight: 600;> + call_type + /span>+ img src/images/pages_icons/set2/ + call_icon + > span stylefont-size: 15px; font-weight: 600;> + paginatedRecordsj.phone_number + /span>+ span stylefont-size: 15px; font-weight: 600; margin-left: 10px;> + paginatedRecordsj.call_result + /span>+ /div>br>; } if (!html) { html div classright_tab_missedcalls_list>p stylecolor:#999;>No Calls/p>/div>; } $(div.right_tab_call_history).html(html); // Adding event listener to sortorder dropdown $(#sortorder).change(function() { if (callHistoryUpdateAllowed) { var selectedValue $(this).val(); callHistoryUpdateAllowed false; // Prevent immediate function execution Agent.init_call_history_update(selectedValue); // Call the function with selected sort order } }); // Event listener for pagination links $(document).on(click, .pagination-link, function(e) { e.preventDefault(); currentPage parseInt($(this).data(page)); $(this).css(text-decoration, none); Agent.init_call_history_update(sortOrder, currentPage); // Reload data for the new page }); } });};// CHOSEN Agent.init_chosen function(select, container_width, drop_width){ if (!Agent.searchable_dropdowns) return; // do not initialize chosen if searchable_dropdowns option is disabled if (typeof select.data(chosen) undefined) { select.chosen({ search_contains : true, disable_search_threshold: 5, no_results_text : Nothing found!, placeholder_text_single : select.data(placeholder), width : container_width }); select.on(chosen:showing_dropdown, function() // Making sure that dropdowns are not being updated when open (being browsed/searched) { $(this).data(dont-update, 1); }); select.on(chosen:hiding_dropdown, function() // When not browsed/searched, dropdowns can be updated for sure { $(this).data(dont-update, 0); }); select.next(.chosen-container:first).find(div.chosen-drop).css(width, drop_width); select.next(.chosen-container).addClass(menu-call-select-width- + container_width); select.next(.chosen-container).attr(id, manual-call-select-box); } else { select.trigger(chosen:updated); }};// #####################################################################################################################Agent.init_connection_interface function(){ $(.connection_option).click(function() // change the current Connection Option ( soft_phone, desk_phone, call_in ) { $(this).addClass(on); $(.connection_option).not($(this)).removeClass(on); Agent.Updater.stop(is_device_registered); Agent.Updater.stop(call_in_status); if($(this).hasClass(soft_phone)) Agent.current_connection_method soft_phone; if($(this).hasClass(desk_phone)) Agent.current_connection_method desk_phone; if (FF(sip_connection.webrtc)) { if($(this).hasClass(webrtc)) { Agent.current_connection_method webrtc; } } if($(this).hasClass(call_in)) Agent.current_connection_method call_in; if($(this).hasClass(dont_connect))Agent.current_connection_method dont_connect; $(.connection_option_body).hide(); $(.connection_option_body. + Agent.current_connection_method).show(); if(Agent.current_connection_method dont_connect) return; if (FF(sip_connection.webrtc)) { if (Agent.current_connection_method webrtc) { webrtc_login(); } } Agent.Updater.add({ what: (Agent.current_connection_method call_in ? call_in_status : is_device_registered), interval: 1, done: function(connected) { var $o $(.connection_option_body. + Agent.current_connection_method); if(connected) { $o.find(.status).text(Registered).css({color: #080}); if(!$o.find(.connecting).is(:visible)) $o.find(.button).show(); $o.find(.offline).hide(); } else { $o.find(.status).text(Not registered).css({color: #F00}); $o.find(.error).hide(); $o.find(.button).hide(); $o.find(.offline).show(); } } }); }); $(.connection_option_body .button).click(function() { if(Agent.current_connection_method dont_connect) { Agent.log(Dont connect!); $.ajax({ url : ajax/, type: POST, dataType: JSON, data: { act: agent/dont_connect } }) .done(function(){ $( #connection_dialog ).dialog(close); }); } else { $(.connection_option_body. + Agent.current_connection_method) .find(.error, .button, .success).hide().end() .find(.connecting).show(); if (FF(sip_connection.webrtc) && Agent.is_supervisor && Agent.current_connection_method webrtc) { agent_connect(); // webrtc connection Agent.update_last_connection_method(Agent.current_connection_method); } else { Agent.connect(); } } });};// #####################################################################################################################Agent.init_phone_interface function(){ var p Agent.$phone; // show/hide the green connected bulb at the top if(Agent.is_connected) Agent.$phone.find(.connected).show(); else Agent.$phone.find(.disconnected).show(); Agent.$phone.find(.disconnected .button).click(function(){ Agent.connection_dialog(); }); var manual_campaign_call function() { var camp_id Agent.$manual_call.filter(.campaign).find(select.campaign).val(); var number Agent.$manual_call.filter(.campaign).find(input.masked_phone).val().replace(/\D/g, ); const account_id_input Agent.$manual_call.filter(.campaign).find(input#account_id); const client_id_input Agent.$manual_call.filter(.campaign).find(input#client_id); const state_select Agent.$manual_call.filter(.campaign).find(select#state); if(number.length ! 10) {$.alert(Can not place the call!, Phone number incorrect.br>It has to be 10 digits long!); return; } if(camp_id ) {$.alert(Can not place the call!, No campaign selected!); return; } // just in case if(camp_id 0) {$.alert(Can not place the call!, No campaign selected!); return; } // just in case if(! /^\d+$/.test(camp_id) ){$.alert(Can not place the call!, No campaign selected!); return; } // just in case if(! /^\d+$/.test(number) ) {$.alert(Can not place the call!, Phone number incorrect!br>It must contain only digits!); return; } // just in case if (account_id_input.prop(required) && !$(account_id_input).val()) { $.alert(Can not place the call!, Please, complete the Account ID field.); return; } if (client_id_input.prop(required) && !$(client_id_input).val()) { $.alert(Can not place the call!, Please, complete the Client ID field.); return; } if (state_select.prop(required) && !$(state_select).val()) { $.alert(Can not place the call!, Please, complete the State field.); return; } Agent.log(Placing call); Agent.place_manual_call( number, camp_id, true, $(account_id_input).val(), $(client_id_input).val(), $(state_select).val() ); }; Agent.$manual_call.filter(.campaign).find(.button).click(function(e){e.preventDefault(); manual_campaign_call(); }); // also make pressing Enter initiate the call Agent.$manual_call.filter(.campaign).find(input).keypress(function(e) { if (e.which 13) { e.preventDefault(); $(this).blur(); manual_campaign_call(); } }); Agent.$manual_call.filter(.internal).find(.button).click(function(e) { var camp_id Agent.$manual_call.filter(.internal).find(select.campaign).val(); var number Agent.$manual_call.filter(.internal).find(select.ext).val(); var to_campaign Agent.$manual_call.filter(.internal).find(select.ext option:selected).hasClass(campaign); if(camp_id ) { $.alert(Can not place the call, No campaign selected!); e.stopPropagation(); return; } if(number ) { $.alert(Can not place the call, No agents to call!); e.stopPropagation(); return; } Agent.place_manual_call( number, camp_id, false ); // if(to_campaign) Agent.place_call_to_campaign( camp_id ); // else Agent.place_manual_call( number, camp_id, false ); e.stopPropagation(); }); Agent.$manual_call.filter(.internal).find(select.campaign).change(function(){ // display First available agent option if the campaign selected is callable var o $(this).find(option:selected); // var ext o.data(ext); var id o.data(id); var type o.data(type); var campaign_extension callCampByID+id; var select Agent.$manual_call.filter(.internal).find(select.ext); select.find(option.campaign).remove(); if(id ! && type ! MA && type ! P3) select.prepend( $(option>).text(First available agent).val(campaign_extension).addClass(campaign) ); select.val(select.find(option:first).val()).change(); // select first option select.trigger(chosen:updated); // update the list of agents that belong to the selected campaign Agent.update_agents_list(id); }); Agent.$manual_call.filter(.campaign).find(select.campaign).change(function () { // display First available agent option if the campaign selected is callable const campaign Agent.campaigns.find(el > el.id parseInt(this.value)); const account_id_input Agent.$manual_call.filter(.campaign).find(input#account_id); const client_id_input Agent.$manual_call.filter(.campaign).find(input#client_id); const state_select Agent.$manual_call.filter(.campaign).find(span#state_select); if (campaign && campaign.irf_enabled) { account_id_input.prop(hidden, false); client_id_input.prop(hidden, false); state_select.prop(hidden, false); account_id_input.prop(required, true); client_id_input.prop(required, true); state_select.prop(required, true); $(.call_fields_divider).show(); } else { account_id_input.prop(hidden, true); client_id_input.prop(hidden, true); state_select.prop(hidden, true); account_id_input.prop(required, false); client_id_input.prop(required, false); state_select.prop(required, false); $(.call_fields_divider).hide(); } }); p.find(.line .hold-queue).click(function() { var i $(this).closest(.line).data(id); var channel_id Agent.phone_linesNumber(i).c; Agent.back_to_hold_queue(channel_id); $(this).closest(.line).removeClass(current); $(this).closest(.line).find(.transfer_to).hide(); $(this).closest(.line).find(.dtmf_keypad).hide(); }); // click on CONTINUE button p.find(.line .continue).click(function() { // do not allow to pick up the held call immediately if clicked accept for the new incoming call if (Agent.accept_call_clicked) { return; } var i $(this).closest(.line).data(id); var channel_id Agent.phone_linesNumber(i).c; Agent.retrieve(channel_id); if ($(this).closest(.line).hasClass(current)) return; Agent.$phone.find(.line).removeClass(current); Agent.$phone.find(.dtmf_keypad).hide(); Agent.$phone.find(.transfer_to).hide(); $(this).closest(.line).addClass(current); $(this).closest(.line).removeClass(onhold-line); Agent.$phone.find(.line:not(.current) .buttons.call).hide(); }); // click on ONHOLD button p.find(.line .onhold).click(function() { var i $(this).closest(.line).data(id); var channel_id Agent.phone_linesNumber(i).c; Agent.onhold(channel_id); $(this).closest(.line).removeClass(current); $(this).closest(.line).find(.transfer_to).hide(); $(this).closest(.line).find(.dtmf_keypad).hide(); $(this).closest(.line).addClass(onhold-line); var cnt_onholdlines $(div.onhold-line).length; if (cnt_onholdlines > 1) Agent.$phone.find(.line .buttons.call).show(); }); // click on HANGUP button p.find(.hangup).click(function(e) { e.stopPropagation(); var i $(this).closest(.line).data(id); var channel_id Agent.phone_linesNumber(i).c; Agent.current_line i; Agent.hangup(channel_id); Agent.status wrap; $(this).closest(.line).hide(); $(this).closest(.line).removeClass(current); $(this).closest(.line).removeClass(onhold-line); Agent.$phone.find(.line:not(.current) .buttons.call).show(); }); p.find(.transfer).click(function(e) { e.stopPropagation(); var line $(this).closest(.line); if(line.find(.transfer_to).is(:visible)) { Agent.log(Clicked on transfer: hiding transfertos); Agent.$phone.find(.line .transfer_to).slideUp(fast); } else { Agent.$phone.find(.line .dtmf_keypad).hide(); Agent.$phone.find(#submit_transfer).attr(disabled, false); var to line.find(.transfer_to); to.find(.choice input).prop(checked,false); to.find(tr).filter(.campaign,.agent,.extension,.number,.send).hide(); Agent.log(Clicked on transfer: showing correct transferto); to.slideDown(fast); to.find(.choice input).unbind().click(function(){ var v $(this).val(); $(this).closest(table).find(tr).filter(.campaign,.agent,.extension,.number).hide(); $(this).closest(table).find(tr).filter(.+v).show(); $(this).closest(table).find(tr).filter(.send).show(); }); } }); p.find(.dtmf).click(function(e){ e.stopPropagation(); $(this).closest(.line).find(.transfer_to).hide(); $(this).closest(.line).find(.dtmf_keypad).slideToggle(fast); }); p.find(.dtmf_keypad div).click(function(e) { e.stopPropagation(); var i $(this).closest(.line).data(id); var channel_id Agent.phone_linesi.c; Agent.dtmf(channel_id, $(this).text() ); }); // click on TRANSFER TO button p.find(.transfer_to tr.send input.button).click(function(e) { e.stopPropagation(); var i $(this).closest(.line).data(id); var channel_id Agent.phone_linesNumber(i).c; var to $(this).closest(.transfer_to).find(.choice input:radio:checked).val(); if(to agent) { var ext $(this).closest(.transfer_to).find(tr.agent select).val(); if(ext null) {$.alert(Ooops!, No agents available!); e.stopPropagation(); return; } Agent.$phone.find(#submit_transfer).attr(disabled, true); var call_id Agent.phone_linesNumber(i).cid; Agent.transfer_to_agent_with_callid(channel_id, ext, call_id); } if(to campaign) { var id $(this).closest(.transfer_to).find(tr.campaign select).val(); if(id ) { $.alert(Ooops!, No campaigns available!); e.stopPropagation(); return; } Agent.$phone.find(#submit_transfer).attr(disabled, true); var call_id Agent.phone_linesNumber(i).cid; Agent.transfer_to_campaign_with_callid(channel_id, id, call_id); } if(to number) { var phone $(this).closest(.transfer_to).find(tr.number input).val(); if(phone ) { $.alert(Ooops!, Please enter a phone number!); e.stopPropagation(); return; } Agent.$phone.find(#submit_transfer).attr(disabled, true); var call_id Agent.phone_linesNumber(i).cid; Agent.log(Callid is: + call_id); Agent.transfer_to_phonenumber(channel_id, phone, call_id, false); } if(to extension) { var phone $(this).closest(.transfer_to).find(tr.extension select).val(); if(phone null) { $.alert(Ooops!, No extensions available!); e.stopPropagation(); return; } Agent.$phone.find(#submit_transfer).attr(disabled, true); var call_id Agent.phone_linesNumber(i).cid; Agent.transfer_to_phonenumber(channel_id, phone, call_id, true); } }); p.find(.between > .bridge).click(function(e){ e.stopPropagation(); Agent.bridge(); }); p.find(.between .conference).click(function(e){ e.stopPropagation(); Agent.conference(); }); p.find(.in_conference > .bridge).click(function(e){ e.stopPropagation(); Agent.conference_to_bridge(); }); p.find(.preview .buttons .call).click(function(e){ e.stopPropagation(); Agent.place_preview_call ( Agent.$phone.find(> .preview).attr(data-lead_id) ); // add call data when agent is in `STATUS_PREVIEW` or `STATUS_CALLBACK` (when agent see `preview block`) but clicks on `logout` button Agent.$phone.find(> .preview).attr(data-lead_id, 0); Agent.$phone.find(> .preview).attr(data-lead_phone, 0); Agent.$phone.find(> .preview).attr(data-campid, 0); }); p.find(.preview .buttons .postpone).click(function(e) { e.stopPropagation(); $(#postpone-call-dialog).remove(); $(body).append(div idpostpone-call-dialog titlePostpone this Call:> + Call back in: select classperiod> + option value60>1 minute/option> + option value300>5 minutes/option> + option value600 selectedselected>10 minutes/option> + option value1800>30 minutes/option> + option value3600>1 hour/option> + option value10800>3 hours/option> + option value21600>6 hours/option> + option value43200>12 hours/option> + option value86400>24 hours/option> + /select> + /div>); $(#postpone-call-dialog).dialog({ show: fade, hide: fade, modal: true, buttons: { Postpone >: function(){ var period $(this).find(select.period).val(); var lead_id Agent.$phone.find(> .preview).attr(data-lead_id); var camp_id Agent.$phone.find(> .preview).attr(data-campid); Agent.postpone_call(lead_id, period, camp_id); Agent.$phone.find(> .preview).attr(data-lead_id, 0); Agent.$phone.find(> .preview).attr(data-lead_phone, 0); Agent.$phone.find(> .preview).attr(data-campid, 0); $(this).dialog(close); } } }); }); // Add popups to phone buttons p.find(.buttons div).qtip({ position: { my: bottom left, at: top center, adjust: { y: 0 }}, style: { classes: qtip-bootstrap } }); // changing agent status by clicking on a status icon Agent.$status.find(div).click(function() { // skip changing agent status if he has wrap form if (Agent.status wrap) return; if($(this).hasClass(active)) return; // already let status $(this).data(id); if (status || status undefined) { return; } Agent.log(Status button clicked: + status); Agent.change_status(status); if(Agent.status ! ready && Agent.status ! notready) Agent.$manual_call.slideUp(fast); Agent.$status.find(div).removeClass(active); Agent.$status.find(div .time).text(00:00); $(this).addClass(active); }); p.find(>.monitor .button).click(function () { Agent.stop_monitoring(); Agent.stop_helping(); }); p.find(.calls_holding a.campaigns).click(function(e){ e.stopPropagation(); Agent.$phone.find(.calls_holding div.campaigns).toggle(); return false; }); p.find(.internal_transfer .accept).click(function(e){ e.stopPropagation(); Agent.internal_transfer_accept(); return false; }); p.find(.internal_transfer .decline).click(function(e){ e.stopPropagation(); Agent.internal_transfer_decline(); return false; });};// #####################################################################################################################Agent.init_wrap_form function(){ var blink_submit_btn setInterval(function(){ Agent.$wrap.find(tr.submit .button).toggleClass(blink); }, 500); var w Agent.$wrap; w.find(tr.call_result select).change(function() { var w Agent.$wrap; var v $(this).val(); w.find(input.revenue).val(0).data(required, 0); w.find(tr.revenue).hide(); // we display callback later checkbox for all campaigns w.find(tr.call_back).show(); w.find(input.call_back).iCheck(enable).iCheck(uncheck); w.find(input.call_back_private).iCheck(uncheck); w.find(> .wrap span.call_back).hide(); if (Agent.allow_agents_dnc) { w.find(tr.dnc).show(); w.find(input.dnc).iCheck(enable).iCheck(uncheck); w.find(tr.dnc div.reason).hide(); w.find(tr.dnc div.reason).removeClass(require_dnc_reason); } for(var i0; i Agent.call_results.length; i++) if(Agent.call_resultsi.id v) { var r Agent.call_resultsi; if(r.recall 1) // follow the Disposition Recall rules { // 1. Remove DNC flag if (Agent.allow_agents_dnc) { w.find(tr.dnc).hide(); w.find(input.dnc).iCheck(uncheck).iCheck(disable); } // 2. Set up the Recall flag w.find(tr.call_back).show(); w.find(> .wrap span.call_back).show(); w.find(input.call_back_private).iCheck(uncheck); w.find(input.call_back).iCheck(check).iCheck(disable); w.find(input.call_back_date).val(r.recall_date); w.find(input.call_back_time).val(r.recall_time); w.find(input.hidden_call_back_time).val(r.recall_time); } if(r.dnc 1 && Agent.allow_disposition_dnc) // follow the Disposition DNC rules { // 1. autocheck DNC flag if (Agent.allow_agents_dnc) { w.find(tr.dnc).show(); w.find(tr.dnc div.reason).show(); w.find(tr.dnc div.reason input).val(); w.find(input.dnc).iCheck(check).iCheck(disable); if (parseInt(Agent.call.info.require_dnc_reason)) { w.find(tr.dnc div.reason).addClass(require_dnc_reason); } } // 2. remove callback flag w.find(tr.call_back).hide(); w.find(input.call_back).iCheck(uncheck).iCheck(disable); } if(r.success 1) { w.find(input.revenue).val(r.revenue).data(required, r.revenue_required); w.find(tr.revenue).show(); } } Agent.resize_everything(); }); // Submit WRAP form w.find(tr.submit input).click(function() { Agent.prevent_preview_call_show false; var errors ; var revenue Number(Agent.$wrap.find(input.revenue).val()); if (revenue > 10000) { var confirmed confirm(You are about to submit a revenue which is greater than $10,000. Is the number correct? Cancel, if this is a mistake); if(!confirmed) return; } var revenue_required Agent.$wrap.find(input.revenue).data(required); if (!Agent.wrap_form_autosubmited && (revenue_required 1) && (revenue 0)) errors.push(Revenue amount is required); var custom_fields ; Agent.$wrap.find(tr.custom).each(function(i) { var field $(this).data(field); var val $(this).find(input).val(); var mandatory $(this).data(mandatory); if (!Agent.wrap_form_autosubmited && mandatory 1 && val ) errors.push(Please fill the field: + $(this).data(title)); custom_fields.push({ field:field, value:val }); }); if (Agent.require_account_number) if (Agent.call.info.camp_type IN || Agent.call.info.camp_type MA) if (!Agent.wrap_form_autosubmited && $.trim(Agent.$wrap.find(input.account_id).val()) ) errors.push(Please fill the field: Account ID); if (!Agent.wrap_form_autosubmited && (Agent.$wrap.find(tr.call_result select).val() 0) && (Agent.$wrap.find(tr.call_result select).data(required) 1)) { errors.push(Please choose call result); } if (Agent.$wrap.find(tr.dnc div.reason).hasClass(require_dnc_reason) && ($.trim(Agent.$wrap.find(tr.dnc div.reason input).val()) ) ) { errors.push(Please enter DNC reason); } // check if current submit time is not less than callback time if ($(input.call_back).is(:checked)) { var currentSubmitServerTime timezoneOffsetTime(-6); // -6 America/Chicago timezone var callbacStatusRecallTime Agent.$wrap.find(tr.call_result select).find(option:selected).data(recalltime); var callbackDate $(.call_back_date).datepicker(getDate); callbackDate $.datepicker.formatDate(yy-mm-dd, callbackDate); //var callbackTime Agent.$wrap.find(tr.call_back input.call_back_time).val() + :00; // TODO: do not remove it! we will use it if need long format: 24h var callbackTime timeConvert12to24(Agent.$wrap.find(tr.call_back input.call_back_time).val()); var callbackDateTimeInSeconds Math.round(new Date(callbackDate + + callbackTime).getTime() / 1000); if (callbackDateTimeInSeconds currentSubmitServerTime) { errors.push(Please insert a valid strong>Callback later on/strong> value. The strong>Callback later on/strong> cannot be less than Call Results submission time or strong>Recall/strong> value ( + callbacStatusRecallTime + seconds) configured by the administrator.); } } // display errors and dont submit the form if(errors.length) { $.alert(Sorry, can not submit!, Please fix the following issues to continue:br>br>\u2022 + errors.join(br> \u2022 )); return; } $(tr.submit #submit_call).attr(disabled, true); clearInterval(blink_submit_btn); $(.wrap tr.submit .button).removeClass(blink); //$(.wrap tr.submit .button).css({ // background: #cac9c9, // border-color: #cac9c9, // -webkit-box-shadow : none, // -moz-box-shadow : none, // box-shadow : none //}); // We found a problem with changing the agents status in case of a slow internet connection. // Problem is with updating agents phone lines. // To fix it we decided to update lines one more time before sending call result to the server. // Here we use ASYNC:FALSE (its a bad practice, please do not use it) to block code running // and wait for response from update lines script. // It may cause some delays in saving call result $.ajax({ async: false, url: ajax/, type: POST, dataType: JSON, data: {act: agent/update, r: {what: lines}} }).done(function (response) { Agent.phone_redraw(response0.r); }); var not_ready Agent.$wrap.find(tr.submit input.notready).is(:checked); var new_status notready; if (Agent.phone_lines0.s 0 && Agent.phone_lines1.s 0) new_status not_ready ? notready : ready; // no line talking - make him Ready if (Agent.phone_lines0.s 2 && Agent.phone_lines1.s 0) new_status onhold; // on hold if (Agent.phone_lines0.s 0 && Agent.phone_lines1.s 2) new_status onhold; // on hold if (Agent.phone_lines0.s 1 && Agent.phone_lines1.cid ! Agent.call.info.call_id) { new_status talking; // we set status `talking` cause line1 has status talking and line2 has statis wrap } Agent.log(Submitting WRAP form; also changing status to + new_status); if (Agent.hangup_data) delete(Agent.hangup_data); // remove hangup data after submit only, cause we need it if we reload page with CTRL+F5 Agent.agent_bridged_calls false; Agent.ignore_wrap_status true; setTimeout(function() { Agent.ignore_wrap_status false; }, 3000); Agent.status new_status; var ajax_data { act : agent/save_call_result, call_id : Agent.call.info.call_id, channel_id : Agent.call.info.channel_id, custom_fields : custom_fields, call_result_id : Agent.$wrap.find(tr.call_result select).val(), note : Agent.$wrap.find(textarea.notes).val(), account_id : Agent.$wrap.find(input.account_id).val(), dnc : Agent.$wrap.find(tr.dnc input.dnc).is(:checked) ? 1 : 0, dnc_reason : Agent.$wrap.find(tr.dnc div.reason input).val(), call_back : Agent.$wrap.find(tr.call_back input.call_back).is(:checked) ? 1 : 0, call_back_date_time : Agent.$wrap.find(tr.call_back input.call_back_date).val() + + Agent.$wrap.find(tr.call_back input.call_back_time).val(), call_back_private : Agent.$wrap.find(tr.call_back input.call_back_private).is(:checked) ? 1 : 0, revenue : revenue, new_status : new_status, // change agent status after saving everything autosubmit_wrap_form : Agent.$wrap.find(tr.submit #wrap_limit_autosubmit_form).val() }; // Timeout timer for Wrap form CC-272 Agent.wrap_form_timer_reset(); Agent.log(WRAP form to be submitted with this data: + JSON.stringify(ajax_data)); var submit_request $.ajax({ url: ajax/, type: POST, dataType: JSON, data: ajax_data }); submit_request.done(function(r) { Agent.log(WRAP form submitted, status must be changed, hiding top, showing statuses, resizing); if(r.error) Agent.log(WRAP form error: + r.error); Agent.$wrap.find(input.account_id).val(); Agent.$top.hide(); if (new_status ready || new_status notready) Agent.$status.slideDown(fast); // wrap form submitted - but do we have active line? if (Agent.phone_lines0.s > 0) { // in this case we should display call details and call result Agent.log(WRAP form submitted, but we have another active channel. Lets show call details for it!!!); Agent.call.info.call_id Agent.phone_lines0.cid; Agent.call.info.channel_id Agent.phone_lines0.c; Agent.display_call_details(); Agent.display_agent_scripts(); } Agent.browser_resize(); // TODO: do not remove it please cc-2151 // Agent.incall_lines.splice(Agent.incall_lines.indexOf(Agent.call.info.call_id), 1); // remove call_id // Agent.old_lines.forEach(function(line, key){ // if (line.cid Agent.call.info.call_id) Agent.old_lines.splice(Agent.old_lines.indexOf(key+1), 1); // }); }); submit_request.fail(function() { $.alert(Ooops!, Theres something wrong: the request wasnt submitted.br>Please try submitting it again!); }); submit_request.always(function() { $(tr.submit #submit_call).attr(disabled, false); //$(.wrap tr.submit .button).css({ // background: #2489c5, // border-color: #0074a2, // -webkit-box-shadow : inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15), // -moz-box-shadow : inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15), // box-shadow : inset 0 1px 0 rgba(120,200,230,.5),0 1px 0 rgba(0,0,0,.15) //}); blink_submit_btn setInterval(function(){ Agent.$wrap.find(tr.submit .button).toggleClass(blink); }, 500); }); }); w.find(input.icheck).iCheck({ checkboxClass: icheckbox_square-blue, radioClass: iradio_square-blue }); if (Agent.allow_agents_dnc) { w.find(input.icheck.dnc) .on(ifChecked, function(event){ $(this).closest(td).find(div.reason).show(); if (parseInt(Agent.call.info.require_dnc_reason)) { $(this).closest(td).find(div.reason).addClass(require_dnc_reason); } $(this).closest(td).find(div.reason input).val(); $(input.icheck.call_back).iCheck(disable); Agent.$wrap.find(tr.call_back).hide(); Agent.resize_everything(); }) .on(ifUnchecked, function(event){ $(this).closest(td).find(div.reason).hide(); $(this).closest(td).find(div.reason).removeClass(require_dnc_reason); $(this).closest(td).find(div.reason input).val(); $(input.icheck.call_back).iCheck(enable); Agent.$wrap.find(tr.call_back).show(); Agent.resize_everything(); }); } w.find(input.icheck.call_back) .on(ifChecked, function(event){ $(this).closest(td).find(span.call_back).show(); if (Agent.allow_agents_dnc) { $(input.icheck.dnc).iCheck(disable); Agent.$wrap.find(tr.dnc).hide(); } Agent.resize_everything(); }) .on(ifUnchecked, function(event){ $(this).closest(td).find(span.call_back).hide(); if (Agent.allow_agents_dnc) { $(input.icheck.dnc).iCheck(enable); Agent.$wrap.find(tr.dnc).show(); } Agent.resize_everything(); }); w.find(input.call_back_date).focus(function(){$(this).blur();}).datepicker({ dateFormat: mm/dd/yy, minDate: 0 }); function getRanges() { var ranges ; var currentServerTime $(.hidden_call_back_time).val(); ranges.push(12:00am, currentServerTime); return ranges; } // Check if date is today $(input.call_back_date).on(change, function (e) { e.preventDefault(); var currentTime new Date(); var call_back_date new Date($(this).val()); // Remove disabled hours if not current day if (call_back_date.getDay() > currentTime.getDay()) { $(.call_back_time).timepicker(remove); $(.call_back_time).timepicker({timeFormat: h:ia, step: 15}); } else { // Calculate disabled hours $(.call_back_time).timepicker(remove); $(.call_back_time).val($(.hidden_call_back_time).val()); $(.call_back_time).timepicker({timeFormat: h:ia, step: 15, disableTimeRanges: getRanges()}); } }); /** * hide time period of past time * and update callback time clicking by times box */ var dispid $(.call_result_select).val(); if (dispid ) { dispid 0; } $.ajax({ method: POST, data: {act: agent/get_callback_time, dispid: dispid}, dataType: JSON, url: ajax/, success: function (data) { $(input.call_back_time).val(data.recall_time); $(input.hidden_call_back_time).val(data.recall_time); $(.call_back_time).timepicker({timeFormat: h:ia, step: 15, disableTimeRanges: getRanges()}); }, error: function (e) { console.log(e); } }); $(input.call_back_time).on(change, function () { var pickedDate $(.call_back_date).val(); var pickedTime $(this).val(); // Only if time is 24:00 then we need to modify date +1 day if (pickedTime 24:00am){ $.ajax({ method: POST, data: {act: agent/get_callback_time, dispid: , pickedData: pickedDate + + pickedTime}, dataType: JSON, url: ajax/, success: function (data) { $(.hidden_call_back_time).val(data.recall_time); $(.call_back_time).val(data.recall_time); $(.call_back_date).val(data.recall_date); }, error: function (e) { console.log(e); } }); } }); // disable paste data in callback time field $(input.call_back_time).on(paste, function (e) { e.preventDefault(); return false; }); // disable keyboard input data in callback time field $(input.call_back_time).on(keydown, function (e) { e.preventDefault(); return false; }); w.find(input.account_id_unknown).click(function(){ w.find(input.account_id).val(Unknown); }); // copy value to clipboard w.find(input.account_id_copy).click(function () { let $account_id_field w.find(input.account_id); $account_id_field .prop(disabled, false) .focus() .select(); document.execCommand(copy); if (Agent.call.info.ifr_enabled && Agent.call.info.account_id.length) { $account_id_field.prop(disabled, true); } });};// #####################################################################################################################Agent.init_browser function(){ var b Agent.$browser; b.find(iframe:first).show(); b.find(.tabs a).click(function(e) { e.preventDefault(); if($(this).hasClass(active)) return; $(#agent-browser .tabs a).removeClass(active); $(this).addClass(active); var n $(this).data(n); Agent.$browser .find(iframe:visible).hide().end() .find(iframe.iframe + n).show(); Agent.browser_resize(); });};// #####################################################################################################################Agent.init_ajax_error_handlers function(){ // Setting up an error handler for all AJAX calls $(document).ajaxError(function (event, xhr, ajaxSettings, thrownError) { const params new URLSearchParams(decodeURIComponent(ajaxSettings.data)); let requestPayload decodeURIComponent(params.toString()); let errorText xhr.responseText; let url ajaxSettings.url + params.get(act); let errorMessage Url + url + returned error: ; if (xhr.status > 400) { errorMessage + xhr.status + : + xhr.statusText; } else { errorMessage + thrownError; } ajaxError( errorMessage, errorText, requestPayload ); }); // Setting up an error handler for all successful AJAX calls $(document).ajaxSuccess(function (event, xhr, ajaxSettings, response) { if (response ! null && typeof response object && response.hasOwnProperty(error)) { const params new URLSearchParams(decodeURIComponent(ajaxSettings.data)); let log_xhr { user_id: USER_ID, domain: SUBDOMAIN, app: (Agent.is_connected ? Agent : Admin) + interface, url: ajaxSettings.url + params.get(act), request: decodeURIComponent(params.toString()), response: response }; Agent.log(Ajax response contains error property \n + JSON.stringify(log_xhr)); } });};// #####################################################################################################################Agent.fetch_agent_status function () { $.ajax({ url: ajax/, type: POST, dataType: JSON, data: { act: agent/fetch_agent_status } }).done(function (agent_status) { if (agent_status preview) { Agent.change_status(ready); Agent.$status.show(); } });};// #####################################################################################################################Agent.init function(){ // First, some jQuery definitions Agent.$phone $(#phone); Agent.$manual_call $(#phone .manual_call); Agent.$acceptdecline $(#phone .accept-decline); Agent.$hangupacceptdecline $(#phone .hangup-accept-decline); Agent.$status $(#agent-status); Agent.$top $(#agent-top); Agent.$top_preloader $(#agent-top-preloader); Agent.$call_info $(#agent-top > .call_info); Agent.$preview_notes $(#agent-top > .call_preview_notes); Agent.$wrap $(#agent-top > .call_wrap); Agent.$browser $(#agent-browser); Agent.screen Agent.$top.length > 0; Agent.init_ajax_error_handlers (); // Now, all the preparations and event handlers Agent.init_regular_updates (); Agent.init_connection_interface (); Agent.init_phone_interface (); Agent.init_wrap_form (); Agent.init_browser (); // Once page is loaded - pop up the connection dialog, if need to connect Agent.$phone.show (); if(!Agent.is_connected) { Agent.$phone.find(> .line).hide(); Agent.$phone.find(> .calls).hide(); } Agent.$phone.find(> .connected) .toggle (Agent.is_connected); Agent.$phone.find(> .disconnected).toggle (!Agent.is_connected); if(!Agent.is_connected && !(Agent.is_supervisor && Agent.dont_connect)) Agent.connection_dialog(); $(window).resize (Agent.resize_everything); Agent.resize_everything (); setInterval (timeticker, 1000);};// // Agent Updater - a separate Updater instance for agent phone interface onlyAgent.Updater { counter : 0, queue : , settings : { ajax_url : ajax/, // URL of the AJAX script to be called ajax_vars : // Variables to be sent to AJAX script { act : agent/update }, interval : 1000 }};Agent.Updater.add function(o) { if(typeof o.what undefined) return; if(typeof o.done undefined || !(o.done && o.done.constructor && o.done.call && o.done.apply)) o.done function(){}; this.queue.push($.extend({}, o, { id: this.counter ++, last_updater:0 }) ); if(this.counter 1) this.ticker(); // initialize the updater mechanism for the first time};Agent.Updater.stop function(what) { for(var i in this.queue) if(this.queuei.what what) this.queue.splice(i,1); };Agent.Updater.update function(what) { this.refresh(what); };Agent.Updater.refresh function(what) { for(var i in this.queue) if(this.queuei.what what) this.queuei.last_updated 0; };Agent.Updater.delete function(what) { this.stop(what); };Agent.Updater.remove function(what) { this.stop(what); };Agent.Updater.ticker function() { var now new Date().getTime(); var request ; for (var i in Agent.Updater.queue) { var d Agent.Updater.queuei; if(d.interval && (now - d.last_updated) / 1000 d.interval) continue; else d.last_updated now; var w {what: d.what, id: d.id}; if(d.params) w.params d.params; request.push(w); } if (request.length) $.ajax({ url: Agent.Updater.settings.ajax_url, type: POST, dataType: JSON, data: $.extend({}, Agent.Updater.settings.ajax_vars, { r: request } ) }) .done(function(result) { for(var i in result) for(var j in Agent.Updater.queue) { var d Agent.Updater.queuej; if(d.id resulti.id){ d.done(resulti.r); if(!d.interval) Agent.Updater.queue.splice(j,1); break; } } }) .always(function() { setTimeout(Agent.Updater.ticker, Agent.Updater.settings.interval); }); else setTimeout(Agent.Updater.ticker, Agent.Updater.settings.interval); // or, check again in a second};// // TRY TO EMULATE PSEUDO WEBSOCKETS aka Long Polling// do not remove it pleasevar lp_callid 0;function get_ended_call(callid){ $.ajax({ url : ajax/, type : POST, dataType: JSON, data : {act: agent/long_polling, lpcallid: callid} }).done(function(r) { if (r.callid) { console.log(r.callid); lp_callid r.callid; get_ended_call(lp_callid); } else { console.log(r); get_ended_call(lp_callid); } }).error(function(jqXHR, textStatus, errorThrown) { console.log(jqXHR, textStatus, errorThrown); get_ended_call(lp_callid); });}function handleUnloadEvent(event) { event.returnValue You have unsaved changes.;}/script> style> /style> script> $(document).ready(function() { $(.chosen-choices .search-field .chosen-search-input.default) .after(div>b>/b>/div>); }); /script> /head> body> div idintelligentcontacts-container classcontainer login> div classcontent> script> $(function(){ $(#emailhint).qtip({ content: If you dont have an email address, use your username to log in, style: { classes: qtip-bootstrap qtip-shadow} }); });/script>style> .errors { padding: 5px 0 5px 35px; margin: 0 0 0 64px; text-align: left; font-size: 13px !important; }/style>div classbox stylewidth:350px;margin:100px auto 0 auto;padding:20px;box-shadow:2px 5px 10px rgba(0,0,0, 0.4)> img srcimages/logos/login_logo_dialer_new.jpg border0 stylemargin: 0 auto;>br> form methodPOST action/> input typehidden name__csrf_token value98bd0c9978c0099cdf7b8f7eb2e4123a867904d1b33ab107711ca7f269dc4323> table border0 cellpadding4 cellspacing0 aligncenter stylewidth: 100%> tr>td alignright>Email: span idemailhint stylecursor:pointer;color:#CCC;>?/span>/td>td>input typetext nameusername stylewidth: 100%;background-color:#faffbd; autofocus>/td> tr>td alignright>Password:/td>td>input typepassword namepassword stylewidth: 100%;background-color:#faffbd;>/td> tr>td alignright> /td> td>input typesubmit classbutton valueSign In »> a hrefforgot/ stylefloat: right; text-decoration: none; font-size: 11px; line-height: 25px; color: #006CB1;>Forgot your password ?/a> /td> /table> input typehidden namerequest_uri value/> /form> /div> /div> /div> script> $(.chosen).chosen({ disable_search_threshold: 14, search_contains: true }); $(function () { //disable autocomplete $( document ).on( focus, :input, function(){ $( this ).attr( autocomplete, off ); }); //fix thead $(#fixthead).on(scroll, function () { delta $(this).offset().top - $(this).find( table thead).offset().top; $(this).find( table thead).children().children().css({ transform: translate(0px, + (delta > 0 ? delta : 0) + px) }); return false; }); $(#fixthead table).tablesorter({ theme: blackice }); // $(document).ready(function () { // // set document height to all container (fix for datatables fixedhead) // var icWindowHeight $(#intelligentcontacts-container).height(); // $(#intelligentcontacts-container).css(height, (icWindowHeight + 100)); // add plus 100px // }); }); /script> !-- Frill (https://frill.co) --> script> (function (t, r) { function s() { var a r.getElementsByTagName(script)0, e r.createElement(script); e.type text/javascript, e.async !0, e.src https://widget.frill.co/v2/container.js, a.parentNode.insertBefore(e, a) } if (!t.Frill) { var o 0, i {}; t.Frill function (e, p) { var n, l o++, c new Promise(function (v, d) { il { params: e, p, resolve: function (f) { n f, v(f) }, reject: d } }); return c.destroy function () { delete il, n && n.destroy() }, c }, t.Frill.q i } r.readyState complete || r.readyState interactive ? s() : r.addEventListener(DOMContentLoaded, s) })(window, document); window.Frill(container, { key: 878d039d-0e94-4d5c-9876-0e70e9faa49f, }) /script> !-- End Frill --> !-- Zoho Chatbot --> !-- End Zoho Chatbot --> /body> /html>
View on OTX
|
View on ThreatMiner
Please enable JavaScript to view the
comments powered by Disqus.
Data with thanks to
AlienVault OTX
,
VirusTotal
,
Malwr
and
others
. [
Sitemap
]