Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / services / ami / dialer / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x6e9a=['loopCampaigns','loopClearZombieChannels','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','ivr','format','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','startProgressive','startPredictive','clearing\x20variable\x20start\x20predictive','handlePredictive','outbound','preview','string','isEmpty','\x22%s\x22\x20<%s>','inspect','error','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','waiting','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','actions','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ListId','UserId','VoiceQueueId','CampaignId','Success','active','SIP/%s','reachable','unmonitored','uniqueid','exten','dialAMDActive','HANGUP','HangupInAMD','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','membername','countmachineretry','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countabandonedretry','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','syncAgentComplete','reason','agiafterat','[syncAgentComplete][createHistory]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','countglobal','dialDropMaxRetry','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[syncAgentComplete][createHistory][11]','actionid','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','pick','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkDialMethod','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','dialer','getCaller','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','dialOriginateTimeout','[originate][error]','originate\x20action\x20Error','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','NoSuchNumber','EMITTING\x20status_nosuchnumber\x20for','nosuchnumber','custom:status_nosuchnumber','buildObj','NoAnswer','log','NO\x20ANSWER\x20evt','NO\x20ANSWER\x20entity','NO\x20ANSWER\x20history','noanswer','[syncAgentComplete][createHistory][3]','Busy','EMITTING\x20status_busy\x20for','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','reason\x2020\x20agentreject','Global','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','getDataPredictive','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','[CatchErlangB]','outboundQueuePauses','predictiveIntervalPauses','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','Agent','voicePause','Contact\x20updated','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','ACTIVE','[actionOriginate]\x20','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','syncOriginateResponse','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x6e9a,0x1dc));var _0xa6e9=function(_0x5d5f03,_0x4d8cfc){_0x5d5f03=_0x5d5f03-0x0;var _0x4e1cb8=_0x6e9a[_0x5d5f03];return _0x4e1cb8;};'use strict';var util=require(_0xa6e9('0x0'));var _=require('lodash');var BPromise=require(_0xa6e9('0x1'));var uuid=require(_0xa6e9('0x2'));var moment=require(_0xa6e9('0x3'));var rr=require('rr');var md5=require(_0xa6e9('0x4'));var Redis=require(_0xa6e9('0x5'));var ut=require(_0xa6e9('0x6'));var config=require(_0xa6e9('0x7'));var logger=require(_0xa6e9('0x8'))('dialer');var loggerBooked=require(_0xa6e9('0x8'))('booked');var loggerPredictive=require('../../../config/logger')(_0xa6e9('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xa6e9('0xa'));var loggerSyncQueueSummary=require(_0xa6e9('0x8'))(_0xa6e9('0xb'));var ami=require(_0xa6e9('0xc'));config[_0xa6e9('0xd')]=_[_0xa6e9('0xe')](config['redis'],{'host':_0xa6e9('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa6e9('0xd')]));var cmHopper=require(_0xa6e9('0x10'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xa6e9('0x11'));var cmHopperBlack=require(_0xa6e9('0x12'));var voiceQueueRt=require(_0xa6e9('0x13'));var Action=require(_0xa6e9('0x14'));var History=require(_0xa6e9('0x15'));var Final=require(_0xa6e9('0x16'));var AgentComplete=require(_0xa6e9('0x17'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0xa6e9('0x18'));var ipAgi=process[_0xa6e9('0x19')][_0xa6e9('0x1a')]||'127.0.0.1';var strategy={'rrmemory':_0xa6e9('0x1b'),'roundrobin':_0xa6e9('0x1c')};var Sequence=function(){};Sequence[_0xa6e9('0x1d')][_0xa6e9('0x1e')]=function(_0x17a92d){this[_0xa6e9('0x1f')]=this[_0xa6e9('0x1f')]?this['tail'][_0xa6e9('0x20')](_0x17a92d):_0x17a92d();};function Dialer(_0x536abc,_0x87482e){this[_0xa6e9('0x21')]=new Sequence();this['preview']=_0x87482e;this[_0xa6e9('0x22')]=_0x536abc['voiceQueues'];this[_0xa6e9('0x23')]=_0x536abc[_0xa6e9('0x23')];this[_0xa6e9('0x24')]=_0x536abc[_0xa6e9('0x24')];this[_0xa6e9('0x25')]=_0x536abc[_0xa6e9('0x25')];this[_0xa6e9('0x26')]=config[_0xa6e9('0x26')]||0x2;this[_0xa6e9('0x27')]={};this['actions']={};this['contactsId']={};this[_0xa6e9('0x28')]={};this[_0xa6e9('0x29')]={};this['startPredictive']={};this['startProgressive']={};this['ivrOriginated']={};this[_0xa6e9('0x2a')]={};this[_0xa6e9('0x2b')]={};ami['on'](_0xa6e9('0x2c'),this[_0xa6e9('0x2d')][_0xa6e9('0x2e')](this));ami['on'](_0xa6e9('0x2f'),this[_0xa6e9('0x30')]['bind'](this));ami['on']('originateresponse',this[_0xa6e9('0x31')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on']('custom:queuesummary',this[_0xa6e9('0xb')]['bind'](this));ami['on'](_0xa6e9('0x32'),this[_0xa6e9('0x33')][_0xa6e9('0x2e')](this));ami['on'](_0xa6e9('0x34'),this[_0xa6e9('0x35')][_0xa6e9('0x2e')](this));ami['on'](_0xa6e9('0x36'),this[_0xa6e9('0x37')][_0xa6e9('0x2e')](this));ami['on'](_0xa6e9('0x38'),this[_0xa6e9('0x39')][_0xa6e9('0x2e')](this));ami['on'](_0xa6e9('0x3a'),this[_0xa6e9('0x3b')]['bind'](this));this[_0xa6e9('0x3c')]();this[_0xa6e9('0x3d')]();}function isNotNull(_0x1e1b4e){return _0x1e1b4e!==null&&!_['isUndefined'](_0x1e1b4e);}function checkIsLoggedIn(_0x57dd44,_0x573cfd){return function(){if(_0x573cfd<=0x0){_0x57dd44['message']=_0xa6e9('0x3e');throw _0x57dd44[_0xa6e9('0x3f')]+_0xa6e9('0x40');}};}function isActive(_0x339078){return _0x339078;}function checkIsActive(_0x7f3636,_0xc698bf){return function(){if(!isActive(_0xc698bf)){_0x7f3636[_0xa6e9('0x41')]=_0xa6e9('0x42');throw _0x7f3636[_0xa6e9('0x3f')]+_0xa6e9('0x43');}};}function checkInterval(_0x396cc2){return function(){if(!isNotNull(_0x396cc2['Interval'])){_0x396cc2[_0xa6e9('0x41')]=_0xa6e9('0x44');throw _0x396cc2[_0xa6e9('0x3f')]+_0xa6e9('0x45');}if(!isNotNull(_0x396cc2[_0xa6e9('0x46')][_0xa6e9('0x47')])){_0x396cc2[_0xa6e9('0x41')]=_0xa6e9('0x44');throw _0x396cc2[_0xa6e9('0x3f')]+_0xa6e9('0x45');}if(!isNotNull(_['isEmpty'](_0x396cc2[_0xa6e9('0x46')][_0xa6e9('0x47')]))){_0x396cc2['message']=_0xa6e9('0x44');throw _0x396cc2[_0xa6e9('0x3f')]+_0xa6e9('0x45');}};}function msgResponse(_0x5cf21f,_0x332650,_0x212f72){return{'action':_0x5cf21f,'response':_0x332650,'message':_0x212f72,'stack':_0x212f72};}function myreject(_0x36569d){return function(_0x2b6191){return _0x36569d(msgResponse(_0xa6e9('0x48'),_0xa6e9('0x49'),JSON[_0xa6e9('0x4a')](_0x2b6191)));};}function getSeconds(_0x120325,_0x27e145){var _0x32714e=moment(_0x120325)[_0xa6e9('0x4b')](0x0);var _0xb7e3af=moment(_0x27e145)['milliseconds'](0x0);return _0x32714e[_0xa6e9('0x4c')](_0xb7e3af,_0xa6e9('0x4d'));}function emit(_0x583be3,_0x3febf6,_0x352cf3){io['to'](_0x583be3)[_0xa6e9('0x4e')](_0x3febf6,_0x352cf3);}function emitVoiceQueueSummary(_0x49b1fc){if(_0x49b1fc[_0xa6e9('0x4f')]==='outbound'){var _0x5ca6b6={'id':_0x49b1fc['id'],'name':_0x49b1fc[_0xa6e9('0x3f')],'strategy':_0x49b1fc[_0xa6e9('0x50')],'answered':_0x49b1fc['answered'],'available':_0x49b1fc[_0xa6e9('0x51')],'loggedIn':_0x49b1fc[_0xa6e9('0x52')],'pTalking':_0x49b1fc['pTalking'],'sumBillable':_0x49b1fc[_0xa6e9('0x53')],'sumDuration':_0x49b1fc[_0xa6e9('0x54')],'sumHoldTime':_0x49b1fc[_0xa6e9('0x55')]||0x0,'talking':_0x49b1fc['talking'],'total':_0x49b1fc[_0xa6e9('0x56')],'type':_0x49b1fc['type'],'unmanaged':_0x49b1fc[_0xa6e9('0x57')],'abandoned':_0x49b1fc[_0xa6e9('0x58')],'waiting':_0x49b1fc['waiting'],'loggedInDb':_0x49b1fc['loggedInDb'],'dialActive':_0x49b1fc[_0xa6e9('0x59')],'dialMethod':_0x49b1fc[_0xa6e9('0x5a')],'dialOriginateCallerIdName':_0x49b1fc[_0xa6e9('0x5b')],'dialOriginateCallerIdNumber':_0x49b1fc['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x49b1fc['dialOriginateTimeout'],'dialPrefix':_0x49b1fc[_0xa6e9('0x5c')],'outboundAnswerAgiCallsDay':_0x49b1fc[_0xa6e9('0x5d')],'outboundAnswerCallsDay':_0x49b1fc[_0xa6e9('0x5e')],'outboundBlacklistCallsDay':_0x49b1fc[_0xa6e9('0x5f')],'outboundBusyCallsDay':_0x49b1fc[_0xa6e9('0x60')],'outboundCongestionCallsDay':_0x49b1fc[_0xa6e9('0x61')],'outboundDropCallsDayACS':_0x49b1fc[_0xa6e9('0x62')],'outboundDropCallsDayCallersExit':_0x49b1fc[_0xa6e9('0x63')],'outboundDropCallsDayTimeout':_0x49b1fc[_0xa6e9('0x64')],'outboundNoAnswerCallsDay':_0x49b1fc[_0xa6e9('0x65')],'outboundNoSuchCallsDay':_0x49b1fc[_0xa6e9('0x66')],'outboundOriginateFailureCallsDay':_0x49b1fc[_0xa6e9('0x67')],'outboundReCallsDay':_0x49b1fc['outboundReCallsDay'],'outboundRejectCallsDay':_0x49b1fc['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x49b1fc[_0xa6e9('0x68')],'predictiveIntervalAnsweredCalls':_0x49b1fc[_0xa6e9('0x69')],'predictiveIntervalAvgHoldtime':_0x49b1fc[_0xa6e9('0x6a')],'predictiveIntervalAvgTalktime':_0x49b1fc[_0xa6e9('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x49b1fc[_0xa6e9('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x49b1fc[_0xa6e9('0x6d')],'predictiveIntervalErlangCalls':_0x49b1fc['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x49b1fc['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x49b1fc['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x49b1fc[_0xa6e9('0x6e')],'predictiveIntervalPauses':_0x49b1fc['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x49b1fc[_0xa6e9('0x6f')],'predictiveIntervalTotalCalls':_0x49b1fc[_0xa6e9('0x70')],'message':_0x49b1fc[_0xa6e9('0x41')],'originated':_0x49b1fc[_0xa6e9('0x71')],'erlangCalls':_0x49b1fc[_0xa6e9('0x72')],'erlangCallToSecond':_0x49b1fc['erlangCallToSecond'],'erlangAbandonmentRate':_0x49b1fc[_0xa6e9('0x73')],'erlangBusyFactor':_0x49b1fc[_0xa6e9('0x74')],'startPredictive':_0x49b1fc['startPredictive'],'startProgressive':_0x49b1fc['startProgressive']};if(_0x49b1fc[_0xa6e9('0x75')]){_0x5ca6b6['Trunk']={'id':_0x49b1fc[_0xa6e9('0x75')]['id'],'name':_0x49b1fc['Trunk'][_0xa6e9('0x3f')],'active':_0x49b1fc['Trunk']['active'],'callerid':_0x49b1fc[_0xa6e9('0x75')]['callerid']};}if(_0x49b1fc[_0xa6e9('0x46')]){_0x5ca6b6[_0xa6e9('0x46')]={'id':_0x49b1fc[_0xa6e9('0x46')]['id'],'name':_0x49b1fc[_0xa6e9('0x46')][_0xa6e9('0x3f')]};}var _0xfcc88a=md5(JSON[_0xa6e9('0x4a')](_0x5ca6b6));if(_0x49b1fc[_0xa6e9('0x4')]!==_0xfcc88a){_0x49b1fc[_0xa6e9('0x4')]=_0xfcc88a;emit(util['format']('voice:queue:%s',_0x5ca6b6[_0xa6e9('0x3f')]),'voice_queue:save',_0x5ca6b6);}}}function emitCampaignSummary(_0x221aa7){if(_0x221aa7[_0xa6e9('0x4f')]===_0xa6e9('0x76')){emit(util[_0xa6e9('0x77')]('campaign:ivr:%s',_0x221aa7[_0xa6e9('0x3f')]),_0xa6e9('0x78'),_0x221aa7);}}function checkGetDataPredictive(_0x17fa09){if(isNotNull(_0x17fa09)){if(!_['isEmpty'](_0x17fa09)){loggerPredictive[_0xa6e9('0x79')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x7a'),_0x17fa09['predictiveIntervalTotalCalls']);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x7b'),_0x17fa09[_0xa6e9('0x69')]);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x7c'),_0x17fa09['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x7d'),_0x17fa09[_0xa6e9('0x6c')]);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x7e'),_0x17fa09[_0xa6e9('0x6a')]);loggerPredictive['info'](_0xa6e9('0x7f'),_0x17fa09['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0xa6e9('0x80'));if(_0x17fa09[_0xa6e9('0x70')]>0x0){if(!_[_0xa6e9('0x81')](_0x17fa09['predictiveIntervalAvgTalktime'])&&_0x17fa09[_0xa6e9('0x6b')]>0x0){return!![];}else{loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x82'));}if(!_['isUndefined'](_0x17fa09[_0xa6e9('0x6a')])&&_0x17fa09[_0xa6e9('0x6a')]>0x0){return!![];}else{loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x83'));}}else{loggerPredictive[_0xa6e9('0x79')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x84'));}}else{loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x84'));}return![];}function mergeDataErlangB(_0x51a596){return function(_0x48f225){loggerPredictive[_0xa6e9('0x79')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x85'),_0x48f225[_0xa6e9('0x72')]);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x86'),_0x48f225[_0xa6e9('0x87')]);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x88'),_0x48f225[_0xa6e9('0x73')]);loggerPredictive[_0xa6e9('0x79')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x48f225[_0xa6e9('0x74')]);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x88'),_0x48f225[_0xa6e9('0x73')]);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x80'));_[_0xa6e9('0x89')](_0x51a596,_0x48f225);};}function getDiff(_0x439c22){var _0x357e98=moment()['milliseconds'](0x0);var _0x4222bc=moment(_0x439c22)[_0xa6e9('0x4b')](0x0);return _0x357e98['diff'](_0x4222bc,_0xa6e9('0x4d'));}function ifInterval(_0x1949d0,_0x23cfc6){if(_[_0xa6e9('0x81')](_0x23cfc6)){return![];}if(getDiff(_0x23cfc6)<_0x1949d0*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x23b59d){if(isNotNull(_0x23b59d)){if(!_[_0xa6e9('0x81')](_0x23b59d[_0xa6e9('0x8a')])){_0x23b59d[_0xa6e9('0x8a')]=undefined;loggerPredictive[_0xa6e9('0x79')](_0x23b59d['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xa6e9('0x81')](_0x23b59d[_0xa6e9('0x8b')])){_0x23b59d[_0xa6e9('0x8b')]=undefined;loggerPredictive[_0xa6e9('0x79')](_0x23b59d[_0xa6e9('0x3f')],_0xa6e9('0x8c'));}if(!_[_0xa6e9('0x81')](_0x23b59d[_0xa6e9('0x8d')])){clearInterval(_0x23b59d[_0xa6e9('0x8d')]);_0x23b59d[_0xa6e9('0x8d')]=undefined;loggerPredictive[_0xa6e9('0x79')](_0x23b59d[_0xa6e9('0x3f')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x26bdb0,_0xd930a7){if(_0xd930a7===0x0){return 0x0;}var _0x42cd0e=0x1;for(var _0x3478cd=0x1;_0x3478cd<=_0xd930a7;_0x3478cd+=0x1){_0x42cd0e=0x1+_0x42cd0e*_0x3478cd/_0x26bdb0;}return 0x1/_0x42cd0e;}function isVoiceQueueOutbound(_0x5f1c5f){return _0x5f1c5f===_0xa6e9('0x8e');}function isNotPreview(_0x1d0ced){return _0x1d0ced!==_0xa6e9('0x8f');}function isCampaignIvr(_0x2ff180){return _0x2ff180===_0xa6e9('0x76');}function getCallerId(_0x58efa9,_0x28cb7f,_0xe926fc){if(!_[_0xa6e9('0x81')](_0xe926fc)&&_0xa6e9('0x90')===typeof _0xe926fc&&!_['isEmpty'](_0xe926fc)){if(!_[_0xa6e9('0x81')](_0x28cb7f)&&_0xa6e9('0x90')===typeof _0x28cb7f&&!_[_0xa6e9('0x91')](_0x28cb7f)){return util[_0xa6e9('0x77')](_0xa6e9('0x92'),_0x28cb7f,_0xe926fc);}return util[_0xa6e9('0x77')]('\x22%s\x22\x20<%s>',_0xe926fc,_0xe926fc);}if(!_[_0xa6e9('0x81')](_0x58efa9)&&_0xa6e9('0x90')===typeof _0x58efa9&&!_[_0xa6e9('0x91')](_0x58efa9)){return _0x58efa9;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x578639,_0x2c7434){return function(_0x1b66f1){freeVariablesPredictive(_0x2c7434);emitVoiceQueueSummary(_0x2c7434);emitCampaignSummary(_0x2c7434);loggerSyncQueueSummary['error'](_0x578639,util[_0xa6e9('0x93')](_0x1b66f1,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x120ef8,_0x184c0d){return function(_0xc9a3c1){loggerPredictive[_0xa6e9('0x94')](_0x184c0d[_0xa6e9('0x3f')],_0x120ef8);loggerPredictive['error'](_0xc9a3c1[_0xa6e9('0x95')]);freeVariablesPredictive(_0x184c0d);};}function loggerCatch(_0x411372){return function(_0x1ff9b8){logger['error'](_0x411372,util[_0xa6e9('0x93')](_0x1ff9b8,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x485bae){return _0x485bae&&!_[_0xa6e9('0x81')](_0x485bae)&&_0x485bae[_0xa6e9('0x96')]>0x0;}function decremetOriginate(_0x278ee2){if(!_['isUndefined'](_0x278ee2)&&_0x278ee2!==null){if(_0x278ee2[_0xa6e9('0x97')]('originated')){if(_0x278ee2[_0xa6e9('0x71')]>0x0){_0x278ee2[_0xa6e9('0x71')]-=0x1;}else{logger[_0xa6e9('0x94')](_0xa6e9('0x98'));}}}else{logger[_0xa6e9('0x94')](_0xa6e9('0x99'));}}function checkContactLowerLimitOriginate(_0xc14a64,_0x5c661a,_0x456676){if(_0x5c661a>_0x456676){for(var _0x426528=0x0;_0x426528<_0x5c661a-_0x456676;_0x426528+=0x1){decremetOriginate(_0xc14a64);}}}function loggerGetContactDialer(_0x4efade,_0x13628e,_0x413dcb){return function(_0x1d2a77){checkContactLowerLimitOriginate(_0x13628e,_0x413dcb,0x0);logger[_0xa6e9('0x94')](_0x4efade,util[_0xa6e9('0x93')](_0x1d2a77,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x3e03c3){return function(_0x465277){if(isNotNull(_0x465277)&&isNotNull(_0x465277[0x0])){if(_0x465277[0x0][_0xa6e9('0x9a')]>0x0){_0x3e03c3[_0xa6e9('0x41')]=_0xa6e9('0x9b');logger[_0xa6e9('0x79')](_0xa6e9('0x9c')+_0x3e03c3[_0xa6e9('0x3f')],_0x465277[0x0][_0xa6e9('0x9a')],'contacts');}else{_0x3e03c3[_0xa6e9('0x41')]=_0xa6e9('0x9d');logger[_0xa6e9('0x79')](_0xa6e9('0x9e')+_0x3e03c3['name']);}}};}function notSendMessagesQueue(_0x26a5a8){if(_0x26a5a8[_0xa6e9('0x9f')]){freeVariablesPredictive(_0x26a5a8);if(_0x26a5a8['originated']===0x0&&_0x26a5a8[_0xa6e9('0xa0')]===0x0&&_0x26a5a8[_0xa6e9('0xa1')]===0x0&&(_0x26a5a8[_0xa6e9('0xa2')]||0x0)===0x0){_0x26a5a8[_0xa6e9('0x9f')]=![];_0x26a5a8[_0xa6e9('0x51')]=0x0;_0x26a5a8[_0xa6e9('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0xa6e9('0xa3'),_0x26a5a8[_0xa6e9('0x3f')],_0xa6e9('0xa4'));}else{_0x26a5a8[_0xa6e9('0x41')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xa6e9('0x94')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x26a5a8[_0xa6e9('0x3f')],_0xa6e9('0xa5'));}emitVoiceQueueSummary(_0x26a5a8);}}function notSendMessagesCampaign(_0x572a72){if(_0x572a72[_0xa6e9('0x9f')]){if(_0x572a72['originated']===0x0){_0x572a72[_0xa6e9('0x9f')]=![];_0x572a72[_0xa6e9('0x41')]=_0xa6e9('0x42');loggerSyncQueueSummary['error'](_0xa6e9('0xa6'),_0x572a72[_0xa6e9('0x3f')],_0xa6e9('0xa4'));}else{_0x572a72[_0xa6e9('0x41')]=_0xa6e9('0xa7');loggerSyncQueueSummary[_0xa6e9('0x94')](_0xa6e9('0xa6'),_0x572a72[_0xa6e9('0x3f')],_0xa6e9('0xa5'));}emitCampaignSummary(_0x572a72);}}function createObjHistory(_0x41f440,_0x498643,_0x3010b3,_0x12ec60,_0x348b32){_0x41f440[_0xa6e9('0x41')]=_0x3010b3;var _0x3d4675=new Action(_0x41f440,_0x498643);var _0x5d58be=new History(_0x3d4675);_0x5d58be[_0xa6e9('0xa8')]=_0x12ec60;_0x5d58be[_0xa6e9('0xa9')]=_0x348b32;_0x5d58be[_0xa6e9('0xaa')]=_0x3d4675[_0xa6e9('0xab')];return _0x5d58be;}Dialer[_0xa6e9('0x1d')][_0xa6e9('0x3d')]=function(){var _0x5f3c1d=this;setInterval(function(){_0x5f3c1d[_0xa6e9('0xac')](_0x5f3c1d[_0xa6e9('0x28')],_0xa6e9('0xad'));_0x5f3c1d[_0xa6e9('0xac')](_0x5f3c1d[_0xa6e9('0xae')],_0xa6e9('0xaf'));},0x32c8);};Dialer[_0xa6e9('0x1d')]['clearZombieChannels']=function(_0x247fd8,_0x31be92){var _0x2cf36f=this;for(var _0x33d22f in _0x247fd8){if(_0x247fd8[_0xa6e9('0x97')](_0x33d22f)){this[_0xa6e9('0x21')]['enqueue'](function(){if(!_[_0xa6e9('0xb0')](_0x247fd8[_0x33d22f])){return ami[_0xa6e9('0xb1')]({'action':_0xa6e9('0xb2'),'channel':_0x247fd8[_0x33d22f][_0xa6e9('0xb3')]})[_0xa6e9('0xb4')](function(_0x4fff46){if(_0x4fff46[_0xa6e9('0x41')]===_0xa6e9('0xb5')){setTimeout(function(){if(_0x247fd8[_0x33d22f]&&_0x247fd8[_0x33d22f][_0xa6e9('0x4f')]!==_0xa6e9('0x76')){_0x2cf36f[_0xa6e9('0xb6')](_0x2cf36f['voiceQueues'][_0x247fd8[_0x33d22f]['queue']]);logger[_0xa6e9('0x94')](_0xa6e9('0xb7'),_0x31be92,_0x33d22f,_0x247fd8[_0x33d22f][_0xa6e9('0xb8')]);delete _0x247fd8[_0x33d22f];}if(_0x247fd8[_0x33d22f]&&_0x247fd8[_0x33d22f][_0xa6e9('0x4f')]===_0xa6e9('0x76')){_0x2cf36f[_0xa6e9('0xb6')](_0x2cf36f[_0xa6e9('0x23')][_0x247fd8[_0x33d22f]['queue']]);logger[_0xa6e9('0x94')](_0xa6e9('0xb9'),_0x31be92,_0x33d22f,_0x247fd8[_0x33d22f]['queue']);delete _0x247fd8[_0x33d22f];}},0x2328);}});}});}}};Dialer['prototype'][_0xa6e9('0xba')]=function(_0x16d952){return BPromise[_0xa6e9('0xbb')]()[_0xa6e9('0xbc')](cmHopper['countReScheduled'](_0x16d952))[_0xa6e9('0xb4')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xbd')]=function(_0x2b1c3e){return BPromise['resolve']()[_0xa6e9('0xbc')](cmHopperBlack[_0xa6e9('0xbd')](_0x2b1c3e))[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0xbe')));};Dialer[_0xa6e9('0x1d')]['checkIsBlackListIvr']=function(_0x30178b){return BPromise[_0xa6e9('0xbb')]()[_0xa6e9('0xbc')](cmHopperBlack[_0xa6e9('0xbf')](_0x30178b))[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0xc0')));};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xc1')]=function(_0x2ca917){return BPromise['resolve']()[_0xa6e9('0xbc')](cmHopperHistory['avgHandleTime'](_0x2ca917))[_0xa6e9('0xb4')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xa6e9('0x1d')]['rescheduleContact']=function(_0x4433c8){return BPromise[_0xa6e9('0xbb')]()[_0xa6e9('0xbc')](cmHopper[_0xa6e9('0xc2')](_0x4433c8))[_0xa6e9('0xb4')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xc3')]=function(_0x5f3801,_0x49ab2c,_0x21b1a2){return BPromise[_0xa6e9('0xbb')]()[_0xa6e9('0xbc')](cmHopper[_0xa6e9('0xc3')](_0x5f3801,_0x49ab2c,_0x21b1a2))[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0xc4')));};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xc5')]=function(_0x51fad3,_0x2693a5,_0x466bf4,_0x56a5fc){return BPromise['resolve']()[_0xa6e9('0xbc')](cmHopper[_0xa6e9('0xc5')](_0x51fad3,_0x2693a5,_0x466bf4,_0x56a5fc))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xc6')]=function(_0x27b8fc,_0x1369ba,_0x191bfe){return BPromise['resolve']()[_0xa6e9('0xbc')](cmHopper[_0xa6e9('0xc6')](_0x27b8fc,_0x1369ba,_0x191bfe))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xc7')]=function(_0x2e0a34){return BPromise[_0xa6e9('0xbb')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x2e0a34))['catch'](loggerCatch(_0xa6e9('0xc8')));};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xc9')]=function(_0x47b879){return BPromise[_0xa6e9('0xbb')]()['then'](cmHopper[_0xa6e9('0xc9')](_0x47b879))['catch'](loggerCatch(_0xa6e9('0xca')));};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xcb')]=function(_0x5cbad4){return BPromise[_0xa6e9('0xbb')]()[_0xa6e9('0xbc')](cmHopperHistory[_0xa6e9('0xcb')](_0x5cbad4))[_0xa6e9('0xb4')](loggerCatch('[createHistory]\x20'));};Dialer[_0xa6e9('0x1d')]['updateOriginated']=function(_0x505c59){if(!_['isUndefined'](_0x505c59)&&_0x505c59!==null){if(_0x505c59[_0xa6e9('0x97')](_0xa6e9('0x71'))){if(_0x505c59[_0xa6e9('0x71')]>0x0){_0x505c59[_0xa6e9('0x71')]-=0x1;}else{logger['error'](_0xa6e9('0xcc'));}}}else{logger[_0xa6e9('0x94')](_0xa6e9('0xcd'));}};Dialer['prototype'][_0xa6e9('0xce')]=function(_0x56eaf0,_0xf412c7){var _0x1e3b17=this;return function(_0x39e126){_0x1e3b17[_0xa6e9('0xb6')](_0xf412c7);logger[_0xa6e9('0x94')](_0x56eaf0,util[_0xa6e9('0x93')](_0x39e126,{'showHidden':![],'depth':null}));};};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xcf')]=function(_0x3bbb9b,_0x26ae2b,_0x49928f){var _0x470e4b={'state':0x19,'statedesc':_0xa6e9('0xd0')};this[_0xa6e9('0xb6')](_0x26ae2b);this[_0xa6e9('0xd1')](_[_0xa6e9('0x89')](_0x470e4b,_['pick'](_0x49928f,['ContactId',_0xa6e9('0xd2'),_0xa6e9('0xd3'),_0xa6e9('0xd4'),_0xa6e9('0xd5')])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x3bbb9b);};Dialer[_0xa6e9('0x1d')]['isSuccess']=function(_0x2e44ab){return _0x2e44ab===_0xa6e9('0xd6');};Dialer[_0xa6e9('0x1d')]['isTrunkReachable']=function(_0x58c834){return!_[_0xa6e9('0x81')](_0x58c834)&&_0x58c834&&!_[_0xa6e9('0x81')](_0x58c834[_0xa6e9('0x3f')])&&!_[_0xa6e9('0x81')](_0x58c834[_0xa6e9('0xd7')])&&_0x58c834[_0xa6e9('0xd7')]&&(this[_0xa6e9('0x25')][util['format'](_0xa6e9('0xd8'),_0x58c834[_0xa6e9('0x3f')])][_0xa6e9('0xb2')]===_0xa6e9('0xd9')||this['trunks'][util[_0xa6e9('0x77')](_0xa6e9('0xd8'),_0x58c834[_0xa6e9('0x3f')])][_0xa6e9('0xb2')]===_0xa6e9('0xda'));};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xd1')]=function(_0xdfb0db,_0x3af3f8,_0x58aed2){this[_0xa6e9('0xcb')](_0xdfb0db)[_0xa6e9('0xb4')](loggerCatch(_0x3af3f8));this[_0xa6e9('0xc9')](_0xdfb0db)[_0xa6e9('0xb4')](loggerCatch(_0x58aed2));};Dialer[_0xa6e9('0x1d')]['syncVarSet']=function(_0x3d9315){var _0x221f87=this[_0xa6e9('0x28')][_0x3d9315[_0xa6e9('0xdb')]];var _0x52a419;if(!_[_0xa6e9('0xb0')](_0x3d9315)&&!_[_0xa6e9('0xb0')](_0x3d9315['variable'])&&!_[_0xa6e9('0xb0')](_0x3d9315['variable']['amdstatus'])&&_0x3d9315[_0xa6e9('0xdc')]==='xcally-motion-dialer'&&_0x221f87){if(_0x221f87['type']!==_0xa6e9('0x76')&&this['voiceQueues'][_0x221f87[_0xa6e9('0xb8')]][_0xa6e9('0xdd')]&&_0x3d9315['value']===_0xa6e9('0xde')){delete this[_0xa6e9('0x28')][_0x3d9315[_0xa6e9('0xdb')]];this[_0xa6e9('0xb6')](this[_0xa6e9('0x22')][_0x221f87[_0xa6e9('0xb8')]]);this['voiceQueues'][_0x221f87[_0xa6e9('0xb8')]][_0xa6e9('0x5e')]+=0x1;this['voiceQueues'][_0x221f87[_0xa6e9('0xb8')]][_0xa6e9('0x5d')]+=0x1;_0x52a419=new Hangup(_0x221f87,_0x3d9315);_0x52a419[_0xa6e9('0xa8')]=0x12;_0x52a419[_0xa6e9('0xa9')]=_0xa6e9('0xdf');_0x52a419['membername']=_0xa6e9('0xe0');this[_0xa6e9('0xd1')](_0x52a419,_0xa6e9('0xe1'),_0xa6e9('0xe2'));}if(_0x221f87[_0xa6e9('0x4f')]!==_0xa6e9('0x76')&&this['voiceQueues'][_0x221f87[_0xa6e9('0xb8')]][_0xa6e9('0xdd')]&&_0x3d9315[_0xa6e9('0xe3')]===_0xa6e9('0xe4')){var _0x56ee0b=this;return new BPromise(function(_0x567533,_0x4eb0a3){delete _0x56ee0b[_0xa6e9('0x28')][_0x3d9315[_0xa6e9('0xdb')]];_0x56ee0b[_0xa6e9('0xb6')](_0x56ee0b['voiceQueues'][_0x221f87[_0xa6e9('0xb8')]]);_0x56ee0b['voiceQueues'][_0x221f87[_0xa6e9('0xb8')]][_0xa6e9('0x5e')]+=0x1;_0x56ee0b[_0xa6e9('0x22')][_0x221f87[_0xa6e9('0xb8')]][_0xa6e9('0x5d')]+=0x1;var _0x53c649=_0x56ee0b['voiceQueues'][_0x221f87[_0xa6e9('0xb8')]];var _0x1ad4d3=new Hangup(_0x221f87,_0x3d9315);_0x1ad4d3[_0xa6e9('0xa8')]=0x13;_0x1ad4d3[_0xa6e9('0xa9')]=_0xa6e9('0xe5');_0x1ad4d3[_0xa6e9('0xe6')]=_0xa6e9('0xe0');_0x1ad4d3[_0xa6e9('0xe7')]+=0x1;_0x1ad4d3['countglobal']+=0x1;_0x1ad4d3[_0xa6e9('0xe8')]=!![];_0x56ee0b[_0xa6e9('0xcb')](_0x1ad4d3)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1ad4d3[_0xa6e9('0xe9')]+_0x1ad4d3[_0xa6e9('0xea')]+_0x1ad4d3[_0xa6e9('0xeb')]+_0x1ad4d3[_0xa6e9('0xec')]+_0x1ad4d3[_0xa6e9('0xed')]+_0x1ad4d3['countabandonedretry']+_0x1ad4d3['countmachineretry']+_0x1ad4d3['countagentrejectretry']>=_0x53c649[_0xa6e9('0xee')]){_0x56ee0b['stateGlobal'](_0x1ad4d3,_0x567533,_0x4eb0a3,_0xa6e9('0xef'));}else{if(_0x1ad4d3[_0xa6e9('0xe7')]>=_0x53c649[_0xa6e9('0xf0')]){_0x56ee0b[_0xa6e9('0xf1')](_0x1ad4d3,_0x567533,_0x4eb0a3,_0xa6e9('0xf2'));}else{_0x56ee0b['rescheduleContact']({'active':![],'countmachineretry':_0x1ad4d3[_0xa6e9('0xe7')],'scheduledat':moment()[_0xa6e9('0xf3')](_0x53c649[_0xa6e9('0xf4')],_0xa6e9('0xf5'))[_0xa6e9('0x77')](_0xa6e9('0xf6')),'ContactId':_0x1ad4d3[_0xa6e9('0xf7')],'ListId':_0x1ad4d3[_0xa6e9('0xd2')],'VoiceQueueId':_0x1ad4d3[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x1ad4d3[_0xa6e9('0xd5')]||undefined})['catch'](loggerCatch(_0xa6e9('0xf8')));_0x567533({'reschedule':0x1});}}});}if(_0x221f87['type']===_0xa6e9('0x76')&&this[_0xa6e9('0x23')][_0x221f87['queue']][_0xa6e9('0xdd')]&&_0x3d9315[_0xa6e9('0xe3')]==='HANGUP'){delete this['uniqueId'][_0x3d9315[_0xa6e9('0xdb')]];this[_0xa6e9('0xb6')](this['campaigns'][_0x221f87[_0xa6e9('0xb8')]]);_0x52a419=new Hangup(_0x221f87,_0x3d9315);_0x52a419[_0xa6e9('0xa8')]=0x12;_0x52a419[_0xa6e9('0xa9')]='HangupInAMD';_0x52a419[_0xa6e9('0xe6')]=_0xa6e9('0xe0');this[_0xa6e9('0xd1')](_0x52a419,_0xa6e9('0xf9'),_0xa6e9('0xfa'));}if(_0x221f87['type']===_0xa6e9('0x76')&&this[_0xa6e9('0x23')][_0x221f87[_0xa6e9('0xb8')]][_0xa6e9('0xdd')]&&_0x3d9315[_0xa6e9('0xe3')]==='MACHINE'){var _0x56ee0b=this;return new BPromise(function(_0x260f24,_0x3ff0c1){delete _0x56ee0b[_0xa6e9('0x28')][_0x3d9315[_0xa6e9('0xdb')]];_0x56ee0b[_0xa6e9('0xb6')](_0x56ee0b[_0xa6e9('0x23')][_0x221f87[_0xa6e9('0xb8')]]);_0x56ee0b[_0xa6e9('0x23')][_0x221f87['queue']][_0xa6e9('0x5e')]+=0x1;_0x56ee0b['campaigns'][_0x221f87[_0xa6e9('0xb8')]]['outboundAnswerAgiCallsDay']+=0x1;var _0xa23823=_0x56ee0b[_0xa6e9('0x23')][_0x221f87['queue']];var _0x13e717=new Hangup(_0x221f87,_0x3d9315);_0x13e717[_0xa6e9('0xa8')]=0x13;_0x13e717[_0xa6e9('0xa9')]='Machine';_0x13e717[_0xa6e9('0xe6')]='AMD';_0x13e717[_0xa6e9('0xe7')]+=0x1;_0x13e717['countglobal']+=0x1;_0x13e717[_0xa6e9('0xe8')]=!![];_0x56ee0b[_0xa6e9('0xcb')](_0x13e717)['catch'](loggerCatch(_0xa6e9('0xfb')));if(_0x13e717[_0xa6e9('0xe9')]+_0x13e717[_0xa6e9('0xea')]+_0x13e717[_0xa6e9('0xeb')]+_0x13e717[_0xa6e9('0xec')]+_0x13e717[_0xa6e9('0xed')]+_0x13e717[_0xa6e9('0xfc')]+_0x13e717['countmachineretry']+_0x13e717['countagentrejectretry']>=_0xa23823[_0xa6e9('0xee')]){_0x56ee0b[_0xa6e9('0xfd')](_0x13e717,_0x260f24,_0x3ff0c1,'reason19\x20machine....');}else{if(_0x13e717[_0xa6e9('0xe7')]>=_0xa23823[_0xa6e9('0xf0')]){_0x56ee0b[_0xa6e9('0xf1')](_0x13e717,_0x260f24,_0x3ff0c1,_0xa6e9('0xf2'));}else{_0x56ee0b[_0xa6e9('0xc2')]({'active':![],'countmachineretry':_0x13e717[_0xa6e9('0xe7')],'scheduledat':moment()['add'](_0xa23823[_0xa6e9('0xf4')],'minutes')[_0xa6e9('0x77')](_0xa6e9('0xf6')),'ContactId':_0x13e717[_0xa6e9('0xf7')],'ListId':_0x13e717[_0xa6e9('0xd2')],'VoiceQueueId':_0x13e717['VoiceQueueId']||undefined,'CampaignId':_0x13e717[_0xa6e9('0xd5')]||undefined})['catch'](loggerCatch(_0xa6e9('0xf8')));_0x260f24({'reschedule':0x1});}}});}}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x33')]=function(_0x2a1728){var _0x385829=this['uniqueId'][_0x2a1728['uniqueid']];var _0x20a5ec=this;var _0x1d7118;if(_0x385829&&_0x385829[_0xa6e9('0x4f')]==='ivr'){delete this[_0xa6e9('0x28')][_0x2a1728['uniqueid']];this[_0xa6e9('0xb6')](this[_0xa6e9('0x23')][_0x385829[_0xa6e9('0xb8')]]);this[_0xa6e9('0x23')][_0x385829[_0xa6e9('0xb8')]][_0xa6e9('0xfe')]+=0x1;_0x1d7118=new Hangup(_0x385829,_0x2a1728);this[_0xa6e9('0xcb')](_0x1d7118)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0xff')));this[_0xa6e9('0xc9')](_0x1d7118)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x100')));}if(_0x385829&&_0x385829[_0xa6e9('0x4f')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x385829[_0xa6e9('0xb8')]]['dialQueueProject'])){delete this[_0xa6e9('0x28')][_0x2a1728[_0xa6e9('0xdb')]];this['updateOriginated'](this[_0xa6e9('0x22')][_0x385829['queue']]);this['voiceQueues'][_0x385829['queue']][_0xa6e9('0x5e')]+=0x1;this['voiceQueues'][_0x385829[_0xa6e9('0xb8')]][_0xa6e9('0x5d')]+=0x1;_0x1d7118=new Hangup(_0x385829,_0x2a1728);_0x1d7118[_0xa6e9('0xa8')]=0x10;_0x1d7118[_0xa6e9('0xa9')]=_0xa6e9('0x101');_0x1d7118[_0xa6e9('0xe6')]=_0xa6e9('0x102');this[_0xa6e9('0xcb')](_0x1d7118)['catch'](loggerCatch(_0xa6e9('0xff')));this[_0xa6e9('0xc9')](_0x1d7118)[_0xa6e9('0xb4')](loggerCatch('[syncHangupIvr]'));}if(_0x385829&&_0x385829[_0xa6e9('0x4f')]!==_0xa6e9('0x76')&&!isNotNull(this[_0xa6e9('0x22')][_0x385829[_0xa6e9('0xb8')]][_0xa6e9('0x103')])){delete this[_0xa6e9('0x28')][_0x2a1728['uniqueid']];this[_0xa6e9('0xb6')](this[_0xa6e9('0x22')][_0x385829[_0xa6e9('0xb8')]]);this['voiceQueues'][_0x385829['queue']][_0xa6e9('0x68')]+=0x1;_0x1d7118=new Hangup(_0x385829,_0x2a1728);_0x1d7118['state']=0xc;_0x1d7118['statedesc']=_0x2a1728[_0xa6e9('0x104')];_0x1d7118['membername']='Unknow';this[_0xa6e9('0xcb')](_0x1d7118)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0xff')));this[_0xa6e9('0xc9')](_0x1d7118)['catch'](loggerCatch(_0xa6e9('0x100')));}};Dialer['prototype'][_0xa6e9('0x105')]=function(_0x58bd1a){var _0x4b1912=this[_0xa6e9('0x28')][_0x58bd1a[_0xa6e9('0xdb')]];var _0x38a532=this;if(this[_0xa6e9('0x22')][_0x58bd1a[_0xa6e9('0xb8')]]){if(_0x4b1912&&_0x4b1912[_0xa6e9('0x4f')]!==_0xa6e9('0x76')){delete this[_0xa6e9('0x28')][_0x58bd1a[_0xa6e9('0xdb')]];this[_0xa6e9('0x22')][_0x58bd1a[_0xa6e9('0xb8')]][_0xa6e9('0x5e')]+=0x1;var _0x479ba2=new AgentComplete(_0x4b1912,_0x58bd1a);if(_0x58bd1a[_0xa6e9('0x106')]==='agent'){_0x479ba2[_0xa6e9('0x107')]=this[_0xa6e9('0x22')][_0x58bd1a[_0xa6e9('0xb8')]]['dialQueueProject2']&&this[_0xa6e9('0x22')][_0x58bd1a[_0xa6e9('0xb8')]]['dialAgiAfterHangupAgent']?moment()[_0xa6e9('0x77')](_0xa6e9('0xf6')):undefined;}this['createHistory'](_0x479ba2)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x108')));this[_0xa6e9('0xc9')](_0x479ba2)[_0xa6e9('0xb4')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x2d')]=function(_0x527b27){if(this[_0xa6e9('0x22')][_0x527b27['queue']]){if(this['uniqueId'][_0x527b27['uniqueid']]&&this[_0xa6e9('0x28')][_0x527b27[_0xa6e9('0xdb')]][_0xa6e9('0x4f')]!==_0xa6e9('0x76')){this[_0xa6e9('0xb6')](this['voiceQueues'][_0x527b27[_0xa6e9('0xb8')]]);this[_0xa6e9('0x28')][_0x527b27[_0xa6e9('0xdb')]]['answertime']=moment()[_0xa6e9('0x77')](_0xa6e9('0xf6'));}}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x109')]=function(_0x1889fb){this[_0xa6e9('0xcb')](_0x1889fb)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x108')));this[_0xa6e9('0xc9')](_0x1889fb)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x10a')));};Dialer[_0xa6e9('0x1d')]['syncQueueCallerAbandon']=function(_0x3c6c88){var _0x2f9e4a=this[_0xa6e9('0x28')][_0x3c6c88[_0xa6e9('0xdb')]];var _0x2728c3=this;if(this[_0xa6e9('0x22')][_0x3c6c88[_0xa6e9('0xb8')]]){if(_0x2f9e4a&&_0x2f9e4a[_0xa6e9('0x4f')]!==_0xa6e9('0x76')){delete this[_0xa6e9('0x28')][_0x3c6c88[_0xa6e9('0xdb')]];this[_0xa6e9('0xb6')](this['voiceQueues'][_0x3c6c88['queue']]);_0x2f9e4a[_0xa6e9('0x10b')]=moment()['format'](_0xa6e9('0xf6'));var _0x5e2269=new QueueCallerAbandon(_0x2f9e4a,_0x3c6c88);if(getSeconds(_0x2f9e4a[_0xa6e9('0x10b')],_0x2f9e4a[_0xa6e9('0x10c')])>=_0x2f9e4a[_0xa6e9('0x10d')]){this[_0xa6e9('0x22')][_0x3c6c88[_0xa6e9('0xb8')]][_0xa6e9('0x6d')]+=0x1;this['voiceQueues'][_0x3c6c88[_0xa6e9('0xb8')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xa6e9('0x22')][_0x3c6c88['queue']][_0xa6e9('0x10e')]+=0x1;_0x5e2269[_0xa6e9('0xa8')]=0xa;_0x5e2269['statedesc']=_0xa6e9('0x10f');_0x5e2269[_0xa6e9('0x110')]=_0xa6e9('0x111');_0x5e2269[_0xa6e9('0x107')]=this[_0xa6e9('0x22')][_0x3c6c88['queue']][_0xa6e9('0x112')]?moment()[_0xa6e9('0x77')](_0xa6e9('0xf6')):undefined;_0x5e2269[_0xa6e9('0xed')]+=0x1;_0x5e2269[_0xa6e9('0x113')]+=0x1;if(_0x5e2269[_0xa6e9('0xed')]>=this[_0xa6e9('0x22')][_0x3c6c88[_0xa6e9('0xb8')]][_0xa6e9('0x114')]){this[_0xa6e9('0x109')](_0x5e2269);}else{this[_0xa6e9('0xc2')]({'active':![],'countdropretry':_0x5e2269[_0xa6e9('0xed')],'scheduledat':moment()[_0xa6e9('0xf3')](this[_0xa6e9('0x22')][_0x3c6c88[_0xa6e9('0xb8')]]['dialDropRetryFrequency'],_0xa6e9('0xf5'))[_0xa6e9('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f9e4a[_0xa6e9('0xf7')],'ListId':_0x2f9e4a[_0xa6e9('0xd2')],'VoiceQueueId':_0x2f9e4a[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x2f9e4a['CampaignId']||undefined})[_0xa6e9('0xb4')](loggerCatch('[rescheduleContact][Drop]'));var _0x161929=new History(_0x5e2269);_0x161929['state']=0xa;_0x161929['statedesc']=_0xa6e9('0x10f');_0x161929[_0xa6e9('0xab')]=moment()[_0xa6e9('0x77')](_0xa6e9('0xf6'));_0x161929[_0xa6e9('0xaa')]=_0x161929[_0xa6e9('0xab')];_0x161929['calleridname']=_0x5e2269[_0xa6e9('0x115')];_0x161929[_0xa6e9('0x116')]=_0x5e2269['calleridnum'];this[_0xa6e9('0xcb')](_0x161929)['catch'](loggerCatch(_0xa6e9('0x117')));}}else{this[_0xa6e9('0x22')][_0x3c6c88[_0xa6e9('0xb8')]][_0xa6e9('0x6c')]+=0x1;this[_0xa6e9('0x22')][_0x3c6c88[_0xa6e9('0xb8')]][_0xa6e9('0x63')]+=0x1;_0x5e2269['state']=0xb;_0x5e2269['statedesc']=_0xa6e9('0x118');_0x5e2269[_0xa6e9('0x110')]='CALLEREXIT';_0x5e2269[_0xa6e9('0xfc')]+=0x1;_0x5e2269['countglobal']+=0x1;if(_0x5e2269[_0xa6e9('0xfc')]>=this['voiceQueues'][_0x3c6c88[_0xa6e9('0xb8')]][_0xa6e9('0x119')]){this[_0xa6e9('0x109')](_0x5e2269);}else{this[_0xa6e9('0xc2')]({'active':![],'countabandonedretry':_0x5e2269[_0xa6e9('0xfc')],'scheduledat':moment()[_0xa6e9('0xf3')](this[_0xa6e9('0x22')][_0x3c6c88['queue']][_0xa6e9('0x11a')],_0xa6e9('0xf5'))[_0xa6e9('0x77')](_0xa6e9('0xf6')),'ContactId':_0x2f9e4a['ContactId'],'ListId':_0x2f9e4a[_0xa6e9('0xd2')],'VoiceQueueId':_0x2f9e4a[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x2f9e4a[_0xa6e9('0xd5')]||undefined})[_0xa6e9('0xb4')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x161929=new History(_0x5e2269);_0x161929[_0xa6e9('0xa8')]=0xb;_0x161929[_0xa6e9('0xa9')]=_0xa6e9('0x118');_0x161929[_0xa6e9('0xab')]=moment()[_0xa6e9('0x77')](_0xa6e9('0xf6'));_0x161929['endtime']=_0x161929[_0xa6e9('0xab')];_0x161929[_0xa6e9('0x115')]=_0x5e2269['calleridname'];_0x161929[_0xa6e9('0x116')]=_0x5e2269[_0xa6e9('0x116')];this['createHistory'](_0x161929)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x11b')));}}}}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x35')]=function(_0x3b001e){if(this[_0xa6e9('0xae')][_0x3b001e[_0xa6e9('0xdb')]]){this[_0xa6e9('0xae')][_0x3b001e[_0xa6e9('0xdb')]]['channel']=_0x3b001e[_0xa6e9('0xb3')];}if(this[_0xa6e9('0x28')][_0x3b001e[_0xa6e9('0xdb')]]){this[_0xa6e9('0x28')][_0x3b001e[_0xa6e9('0xdb')]]['channel']=_0x3b001e['channel'];}};Dialer['prototype'][_0xa6e9('0x39')]=function(_0x3d6d29){if(strategy[this['voiceQueues'][this[_0xa6e9('0xae')][_0x3d6d29['actionid']][_0xa6e9('0xb8')]][_0xa6e9('0x50')]]===_0xa6e9('0x1c')){if(this[_0xa6e9('0xae')][_0x3d6d29['actionid']]&&_[_0xa6e9('0xb0')](this[_0xa6e9('0xae')][_0x3d6d29[_0xa6e9('0x11c')]][_0xa6e9('0x11d')])&&_0x3d6d29[_0xa6e9('0xb2')]==='1'&&_0x3d6d29['paused']==='0'){if(this[_0xa6e9('0x24')][_0x3d6d29[_0xa6e9('0x11e')]]){if(!this[_0xa6e9('0x24')][_0x3d6d29[_0xa6e9('0x11e')]][_0xa6e9('0x11d')]){this[_0xa6e9('0x24')][_0x3d6d29[_0xa6e9('0x11e')]][_0xa6e9('0x11d')]=!![];this['actions'][_0x3d6d29[_0xa6e9('0x11c')]]['locked']=!![];this['actions'][_0x3d6d29['actionid']][_0xa6e9('0x11e')]=_0x3d6d29[_0xa6e9('0x11e')];}}}}else if((strategy[this[_0xa6e9('0x22')][this[_0xa6e9('0xae')][_0x3d6d29[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]][_0xa6e9('0x50')]]||'rrmemory')===_0xa6e9('0x1b')){if(this[_0xa6e9('0xae')][_0x3d6d29[_0xa6e9('0x11c')]]){if(this[_0xa6e9('0x24')][_0x3d6d29[_0xa6e9('0x11e')]]){this[_0xa6e9('0xae')][_0x3d6d29[_0xa6e9('0x11c')]][_0xa6e9('0x11e')]=_0x3d6d29['stateinterface'];if(_['isNil'](this['queueBooked'][this['actions'][_0x3d6d29[_0xa6e9('0x11c')]]['queue']])){this[_0xa6e9('0x2a')][this[_0xa6e9('0xae')][_0x3d6d29['actionid']][_0xa6e9('0xb8')]]=[];}this[_0xa6e9('0x2a')][this[_0xa6e9('0xae')][_0x3d6d29[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]][_0xa6e9('0x11f')](_[_0xa6e9('0x89')](_['pick'](this['actions'][_0x3d6d29[_0xa6e9('0x11c')]],[_0xa6e9('0x120'),'stateinterface']),{'status':_0x3d6d29[_0xa6e9('0xb2')],'paused':_0x3d6d29[_0xa6e9('0x121')]}));}}}};function unlockQueueStatus(_0x2e7090,_0x439fce){setTimeout(function(){if(_[_0xa6e9('0x81')](_0x2e7090[_0xa6e9('0x122')])){loggerBooked[_0xa6e9('0x94')](_0xa6e9('0x123'),_0x439fce);}_0x2e7090['queueStatusComplete']=!![];loggerBooked['info'](_0xa6e9('0x124'),_0x439fce,JSON[_0xa6e9('0x4a')](_[_0xa6e9('0x125')](_0x2e7090,[_0xa6e9('0x3f'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xa6e9('0x1d')][_0xa6e9('0x3b')]=function(_0x45fa55){var _0x3fe3cd=this;var _0x175dad=_0x3fe3cd[_0xa6e9('0x22')][_0x3fe3cd[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]];if(strategy[this[_0xa6e9('0x22')][this['actions'][_0x45fa55['actionid']][_0xa6e9('0xb8')]][_0xa6e9('0x50')]]===_0xa6e9('0x1c')){if(this[_0xa6e9('0xae')][_0x45fa55['actionid']]&&this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0x11e')]){this[_0xa6e9('0x8f')]['run'](this[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0x120')],this['actions'][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0x11e')])[_0xa6e9('0xb4')](function(_0x5e600f){logger['error'](_0xa6e9('0x126'),util[_0xa6e9('0x93')](_0x5e600f,{'showHidden':![],'depth':null}));})[_0xa6e9('0x20')](function(){_0x3fe3cd['updateOriginated'](_0x3fe3cd[_0xa6e9('0x22')][_0x3fe3cd[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]]);_0x3fe3cd[_0xa6e9('0x24')][_0x3fe3cd[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0x11e')]]['locked']=![];delete _0x3fe3cd[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]];unlockQueueStatus(_0x175dad);});}else{this[_0xa6e9('0xb6')](this[_0xa6e9('0x22')][this[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0xb8')]]);this[_0xa6e9('0xc2')]({'active':![],'ContactId':this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xf7')],'ListId':this[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0xd2')],'VoiceQueueId':this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xd4')]||undefined,'CampaignId':this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xd5')]||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x127')));delete this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]];unlockQueueStatus(_0x175dad);}}else if((strategy[this[_0xa6e9('0x22')][this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]][_0xa6e9('0x50')]]||_0xa6e9('0x1b'))===_0xa6e9('0x1b')){var _0x468516;if(this['actions'][_0x45fa55[_0xa6e9('0x11c')]]&&!_['isEmpty'](this[_0xa6e9('0x2a')][this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]])){if(this[_0xa6e9('0x2b')][_0x3fe3cd['actions'][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]]){this[_0xa6e9('0x2b')][_0x3fe3cd[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]]['queue']]=this[_0xa6e9('0x2b')][this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]]['queue']]?this[_0xa6e9('0x2b')][this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]]['queue']]:this['queueBooked'][this[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0xb8')]]?this[_0xa6e9('0x2a')][this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]][_0xa6e9('0x128')]||0x0:0x0;}this[_0xa6e9('0x2a')][this[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0xb8')]]['_rr']=this[_0xa6e9('0x2b')][this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]];for(var _0x3e60c8=0x0;_0x3e60c8<this[_0xa6e9('0x2a')][this['actions'][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]][_0xa6e9('0x96')];_0x3e60c8+=0x1){_0x468516=rr(this[_0xa6e9('0x2a')][this['actions'][_0x45fa55['actionid']][_0xa6e9('0xb8')]]);this[_0xa6e9('0x2b')][_0x3fe3cd[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0xb8')]]=this['queueBooked'][this[_0xa6e9('0xae')][_0x45fa55['actionid']]['queue']][_0xa6e9('0x128')];if(_0x468516[_0xa6e9('0xb2')]==='1'&&_0x468516['paused']==='0'){break;}}if(!_[_0xa6e9('0xb0')](_0x468516)){this[_0xa6e9('0x24')][_0x468516['stateinterface']][_0xa6e9('0x129')]=_['isUndefined'](this[_0xa6e9('0x24')][_0x468516[_0xa6e9('0x11e')]][_0xa6e9('0x129')])?!![]:this[_0xa6e9('0x24')][_0x468516[_0xa6e9('0x11e')]]['unlockRR'];}loggerBooked[_0xa6e9('0x79')](_0xa6e9('0x12a'),_0x45fa55[_0xa6e9('0x11c')],_0xa6e9('0x12b'),JSON[_0xa6e9('0x4a')](_[_0xa6e9('0x125')](this[_0xa6e9('0x24')][_0x468516[_0xa6e9('0x11e')]],[_0xa6e9('0x3f'),'unlockRR'])),_0xa6e9('0x12c'),JSON[_0xa6e9('0x4a')](_0x468516['idHopper']));if(!_[_0xa6e9('0xb0')](_0x468516)&&_0x468516[_0xa6e9('0xb2')]==='1'&&_0x468516[_0xa6e9('0x121')]==='0'&&this['agents'][_0x468516['stateinterface']][_0xa6e9('0x129')]){this['agents'][_0x468516['stateinterface']][_0xa6e9('0x129')]=![];this['queueBooked'][_0x3fe3cd[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]]=[];this[_0xa6e9('0x8f')][_0xa6e9('0x12d')](_0x468516['idHopper'],_0x468516[_0xa6e9('0x11e')])['catch'](function(_0x4159ab){logger[_0xa6e9('0x94')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xa6e9('0x93')](_0x4159ab,{'showHidden':![],'depth':null}));})[_0xa6e9('0x20')](function(){_0x3fe3cd[_0xa6e9('0xb6')](_0x3fe3cd[_0xa6e9('0x22')][_0x3fe3cd['actions'][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]]);setTimeout(function(){_0x3fe3cd['agents'][_0x468516[_0xa6e9('0x11e')]][_0xa6e9('0x129')]=!![];loggerBooked['info'](_0xa6e9('0x12e'),_0x45fa55[_0xa6e9('0x11c')],_0xa6e9('0x12b'),JSON[_0xa6e9('0x4a')](_[_0xa6e9('0x125')](_0x3fe3cd[_0xa6e9('0x24')][_0x468516[_0xa6e9('0x11e')]],[_0xa6e9('0x3f'),_0xa6e9('0x129')])),'contactAgent-idHopper:\x20',JSON[_0xa6e9('0x4a')](_0x468516['idHopper']));},0xc7);delete _0x3fe3cd['actions'][_0x45fa55[_0xa6e9('0x11c')]];unlockQueueStatus(_0x175dad,_0x45fa55['actionid']);});}else{loggerBooked[_0xa6e9('0x79')](_0xa6e9('0x12f'));this['updateOriginated'](this[_0xa6e9('0x22')][this[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0xb8')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0xf7')],'ListId':this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xd2')],'VoiceQueueId':this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xd4')]||undefined,'CampaignId':this['actions'][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xd5')]||undefined})[_0xa6e9('0xb4')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]];unlockQueueStatus(_0x175dad);}}else{loggerBooked['info'](_0xa6e9('0x130'));this[_0xa6e9('0xb6')](this['voiceQueues'][this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]]);this[_0xa6e9('0xc2')]({'active':![],'ContactId':this['actions'][_0x45fa55['actionid']][_0xa6e9('0xf7')],'ListId':this['actions'][_0x45fa55[_0xa6e9('0x11c')]]['ListId'],'VoiceQueueId':this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xd4')]||undefined,'CampaignId':this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xd5')]||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x131')));delete this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]];unlockQueueStatus(_0x175dad);}}else{loggerBooked['info']('[booked][unlock3]');this[_0xa6e9('0xb6')](this[_0xa6e9('0x22')][this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xb8')]]);this[_0xa6e9('0xc2')]({'active':![],'ContactId':this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]][_0xa6e9('0xf7')],'ListId':this[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0xd2')],'VoiceQueueId':this[_0xa6e9('0xae')][_0x45fa55['actionid']][_0xa6e9('0xd4')]||undefined,'CampaignId':this['actions'][_0x45fa55[_0xa6e9('0x11c')]]['CampaignId']||undefined})[_0xa6e9('0xb4')](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0xa6e9('0xae')][_0x45fa55[_0xa6e9('0x11c')]];unlockQueueStatus(_0x175dad);}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x3c')]=function(){var _0x3310b0=this;setInterval(function(){_0x3310b0[_0xa6e9('0x132')]();},0x3e8);};Dialer[_0xa6e9('0x1d')]['checkIsTrunkReachable']=function(_0x52a8d7){var _0x4a04ff=this;return function(){if(!_0x4a04ff[_0xa6e9('0x133')](_0x52a8d7[_0xa6e9('0x75')])){if(!_0x4a04ff['isTrunkReachable'](_0x52a8d7[_0xa6e9('0x134')])){_0x52a8d7[_0xa6e9('0x41')]=_0xa6e9('0x135');throw _0x52a8d7[_0xa6e9('0x3f')]+_0xa6e9('0x136');}}};};Dialer['prototype'][_0xa6e9('0x137')]=function(_0xb9abac,_0x3e5f2e,_0x27e0ab,_0x252ca8){var _0x2d8990=this;return function(){var _0x18bf0d=!![];return _0x2d8990[_0xa6e9('0x138')](_0xb9abac,_0x3e5f2e,_0x27e0ab,_0x252ca8,_0x18bf0d);};};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x139')]=function(_0x18a942,_0x309552,_0x36bb98,_0x2df662){var _0x39ca41=this;return function(){var _0x4ec942=![];return _0x39ca41['ifTime'](_0x18a942[_0xa6e9('0x47')],_0x309552,_0x36bb98,_0x2df662,_0x4ec942);};};Dialer['prototype']['ifTime']=function(_0x46abd1,_0x1f5efd,_0x3e939e,_0x450f72,_0x3305b7){var _0x18dfd4=[];return new BPromise(function(_0x501a2e,_0x8bab5c){if(!isNotNull(_0x46abd1)){_0x450f72[_0xa6e9('0x41')]='INTERVAL_IS_NULL';return _0x8bab5c(msgResponse(_0xa6e9('0x138'),_0xa6e9('0x13a'),_0x3e939e+_0xa6e9('0x13b')));}if(_[_0xa6e9('0x91')](_0x46abd1)){_0x450f72['message']=_0xa6e9('0x13c');return _0x8bab5c(msgResponse('ifTime','Failure',_0x3e939e+'\x20Intervals\x20is\x20empty\x20'));}if(_0x1f5efd&&_[_0xa6e9('0x81')](config['timezones'][_0x1f5efd])){_0x450f72[_0xa6e9('0x41')]=_0xa6e9('0x13d');return _0x8bab5c(msgResponse(_0xa6e9('0x138'),_0xa6e9('0x13a'),_0x3e939e+_0xa6e9('0x13e')+_0x1f5efd));}if(_[_0xa6e9('0x13f')](_0x46abd1)){for(var _0x54fbf9=0x0;_0x54fbf9<_0x46abd1['length'];_0x54fbf9+=0x1){_0x18dfd4[_0xa6e9('0x11f')](ami[_0xa6e9('0xb1')]({'action':_0xa6e9('0x140'),'command':util[_0xa6e9('0x77')](_0xa6e9('0x141'),_0x46abd1[_0x54fbf9]['interval'],!_['isUndefined'](config[_0xa6e9('0x142')][_0x1f5efd])?_0x1f5efd:'')})[_0xa6e9('0xbc')](function(_0xb8869b){return _0xb8869b[_0xa6e9('0x143')][_0xa6e9('0x144')](_0xa6e9('0x145'))>=0x0?!![]:![];})[_0xa6e9('0xb4')](myreject(_0x8bab5c)));}}else{_0x18dfd4['push'](ami[_0xa6e9('0xb1')]({'action':_0xa6e9('0x140'),'command':util[_0xa6e9('0x77')](_0xa6e9('0x141'),_0x46abd1,!_['isUndefined'](config[_0xa6e9('0x142')][_0x1f5efd])?_0x1f5efd:'')})[_0xa6e9('0xbc')](function(_0x40b7f6){return _0x40b7f6[_0xa6e9('0x143')][_0xa6e9('0x144')](_0xa6e9('0x145'))>=0x0?!![]:![];})[_0xa6e9('0xb4')](myreject(_0x8bab5c)));}BPromise[_0xa6e9('0x146')](_0x18dfd4)['then'](function(_0x3d3440){var _0x1f841a=_[_0xa6e9('0x147')](_0x3d3440);if(_0x1f841a){return _0x501a2e(_0x1f841a);}else{_0x450f72[_0xa6e9('0x41')]=_0x3305b7?_0xa6e9('0x148'):_0xa6e9('0x149');return _0x8bab5c(msgResponse('[ifTime][promiseAll]',_0xa6e9('0x13a'),_0xa6e9('0x14a')+_0x3305b7+'\x20'+_0x3e939e+'\x20Interval\x20is\x20overtime:\x20'+util[_0xa6e9('0x93')](_0x46abd1,{'showHidden':![],'depth':null})+_0xa6e9('0x14b')+_0x1f5efd));}})[_0xa6e9('0xb4')](function(_0x4363ff){return _0x8bab5c(msgResponse(_0xa6e9('0x138'),_0xa6e9('0x13a'),JSON['stringify'](_0x4363ff)));});});};Dialer[_0xa6e9('0x1d')]['checkDialMethod']=function(_0x5ae5ab){var _0x219fc3=this;return function(){switch(_0x5ae5ab[_0xa6e9('0x5a')]){case'progressive':freeVariablesPredictive(_0x5ae5ab);_0x219fc3[_0xa6e9('0x14c')](_0x5ae5ab,0x1);break;case _0xa6e9('0x14d'):freeVariablesPredictive(_0x5ae5ab);_0x219fc3['handlePower'](_0x5ae5ab,_0x5ae5ab[_0xa6e9('0x14e')]);break;case _0xa6e9('0x9'):_0x219fc3[_0xa6e9('0x9')](_0x5ae5ab);break;case _0xa6e9('0x14f'):freeVariablesPredictive(_0x5ae5ab);_0x219fc3[_0xa6e9('0x14c')](_0x5ae5ab,0x1);break;default:freeVariablesPredictive(_0x5ae5ab);logger[_0xa6e9('0x94')](_0xa6e9('0x150'),_0x5ae5ab[_0xa6e9('0x3f')],_0xa6e9('0x151'));}};};Dialer['prototype'][_0xa6e9('0x152')]=function(_0x2d324d){var _0x59d6a8=this;return function(){_0x59d6a8[_0xa6e9('0x153')](_0x2d324d);};};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xb')]=function(_0x5becb1){var _0x965093=this;if(isNotPreview(_0x5becb1[_0xa6e9('0x5a')])){if(isVoiceQueueOutbound(_0x5becb1[_0xa6e9('0x4f')])&&isActive(_0x5becb1[_0xa6e9('0x59')])){_0x5becb1[_0xa6e9('0x9f')]=!![];BPromise[_0xa6e9('0xbb')]()[_0xa6e9('0xbc')](checkIsLoggedIn(_0x5becb1,_0x5becb1[_0xa6e9('0x52')]))['then'](checkIsActive(_0x5becb1,_0x5becb1[_0xa6e9('0x59')]))[_0xa6e9('0xbc')](checkInterval(_0x5becb1))[_0xa6e9('0xbc')](_0x965093[_0xa6e9('0x154')](_0x5becb1))[_0xa6e9('0xbc')](_0x965093[_0xa6e9('0x137')](_0x5becb1[_0xa6e9('0x155')],_0x5becb1[_0xa6e9('0x156')],_0x5becb1[_0xa6e9('0x3f')],_0x5becb1))[_0xa6e9('0xbc')](_0x965093[_0xa6e9('0x139')](_0x5becb1[_0xa6e9('0x46')],_0x5becb1[_0xa6e9('0x156')],_0x5becb1[_0xa6e9('0x3f')],_0x5becb1))[_0xa6e9('0xbc')](_0x965093[_0xa6e9('0x157')](_0x5becb1))[_0xa6e9('0xb4')](loggerCatchQueueSummary('[syncQueueSummary]',_0x5becb1));}else{notSendMessagesQueue(_0x5becb1);}}else{freeVariablesPredictive(_0x5becb1);}};Dialer[_0xa6e9('0x1d')]['syncCampaigns']=function(){var _0x10c195=this;var _0x390cd0;for(var _0xd3592d in this[_0xa6e9('0x23')]){if(this[_0xa6e9('0x23')][_0xa6e9('0x97')](_0xd3592d)){_0x390cd0=this[_0xa6e9('0x23')][_0xd3592d];if(isCampaignIvr(_0x390cd0[_0xa6e9('0x4f')])&&isActive(_0x390cd0[_0xa6e9('0xd7')])){_0x390cd0['sendMessageOneNotActive']=!![];BPromise[_0xa6e9('0xbb')]()['then'](checkIsActive(_0x390cd0,_0x390cd0[_0xa6e9('0xd7')]))[_0xa6e9('0xbc')](checkInterval(_0x390cd0))[_0xa6e9('0xbc')](_0x10c195[_0xa6e9('0x154')](_0x390cd0))[_0xa6e9('0xbc')](_0x10c195['checkIfTime'](_0x390cd0[_0xa6e9('0x155')],_0x390cd0[_0xa6e9('0x156')],_0x390cd0[_0xa6e9('0x3f')],_0x390cd0))['then'](_0x10c195[_0xa6e9('0x139')](_0x390cd0['Interval'],_0x390cd0['dialTimezone'],_0x390cd0[_0xa6e9('0x3f')],_0x390cd0))['then'](_0x10c195[_0xa6e9('0x152')](_0x390cd0))[_0xa6e9('0xb4')](loggerCatchQueueSummary(_0xa6e9('0x158'),_0x390cd0));}else{notSendMessagesCampaign(_0x390cd0);}}}};function getCallerIdRandom(_0x435e67,_0x1ad6d7){var _0x26e64d,_0x4e2fd1,_0x188527;if(_0x1ad6d7<=0x0){_0x1ad6d7=0x1;}_0x26e64d=new RegExp(_0xa6e9('0x159')+_0x1ad6d7+'}$');_0x4e2fd1=Math[_0xa6e9('0x15a')](0xa,_0x1ad6d7-0x1);_0x188527=Math['pow'](0xa,_0x1ad6d7)-0x1;return util[_0xa6e9('0x77')]('%s',_['replace'](_0x435e67,_0x26e64d,_[_0xa6e9('0x15b')](_0x4e2fd1,_0x188527)));}function extractCalleridName(_0x1358c8){var _0x7acd32=_0x1358c8[_0xa6e9('0x15c')](/"(.*?)"/);return _0x7acd32?_0x7acd32[0x1]:_0x1358c8;}function extractCalleridNumber(_0x3ec3b1){var _0x2edd82=_0x3ec3b1['match'](/<(.*?)>/);return _0x2edd82?_0x2edd82[0x1]:_0x3ec3b1;}Dialer[_0xa6e9('0x1d')][_0xa6e9('0x15d')]=function(_0x4c2ff1,_0x207bad){var _0x1ba047=this;var _0x6bdd7b=uuid['v4']();this[_0xa6e9('0xae')][_0x6bdd7b]=new Action(_0x4c2ff1,_0x207bad,_0x6bdd7b);return new BPromise(function(_0x3aebd4,_0x1a5bb8){if(_[_0xa6e9('0x81')](_0x4c2ff1)&&_0xa6e9('0x15e')!==typeof _0x4c2ff1){return _0x1a5bb8(msgResponse('originate',_0xa6e9('0x13a'),_0xa6e9('0x15f')));}if(_[_0xa6e9('0x81')](_0x207bad[_0xa6e9('0x160')][_0xa6e9('0x161')])||_0x207bad[_0xa6e9('0x160')][_0xa6e9('0x161')]===null){return _0x1a5bb8(msgResponse(_0xa6e9('0x162'),_0xa6e9('0x13a'),_0xa6e9('0x163')));}var _0x595847={'XMD-CALLERID':_0x1ba047[_0xa6e9('0xae')][_0x6bdd7b]['getCaller'](),'XMD-AGI':_0x4c2ff1[_0xa6e9('0x103')]?util[_0xa6e9('0x77')](_0xa6e9('0x164'),ipAgi,_0x4c2ff1[_0xa6e9('0x103')]):_0xa6e9('0x165'),'XMD-AGIAFTER':_0x4c2ff1['dialQueueProject2']?util[_0xa6e9('0x77')](_0xa6e9('0x164'),ipAgi,_0x4c2ff1[_0xa6e9('0x112')]):_0xa6e9('0x165'),'XMD-QUEUE':_0x4c2ff1[_0xa6e9('0x4f')]===_0xa6e9('0x8e')?util['format'](_0xa6e9('0x166'),_0x4c2ff1['name'],_0x4c2ff1[_0xa6e9('0x167')]||'',_0x4c2ff1[_0xa6e9('0x168')]?'c':'',_0x4c2ff1[_0xa6e9('0x10d')]||0x3):'NONE','XMD-CONTACTID':_0x207bad[_0xa6e9('0xf7')],'XMD-CDRTYPE':_0xa6e9('0x169'),'CALLERID(all)':_0x1ba047[_0xa6e9('0xae')][_0x6bdd7b][_0xa6e9('0x16a')](),'XMD-AMD':_0x4c2ff1[_0xa6e9('0xdd')]?'ACTIVE':_0xa6e9('0x165'),'XMD-DESTINATION':_0xa6e9('0x16b')};if(_0x4c2ff1[_0xa6e9('0xdd')]){_0x595847[_0xa6e9('0x16c')]=_0x4c2ff1['dialAMDInitialSilence']||0x9c4;_0x595847['XMD-AMDGREETING']=_0x4c2ff1[_0xa6e9('0x16d')]||0x5dc;_0x595847['XMD-AMDAFTERGREETINGSILENCE']=_0x4c2ff1[_0xa6e9('0x16e')]||0x320;_0x595847[_0xa6e9('0x16f')]=_0x4c2ff1[_0xa6e9('0x170')]||0x1388;_0x595847[_0xa6e9('0x171')]=_0x4c2ff1[_0xa6e9('0x172')]||0x64;_0x595847[_0xa6e9('0x173')]=_0x4c2ff1[_0xa6e9('0x174')]||0x32;_0x595847['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x4c2ff1['dialAMDMaximumNumberOfWords']||0x3;_0x595847[_0xa6e9('0x175')]=_0x4c2ff1['dialAMDSilenceThreshold']||0x100;_0x595847[_0xa6e9('0x176')]=_0x4c2ff1[_0xa6e9('0x177')]||0x1388;}if(_0x4c2ff1['type']==='outbound'){_0x595847[_0xa6e9('0x178')]=_0x207bad[_0xa6e9('0xd4')];}else{_0x595847[_0xa6e9('0x179')]=_0x207bad[_0xa6e9('0xd5')];}for(var _0x5bcb34 in _0x207bad['Contact']){if(_0x207bad[_0xa6e9('0x160')][_0xa6e9('0x97')](_0x5bcb34)){if(isNotNull(_0x207bad[_0xa6e9('0x160')][_0x5bcb34])&&_0x5bcb34!=='id'&&_0x5bcb34!==_0xa6e9('0x17a')&&_0x5bcb34!==_0xa6e9('0x17b')&&_0x5bcb34!==_0xa6e9('0x17c')){_0x595847[util[_0xa6e9('0x77')](_0xa6e9('0x17d'),_0xa6e9('0x17e'),_['toUpper'](_0x5bcb34))]=_0x207bad['Contact'][_0x5bcb34];}}}var _0x27af2b=_0x1ba047[_0xa6e9('0x133')](_0x4c2ff1['Trunk'])?getCallerId(_0x4c2ff1[_0xa6e9('0x75')][_0xa6e9('0x17f')],_0x4c2ff1[_0xa6e9('0x5b')],_0x4c2ff1[_0xa6e9('0x180')]>0x0?getCallerIdRandom(_0x4c2ff1[_0xa6e9('0x181')],_0x4c2ff1['dialRandomLastDigitCallerIdNumber']):_0x4c2ff1['dialOriginateCallerIdNumber']):getCallerId(_[_0xa6e9('0xb0')](_0x4c2ff1[_0xa6e9('0x134')])?_0x4c2ff1[_0xa6e9('0x75')][_0xa6e9('0x17f')]:_0x4c2ff1[_0xa6e9('0x134')][_0xa6e9('0x17f')],_0x4c2ff1['dialOriginateCallerIdName'],_0x4c2ff1[_0xa6e9('0x180')]>0x0?getCallerIdRandom(_0x4c2ff1[_0xa6e9('0x181')],_0x4c2ff1[_0xa6e9('0x180')]):_0x4c2ff1[_0xa6e9('0x181')]);if(_0x27af2b){_0x595847[_0xa6e9('0x182')]=_0x1ba047[_0xa6e9('0xae')][_0x6bdd7b]['originatecalleridname']=extractCalleridName(_0x27af2b);_0x595847[_0xa6e9('0x183')]=_0x1ba047[_0xa6e9('0xae')][_0x6bdd7b][_0xa6e9('0x184')]=extractCalleridNumber(_0x27af2b);}return ami[_0xa6e9('0xb1')]({'actionid':_0x6bdd7b,'action':_0xa6e9('0x162'),'channel':_0x1ba047['isTrunkReachable'](_0x4c2ff1[_0xa6e9('0x75')])?util[_0xa6e9('0x77')](_0xa6e9('0x185'),_0x4c2ff1['Trunk'][_0xa6e9('0x3f')],isNotNull(_0x4c2ff1[_0xa6e9('0x5c')])?_0x4c2ff1[_0xa6e9('0x5c')][_0xa6e9('0x186')]()||'':'',_0x4c2ff1[_0xa6e9('0x187')]>0x0?_0x207bad['Contact'][_0xa6e9('0x161')][_0xa6e9('0x188')](_0x4c2ff1['dialCutDigit']):_0x207bad[_0xa6e9('0x160')][_0xa6e9('0x161')]):util[_0xa6e9('0x77')](_0xa6e9('0x185'),_[_0xa6e9('0xb0')](_0x4c2ff1[_0xa6e9('0x134')])?_0x4c2ff1['Trunk']['name']:_0x4c2ff1[_0xa6e9('0x134')][_0xa6e9('0x3f')],isNotNull(_0x4c2ff1[_0xa6e9('0x5c')])?_0x4c2ff1[_0xa6e9('0x5c')][_0xa6e9('0x186')]()||'':'',_0x4c2ff1[_0xa6e9('0x187')]>0x0?_0x207bad['Contact'][_0xa6e9('0x161')][_0xa6e9('0x188')](_0x4c2ff1[_0xa6e9('0x187')]):_0x207bad[_0xa6e9('0x160')]['phone']),'callerid':_0x27af2b,'Exten':_0xa6e9('0x16b'),'Context':'from-sip','Priority':'1','variable':_0x595847,'timeout':(_0x4c2ff1[_0xa6e9('0x189')]||0x1e)*0x3e8,'async':!![],'channelid':_0x6bdd7b})[_0xa6e9('0xbc')](function(_0x39ce57){return _0x3aebd4(_0x39ce57);})[_0xa6e9('0xb4')](function(_0x586256){_0x4c2ff1[_0xa6e9('0x67')]+=0x1;var _0x37aae2=new History(_0x1ba047['actions'][_0x6bdd7b]);logger[_0xa6e9('0x94')](util[_0xa6e9('0x77')]('[originateError]:\x20%s',JSON[_0xa6e9('0x4a')](_0x586256)));_0x37aae2[_0xa6e9('0xa8')]=0xe;_0x37aae2['statedesc']='OriginateError';_0x37aae2[_0xa6e9('0xab')]=moment()[_0xa6e9('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x37aae2[_0xa6e9('0xaa')]=_0x37aae2[_0xa6e9('0xab')];_0x1ba047[_0xa6e9('0xcb')](_0x37aae2)['catch'](loggerCatch(_0xa6e9('0x18a')));_0x1ba047[_0xa6e9('0xc9')](_0x37aae2)[_0xa6e9('0xb4')](loggerCatch('[originate][error]'))[_0xa6e9('0x20')](function(){delete _0x1ba047[_0xa6e9('0xae')][_0x6bdd7b];return _0x1a5bb8(msgResponse(_0xa6e9('0x162'),_0xa6e9('0x49'),_0xa6e9('0x18b')));});});});};Dialer['prototype'][_0xa6e9('0x31')]=function(_0x1b276b){var _0xb3008b=this[_0xa6e9('0xae')][_0x1b276b[_0xa6e9('0x11c')]];var _0xc7cfee=this;if(_0xb3008b){delete this[_0xa6e9('0xae')][_0x1b276b[_0xa6e9('0x11c')]];_0xb3008b[_0xa6e9('0x10c')]=moment()[_0xa6e9('0x77')](_0xa6e9('0xf6'));var _0x454dcf=_0xb3008b['type']==='ivr'?this[_0xa6e9('0x23')][_0xb3008b[_0xa6e9('0xb8')]]:this['voiceQueues'][_0xb3008b[_0xa6e9('0x18c')]()];if(!this[_0xa6e9('0x18d')](_0x1b276b[_0xa6e9('0x18e')])){this[_0xa6e9('0xb6')](_0x454dcf);return this[_0xa6e9('0x18f')](_0xb3008b,_0x454dcf,_0x1b276b)[_0xa6e9('0xbc')](function(_0x5e2b7e){})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x190')));}else{this[_0xa6e9('0x28')][_0x1b276b[_0xa6e9('0xdb')]]=_0xb3008b;}}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x191')]=function(_0x3a75b0,_0x37efb7,_0x2a1a80){var _0x281104=new History(_0x37efb7);if(_0x281104[_0xa6e9('0xe9')]+_0x281104[_0xa6e9('0xea')]+_0x281104[_0xa6e9('0xeb')]+_0x281104['countnosuchnumberretry']+_0x281104['countdropretry']+_0x281104['countabandonedretry']+_0x281104[_0xa6e9('0xe7')]+_0x281104[_0xa6e9('0x192')]>=_0x2a1a80['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x3a75b0){case 0x3:if(_0x281104[_0xa6e9('0xeb')]>=_0x2a1a80[_0xa6e9('0x193')]-0x1){return!![];}else{this[_0xa6e9('0xc2')]({'active':![],'countnoanswerretry':_0x281104[_0xa6e9('0xeb')]+=0x1,'scheduledat':moment()[_0xa6e9('0xf3')](_0x2a1a80[_0xa6e9('0x194')],_0xa6e9('0xf5'))[_0xa6e9('0x77')](_0xa6e9('0xf6')),'ContactId':_0x281104['ContactId'],'ListId':_0x281104['ListId'],'VoiceQueueId':_0x281104[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x281104[_0xa6e9('0xd5')]||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x195')));}break;case 0x5:if(_0x281104['countbusyretry']>=_0x2a1a80['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xa6e9('0xc2')]({'active':![],'countbusyretry':_0x281104[_0xa6e9('0xe9')]+=0x1,'scheduledat':moment()[_0xa6e9('0xf3')](_0x2a1a80[_0xa6e9('0x196')],'minutes')[_0xa6e9('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x281104[_0xa6e9('0xf7')],'ListId':_0x281104[_0xa6e9('0xd2')],'VoiceQueueId':_0x281104[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x281104[_0xa6e9('0xd5')]||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x197')));}break;case 0x8:if(_0x281104['countcongestionretry']>=_0x2a1a80[_0xa6e9('0x198')]-0x1){return!![];}else{this[_0xa6e9('0xc2')]({'active':![],'countcongestionretry':_0x281104['countcongestionretry']+=0x1,'scheduledat':moment()[_0xa6e9('0xf3')](_0x2a1a80[_0xa6e9('0x199')],_0xa6e9('0xf5'))[_0xa6e9('0x77')](_0xa6e9('0xf6')),'ContactId':_0x281104[_0xa6e9('0xf7')],'ListId':_0x281104[_0xa6e9('0xd2')],'VoiceQueueId':_0x281104[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x281104[_0xa6e9('0xd5')]||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x19a')));}break;case 0x0:if(_0x281104[_0xa6e9('0xec')]>=_0x2a1a80[_0xa6e9('0x19b')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x281104[_0xa6e9('0xec')]+=0x1,'scheduledat':moment()[_0xa6e9('0xf3')](_0x2a1a80[_0xa6e9('0x19c')],_0xa6e9('0xf5'))['format'](_0xa6e9('0xf6')),'ContactId':_0x281104[_0xa6e9('0xf7')],'ListId':_0x281104[_0xa6e9('0xd2')],'VoiceQueueId':_0x281104[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x281104['CampaignId']||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x19d')));}break;case 0xa:if(_0x281104[_0xa6e9('0xed')]>=_0x2a1a80[_0xa6e9('0x114')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0x281104[_0xa6e9('0xed')]+=0x1,'scheduledat':moment()[_0xa6e9('0xf3')](_0x2a1a80['dialDropRetryFrequency'],_0xa6e9('0xf5'))[_0xa6e9('0x77')](_0xa6e9('0xf6')),'ContactId':_0x281104[_0xa6e9('0xf7')],'ListId':_0x281104[_0xa6e9('0xd2')],'VoiceQueueId':_0x281104[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x281104['CampaignId']||undefined})['catch'](loggerCatch(_0xa6e9('0x19e')));}break;case 0xb:if(_0x281104[_0xa6e9('0xfc')]>=_0x2a1a80[_0xa6e9('0x119')]-0x1){return!![];}else{this[_0xa6e9('0xc2')]({'active':![],'countabandonedretry':_0x281104[_0xa6e9('0xfc')]+=0x1,'scheduledat':moment()[_0xa6e9('0xf3')](_0x2a1a80[_0xa6e9('0x11a')],_0xa6e9('0xf5'))[_0xa6e9('0x77')](_0xa6e9('0xf6')),'ContactId':_0x281104[_0xa6e9('0xf7')],'ListId':_0x281104[_0xa6e9('0xd2')],'VoiceQueueId':_0x281104[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x281104[_0xa6e9('0xd5')]||undefined})[_0xa6e9('0xb4')](loggerCatch('[rescheduleContact][Abandoned]'));}break;case 0x13:if(_0x281104[_0xa6e9('0xe7')]>=_0x2a1a80[_0xa6e9('0xf0')]-0x1){return!![];}else{this[_0xa6e9('0xc2')]({'active':![],'countmachineretry':_0x281104[_0xa6e9('0xe7')]+=0x1,'scheduledat':moment()[_0xa6e9('0xf3')](_0x2a1a80[_0xa6e9('0xf4')],_0xa6e9('0xf5'))[_0xa6e9('0x77')](_0xa6e9('0xf6')),'ContactId':_0x281104['ContactId'],'ListId':_0x281104[_0xa6e9('0xd2')],'VoiceQueueId':_0x281104[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x281104['CampaignId']||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0xf8')));}break;case 0x14:if(_0x281104[_0xa6e9('0x192')]>=_0x2a1a80[_0xa6e9('0x19f')]-0x1){return!![];}else{this[_0xa6e9('0xc2')]({'active':![],'countagentrejectretry':_0x281104[_0xa6e9('0x192')]+=0x1,'scheduledat':moment()[_0xa6e9('0xf3')](_0x2a1a80[_0xa6e9('0x1a0')],'minutes')[_0xa6e9('0x77')](_0xa6e9('0xf6')),'ContactId':_0x281104[_0xa6e9('0xf7')],'ListId':_0x281104[_0xa6e9('0xd2')],'VoiceQueueId':_0x281104[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x281104['CampaignId']||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x1a1')));}break;default:return!![];}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x18f')]=function(_0x2f6865,_0x4562f6,_0x1a3fd0){var _0x4d2de6=this;var _0x5f3650=new History(_0x2f6865);return new BPromise(function(_0x1c8ab7,_0x147052){if(_['isUndefined'](_0x4562f6)&&_0xa6e9('0x15e')!==typeof _0x4562f6){return _0x147052(msgResponse(_0xa6e9('0x1a2'),_0xa6e9('0x13a'),'entity\x20is\x20undefine'));}if(_['isUndefined'](_0x1a3fd0)&&'object'!==typeof _0x1a3fd0){return _0x147052(msgResponse(_0xa6e9('0x1a2'),'Failure','evt\x20is\x20undefine'));}switch(_0x1a3fd0[_0xa6e9('0x106')]){case'0':_0x4562f6[_0xa6e9('0x66')]+=0x1;_0x5f3650['state']=0x0;_0x5f3650[_0xa6e9('0xa9')]=_0xa6e9('0x1a3');_0x5f3650[_0xa6e9('0xec')]+=0x1;_0x5f3650[_0xa6e9('0x113')]+=0x1;console['log'](_0xa6e9('0x1a4'),ut['buildObj'](_0x2f6865,_0xa6e9('0x1a5')));ami['emit'](_0xa6e9('0x1a6'),ut[_0xa6e9('0x1a7')](_0x2f6865,'nosuchnumber'));_0x4d2de6[_0xa6e9('0xcb')](_0x5f3650)[_0xa6e9('0xb4')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x4d2de6[_0xa6e9('0x191')](0x0,_0x2f6865,_0x4562f6)){if(_0x5f3650[_0xa6e9('0xec')]>=_0x4562f6[_0xa6e9('0x19b')]){_0x4d2de6['createStateFinal'](_0x5f3650,_0x1c8ab7,_0x147052,'reason\x200\x20no\x20such\x20number....');}else{_0x4d2de6[_0xa6e9('0xfd')](_0x5f3650,_0x1c8ab7,_0x147052,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x4562f6['outboundNoAnswerCallsDay']+=0x1;_0x5f3650['state']=0x3;_0x5f3650[_0xa6e9('0xa9')]=_0xa6e9('0x1a8');_0x5f3650['countnoanswerretry']+=0x1;_0x5f3650[_0xa6e9('0x113')]+=0x1;console[_0xa6e9('0x1a9')](_0xa6e9('0x1aa'),_0x1a3fd0);console[_0xa6e9('0x1a9')]('NO\x20ANSWER\x20action',_0x2f6865);console[_0xa6e9('0x1a9')](_0xa6e9('0x1ab'),_0x4562f6);console[_0xa6e9('0x1a9')](_0xa6e9('0x1ac'),_0x5f3650);console[_0xa6e9('0x1a9')]('EMITTING\x20status_noanswer\x20for',ut[_0xa6e9('0x1a7')](_0x2f6865,_0xa6e9('0x1ad')));ami['emit']('custom:status_noanswer',ut[_0xa6e9('0x1a7')](_0x2f6865,_0xa6e9('0x1ad')));_0x4d2de6['createHistory'](_0x5f3650)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x1ae')));if(_0x4d2de6[_0xa6e9('0x191')](0x3,_0x2f6865,_0x4562f6)){if(_0x5f3650['countnoanswerretry']>=_0x4562f6[_0xa6e9('0x193')]){_0x4d2de6[_0xa6e9('0xf1')](_0x5f3650,_0x1c8ab7,_0x147052,'reason\x203\x20ringing\x20no\x20answer');}else{_0x4d2de6[_0xa6e9('0xfd')](_0x5f3650,_0x1c8ab7,_0x147052,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x4562f6['outboundBusyCallsDay']+=0x1;_0x5f3650[_0xa6e9('0xa8')]=0x5;_0x5f3650[_0xa6e9('0xa9')]=_0xa6e9('0x1af');_0x5f3650['countbusyretry']+=0x1;_0x5f3650[_0xa6e9('0x113')]+=0x1;console[_0xa6e9('0x1a9')](_0xa6e9('0x1b0'),ut[_0xa6e9('0x1a7')](_0x2f6865,_0xa6e9('0x1b1')));ami[_0xa6e9('0x4e')]('custom:status_busy',ut[_0xa6e9('0x1a7')](_0x2f6865,_0xa6e9('0x1b1')));_0x4d2de6[_0xa6e9('0xcb')](_0x5f3650)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x1b2')));if(_0x4d2de6[_0xa6e9('0x191')](0x5,_0x2f6865,_0x4562f6)){if(_0x5f3650[_0xa6e9('0xe9')]>=_0x4562f6[_0xa6e9('0x1b3')]){_0x4d2de6[_0xa6e9('0xf1')](_0x5f3650,_0x1c8ab7,_0x147052,'reason\x205\x20busy');}else{_0x4d2de6['stateGlobal'](_0x5f3650,_0x1c8ab7,_0x147052,_0xa6e9('0x1b4'));}}break;case'8':_0x4562f6[_0xa6e9('0x61')]+=0x1;_0x5f3650[_0xa6e9('0xa8')]=0x8;_0x5f3650[_0xa6e9('0xa9')]=_0xa6e9('0x1b5');_0x5f3650['countcongestionretry']+=0x1;_0x5f3650[_0xa6e9('0x113')]+=0x1;_0x4d2de6['createHistory'](_0x5f3650)[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x1b6')));if(_0x4d2de6[_0xa6e9('0x191')](0x8,_0x2f6865,_0x4562f6)){if(_0x5f3650[_0xa6e9('0xea')]>=_0x4562f6[_0xa6e9('0x198')]){_0x4d2de6[_0xa6e9('0xf1')](_0x5f3650,_0x1c8ab7,_0x147052,_0xa6e9('0x1b7'));}else{_0x4d2de6['stateGlobal'](_0x5f3650,_0x1c8ab7,_0x147052,_0xa6e9('0x1b7'));}}break;case'11':_0x4562f6[_0xa6e9('0x1b8')]+=0x1;_0x5f3650[_0xa6e9('0xa8')]=0xb;_0x5f3650['statedesc']=_0xa6e9('0x118');_0x5f3650[_0xa6e9('0xfc')]+=0x1;_0x5f3650['countglobal']+=0x1;_0x4d2de6['createHistory'](_0x5f3650)['catch'](loggerCatch(_0xa6e9('0x11b')));if(_0x4d2de6['checkRetriveMax'](0xb,_0x2f6865,_0x4562f6)){if(_0x5f3650['countabandonedretry']>=_0x4562f6[_0xa6e9('0x119')]){_0x4d2de6[_0xa6e9('0xf1')](_0x5f3650,_0x1c8ab7,_0x147052,'reason\x2011\x20abandoned');}else{_0x4d2de6[_0xa6e9('0xfd')](_0x5f3650,_0x1c8ab7,_0x147052,_0xa6e9('0x1b9'));}}break;case'20':_0x4562f6[_0xa6e9('0x1ba')]+=0x1;_0x5f3650[_0xa6e9('0xa8')]=0x14;_0x5f3650[_0xa6e9('0xa9')]=_0xa6e9('0x1bb');_0x5f3650['countagentrejectretry']+=0x1;_0x5f3650[_0xa6e9('0x113')]+=0x1;_0x4d2de6[_0xa6e9('0xcb')](_0x5f3650)[_0xa6e9('0xb4')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x4d2de6[_0xa6e9('0x191')](0x14,_0x2f6865,_0x4562f6)){if(_0x5f3650[_0xa6e9('0x192')]>=_0x4562f6[_0xa6e9('0x19f')]){_0x4d2de6[_0xa6e9('0xf1')](_0x5f3650,_0x1c8ab7,_0x147052,_0xa6e9('0x1bc'));}else{_0x4d2de6[_0xa6e9('0xfd')](_0x5f3650,_0x1c8ab7,_0x147052,'reason\x2020\x20agentreject');}}break;default:_0x4562f6[_0xa6e9('0x68')]+=0x1;_0x5f3650[_0xa6e9('0xa8')]=0xc;_0x5f3650[_0xa6e9('0xa9')]=_0x1a3fd0[_0xa6e9('0x106')];_0x4d2de6[_0xa6e9('0xcb')](_0x5f3650)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x4d2de6['checkRetriveMax'](_0x1a3fd0['reason'],_0x2f6865,_0x4562f6)){if(_0x5f3650['countbusyretry']+_0x5f3650[_0xa6e9('0xea')]+_0x5f3650[_0xa6e9('0xeb')]+_0x5f3650['countnosuchnumberretry']+_0x5f3650[_0xa6e9('0xed')]+_0x5f3650[_0xa6e9('0xfc')]+_0x5f3650[_0xa6e9('0xe7')]+_0x5f3650[_0xa6e9('0x192')]>=_0x4562f6[_0xa6e9('0xee')]){_0x4d2de6[_0xa6e9('0xfd')](_0x5f3650,_0x1c8ab7,_0x147052,_0x1a3fd0['reason']);}else{_0x4d2de6[_0xa6e9('0xf1')](_0x5f3650,_0x1c8ab7,_0x147052,_0x1a3fd0['reason']);}}}});};Dialer[_0xa6e9('0x1d')][_0xa6e9('0xfd')]=function(_0x319e1e,_0x31e864,_0x20a1e6,_0x2f9e01){var _0x37c325=new Final(_0x319e1e);_0x37c325[_0xa6e9('0xa8')]=0xf;_0x37c325[_0xa6e9('0xa9')]=_0xa6e9('0x1bd');this[_0xa6e9('0xf1')](_0x37c325,_0x31e864,_0x20a1e6,_0x2f9e01);};Dialer[_0xa6e9('0x1d')]['createStateFinal']=function(_0x2e50c5,_0x129b79,_0x6faff,_0x351205){this[_0xa6e9('0xc9')](_0x2e50c5)['then'](function(_0x46f8ea){return _0x129b79(msgResponse(_0xa6e9('0x1a2'),_0xa6e9('0xd6'),_0x351205));})['catch'](function(_0x172f2c){return _0x6faff(msgResponse('[moveContactManagedDialer][0]',_0xa6e9('0x13a'),'contact\x20not\x20moved'));});};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x9')]=function(_0x5a6188){var _0x5ab6f9=this;var _0x18b973=_0x5a6188['dialPredictiveOptimizationPercentage']/0x64;var _0x4c8a75=_0x5a6188[_0xa6e9('0x64')]/(_0x5a6188[_0xa6e9('0x64')]+_0x5a6188[_0xa6e9('0x5e')]);var _0x43774b=Math[_0xa6e9('0x1be')](_0x5a6188[_0xa6e9('0x6f')]*(_0x5a6188[_0xa6e9('0x1bf')]/0x64));var _0x4e108c=Math[_0xa6e9('0x1be')](_0x5a6188[_0xa6e9('0x6f')]*(_0x5a6188['predictiveIntervalMinThreshold']/0x64));var _0x36fa6e=_0x5a6188['available']+_0x5a6188[_0xa6e9('0xa0')];var _0x73dcc2=Math[_0xa6e9('0x1c0')](_0x5a6188[_0xa6e9('0x72')]*_0x5a6188[_0xa6e9('0x73')]*_0x5a6188[_0xa6e9('0x1c1')]*_0x5a6188[_0xa6e9('0x6e')]);if(_[_0xa6e9('0x81')](_0x5a6188[_0xa6e9('0x8a')])){if(!_[_0xa6e9('0x81')](_0x5a6188['startPredictive'])){_0x5a6188[_0xa6e9('0x8b')]=undefined;loggerPredictive[_0xa6e9('0x94')](_0xa6e9('0x1c2'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xa6e9('0x81')](_0x5a6188['handlePredictive'])){loggerPredictive[_0xa6e9('0x94')](_0xa6e9('0x1c2'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5a6188[_0xa6e9('0x8d')]);_0x5a6188[_0xa6e9('0x8d')]=undefined;}_0x5a6188[_0xa6e9('0x8a')]=moment()[_0xa6e9('0x77')](_0xa6e9('0xf6'));loggerPredictive[_0xa6e9('0x79')](_0x5a6188[_0xa6e9('0x3f')],_0xa6e9('0x1c3'),_0x5a6188[_0xa6e9('0x8a')]);this[_0xa6e9('0x14c')](_0x5a6188,0x1);}else if(ifInterval(_0x5a6188[_0xa6e9('0x1c4')],_0x5a6188[_0xa6e9('0x8a')])){this[_0xa6e9('0x14c')](_0x5a6188,0x1);loggerPredictiveCalls['info'](_0xa6e9('0x1c5'),_0x5a6188[_0xa6e9('0x8a')],_0x5a6188[_0xa6e9('0x3f')]);_0x5a6188[_0xa6e9('0x72')]=0x0;_0x5a6188[_0xa6e9('0x10e')]=0x0;}else if(_0x18b973<_0x4c8a75&&_0x5a6188[_0xa6e9('0x1c6')]===_0xa6e9('0x1c7')){freeVariablesPredictive(_0x5a6188);loggerPredictive['info'](_0xa6e9('0x1c8'),_0xa6e9('0x1c9'),_0x4c8a75,_0xa6e9('0x8a'),_0x5a6188[_0xa6e9('0x3f')]);}else if(_0x73dcc2<_0x5a6188[_0xa6e9('0x10e')]&&_0x5a6188[_0xa6e9('0x1c6')]===_0xa6e9('0x1c7')){freeVariablesPredictive(_0x5a6188);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x1ca'),'Max\x20Drop\x20',_0x73dcc2,_0xa6e9('0x1cb'),_0x5a6188[_0xa6e9('0x10e')],_0xa6e9('0x8a'),_0x5a6188[_0xa6e9('0x3f')]);}else if(!ifInterval(_0x5a6188[_0xa6e9('0x1c4')],_0x5a6188[_0xa6e9('0x8a')])&&_[_0xa6e9('0x81')](_0x5a6188[_0xa6e9('0x8b')])&&!_[_0xa6e9('0x81')](_0x5a6188[_0xa6e9('0x8a')])){_0x5a6188[_0xa6e9('0x8b')]=moment()[_0xa6e9('0x77')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x5a6188[_0xa6e9('0x3f')],'started\x20in\x20predictive\x20at',_0x5a6188[_0xa6e9('0x8b')]);this[_0xa6e9('0xc1')](_0x5a6188[_0xa6e9('0x1c4')])[_0xa6e9('0xbc')](this[_0xa6e9('0x1cc')](_0x5a6188))['then'](mergeDataErlangB(_0x5a6188))['then'](this['startMethodPredictive'](_0x5a6188))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5a6188));}else if(!ifInterval(_0x5a6188[_0xa6e9('0x1c4')],_0x5a6188[_0xa6e9('0x8b')])){_0x5a6188[_0xa6e9('0x10e')]=0x0;_0x5a6188['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x5a6188['name'],_0xa6e9('0x1cd'),_0x5a6188[_0xa6e9('0x8b')]);clearInterval(_0x5a6188[_0xa6e9('0x8d')]);_0x5a6188[_0xa6e9('0x8d')]=undefined;this['averageHandleTime'](_0x5a6188[_0xa6e9('0x1c4')])[_0xa6e9('0xbc')](this[_0xa6e9('0x1cc')](_0x5a6188))['then'](mergeDataErlangB(_0x5a6188))[_0xa6e9('0xbc')](this[_0xa6e9('0x1ce')](_0x5a6188))[_0xa6e9('0xb4')](loggerCatchPredictive(_0xa6e9('0x1cf'),_0x5a6188));}else if(_0x5a6188['predictiveIntervalAvailable']&&_0x36fa6e<_0x5a6188['predictiveIntervalAvailable']-_0x4e108c){freeVariablesPredictive(_0x5a6188);loggerPredictive[_0xa6e9('0x79')](_0x5a6188[_0xa6e9('0x3f')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x36fa6e,_0xa6e9('0x1d0'),_0x5a6188[_0xa6e9('0x6f')],'-',_0x4e108c,'=',_0x5a6188[_0xa6e9('0x6f')]-_0x4e108c,')');}else if(_0x5a6188[_0xa6e9('0x6f')]&&_0x36fa6e>_0x5a6188[_0xa6e9('0x6f')]+_0x43774b){freeVariablesPredictive(_0x5a6188);loggerPredictive[_0xa6e9('0x79')](_0x5a6188[_0xa6e9('0x3f')],_0xa6e9('0x1d1'),_0x36fa6e,_0xa6e9('0x1d2'),_0x5a6188[_0xa6e9('0x6f')],'+',_0x43774b,'=',_0x5a6188[_0xa6e9('0x6f')]+_0x43774b,')');}};Dialer[_0xa6e9('0x1d')]['getDataPredictive']=function(_0x1cd4f8){var _0x2fcd47=this;return function(_0x2c6e0c){return new BPromise(function(_0x842aa3,_0x46e830){_[_0xa6e9('0x89')](_0x1cd4f8,_0x2c6e0c[0x0]);if(checkGetDataPredictive(_0x2c6e0c[0x0])){var _0x3f43e7=_0x1cd4f8['predictiveIntervalAvailable']=_0x1cd4f8[_0xa6e9('0xa0')]+_0x1cd4f8[_0xa6e9('0x51')];var _0x14e1f8=_0x1cd4f8[_0xa6e9('0x1c4')]*0x3c;var _0x31efa9=_0x2c6e0c[0x0]['predictiveIntervalAvgTalktime']+_0x2c6e0c[0x0][_0xa6e9('0x6a')];var _0x4cbbad=(_0x2c6e0c[0x0]['predictiveIntervalAnsweredCalls']+_0x2c6e0c[0x0][_0xa6e9('0x6d')]+_0x2c6e0c[0x0][_0xa6e9('0x6c')])/_0x2c6e0c[0x0]['predictiveIntervalTotalCalls'];_0x1cd4f8[_0xa6e9('0x1c1')]=_0x4cbbad>0x0?_0x4cbbad:0x1;switch(_0x1cd4f8[_0xa6e9('0x1c6')]){case _0xa6e9('0x1c7'):var _0x1c3a4d=_0x1cd4f8[_0xa6e9('0x1d3')]/0x64;return _0x2fcd47[_0xa6e9('0x1d4')](_0x3f43e7,_0x14e1f8,_0x31efa9,_0x4cbbad,_0x1c3a4d)[_0xa6e9('0xbc')](function(_0x2449d1){return _0x842aa3(_0x2449d1);});case _0xa6e9('0x1d5'):var _0x45c3a8=_0x1cd4f8['dialPredictiveOptimizationPercentage']/0x64;return _0x2fcd47[_0xa6e9('0x1d6')](_0x3f43e7,_0x14e1f8,_0x31efa9,_0x4cbbad,_0x45c3a8)[_0xa6e9('0xbc')](function(_0x1e4d16){return _0x842aa3(_0x1e4d16);});default:return _0x46e830(msgResponse(_0xa6e9('0x1d7'),_0xa6e9('0x13a'),'Unknown\x20Predictive'));}}else{return _0x46e830(msgResponse(_0xa6e9('0x1d7'),_0xa6e9('0x13a'),_0xa6e9('0x1d8')));}});};};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x1d9')]=function(_0x53d6a2){var _0xf8bf79=this;return function(_0x4955bb){return new BPromise(function(_0x31b4e4,_0x4a4dea){_[_0xa6e9('0x89')](_0x53d6a2,_0x4955bb[0x0]);if(checkGetDataPredictive(_0x4955bb[0x0])){loggerPredictive['info'](JSON['stringify'](_0x4955bb[0x0]));if(_0x53d6a2[_0xa6e9('0x1c6')]===_0xa6e9('0x1c7')){return _0xf8bf79[_0xa6e9('0xc7')](_0x53d6a2['id'])['then'](function(_0x47f007){var _0x3670a8=_0x53d6a2[_0xa6e9('0x52')]-_0x47f007[0x0]['outboundQueuePauses'];var _0xa0dc00=_0x53d6a2[_0xa6e9('0x1c4')]*0x3c;var _0x1daa5e=_0x4955bb[0x0][_0xa6e9('0x6b')]+_0x4955bb[0x0][_0xa6e9('0x6a')];var _0x3af8cb=(_0x4955bb[0x0]['predictiveIntervalAnsweredCalls']+_0x4955bb[0x0][_0xa6e9('0x6d')]+_0x4955bb[0x0][_0xa6e9('0x6c')])/_0x4955bb[0x0][_0xa6e9('0x70')];var _0x33bb28=_0x53d6a2[_0xa6e9('0x1d3')]/0x64;_0x53d6a2['predictiveIntervalPauses']=_0x47f007[0x0]['outboundQueuePauses']||0x0;_0x53d6a2[_0xa6e9('0x1c1')]=_0x3af8cb>0x0?_0x3af8cb:0x1;return _0xf8bf79[_0xa6e9('0x1d4')](_0x3670a8,_0xa0dc00,_0x1daa5e,_0x3af8cb,_0x33bb28);})[_0xa6e9('0xbc')](function(_0x21e2c4){return _0x31b4e4(_0x21e2c4);})[_0xa6e9('0xb4')](function(_0x4bee6f){return _0x4a4dea(msgResponse(_0xa6e9('0x1da'),'Failure',JSON[_0xa6e9('0x4a')](_0x4bee6f)));});}if(_0x53d6a2[_0xa6e9('0x1c6')]==='agentBusyFactor'){return _0xf8bf79[_0xa6e9('0xc7')](_0x53d6a2['id'])[_0xa6e9('0xbc')](function(_0x2ee5ef){var _0x6cb41f=_0x53d6a2[_0xa6e9('0x52')]-_0x2ee5ef[0x0][_0xa6e9('0x1db')];var _0x55eb9e=_0x53d6a2[_0xa6e9('0x1c4')]*0x3c;var _0x1404b4=_0x4955bb[0x0][_0xa6e9('0x6b')]+_0x4955bb[0x0]['predictiveIntervalAvgHoldtime'];var _0x598510=(_0x4955bb[0x0][_0xa6e9('0x69')]+_0x4955bb[0x0][_0xa6e9('0x6d')]+_0x4955bb[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4955bb[0x0]['predictiveIntervalTotalCalls'];var _0x5f3d09=_0x53d6a2[_0xa6e9('0x1d3')]/0x64;_0x53d6a2[_0xa6e9('0x1dc')]=_0x2ee5ef[0x0]['outboundQueuePauses']||0x0;_0x53d6a2[_0xa6e9('0x1c1')]=_0x598510>0x0?_0x598510:0x1;return _0xf8bf79[_0xa6e9('0x1d6')](_0x6cb41f,_0x55eb9e,_0x1404b4,_0x598510,_0x5f3d09);})['then'](function(_0x4851a4){return _0x31b4e4(_0x4851a4);})['catch'](function(_0x500e6d){return _0x4a4dea(msgResponse(_0xa6e9('0x1da'),'Failure',JSON['stringify'](_0x500e6d)));});}}else{return _0x4a4dea(msgResponse(_0xa6e9('0x1d7'),_0xa6e9('0x13a'),_0xa6e9('0x1d8')));}});};};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x1ce')]=function(_0x1083d7){var _0x2544f9=this;return function(){var _0x51bb2b=0x0;var _0x1d21a0=Math[_0xa6e9('0x1c0')](_0x1083d7[_0xa6e9('0x87')]*0x3e8);if(_0x1d21a0>0x0){_0x1d21a0=_0x1d21a0<0x64?0x64:_0x1d21a0;loggerPredictive['info'](_0x1083d7[_0xa6e9('0x3f')],'one\x20call\x20every:',_0x1d21a0,_0xa6e9('0x4b'));_0x1083d7[_0xa6e9('0x8d')]=setInterval(function(){_0x2544f9[_0xa6e9('0x8d')](_0x1083d7);loggerPredictiveCalls[_0xa6e9('0x79')]('[handlePredictive]',_0x51bb2b+=0x1);},_0x1d21a0);}else{loggerPredictive[_0xa6e9('0x79')](_0x1083d7[_0xa6e9('0x3f')],_0xa6e9('0x1dd'));}};};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x1de')]=function(_0x5a103f,_0x5d8257){var _0xa268a6=this;return function(_0x79c867){if(_[_0xa6e9('0x91')](_0x79c867)){if(_[_0xa6e9('0xb0')](_0x5d8257[_0xa6e9('0xd3')])||!_0x5d8257[_0xa6e9('0x1df')]){if(_0x5a103f[_0xa6e9('0x5a')]===_0xa6e9('0x14f')){_0x5a103f[_0xa6e9('0x122')]=_[_0xa6e9('0x81')](_0x5a103f[_0xa6e9('0x122')])?!![]:_0x5a103f[_0xa6e9('0x122')];var _0x3e0c50=uuid['v4']();_0xa268a6[_0xa6e9('0xae')][_0x3e0c50]=new Action(_0x5a103f,_0x5d8257,_0x3e0c50);loggerBooked[_0xa6e9('0x79')]('[booked][checkContactBlack]',_0x3e0c50,_0xa6e9('0x1e0'),JSON[_0xa6e9('0x4a')](_0x5a103f[_0xa6e9('0x122')]),'Queue:\x20',_0x5a103f[_0xa6e9('0x3f')]);if(_0x5a103f[_0xa6e9('0x122')]){_0x5a103f['queueStatusComplete']=![];_0xa268a6['queueBooked'][_0xa268a6[_0xa6e9('0xae')][_0x3e0c50][_0xa6e9('0xb8')]]=[];ami[_0xa6e9('0xb1')]({'actionid':_0x3e0c50,'action':_0xa6e9('0x1e1'),'queue':_0x5a103f[_0xa6e9('0x3f')]})['catch'](function(_0x58ee92){_0xa268a6[_0xa6e9('0xb6')](_0x5a103f);_0xa268a6[_0xa6e9('0xc2')]({'active':![],'ContactId':_0xa268a6[_0xa6e9('0xae')][_0x3e0c50][_0xa6e9('0xf7')],'ListId':_0xa268a6['actions'][_0x3e0c50][_0xa6e9('0xd2')],'VoiceQueueId':_0xa268a6[_0xa6e9('0xae')][_0x3e0c50]['VoiceQueueId']||undefined,'CampaignId':_0xa268a6[_0xa6e9('0xae')][_0x3e0c50][_0xa6e9('0xd5')]||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x1e2')));delete _0xa268a6[_0xa6e9('0xae')][_0x3e0c50];});}else{loggerBooked[_0xa6e9('0x79')](_0xa6e9('0x1e3'),JSON[_0xa6e9('0x4a')](_0x5a103f[_0xa6e9('0x122')]),_0xa6e9('0x1e4'),_0x5a103f[_0xa6e9('0x3f')]);_0xa268a6[_0xa6e9('0xb6')](_0x5a103f);_0xa268a6[_0xa6e9('0xc2')]({'active':![],'ContactId':_0xa268a6[_0xa6e9('0xae')][_0x3e0c50][_0xa6e9('0xf7')],'ListId':_0xa268a6['actions'][_0x3e0c50][_0xa6e9('0xd2')],'VoiceQueueId':_0xa268a6[_0xa6e9('0xae')][_0x3e0c50][_0xa6e9('0xd4')]||undefined,'CampaignId':_0xa268a6[_0xa6e9('0xae')][_0x3e0c50][_0xa6e9('0xd5')]||undefined})['catch'](loggerCatch(_0xa6e9('0x1e2')));delete _0xa268a6['actions'][_0x3e0c50];}}else{return _0xa268a6[_0xa6e9('0x15d')](_0x5a103f,_0x5d8257);}}else{if(getDiff(_0x5d8257[_0xa6e9('0x1e5')])<_0x5a103f['dialRecallMeTimeout']*0x3c){if(_0x5d8257[_0xa6e9('0x1e6')]&&!_0x5d8257['Agent'][_0xa6e9('0x1e7')]){_0xa268a6[_0xa6e9('0x8f')]['run'](_0x5d8257['id'])[_0xa6e9('0x20')](function(){_0xa268a6[_0xa6e9('0xb6')](_0x5a103f);});}else{_0xa268a6['unlockContact']({'active':![]},_0x5d8257['id'],0x1)[_0xa6e9('0x20')](function(){console['log'](_0xa6e9('0x1e8'));_0xa268a6[_0xa6e9('0xb6')](_0x5a103f);});}}else{_0x5a103f[_0xa6e9('0x1e9')]+=0x1;_0xa268a6[_0xa6e9('0xb6')](_0x5a103f);if(_0x5a103f[_0xa6e9('0x1ea')]){_0xa268a6[_0xa6e9('0xc2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5d8257[_0xa6e9('0xf7')],'ListId':_0x5d8257[_0xa6e9('0xd2')],'VoiceQueueId':_0x5d8257[_0xa6e9('0xd4')]||undefined,'CampaignId':_0x5d8257['CampaignId']||undefined})[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x1eb')));_0xa268a6[_0xa6e9('0xcb')](createObjHistory(_0x5a103f,_0x5d8257,_0xa6e9('0x1ec'),0x17,_0xa6e9('0x1ed')))[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x1ee')));}else{_0xa268a6[_0xa6e9('0xd1')](createObjHistory(_0x5a103f,_0x5d8257,_0xa6e9('0x1ef'),0x16,_0xa6e9('0x1f0')),'[Originate][HistoryRecallClose][historyCatch]',_0xa6e9('0x1f1'));}}}}else{_0x5a103f[_0xa6e9('0x5f')]+=0x1;_0xa268a6[_0xa6e9('0xd1')](createObjHistory(_0x5a103f,_0x5d8257,'BLACKLIST',0xd,_0xa6e9('0x1f2')),_0xa6e9('0x1f3'),_0xa6e9('0x1f4'));throw _0xa6e9('0x1f5');}};};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x153')]=function(_0x2734d9){var _0x14ab17=this;var _0x5708ea=[];var _0x53362a=_0x2734d9[_0xa6e9('0x1f6')]-_0x2734d9[_0xa6e9('0x71')]-_0x2734d9[_0xa6e9('0x1f7')];emitCampaignSummary(_0x2734d9);if(_0x53362a>0x0){if(_0x53362a>this[_0xa6e9('0x26')]){_0x53362a=this[_0xa6e9('0x26')];}_0x2734d9[_0xa6e9('0x1f7')]+=_0x53362a;this[_0xa6e9('0xc6')](_0x2734d9['id'],_0x53362a,_0x2734d9[_0xa6e9('0x1f8')])[_0xa6e9('0xbc')](function(_0x4069cc){_0x2734d9[_0xa6e9('0x1f7')]-=_0x53362a;_0x2734d9[_0xa6e9('0x1f7')]=_0x2734d9[_0xa6e9('0x1f7')]>0x0?_0x2734d9[_0xa6e9('0x1f7')]:0x0;if(!checkContactEmpty(_0x4069cc)){_0x2734d9['message']=_0xa6e9('0x9d');logger['info'](_0xa6e9('0x1f9')+_0x2734d9[_0xa6e9('0x3f')]);}else{_0x2734d9[_0xa6e9('0x71')]+=_0x4069cc[_0xa6e9('0x96')];_0x2734d9[_0xa6e9('0x41')]='RUNNING';for(var _0x1b7a7c=0x0;_0x1b7a7c<_0x4069cc[_0xa6e9('0x96')];_0x1b7a7c+=0x1){_0x2734d9['ivrTotalCallsDays']+=0x1;if(_[_0xa6e9('0xb0')](_0x4069cc[_0x1b7a7c])||_[_0xa6e9('0xb0')](_0x4069cc[_0x1b7a7c][_0xa6e9('0x160')])||_['isNil'](_0x4069cc[_0x1b7a7c][_0xa6e9('0x160')][_0xa6e9('0x161')])){_0x14ab17[_0xa6e9('0xcf')]('[actionOriginate]\x20',_0x2734d9,_0x4069cc[_0x1b7a7c]);}else{_0x14ab17['checkIsBlackListIvr'](_['pick'](_0x4069cc[_0x1b7a7c],[_0xa6e9('0xd5'),_0xa6e9('0x1fa')]))[_0xa6e9('0xbc')](_0x14ab17['checkContactBlack'](_0x2734d9,_0x4069cc[_0x1b7a7c]))['catch'](_0x14ab17[_0xa6e9('0xce')](_0xa6e9('0x1fb'),_0x2734d9));}}}})['catch'](loggerGetContactDialer(_0xa6e9('0x1fc'),_0x2734d9,_0x53362a));}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x14c')]=function(_0x8ffd35,_0xf6af60){var _0x493e6a=this;var _0x36ab3d=[];var _0x1951ce=_0xf6af60>=0x1?_0xf6af60:0x1;var _0x30b044=[];if(_0x8ffd35['dialMethod']===_0xa6e9('0x14f')){_0x1951ce=0x1;}var _0x3dd8b7=Math[_0xa6e9('0x1c0')](_0x8ffd35[_0xa6e9('0x51')]*_0x1951ce)-_0x8ffd35['originated']-_0x8ffd35['temp'];emitVoiceQueueSummary(_0x8ffd35);if(_0x8ffd35[_0xa6e9('0x1fd')]>0x0){var _0x576de3=_0x8ffd35[_0xa6e9('0x1fd')]-_0x8ffd35['originated']-_0x8ffd35['talking']-_0x8ffd35[_0xa6e9('0x1f7')]-_0x8ffd35['pTalking'];if(_0x3dd8b7>_0x576de3){_0x3dd8b7=_0x576de3;}}if(_0x3dd8b7>0x0){if(_0x8ffd35[_0xa6e9('0x5a')]===_0xa6e9('0x14f')){_0x3dd8b7=0x1;}if(_0x3dd8b7>this[_0xa6e9('0x26')]){_0x3dd8b7=this[_0xa6e9('0x26')];}_0x8ffd35[_0xa6e9('0x1f7')]+=_0x3dd8b7;for(var _0x303bc3 in this[_0xa6e9('0x24')]){if(this[_0xa6e9('0x24')]['hasOwnProperty'](_0x303bc3)){if(this['agents'][_0x303bc3][_0xa6e9('0xa8')]===_0xa6e9('0x1fe')&&this[_0xa6e9('0x24')][_0x303bc3][_0xa6e9('0xb2')]===_0xa6e9('0xd9')){_0x36ab3d[_0xa6e9('0x11f')](this[_0xa6e9('0x24')][_0x303bc3]['id']);}}}this[_0xa6e9('0xc5')](_0x8ffd35['id'],_0x36ab3d,_0x3dd8b7,_0x8ffd35[_0xa6e9('0x1f8')])['then'](function(_0x476aae){_0x8ffd35[_0xa6e9('0x1f7')]-=_0x3dd8b7;_0x8ffd35['temp']=_0x8ffd35['temp']>0x0?_0x8ffd35[_0xa6e9('0x1f7')]:0x0;if(!checkContactEmpty(_0x476aae)){_0x493e6a[_0xa6e9('0xba')](_0x8ffd35)[_0xa6e9('0xbc')](sendMessageReschedule(_0x8ffd35))[_0xa6e9('0xb4')](loggerCatch(_0xa6e9('0x1ff')));}else{_0x8ffd35['originated']+=_0x476aae[_0xa6e9('0x96')];_0x8ffd35[_0xa6e9('0x41')]=_0x8ffd35[_0xa6e9('0x5a')]==='booked'?_0xa6e9('0x200'):'RUNNING';for(var _0xc1a8c=0x0;_0xc1a8c<_0x476aae[_0xa6e9('0x96')];_0xc1a8c+=0x1){if(_[_0xa6e9('0xb0')](_0x476aae[_0xc1a8c])||_[_0xa6e9('0xb0')](_0x476aae[_0xc1a8c][_0xa6e9('0x160')])||_['isNil'](_0x476aae[_0xc1a8c][_0xa6e9('0x160')][_0xa6e9('0x161')])){_0x493e6a[_0xa6e9('0xcf')]('[actionOriginate]\x20',_0x8ffd35,_0x476aae[_0xc1a8c]);}else{_0x493e6a[_0xa6e9('0xbd')](_[_0xa6e9('0x125')](_0x476aae[_0xc1a8c],['VoiceQueueId',_0xa6e9('0x1fa')]))[_0xa6e9('0xbc')](_0x493e6a[_0xa6e9('0x1de')](_0x8ffd35,_0x476aae[_0xc1a8c]))[_0xa6e9('0xb4')](_0x493e6a[_0xa6e9('0xce')](_0xa6e9('0x201'),_0x8ffd35));}}}})[_0xa6e9('0xb4')](loggerGetContactDialer(_0xa6e9('0x202'),_0x8ffd35,_0x3dd8b7));}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x8d')]=function(_0x165ea4){var _0x2805c3=this;if(_0x165ea4[_0xa6e9('0x1fd')]>0x0){var _0x5a630f=_0x165ea4[_0xa6e9('0x1fd')]-_0x165ea4[_0xa6e9('0x71')]-_0x165ea4[_0xa6e9('0xa0')];if(_0x5a630f>0x0){this['tryOriginatePredictive'](_0x165ea4);}else{loggerPredictiveCalls[_0xa6e9('0x79')](_0xa6e9('0x203'));}}else{this[_0xa6e9('0x204')](_0x165ea4);}};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x204')]=function(_0x5c583a){var _0x4663ed=this;var _0x571167=[];_0x5c583a[_0xa6e9('0x71')]+=0x1;for(var _0x29d458 in this['agents']){if(this['agents'][_0xa6e9('0x97')](_0x29d458)){if(this[_0xa6e9('0x24')][_0x29d458][_0xa6e9('0xa8')]===_0xa6e9('0x1fe')&&this['agents'][_0x29d458][_0xa6e9('0xb2')]===_0xa6e9('0xd9')){_0x571167[_0xa6e9('0x11f')](this[_0xa6e9('0x24')][_0x29d458]['id']);}}}this[_0xa6e9('0xc5')](_0x5c583a['id'],_0x571167,0x1,_0x5c583a[_0xa6e9('0x1f8')])[_0xa6e9('0xbc')](function(_0x2f8e8d){if(!checkContactEmpty(_0x2f8e8d)){checkContactLowerLimitOriginate(_0x5c583a,0x1,0x0);_0x4663ed['countReScheduled'](_0x5c583a)[_0xa6e9('0xbc')](sendMessageReschedule(_0x5c583a))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x5c583a['message']=_0xa6e9('0x205');if(_[_0xa6e9('0xb0')](_0x2f8e8d[0x0])||_[_0xa6e9('0xb0')](_0x2f8e8d[0x0]['Contact'])||_[_0xa6e9('0xb0')](_0x2f8e8d[0x0][_0xa6e9('0x160')][_0xa6e9('0x161')])){_0x4663ed[_0xa6e9('0xcf')](_0xa6e9('0x201'),_0x5c583a,_0x2f8e8d[0x0]);}else{_0x4663ed[_0xa6e9('0xbd')](_[_0xa6e9('0x125')](_0x2f8e8d[0x0],[_0xa6e9('0xd4'),_0xa6e9('0x1fa')]))[_0xa6e9('0xbc')](_0x4663ed[_0xa6e9('0x1de')](_0x5c583a,_0x2f8e8d[0x0]))['catch'](_0x4663ed['loggerHandler'](_0xa6e9('0x206'),_0x5c583a));}}})['catch'](loggerGetContactDialer(_0xa6e9('0x207'),_0x5c583a,0x1));emitVoiceQueueSummary(_0x5c583a);};Dialer[_0xa6e9('0x1d')]['abandonmentRate']=function(_0x17c357,_0x3c9e1d,_0x3fe3ef,_0x14e3e0,_0x481303,_0x2df3cc){loggerPredictive['info'](_0xa6e9('0x208'));loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x209'),_0x17c357);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x20a'),_0x3c9e1d);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x20b'),_0x3fe3ef);loggerPredictive['info'](_0xa6e9('0x20c'),_0x14e3e0);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x481303);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x80'));return new BPromise(function(_0xf1d9aa,_0x5f236){if(_0x17c357<=0x0||isNaN(_0x17c357)){return _0x5f236(msgResponse('[abandonmentRate]',_0xa6e9('0x49'),_0xa6e9('0x20d')+_0x17c357));}if(_0x3fe3ef<=0x0||isNaN(_0x3fe3ef)){return _0x5f236(msgResponse(_0xa6e9('0x20e'),_0xa6e9('0x49'),'Ts\x20=\x20'+_0x3fe3ef));}if(_0x14e3e0<=0x0||isNaN(_0x14e3e0)){return _0x5f236(msgResponse(_0xa6e9('0x20e'),_0xa6e9('0x49'),_0xa6e9('0x20f')+_0x14e3e0));}if(_0x3c9e1d<=0x0||isNaN(_0x3c9e1d)){return _0x5f236(msgResponse(_0xa6e9('0x20e'),_0xa6e9('0x49'),_0xa6e9('0x210')+_0x3c9e1d));}if(_0x481303<=0x0||isNaN(_0x481303)){return _0x5f236(msgResponse(_0xa6e9('0x20e'),_0xa6e9('0x49'),_0xa6e9('0x211')+_0x481303));}_0x2df3cc=_0x2df3cc||0x0;var _0x283035=0x1/_0x3fe3ef;var _0x3ec7b4=0x0;var _0x586bb4=0x0;var _0x5125a2=0x0;var _0x391d0b=0x0;for(var _0x1b1b67=0x0;_0x5125a2<_0x481303;_0x1b1b67+=0x1){_0x586bb4=_0x1b1b67/_0x3c9e1d;_0x3ec7b4=(_0x14e3e0*_0x586bb4+_0x2df3cc)/_0x283035;_0x5125a2=erlangb(_0x3ec7b4,_0x17c357);_0x391d0b=_0x3ec7b4/_0x17c357*(0x1-erlangb(_0x3ec7b4,_0x17c357));}return _0xf1d9aa({'erlangCalls':_0x1b1b67,'erlangCallToSecond':_0x3c9e1d/_0x1b1b67,'erlangAbandonmentRate':_0x5125a2,'erlangBusyFactor':_0x391d0b});});};Dialer[_0xa6e9('0x1d')][_0xa6e9('0x1d6')]=function(_0xf18db7,_0x6fdf45,_0x3aee7b,_0x2d16fe,_0x34c9f4,_0x414cd0){loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x212'));loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x209'),_0xf18db7);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x20a'),_0x6fdf45);loggerPredictive['info'](_0xa6e9('0x20b'),_0x3aee7b);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x20c'),_0x2d16fe);loggerPredictive[_0xa6e9('0x79')](_0xa6e9('0x213'),_0x34c9f4);loggerPredictive[_0xa6e9('0x79')]('---------------------------');return new BPromise(function(_0x59f40c,_0x567f78){if(_0xf18db7<=0x0||isNaN(_0xf18db7)){return _0x567f78(msgResponse(_0xa6e9('0x214'),'Error',_0xa6e9('0x20d')+_0xf18db7));}if(_0x3aee7b<=0x0||isNaN(_0x3aee7b)){return _0x567f78(msgResponse(_0xa6e9('0x214'),_0xa6e9('0x49'),_0xa6e9('0x215')+_0x3aee7b));}if(_0x2d16fe<=0x0||isNaN(_0x2d16fe)){return _0x567f78(msgResponse(_0xa6e9('0x214'),_0xa6e9('0x49'),'p\x20=\x20'+_0x2d16fe));}if(_0x6fdf45<=0x0||isNaN(_0x6fdf45)){return _0x567f78(msgResponse(_0xa6e9('0x214'),_0xa6e9('0x49'),_0xa6e9('0x210')+_0x6fdf45));}if(_0x34c9f4<=0x0||isNaN(_0x34c9f4)){return _0x567f78(msgResponse('[busyFactor]',_0xa6e9('0x49'),_0xa6e9('0x216')+_0x34c9f4));}_0x414cd0=_0x414cd0||0x0;var _0x4345d9=0x1/_0x3aee7b;var _0x48dfed=0x0;var _0x2a9f06=0x0;var _0xb1b7dd=0x0;var _0x1cb28a=0x0;for(var _0x34dca7=0x0;_0x1cb28a<_0x34c9f4;_0x34dca7+=0x1){_0x2a9f06=_0x34dca7/_0x6fdf45;_0x48dfed=(_0x2d16fe*_0x2a9f06+_0x414cd0)/_0x4345d9;_0xb1b7dd=erlangb(_0x48dfed,_0xf18db7);_0x1cb28a=_0x48dfed/_0xf18db7*(0x1-erlangb(_0x48dfed,_0xf18db7));}return _0x59f40c({'erlangCalls':_0x34dca7,'erlangCallToSecond':_0x6fdf45/_0x34dca7,'erlangAbandonmentRate':_0xb1b7dd,'erlangBusyFactor':_0x1cb28a});});};module[_0xa6e9('0x217')]=Dialer;