Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / services / ami / dialer / index.js
index 0eadc28..831a023 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2875=['notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','CampaignId','isSuccess','isTrunkReachable','SIP/%s','reachable','status','unmonitored','syncVarSet','variable','amdstatus','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','outboundAnswerCallsDay','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countglobal','amd','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','countnosuchnumberretry','countabandonedretry','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','Unknow','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','dialDropRetryFrequency','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','push','pick','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','ifTime','Failure','INTERVAL_IS_EMPTY','timezones','isArray','command','iftime\x20%s,%s','interval','content','true','indexOf','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','syncQueueSummary','loggedIn','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','checkIfTime','\x5cw{0,','pow','random','match','object','voiceQueue\x20is\x20undefine','Contact','originate','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','phone','substring','dialCutDigit','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','[rescheduleContact][Drop]','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','custom:agentnosuchnumber','buildObj','nosuchnumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','dialNoSuchNumberMaxRetry','createStateFinal','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','reason\x205\x20busy','outboundCongestionCallsDay','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','Success','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[getDataPredictive]','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','actionOriginate','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','maxNumberOriginate','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','ACTIVE','Contact.phone','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','[busyFactor]','interval\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictive','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','actions','contactsId','optionPredictive','startPredictive','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','Intervals','isEmpty','INTERVAL_IS_NULL','Error','stringify','milliseconds','seconds','emit','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','type','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','voice:queue:%s','ivr','format','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','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','predictiveIntervalAnsweredCalls','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','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','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','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','inspect','error','stack','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','sendMessageOneNotActive','waiting','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','loopClearZombieChannels','uniqueId','[uniqueid]','clearZombieChannels','[actions]','undefined','sequence','isNil','Action','catch','No\x20such\x20channel','queue','[Dialer][checkChannel]','updateOriginated','countReScheduled','resolve','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler'];(function(_0x467257,_0x240932){var _0x4b4fcf=function(_0x4b41fb){while(--_0x4b41fb){_0x467257['push'](_0x467257['shift']());}};_0x4b4fcf(++_0x240932);}(_0x2875,0x14b));var _0x5287=function(_0xb065e3,_0x2d01cf){_0xb065e3=_0xb065e3-0x0;var _0x1db262=_0x2875[_0xb065e3];return _0x1db262;};'use strict';var util=require(_0x5287('0x0'));var _=require(_0x5287('0x1'));var BPromise=require(_0x5287('0x2'));var uuid=require(_0x5287('0x3'));var moment=require(_0x5287('0x4'));var rr=require('rr');var md5=require(_0x5287('0x5'));var Redis=require(_0x5287('0x6'));var ut=require(_0x5287('0x7'));var config=require(_0x5287('0x8'));var logger=require(_0x5287('0x9'))('dialer');var loggerBooked=require(_0x5287('0x9'))(_0x5287('0xa'));var loggerPredictive=require(_0x5287('0x9'))(_0x5287('0xb'));var loggerPredictiveCalls=require(_0x5287('0x9'))(_0x5287('0xc'));var loggerSyncQueueSummary=require(_0x5287('0x9'))('syncQueueSummary');var ami=require(_0x5287('0xd'));config[_0x5287('0xe')]=_[_0x5287('0xf')](config[_0x5287('0xe')],{'host':_0x5287('0x10'),'port':0x18eb});var io=require(_0x5287('0x11'))(new Redis(config['redis']));var cmHopper=require(_0x5287('0x12'));var cmHopperHistory=require(_0x5287('0x13'));var cmHopperBlack=require(_0x5287('0x14'));var voiceQueueRt=require(_0x5287('0x15'));var Action=require(_0x5287('0x16'));var History=require('./history');var Final=require(_0x5287('0x17'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process['env'][_0x5287('0x18')]||'127.0.0.1';var strategy={'rrmemory':_0x5287('0x19'),'roundrobin':_0x5287('0x1a')};var Sequence=function(){};Sequence[_0x5287('0x1b')][_0x5287('0x1c')]=function(_0x554736){this[_0x5287('0x1d')]=this['tail']?this[_0x5287('0x1d')][_0x5287('0x1e')](_0x554736):_0x554736();};function Dialer(_0x516197,_0x2667f8){this['sequence']=new Sequence();this[_0x5287('0x1f')]=_0x2667f8;this[_0x5287('0x20')]=_0x516197[_0x5287('0x20')];this[_0x5287('0x21')]=_0x516197[_0x5287('0x21')];this['agents']=_0x516197[_0x5287('0x22')];this[_0x5287('0x23')]=_0x516197[_0x5287('0x23')];this['maxNumberOriginate']=config['maxNumberOriginate']||0x2;this['channels']={};this[_0x5287('0x24')]={};this[_0x5287('0x25')]={};this['uniqueId']={};this[_0x5287('0x26')]={};this[_0x5287('0x27')]={};this['startProgressive']={};this['ivrOriginated']={};this[_0x5287('0x28')]={};this[_0x5287('0x29')]={};ami['on']('agentconnect',this[_0x5287('0x2a')][_0x5287('0x2b')](this));ami['on'](_0x5287('0x2c'),this[_0x5287('0x2d')][_0x5287('0x2b')](this));ami['on'](_0x5287('0x2e'),this[_0x5287('0x2f')][_0x5287('0x2b')](this));ami['on'](_0x5287('0x30'),this[_0x5287('0x31')][_0x5287('0x2b')](this));ami['on'](_0x5287('0x32'),this['syncQueueSummary'][_0x5287('0x2b')](this));ami['on']('hangup',this[_0x5287('0x33')][_0x5287('0x2b')](this));ami['on'](_0x5287('0x34'),this[_0x5287('0x35')][_0x5287('0x2b')](this));ami['on'](_0x5287('0x36'),this['syncVarSet'][_0x5287('0x2b')](this));ami['on']('queuemember',this[_0x5287('0x37')][_0x5287('0x2b')](this));ami['on'](_0x5287('0x38'),this[_0x5287('0x39')][_0x5287('0x2b')](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0x3727aa){return _0x3727aa!==null&&!_['isUndefined'](_0x3727aa);}function checkIsLoggedIn(_0x910df1,_0x294b38){return function(){if(_0x294b38<=0x0){_0x910df1[_0x5287('0x3a')]=_0x5287('0x3b');throw _0x910df1[_0x5287('0x3c')]+_0x5287('0x3d');}};}function isActive(_0x37381b){return _0x37381b;}function checkIsActive(_0x1aff59,_0x240026){return function(){if(!isActive(_0x240026)){_0x1aff59['message']=_0x5287('0x3e');throw _0x1aff59['name']+_0x5287('0x3f');}};}function checkInterval(_0x4078b4){return function(){if(!isNotNull(_0x4078b4[_0x5287('0x40')])){_0x4078b4[_0x5287('0x3a')]='INTERVAL_IS_NULL';throw _0x4078b4[_0x5287('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x4078b4[_0x5287('0x40')][_0x5287('0x41')])){_0x4078b4['message']='INTERVAL_IS_NULL';throw _0x4078b4['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x5287('0x42')](_0x4078b4[_0x5287('0x40')][_0x5287('0x41')]))){_0x4078b4[_0x5287('0x3a')]=_0x5287('0x43');throw _0x4078b4['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x57c982,_0x497b12,_0xf58c3d){return{'action':_0x57c982,'response':_0x497b12,'message':_0xf58c3d,'stack':_0xf58c3d};}function myreject(_0x577ca7){return function(_0x44f6a3){return _0x577ca7(msgResponse('[ifTime][Action]',_0x5287('0x44'),JSON[_0x5287('0x45')](_0x44f6a3)));};}function getSeconds(_0x2c6a5e,_0x44dbbe){var _0x7311dd=moment(_0x2c6a5e)[_0x5287('0x46')](0x0);var _0x36f958=moment(_0x44dbbe)[_0x5287('0x46')](0x0);return _0x7311dd['diff'](_0x36f958,_0x5287('0x47'));}function emit(_0x1d19c7,_0x2ab858,_0x10e787){io['to'](_0x1d19c7)[_0x5287('0x48')](_0x2ab858,_0x10e787);}function emitVoiceQueueSummary(_0x509af5){if(_0x509af5['type']===_0x5287('0x49')){var _0x542cc2={'id':_0x509af5['id'],'name':_0x509af5[_0x5287('0x3c')],'strategy':_0x509af5[_0x5287('0x4a')],'answered':_0x509af5[_0x5287('0x4b')],'available':_0x509af5[_0x5287('0x4c')],'loggedIn':_0x509af5['loggedIn'],'pTalking':_0x509af5[_0x5287('0x4d')],'sumBillable':_0x509af5[_0x5287('0x4e')],'sumDuration':_0x509af5[_0x5287('0x4f')],'sumHoldTime':_0x509af5[_0x5287('0x50')]||0x0,'talking':_0x509af5['talking'],'total':_0x509af5['total'],'type':_0x509af5[_0x5287('0x51')],'unmanaged':_0x509af5['unmanaged'],'abandoned':_0x509af5[_0x5287('0x52')],'waiting':_0x509af5['waiting'],'loggedInDb':_0x509af5[_0x5287('0x53')],'dialActive':_0x509af5[_0x5287('0x54')],'dialMethod':_0x509af5[_0x5287('0x55')],'dialOriginateCallerIdName':_0x509af5['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x509af5['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x509af5[_0x5287('0x56')],'dialPrefix':_0x509af5[_0x5287('0x57')],'outboundAnswerAgiCallsDay':_0x509af5[_0x5287('0x58')],'outboundAnswerCallsDay':_0x509af5['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x509af5[_0x5287('0x59')],'outboundBusyCallsDay':_0x509af5['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x509af5['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x509af5['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x509af5[_0x5287('0x5a')],'outboundDropCallsDayTimeout':_0x509af5[_0x5287('0x5b')],'outboundNoAnswerCallsDay':_0x509af5['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x509af5[_0x5287('0x5c')],'outboundOriginateFailureCallsDay':_0x509af5[_0x5287('0x5d')],'outboundReCallsDay':_0x509af5[_0x5287('0x5e')],'outboundRejectCallsDay':_0x509af5['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x509af5[_0x5287('0x5f')],'predictiveIntervalAnsweredCalls':_0x509af5['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x509af5[_0x5287('0x60')],'predictiveIntervalAvgTalktime':_0x509af5[_0x5287('0x61')],'predictiveIntervalDroppedCallsCallersExit':_0x509af5[_0x5287('0x62')],'predictiveIntervalDroppedCallsTimeout':_0x509af5[_0x5287('0x63')],'predictiveIntervalErlangCalls':_0x509af5[_0x5287('0x64')],'predictiveIntervalErlangCallsDroppedCalls':_0x509af5[_0x5287('0x65')],'predictiveIntervalHitRate':_0x509af5[_0x5287('0x66')],'predictiveIntervalMultiplicativeFactor':_0x509af5[_0x5287('0x67')],'predictiveIntervalPauses':_0x509af5[_0x5287('0x68')],'predictiveIntervalAvailable':_0x509af5[_0x5287('0x69')],'predictiveIntervalTotalCalls':_0x509af5[_0x5287('0x6a')],'message':_0x509af5['message'],'originated':_0x509af5['originated'],'erlangCalls':_0x509af5[_0x5287('0x6b')],'erlangCallToSecond':_0x509af5['erlangCallToSecond'],'erlangAbandonmentRate':_0x509af5[_0x5287('0x6c')],'erlangBusyFactor':_0x509af5[_0x5287('0x6d')],'startPredictive':_0x509af5[_0x5287('0x27')],'startProgressive':_0x509af5[_0x5287('0x6e')]};if(_0x509af5['Trunk']){_0x542cc2[_0x5287('0x6f')]={'id':_0x509af5[_0x5287('0x6f')]['id'],'name':_0x509af5['Trunk'][_0x5287('0x3c')],'active':_0x509af5[_0x5287('0x6f')][_0x5287('0x70')],'callerid':_0x509af5[_0x5287('0x6f')][_0x5287('0x71')]};}if(_0x509af5[_0x5287('0x40')]){_0x542cc2[_0x5287('0x40')]={'id':_0x509af5[_0x5287('0x40')]['id'],'name':_0x509af5[_0x5287('0x40')][_0x5287('0x3c')]};}var _0x1b8326=md5(JSON['stringify'](_0x542cc2));if(_0x509af5[_0x5287('0x5')]!==_0x1b8326){_0x509af5[_0x5287('0x5')]=_0x1b8326;emit(util['format'](_0x5287('0x72'),_0x542cc2['name']),'voice_queue:save',_0x542cc2);}}}function emitCampaignSummary(_0x5e1b50){if(_0x5e1b50[_0x5287('0x51')]===_0x5287('0x73')){emit(util[_0x5287('0x74')](_0x5287('0x75'),_0x5e1b50[_0x5287('0x3c')]),_0x5287('0x76'),_0x5e1b50);}}function checkGetDataPredictive(_0x2f29cc){if(isNotNull(_0x2f29cc)&&!_[_0x5287('0x42')](_0x2f29cc)){loggerPredictive['info'](_0x5287('0x77'));loggerPredictive[_0x5287('0x78')](_0x5287('0x79'),_0x2f29cc['predictiveIntervalTotalCalls']);loggerPredictive[_0x5287('0x78')](_0x5287('0x7a'),_0x2f29cc[_0x5287('0x7b')]);loggerPredictive[_0x5287('0x78')](_0x5287('0x7c'),_0x2f29cc[_0x5287('0x63')]);loggerPredictive[_0x5287('0x78')](_0x5287('0x7d'),_0x2f29cc[_0x5287('0x62')]);loggerPredictive[_0x5287('0x78')](_0x5287('0x7e'),_0x2f29cc[_0x5287('0x60')]);loggerPredictive[_0x5287('0x78')](_0x5287('0x7f'),_0x2f29cc['predictiveIntervalAvgTalktime']);loggerPredictive[_0x5287('0x78')]('---------------------------');if(_0x2f29cc[_0x5287('0x6a')]>0x0){if(!_[_0x5287('0x80')](_0x2f29cc[_0x5287('0x61')])&&_0x2f29cc[_0x5287('0x61')]>0x0){return!![];}loggerPredictive['info'](_0x5287('0x81'));if(!_[_0x5287('0x80')](_0x2f29cc[_0x5287('0x60')])&&_0x2f29cc['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0x5287('0x82'));}else{loggerPredictive[_0x5287('0x78')](_0x5287('0x83'));}}else{loggerPredictive[_0x5287('0x78')](_0x5287('0x84'));}return![];}function mergeDataErlangB(_0x4e94b3){return function(_0xbde0f0){loggerPredictive[_0x5287('0x78')](_0x5287('0x85'));loggerPredictive[_0x5287('0x78')](_0x5287('0x86'),_0xbde0f0[_0x5287('0x6b')]);loggerPredictive[_0x5287('0x78')](_0x5287('0x87'),_0xbde0f0[_0x5287('0x88')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xbde0f0[_0x5287('0x6c')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xbde0f0[_0x5287('0x6d')]);loggerPredictive[_0x5287('0x78')](_0x5287('0x89'),_0xbde0f0[_0x5287('0x6c')]);loggerPredictive['info'](_0x5287('0x8a'));_[_0x5287('0x8b')](_0x4e94b3,_0xbde0f0);};}function getDiff(_0x39b93c){var _0x412e84=moment()[_0x5287('0x46')](0x0);var _0xea74ba=moment(_0x39b93c)['milliseconds'](0x0);return _0x412e84['diff'](_0xea74ba,_0x5287('0x47'));}function ifInterval(_0x3f335b,_0x44aba7){if(_[_0x5287('0x80')](_0x44aba7)){return![];}return getDiff(_0x44aba7)<_0x3f335b*0x3c;}function freeVariablesPredictive(_0x3b5dc9){if(isNotNull(_0x3b5dc9)){if(!_[_0x5287('0x80')](_0x3b5dc9[_0x5287('0x6e')])){_0x3b5dc9[_0x5287('0x6e')]=undefined;loggerPredictive[_0x5287('0x78')](_0x3b5dc9[_0x5287('0x3c')],_0x5287('0x8c'));}if(!_[_0x5287('0x80')](_0x3b5dc9[_0x5287('0x27')])){_0x3b5dc9['startPredictive']=undefined;loggerPredictive[_0x5287('0x78')](_0x3b5dc9[_0x5287('0x3c')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x3b5dc9[_0x5287('0x8d')])){clearInterval(_0x3b5dc9[_0x5287('0x8d')]);_0x3b5dc9['handlePredictive']=undefined;loggerPredictive[_0x5287('0x78')](_0x3b5dc9[_0x5287('0x3c')],_0x5287('0x8e'));}}}function erlangb(_0x53c08e,_0x1362bc){if(_0x1362bc===0x0){return 0x0;}var _0x316c65=0x1;for(var _0x5cad8c=0x1;_0x5cad8c<=_0x1362bc;_0x5cad8c+=0x1){_0x316c65=0x1+_0x316c65*_0x5cad8c/_0x53c08e;}return 0x1/_0x316c65;}function isVoiceQueueOutbound(_0x110738){return _0x110738===_0x5287('0x49');}function isNotPreview(_0x483631){return _0x483631!==_0x5287('0x1f');}function isCampaignIvr(_0x277606){return _0x277606===_0x5287('0x73');}function getCallerId(_0x2c3616,_0x22dff1,_0x195cd6){if(!_[_0x5287('0x80')](_0x195cd6)&&typeof _0x195cd6===_0x5287('0x8f')&&!_[_0x5287('0x42')](_0x195cd6)){if(!_[_0x5287('0x80')](_0x22dff1)&&typeof _0x22dff1===_0x5287('0x8f')&&!_[_0x5287('0x42')](_0x22dff1)){return util['format'](_0x5287('0x90'),_0x22dff1,_0x195cd6);}return util[_0x5287('0x74')](_0x5287('0x90'),_0x195cd6,_0x195cd6);}if(!_['isUndefined'](_0x2c3616)&&typeof _0x2c3616===_0x5287('0x8f')&&!_[_0x5287('0x42')](_0x2c3616)){return _0x2c3616;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x479dc2,_0xf0faa6){return function(_0x8afdce){freeVariablesPredictive(_0xf0faa6);emitVoiceQueueSummary(_0xf0faa6);emitCampaignSummary(_0xf0faa6);loggerSyncQueueSummary['error'](_0x479dc2,util[_0x5287('0x91')](_0x8afdce,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x287dd5,_0x2dffcf){return function(_0x266c17){loggerPredictive[_0x5287('0x92')](_0x2dffcf[_0x5287('0x3c')],_0x287dd5);loggerPredictive[_0x5287('0x92')](_0x266c17[_0x5287('0x93')]);freeVariablesPredictive(_0x2dffcf);};}function loggerCatch(_0x598aa0){return function(_0x4a470e){logger[_0x5287('0x92')](_0x598aa0,util['inspect'](_0x4a470e,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xbf5996){return _0xbf5996&&!_['isUndefined'](_0xbf5996)&&_0xbf5996['length']>0x0;}function decremetOriginate(_0x2ed83d){if(!_['isUndefined'](_0x2ed83d)&&_0x2ed83d!==null){if(typeof _0x2ed83d[_0x5287('0x94')]!=='undefined'){if(_0x2ed83d['originated']>0x0){_0x2ed83d[_0x5287('0x94')]-=0x1;}else{logger[_0x5287('0x92')](_0x5287('0x95'));}}}else{logger['error'](_0x5287('0x96'));}}function checkContactLowerLimitOriginate(_0x235df4,_0x59db97,_0x3c272d){if(_0x59db97>_0x3c272d){for(var _0x43732d=0x0;_0x43732d<_0x59db97-_0x3c272d;_0x43732d+=0x1){decremetOriginate(_0x235df4);}}}function loggerGetContactDialer(_0x190dc6,_0x5bf52c,_0x1e3d3d){return function(_0x18d1aa){checkContactLowerLimitOriginate(_0x5bf52c,_0x1e3d3d,0x0);logger[_0x5287('0x92')](_0x190dc6,util['inspect'](_0x18d1aa,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4db098){return function(_0x1a5a56){if(isNotNull(_0x1a5a56)&&isNotNull(_0x1a5a56[0x0])){if(_0x1a5a56[0x0][_0x5287('0x97')]>0x0){_0x4db098[_0x5287('0x3a')]=_0x5287('0x98');logger[_0x5287('0x78')](_0x5287('0x99')+_0x4db098[_0x5287('0x3c')],_0x1a5a56[0x0][_0x5287('0x97')],_0x5287('0x9a'));}else{_0x4db098[_0x5287('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x5287('0x78')]('[getContactDialer2][Empty]'+_0x4db098[_0x5287('0x3c')]);}}};}function notSendMessagesQueue(_0xa60430){if(_0xa60430[_0x5287('0x9b')]){freeVariablesPredictive(_0xa60430);if(_0xa60430[_0x5287('0x94')]===0x0&&_0xa60430['talking']===0x0&&_0xa60430[_0x5287('0x9c')]===0x0&&(_0xa60430[_0x5287('0x4d')]||0x0)===0x0){_0xa60430[_0x5287('0x9b')]=![];_0xa60430[_0x5287('0x4c')]=0x0;_0xa60430['message']=_0x5287('0x3e');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0xa60430[_0x5287('0x3c')],_0x5287('0x9d'));}else{_0xa60430[_0x5287('0x3a')]=_0x5287('0x9e');loggerSyncQueueSummary['error'](_0x5287('0x9f'),_0xa60430[_0x5287('0x3c')],_0x5287('0xa0'));}emitVoiceQueueSummary(_0xa60430);}}function notSendMessagesCampaign(_0xac92b2){if(_0xac92b2[_0x5287('0x9b')]){if(_0xac92b2[_0x5287('0x94')]===0x0){_0xac92b2['sendMessageOneNotActive']=![];_0xac92b2[_0x5287('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x5287('0x92')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0xac92b2[_0x5287('0x3c')],_0x5287('0x9d'));}else{_0xac92b2[_0x5287('0x3a')]=_0x5287('0x9e');loggerSyncQueueSummary['error'](_0x5287('0xa1'),_0xac92b2[_0x5287('0x3c')],_0x5287('0xa0'));}emitCampaignSummary(_0xac92b2);}}function createObjHistory(_0x3bb47f,_0x52d133,_0x4f67e7,_0xf37e30,_0x387bbb){_0x3bb47f[_0x5287('0x3a')]=_0x4f67e7;var _0xe122c7=new Action(_0x3bb47f,_0x52d133);var _0x40e07d=new History(_0xe122c7);_0x40e07d[_0x5287('0xa2')]=_0xf37e30;_0x40e07d[_0x5287('0xa3')]=_0x387bbb;_0x40e07d[_0x5287('0xa4')]=_0xe122c7[_0x5287('0xa5')];return _0x40e07d;}Dialer[_0x5287('0x1b')][_0x5287('0xa6')]=function(){var _0x145951=this;setInterval(function(){_0x145951['clearZombieChannels'](_0x145951[_0x5287('0xa7')],_0x5287('0xa8'));_0x145951[_0x5287('0xa9')](_0x145951[_0x5287('0x24')],_0x5287('0xaa'));},0x32c8);};Dialer[_0x5287('0x1b')][_0x5287('0xa9')]=function(_0x186e3a,_0x5213fc){var _0x259833=this;for(var _0x25d45b in _0x186e3a){if(typeof _0x186e3a[_0x25d45b]!==_0x5287('0xab')){this[_0x5287('0xac')][_0x5287('0x1c')](function(){if(!_[_0x5287('0xad')](_0x186e3a[_0x25d45b])){return ami[_0x5287('0xae')]({'action':'status','channel':_0x186e3a[_0x25d45b]['channel']})[_0x5287('0xaf')](function(_0x197577){if(_0x197577[_0x5287('0x3a')]===_0x5287('0xb0')){setTimeout(function(){if(_0x186e3a[_0x25d45b]&&_0x186e3a[_0x25d45b][_0x5287('0x51')]!==_0x5287('0x73')){_0x259833['updateOriginated'](_0x259833[_0x5287('0x20')][_0x186e3a[_0x25d45b][_0x5287('0xb1')]]);logger[_0x5287('0x92')](_0x5287('0xb2'),_0x5213fc,_0x25d45b,_0x186e3a[_0x25d45b]['queue']);delete _0x186e3a[_0x25d45b];}if(_0x186e3a[_0x25d45b]&&_0x186e3a[_0x25d45b][_0x5287('0x51')]===_0x5287('0x73')){_0x259833[_0x5287('0xb3')](_0x259833[_0x5287('0x21')][_0x186e3a[_0x25d45b][_0x5287('0xb1')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x5213fc,_0x25d45b,_0x186e3a[_0x25d45b][_0x5287('0xb1')]);delete _0x186e3a[_0x25d45b];}},0x2328);}});}});}}};Dialer['prototype'][_0x5287('0xb4')]=function(_0x126131){return BPromise[_0x5287('0xb5')]()['then'](cmHopper[_0x5287('0xb4')](_0x126131))[_0x5287('0xaf')](loggerCatch(_0x5287('0xb6')));};Dialer[_0x5287('0x1b')]['checkIsBlackList']=function(_0xa4c882){return BPromise[_0x5287('0xb5')]()[_0x5287('0xb7')](cmHopperBlack[_0x5287('0xb8')](_0xa4c882))[_0x5287('0xaf')](loggerCatch(_0x5287('0xb9')));};Dialer[_0x5287('0x1b')][_0x5287('0xba')]=function(_0x5bdcd2){return BPromise[_0x5287('0xb5')]()[_0x5287('0xb7')](cmHopperBlack[_0x5287('0xba')](_0x5bdcd2))[_0x5287('0xaf')](loggerCatch(_0x5287('0xbb')));};Dialer[_0x5287('0x1b')]['averageHandleTime']=function(_0x541546){return BPromise[_0x5287('0xb5')]()[_0x5287('0xb7')](cmHopperHistory[_0x5287('0xbc')](_0x541546))[_0x5287('0xaf')](loggerCatch(_0x5287('0xbd')));};Dialer[_0x5287('0x1b')][_0x5287('0xbe')]=function(_0x58d868){return BPromise[_0x5287('0xb5')]()[_0x5287('0xb7')](cmHopper[_0x5287('0xbe')](_0x58d868))['catch'](loggerCatch(_0x5287('0xbf')));};Dialer['prototype'][_0x5287('0xc0')]=function(_0x3cffa7,_0x48a4bb,_0x5c6e14){return BPromise[_0x5287('0xb5')]()[_0x5287('0xb7')](cmHopper[_0x5287('0xc0')](_0x3cffa7,_0x48a4bb,_0x5c6e14))['catch'](loggerCatch(_0x5287('0xc1')));};Dialer[_0x5287('0x1b')][_0x5287('0xc2')]=function(_0x1284aa,_0x44d9cb,_0x286bd1,_0x2cdea7){return BPromise[_0x5287('0xb5')]()['then'](cmHopper[_0x5287('0xc2')](_0x1284aa,_0x44d9cb,_0x286bd1,_0x2cdea7))[_0x5287('0xaf')](loggerCatch(_0x5287('0xc3')));};Dialer['prototype'][_0x5287('0xc4')]=function(_0x16a3f9,_0x24a890,_0x1d6fba){return BPromise['resolve']()[_0x5287('0xb7')](cmHopper['getContactDialerIvr'](_0x16a3f9,_0x24a890,_0x1d6fba))[_0x5287('0xaf')](loggerCatch(_0x5287('0xc3')));};Dialer[_0x5287('0x1b')][_0x5287('0xc5')]=function(_0x1f766f){return BPromise[_0x5287('0xb5')]()[_0x5287('0xb7')](voiceQueueRt['getVoiceQueueRtPauses'](_0x1f766f))[_0x5287('0xaf')](loggerCatch(_0x5287('0xc6')));};Dialer['prototype'][_0x5287('0xc7')]=function(_0x4d6596){return BPromise['resolve']()[_0x5287('0xb7')](cmHopper[_0x5287('0xc7')](_0x4d6596))[_0x5287('0xaf')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x5287('0xc8')]=function(_0x4b0c75){return BPromise[_0x5287('0xb5')]()['then'](cmHopperHistory[_0x5287('0xc8')](_0x4b0c75))[_0x5287('0xaf')](loggerCatch(_0x5287('0xc9')));};Dialer[_0x5287('0x1b')][_0x5287('0xb3')]=function(_0x223885){if(!_[_0x5287('0x80')](_0x223885)&&_0x223885!==null){if(typeof _0x223885[_0x5287('0x94')]!=='undefined'){if(_0x223885['originated']>0x0){_0x223885[_0x5287('0x94')]-=0x1;}else{logger[_0x5287('0x92')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x5287('0xca'));}};Dialer[_0x5287('0x1b')][_0x5287('0xcb')]=function(_0xd6fe4b,_0x26e642){var _0x997ec8=this;return function(_0x1c09f2){_0x997ec8['updateOriginated'](_0x26e642);logger[_0x5287('0x92')](_0xd6fe4b,util['inspect'](_0x1c09f2,{'showHidden':![],'depth':null}));};};Dialer[_0x5287('0x1b')]['emptyContact']=function(_0x571fa1,_0x41add5,_0x40a12e){var _0x34889c={'state':0x19,'statedesc':_0x5287('0xcc')};this[_0x5287('0xb3')](_0x41add5);this[_0x5287('0xcd')](_[_0x5287('0x8b')](_0x34889c,_['pick'](_0x40a12e,[_0x5287('0xce'),_0x5287('0xcf'),_0x5287('0xd0'),_0x5287('0xd1'),_0x5287('0xd2')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x5287('0x92')](_0x571fa1);};Dialer[_0x5287('0x1b')][_0x5287('0xd3')]=function(_0x10c404){return _0x10c404==='Success';};Dialer[_0x5287('0x1b')][_0x5287('0xd4')]=function(_0x21c309){return!_[_0x5287('0x80')](_0x21c309)&&_0x21c309&&!_[_0x5287('0x80')](_0x21c309[_0x5287('0x3c')])&&!_[_0x5287('0x80')](_0x21c309[_0x5287('0x70')])&&_0x21c309['active']&&(this[_0x5287('0x23')][util[_0x5287('0x74')](_0x5287('0xd5'),_0x21c309[_0x5287('0x3c')])]['status']===_0x5287('0xd6')||this['trunks'][util[_0x5287('0x74')](_0x5287('0xd5'),_0x21c309[_0x5287('0x3c')])][_0x5287('0xd7')]===_0x5287('0xd8'));};Dialer['prototype'][_0x5287('0xcd')]=function(_0x4e6308,_0x742cb2,_0x515203){this['createHistory'](_0x4e6308)[_0x5287('0xaf')](loggerCatch(_0x742cb2));this['moveContactManagedDialer'](_0x4e6308)[_0x5287('0xaf')](loggerCatch(_0x515203));};Dialer[_0x5287('0x1b')][_0x5287('0xd9')]=function(_0x905432){var _0x2c7c6f=this[_0x5287('0xa7')][_0x905432['uniqueid']];var _0x31165c;if(!_[_0x5287('0xad')](_0x905432)&&!_[_0x5287('0xad')](_0x905432['variable'])&&!_['isNil'](_0x905432[_0x5287('0xda')][_0x5287('0xdb')])&&_0x905432['exten']===_0x5287('0xdc')&&_0x2c7c6f){if(_0x2c7c6f[_0x5287('0x51')]!==_0x5287('0x73')&&this[_0x5287('0x20')][_0x2c7c6f[_0x5287('0xb1')]][_0x5287('0xdd')]&&_0x905432[_0x5287('0xde')]===_0x5287('0xdf')){delete this[_0x5287('0xa7')][_0x905432[_0x5287('0xe0')]];this[_0x5287('0xb3')](this[_0x5287('0x20')][_0x2c7c6f[_0x5287('0xb1')]]);this[_0x5287('0x20')][_0x2c7c6f['queue']][_0x5287('0xe1')]+=0x1;this[_0x5287('0x20')][_0x2c7c6f[_0x5287('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x31165c=new Hangup(_0x2c7c6f,_0x905432);_0x31165c[_0x5287('0xa2')]=0x12;_0x31165c[_0x5287('0xa3')]=_0x5287('0xe2');_0x31165c[_0x5287('0xe3')]=_0x5287('0xe4');this['saveInDb'](_0x31165c,_0x5287('0xe5'),_0x5287('0xe6'));}if(_0x2c7c6f[_0x5287('0x51')]!=='ivr'&&this[_0x5287('0x20')][_0x2c7c6f[_0x5287('0xb1')]][_0x5287('0xdd')]&&_0x905432[_0x5287('0xde')]===_0x5287('0xe7')){var _0x50714c=this;return new BPromise(function(_0x54eb0d,_0x3fdf1b){delete _0x50714c[_0x5287('0xa7')][_0x905432[_0x5287('0xe0')]];_0x50714c[_0x5287('0xb3')](_0x50714c[_0x5287('0x20')][_0x2c7c6f[_0x5287('0xb1')]]);_0x50714c['voiceQueues'][_0x2c7c6f[_0x5287('0xb1')]][_0x5287('0xe1')]+=0x1;_0x50714c[_0x5287('0x20')][_0x2c7c6f[_0x5287('0xb1')]][_0x5287('0x58')]+=0x1;var _0x176829=_0x50714c[_0x5287('0x20')][_0x2c7c6f[_0x5287('0xb1')]];var _0xdd26a9=new Hangup(_0x2c7c6f,_0x905432);_0xdd26a9[_0x5287('0xa2')]=0x13;_0xdd26a9[_0x5287('0xa3')]=_0x5287('0xe8');_0xdd26a9[_0x5287('0xe3')]=_0x5287('0xe4');_0xdd26a9['countmachineretry']+=0x1;_0xdd26a9[_0x5287('0xe9')]+=0x1;_0xdd26a9[_0x5287('0xea')]=!![];_0x50714c[_0x5287('0xc8')](_0xdd26a9)[_0x5287('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xdd26a9[_0x5287('0xeb')]+_0xdd26a9[_0x5287('0xec')]+_0xdd26a9[_0x5287('0xed')]+_0xdd26a9['countnosuchnumberretry']+_0xdd26a9[_0x5287('0xee')]+_0xdd26a9['countabandonedretry']+_0xdd26a9[_0x5287('0xef')]+_0xdd26a9[_0x5287('0xf0')]>=_0x176829[_0x5287('0xf1')]){_0x50714c[_0x5287('0xf2')](_0xdd26a9,_0x54eb0d,_0x3fdf1b,_0x5287('0xf3'));}else{if(_0xdd26a9['countmachineretry']>=_0x176829[_0x5287('0xf4')]){_0x50714c['createStateFinal'](_0xdd26a9,_0x54eb0d,_0x3fdf1b,_0x5287('0xf5'));}else{_0x50714c[_0x5287('0xbe')]({'active':![],'countmachineretry':_0xdd26a9[_0x5287('0xef')],'scheduledat':moment()[_0x5287('0xf6')](_0x176829[_0x5287('0xf7')],_0x5287('0xf8'))[_0x5287('0x74')](_0x5287('0xf9')),'ContactId':_0xdd26a9[_0x5287('0xce')],'ListId':_0xdd26a9[_0x5287('0xcf')],'VoiceQueueId':_0xdd26a9['VoiceQueueId']||undefined,'CampaignId':_0xdd26a9[_0x5287('0xd2')]||undefined})['catch'](loggerCatch(_0x5287('0xfa')));_0x54eb0d({'reschedule':0x1});}}});}if(_0x2c7c6f['type']===_0x5287('0x73')&&this[_0x5287('0x21')][_0x2c7c6f['queue']][_0x5287('0xdd')]&&_0x905432[_0x5287('0xde')]===_0x5287('0xdf')){delete this['uniqueId'][_0x905432[_0x5287('0xe0')]];this[_0x5287('0xb3')](this[_0x5287('0x21')][_0x2c7c6f['queue']]);_0x31165c=new Hangup(_0x2c7c6f,_0x905432);_0x31165c[_0x5287('0xa2')]=0x12;_0x31165c[_0x5287('0xa3')]='HangupInAMD';_0x31165c[_0x5287('0xe3')]=_0x5287('0xe4');this[_0x5287('0xcd')](_0x31165c,_0x5287('0xfb'),'[syncHangupInAMDIvr]');}if(_0x2c7c6f[_0x5287('0x51')]===_0x5287('0x73')&&this[_0x5287('0x21')][_0x2c7c6f[_0x5287('0xb1')]][_0x5287('0xdd')]&&_0x905432[_0x5287('0xde')]===_0x5287('0xe7')){var _0x50714c=this;return new BPromise(function(_0x2dd7fd,_0x32b80d){delete _0x50714c['uniqueId'][_0x905432[_0x5287('0xe0')]];_0x50714c[_0x5287('0xb3')](_0x50714c[_0x5287('0x21')][_0x2c7c6f[_0x5287('0xb1')]]);_0x50714c[_0x5287('0x21')][_0x2c7c6f[_0x5287('0xb1')]][_0x5287('0xe1')]+=0x1;_0x50714c[_0x5287('0x21')][_0x2c7c6f[_0x5287('0xb1')]][_0x5287('0x58')]+=0x1;var _0x436853=_0x50714c[_0x5287('0x21')][_0x2c7c6f[_0x5287('0xb1')]];var _0x26c6ed=new Hangup(_0x2c7c6f,_0x905432);_0x26c6ed[_0x5287('0xa2')]=0x13;_0x26c6ed['statedesc']=_0x5287('0xe8');_0x26c6ed[_0x5287('0xe3')]=_0x5287('0xe4');_0x26c6ed[_0x5287('0xef')]+=0x1;_0x26c6ed['countglobal']+=0x1;_0x26c6ed['amd']=!![];_0x50714c['createHistory'](_0x26c6ed)[_0x5287('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x26c6ed[_0x5287('0xeb')]+_0x26c6ed[_0x5287('0xec')]+_0x26c6ed[_0x5287('0xed')]+_0x26c6ed[_0x5287('0xfc')]+_0x26c6ed[_0x5287('0xee')]+_0x26c6ed[_0x5287('0xfd')]+_0x26c6ed['countmachineretry']+_0x26c6ed[_0x5287('0xf0')]>=_0x436853[_0x5287('0xf1')]){_0x50714c[_0x5287('0xf2')](_0x26c6ed,_0x2dd7fd,_0x32b80d,_0x5287('0xf3'));}else{if(_0x26c6ed['countmachineretry']>=_0x436853[_0x5287('0xf4')]){_0x50714c['createStateFinal'](_0x26c6ed,_0x2dd7fd,_0x32b80d,_0x5287('0xf5'));}else{_0x50714c[_0x5287('0xbe')]({'active':![],'countmachineretry':_0x26c6ed[_0x5287('0xef')],'scheduledat':moment()[_0x5287('0xf6')](_0x436853['dialMachineRetryFrequency'],_0x5287('0xf8'))[_0x5287('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x26c6ed['ContactId'],'ListId':_0x26c6ed[_0x5287('0xcf')],'VoiceQueueId':_0x26c6ed[_0x5287('0xd1')]||undefined,'CampaignId':_0x26c6ed[_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0xfa')));_0x2dd7fd({'reschedule':0x1});}}});}}};Dialer[_0x5287('0x1b')][_0x5287('0x33')]=function(_0x2b8df9){var _0x90074=this[_0x5287('0xa7')][_0x2b8df9[_0x5287('0xe0')]];var _0x5abc83=this;var _0x1707b5;if(_0x90074&&_0x90074[_0x5287('0x51')]==='ivr'){delete this[_0x5287('0xa7')][_0x2b8df9[_0x5287('0xe0')]];this[_0x5287('0xb3')](this['campaigns'][_0x90074['queue']]);this[_0x5287('0x21')][_0x90074['queue']][_0x5287('0xfe')]+=0x1;_0x1707b5=new Hangup(_0x90074,_0x2b8df9);this['createHistory'](_0x1707b5)[_0x5287('0xaf')](loggerCatch(_0x5287('0xff')));this[_0x5287('0xc7')](_0x1707b5)[_0x5287('0xaf')](loggerCatch(_0x5287('0x100')));}if(_0x90074&&_0x90074[_0x5287('0x51')]!==_0x5287('0x73')&&isNotNull(this[_0x5287('0x20')][_0x90074[_0x5287('0xb1')]]['dialQueueProject'])){delete this[_0x5287('0xa7')][_0x2b8df9['uniqueid']];this['updateOriginated'](this[_0x5287('0x20')][_0x90074[_0x5287('0xb1')]]);this[_0x5287('0x20')][_0x90074[_0x5287('0xb1')]][_0x5287('0xe1')]+=0x1;this[_0x5287('0x20')][_0x90074[_0x5287('0xb1')]][_0x5287('0x58')]+=0x1;_0x1707b5=new Hangup(_0x90074,_0x2b8df9);_0x1707b5[_0x5287('0xa2')]=0x10;_0x1707b5['statedesc']=_0x5287('0x101');_0x1707b5[_0x5287('0xe3')]=_0x5287('0x102');this[_0x5287('0xc8')](_0x1707b5)['catch'](loggerCatch(_0x5287('0xff')));this['moveContactManagedDialer'](_0x1707b5)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x90074&&_0x90074[_0x5287('0x51')]!==_0x5287('0x73')&&!isNotNull(this[_0x5287('0x20')][_0x90074['queue']][_0x5287('0x103')])){delete this['uniqueId'][_0x2b8df9[_0x5287('0xe0')]];this[_0x5287('0xb3')](this[_0x5287('0x20')][_0x90074[_0x5287('0xb1')]]);this[_0x5287('0x20')][_0x90074[_0x5287('0xb1')]][_0x5287('0x5f')]+=0x1;_0x1707b5=new Hangup(_0x90074,_0x2b8df9);_0x1707b5[_0x5287('0xa2')]=0xc;_0x1707b5[_0x5287('0xa3')]=_0x2b8df9[_0x5287('0x104')];_0x1707b5[_0x5287('0xe3')]=_0x5287('0x105');this[_0x5287('0xc8')](_0x1707b5)[_0x5287('0xaf')](loggerCatch(_0x5287('0xff')));this['moveContactManagedDialer'](_0x1707b5)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x5287('0x1b')][_0x5287('0x31')]=function(_0x10d969){var _0xaa3742=this[_0x5287('0xa7')][_0x10d969['uniqueid']];var _0x35362c=this;if(this['voiceQueues'][_0x10d969[_0x5287('0xb1')]]){if(_0xaa3742&&_0xaa3742['type']!==_0x5287('0x73')){delete this['uniqueId'][_0x10d969['uniqueid']];this[_0x5287('0x20')][_0x10d969['queue']]['outboundAnswerCallsDay']+=0x1;var _0x3a4876=new AgentComplete(_0xaa3742,_0x10d969);if(_0x10d969['reason']==='agent'){_0x3a4876[_0x5287('0x106')]=this[_0x5287('0x20')][_0x10d969[_0x5287('0xb1')]]['dialQueueProject2']&&this[_0x5287('0x20')][_0x10d969[_0x5287('0xb1')]][_0x5287('0x107')]?moment()[_0x5287('0x74')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x5287('0xc8')](_0x3a4876)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x5287('0xc7')](_0x3a4876)[_0x5287('0xaf')](loggerCatch(_0x5287('0x108')));}}};Dialer[_0x5287('0x1b')][_0x5287('0x2a')]=function(_0x2284a9){if(this[_0x5287('0x20')][_0x2284a9[_0x5287('0xb1')]]){if(this[_0x5287('0xa7')][_0x2284a9[_0x5287('0xe0')]]&&this[_0x5287('0xa7')][_0x2284a9[_0x5287('0xe0')]]['type']!==_0x5287('0x73')){this[_0x5287('0xb3')](this['voiceQueues'][_0x2284a9[_0x5287('0xb1')]]);this[_0x5287('0xa7')][_0x2284a9['uniqueid']]['answertime']=moment()[_0x5287('0x74')](_0x5287('0xf9'));}}};Dialer['prototype'][_0x5287('0x109')]=function(_0x48dd01){this[_0x5287('0xc8')](_0x48dd01)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x48dd01)['catch'](loggerCatch(_0x5287('0x10a')));};Dialer['prototype'][_0x5287('0x2d')]=function(_0x23404f){var _0xc5ddc7=this[_0x5287('0xa7')][_0x23404f[_0x5287('0xe0')]];var _0x13909f=this;if(this['voiceQueues'][_0x23404f[_0x5287('0xb1')]]){if(_0xc5ddc7&&_0xc5ddc7[_0x5287('0x51')]!==_0x5287('0x73')){delete this[_0x5287('0xa7')][_0x23404f[_0x5287('0xe0')]];this['updateOriginated'](this['voiceQueues'][_0x23404f['queue']]);_0xc5ddc7[_0x5287('0x10b')]=moment()[_0x5287('0x74')]('YYYY-MM-DD\x20HH:mm:ss');var _0xdeb806=new QueueCallerAbandon(_0xc5ddc7,_0x23404f);if(getSeconds(_0xc5ddc7[_0x5287('0x10b')],_0xc5ddc7[_0x5287('0x10c')])>=_0xc5ddc7[_0x5287('0x10d')]){this[_0x5287('0x20')][_0x23404f[_0x5287('0xb1')]][_0x5287('0x63')]+=0x1;this[_0x5287('0x20')][_0x23404f[_0x5287('0xb1')]][_0x5287('0x5b')]+=0x1;this[_0x5287('0x20')][_0x23404f[_0x5287('0xb1')]][_0x5287('0x65')]+=0x1;_0xdeb806['state']=0xa;_0xdeb806[_0x5287('0xa3')]='Drop';_0xdeb806[_0x5287('0x10e')]=_0x5287('0x10f');_0xdeb806[_0x5287('0x106')]=this[_0x5287('0x20')][_0x23404f[_0x5287('0xb1')]][_0x5287('0x110')]?moment()['format'](_0x5287('0xf9')):undefined;_0xdeb806[_0x5287('0xee')]+=0x1;_0xdeb806['countglobal']+=0x1;if(_0xdeb806['countdropretry']>=this[_0x5287('0x20')][_0x23404f[_0x5287('0xb1')]][_0x5287('0x111')]){this[_0x5287('0x109')](_0xdeb806);}else{this[_0x5287('0xbe')]({'active':![],'countdropretry':_0xdeb806['countdropretry'],'scheduledat':moment()[_0x5287('0xf6')](this[_0x5287('0x20')][_0x23404f[_0x5287('0xb1')]][_0x5287('0x112')],_0x5287('0xf8'))[_0x5287('0x74')](_0x5287('0xf9')),'ContactId':_0xc5ddc7[_0x5287('0xce')],'ListId':_0xc5ddc7[_0x5287('0xcf')],'VoiceQueueId':_0xc5ddc7[_0x5287('0xd1')]||undefined,'CampaignId':_0xc5ddc7[_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch('[rescheduleContact][Drop]'));var _0x1c2dfc=new History(_0xdeb806);_0x1c2dfc['state']=0xa;_0x1c2dfc[_0x5287('0xa3')]=_0x5287('0x113');_0x1c2dfc[_0x5287('0xa5')]=moment()[_0x5287('0x74')](_0x5287('0xf9'));_0x1c2dfc['endtime']=_0x1c2dfc['starttime'];_0x1c2dfc[_0x5287('0x114')]=_0xdeb806[_0x5287('0x114')];_0x1c2dfc[_0x5287('0x115')]=_0xdeb806[_0x5287('0x115')];this[_0x5287('0xc8')](_0x1c2dfc)[_0x5287('0xaf')](loggerCatch(_0x5287('0x116')));}}else{this['voiceQueues'][_0x23404f[_0x5287('0xb1')]][_0x5287('0x62')]+=0x1;this[_0x5287('0x20')][_0x23404f[_0x5287('0xb1')]]['outboundDropCallsDayCallersExit']+=0x1;_0xdeb806[_0x5287('0xa2')]=0xb;_0xdeb806['statedesc']=_0x5287('0x117');_0xdeb806['dropreason']='CALLEREXIT';_0xdeb806['countabandonedretry']+=0x1;_0xdeb806[_0x5287('0xe9')]+=0x1;if(_0xdeb806[_0x5287('0xfd')]>=this[_0x5287('0x20')][_0x23404f[_0x5287('0xb1')]]['dialAbandonedMaxRetry']){this[_0x5287('0x109')](_0xdeb806);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0xdeb806[_0x5287('0xfd')],'scheduledat':moment()[_0x5287('0xf6')](this[_0x5287('0x20')][_0x23404f[_0x5287('0xb1')]][_0x5287('0x118')],_0x5287('0xf8'))['format'](_0x5287('0xf9')),'ContactId':_0xc5ddc7['ContactId'],'ListId':_0xc5ddc7[_0x5287('0xcf')],'VoiceQueueId':_0xc5ddc7['VoiceQueueId']||undefined,'CampaignId':_0xc5ddc7[_0x5287('0xd2')]||undefined})['catch'](loggerCatch(_0x5287('0x119')));var _0x1c2dfc=new History(_0xdeb806);_0x1c2dfc[_0x5287('0xa2')]=0xb;_0x1c2dfc['statedesc']=_0x5287('0x117');_0x1c2dfc[_0x5287('0xa5')]=moment()[_0x5287('0x74')](_0x5287('0xf9'));_0x1c2dfc['endtime']=_0x1c2dfc[_0x5287('0xa5')];_0x1c2dfc[_0x5287('0x114')]=_0xdeb806['calleridname'];_0x1c2dfc[_0x5287('0x115')]=_0xdeb806[_0x5287('0x115')];this['createHistory'](_0x1c2dfc)[_0x5287('0xaf')](loggerCatch(_0x5287('0x11a')));}}}}};Dialer[_0x5287('0x1b')][_0x5287('0x35')]=function(_0x26024c){if(this[_0x5287('0x24')][_0x26024c[_0x5287('0xe0')]]){this['actions'][_0x26024c[_0x5287('0xe0')]][_0x5287('0x11b')]=_0x26024c['channel'];}if(this[_0x5287('0xa7')][_0x26024c['uniqueid']]){this['uniqueId'][_0x26024c[_0x5287('0xe0')]][_0x5287('0x11b')]=_0x26024c[_0x5287('0x11b')];}};Dialer[_0x5287('0x1b')][_0x5287('0x37')]=function(_0x298ba6){if(strategy[this[_0x5287('0x20')][this[_0x5287('0x24')][_0x298ba6[_0x5287('0x11c')]][_0x5287('0xb1')]][_0x5287('0x4a')]]===_0x5287('0x1a')){if(this[_0x5287('0x24')][_0x298ba6[_0x5287('0x11c')]]&&_[_0x5287('0xad')](this['actions'][_0x298ba6[_0x5287('0x11c')]][_0x5287('0x11d')])&&_0x298ba6[_0x5287('0xd7')]==='1'&&_0x298ba6[_0x5287('0x11e')]==='0'){if(this[_0x5287('0x22')][_0x298ba6[_0x5287('0x11f')]]){if(!this[_0x5287('0x22')][_0x298ba6[_0x5287('0x11f')]][_0x5287('0x11d')]){this[_0x5287('0x22')][_0x298ba6['stateinterface']]['locked']=!![];this[_0x5287('0x24')][_0x298ba6[_0x5287('0x11c')]][_0x5287('0x11d')]=!![];this[_0x5287('0x24')][_0x298ba6[_0x5287('0x11c')]]['stateinterface']=_0x298ba6[_0x5287('0x11f')];}}}}else if((strategy[this[_0x5287('0x20')][this[_0x5287('0x24')][_0x298ba6['actionid']][_0x5287('0xb1')]][_0x5287('0x4a')]]||_0x5287('0x19'))===_0x5287('0x19')){if(this[_0x5287('0x24')][_0x298ba6[_0x5287('0x11c')]]){if(this['agents'][_0x298ba6[_0x5287('0x11f')]]){this[_0x5287('0x24')][_0x298ba6[_0x5287('0x11c')]]['stateinterface']=_0x298ba6['stateinterface'];if(_[_0x5287('0xad')](this[_0x5287('0x28')][this[_0x5287('0x24')][_0x298ba6['actionid']][_0x5287('0xb1')]])){this[_0x5287('0x28')][this[_0x5287('0x24')][_0x298ba6[_0x5287('0x11c')]][_0x5287('0xb1')]]=[];}this[_0x5287('0x28')][this[_0x5287('0x24')][_0x298ba6[_0x5287('0x11c')]]['queue']][_0x5287('0x120')](_[_0x5287('0x8b')](_[_0x5287('0x121')](this['actions'][_0x298ba6[_0x5287('0x11c')]],[_0x5287('0x122'),_0x5287('0x11f')]),{'status':_0x298ba6['status'],'paused':_0x298ba6['paused']}));}}}};function unlockQueueStatus(_0x4ccb05,_0x56ea02){setTimeout(function(){if(_['isUndefined'](_0x4ccb05['queueStatusComplete'])){loggerBooked[_0x5287('0x92')](_0x5287('0x123'),_0x56ea02);}_0x4ccb05[_0x5287('0x124')]=!![];loggerBooked[_0x5287('0x78')](_0x5287('0x125'),_0x56ea02,JSON['stringify'](_[_0x5287('0x121')](_0x4ccb05,[_0x5287('0x3c'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x5287('0x1b')][_0x5287('0x39')]=function(_0x3c2757){var _0x19e2b7=this;var _0x15d41a=_0x19e2b7[_0x5287('0x20')][_0x19e2b7[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]];if(strategy[this['voiceQueues'][this[_0x5287('0x24')][_0x3c2757['actionid']][_0x5287('0xb1')]]['strategy']]===_0x5287('0x1a')){if(this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]]&&this[_0x5287('0x24')][_0x3c2757['actionid']]['stateinterface']){this[_0x5287('0x1f')][_0x5287('0x126')](this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0x122')],this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0x11f')])[_0x5287('0xaf')](function(_0x46064d){logger[_0x5287('0x92')](_0x5287('0x127'),util['inspect'](_0x46064d,{'showHidden':![],'depth':null}));})[_0x5287('0x1e')](function(){_0x19e2b7[_0x5287('0xb3')](_0x19e2b7[_0x5287('0x20')][_0x19e2b7['actions'][_0x3c2757[_0x5287('0x11c')]]['queue']]);_0x19e2b7[_0x5287('0x22')][_0x19e2b7[_0x5287('0x24')][_0x3c2757['actionid']][_0x5287('0x11f')]][_0x5287('0x11d')]=![];delete _0x19e2b7[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]];unlockQueueStatus(_0x15d41a);});}else{this[_0x5287('0xb3')](this[_0x5287('0x20')][this['actions'][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xce')],'ListId':this['actions'][_0x3c2757['actionid']][_0x5287('0xcf')],'VoiceQueueId':this['actions'][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xd1')]||undefined,'CampaignId':this[_0x5287('0x24')][_0x3c2757['actionid']][_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x128')));delete this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]];unlockQueueStatus(_0x15d41a);}}else if((strategy[this[_0x5287('0x20')][this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]][_0x5287('0x4a')]]||'rrmemory')===_0x5287('0x19')){var _0x2edc49;if(this['actions'][_0x3c2757[_0x5287('0x11c')]]&&!_[_0x5287('0x42')](this[_0x5287('0x28')][this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]])){if(this[_0x5287('0x29')][_0x19e2b7[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]]){this['queueBookedRR'][_0x19e2b7[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]]['queue']]=this[_0x5287('0x29')][this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]]?this[_0x5287('0x29')][this[_0x5287('0x24')][_0x3c2757['actionid']][_0x5287('0xb1')]]:this[_0x5287('0x28')][this['actions'][_0x3c2757[_0x5287('0x11c')]]['queue']]?this[_0x5287('0x28')][this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]]['queue']][_0x5287('0x129')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]][_0x5287('0x129')]=this[_0x5287('0x29')][this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]];for(var _0x1b430b=0x0;_0x1b430b<this[_0x5287('0x28')][this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]]['queue']][_0x5287('0x12a')];_0x1b430b+=0x1){_0x2edc49=rr(this['queueBooked'][this['actions'][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]]);this[_0x5287('0x29')][_0x19e2b7[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]]['queue']]=this[_0x5287('0x28')][this['actions'][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]][_0x5287('0x129')];if(_0x2edc49[_0x5287('0xd7')]==='1'&&_0x2edc49[_0x5287('0x11e')]==='0'){break;}}if(!_[_0x5287('0xad')](_0x2edc49)){this[_0x5287('0x22')][_0x2edc49[_0x5287('0x11f')]][_0x5287('0x12b')]=_[_0x5287('0x80')](this[_0x5287('0x22')][_0x2edc49[_0x5287('0x11f')]][_0x5287('0x12b')])?!![]:this[_0x5287('0x22')][_0x2edc49[_0x5287('0x11f')]][_0x5287('0x12b')];}loggerBooked[_0x5287('0x78')]('[booked][RR]',_0x3c2757[_0x5287('0x11c')],_0x5287('0x12c'),JSON[_0x5287('0x45')](_[_0x5287('0x121')](this[_0x5287('0x22')][_0x2edc49[_0x5287('0x11f')]],[_0x5287('0x3c'),_0x5287('0x12b')])),_0x5287('0x12d'),JSON[_0x5287('0x45')](_0x2edc49[_0x5287('0x122')]));if(!_[_0x5287('0xad')](_0x2edc49)&&_0x2edc49['status']==='1'&&_0x2edc49[_0x5287('0x11e')]==='0'&&this[_0x5287('0x22')][_0x2edc49[_0x5287('0x11f')]][_0x5287('0x12b')]){this['agents'][_0x2edc49[_0x5287('0x11f')]][_0x5287('0x12b')]=![];this[_0x5287('0x28')][_0x19e2b7[_0x5287('0x24')][_0x3c2757['actionid']][_0x5287('0xb1')]]=[];this[_0x5287('0x1f')][_0x5287('0x126')](_0x2edc49[_0x5287('0x122')],_0x2edc49[_0x5287('0x11f')])[_0x5287('0xaf')](function(_0x464bb9){logger[_0x5287('0x92')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x5287('0x91')](_0x464bb9,{'showHidden':![],'depth':null}));})[_0x5287('0x1e')](function(){_0x19e2b7[_0x5287('0xb3')](_0x19e2b7['voiceQueues'][_0x19e2b7[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]]);setTimeout(function(){_0x19e2b7['agents'][_0x2edc49['stateinterface']][_0x5287('0x12b')]=!![];loggerBooked[_0x5287('0x78')](_0x5287('0x12e'),_0x3c2757['actionid'],_0x5287('0x12c'),JSON[_0x5287('0x45')](_[_0x5287('0x121')](_0x19e2b7['agents'][_0x2edc49[_0x5287('0x11f')]],[_0x5287('0x3c'),'unlockRR'])),'contactAgent-idHopper:\x20',JSON['stringify'](_0x2edc49[_0x5287('0x122')]));},0xc7);delete _0x19e2b7[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]];unlockQueueStatus(_0x15d41a,_0x3c2757[_0x5287('0x11c')]);});}else{loggerBooked[_0x5287('0x78')]('[booked][unlock]');this['updateOriginated'](this[_0x5287('0x20')][this['actions'][_0x3c2757['actionid']][_0x5287('0xb1')]]);this[_0x5287('0xbe')]({'active':![],'ContactId':this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xce')],'ListId':this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xcf')],'VoiceQueueId':this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xd1')]||undefined,'CampaignId':this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x128')));delete this[_0x5287('0x24')][_0x3c2757['actionid']];unlockQueueStatus(_0x15d41a);}}else{loggerBooked['info'](_0x5287('0x12f'));this[_0x5287('0xb3')](this[_0x5287('0x20')][this[_0x5287('0x24')][_0x3c2757['actionid']][_0x5287('0xb1')]]);this[_0x5287('0xbe')]({'active':![],'ContactId':this[_0x5287('0x24')][_0x3c2757['actionid']][_0x5287('0xce')],'ListId':this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]]['ListId'],'VoiceQueueId':this['actions'][_0x3c2757[_0x5287('0x11c')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x5287('0x24')][_0x3c2757['actionid']][_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this['actions'][_0x3c2757[_0x5287('0x11c')]];unlockQueueStatus(_0x15d41a);}}else{loggerBooked[_0x5287('0x78')]('[booked][unlock3]');this[_0x5287('0xb3')](this[_0x5287('0x20')][this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xb1')]]);this[_0x5287('0xbe')]({'active':![],'ContactId':this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xce')],'ListId':this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xcf')],'VoiceQueueId':this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]][_0x5287('0xd1')]||undefined,'CampaignId':this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x5287('0x130')));delete this[_0x5287('0x24')][_0x3c2757[_0x5287('0x11c')]];unlockQueueStatus(_0x15d41a);}};Dialer[_0x5287('0x1b')][_0x5287('0x131')]=function(){var _0x14b43d=this;setInterval(function(){_0x14b43d[_0x5287('0x132')]();},0x3e8);};Dialer[_0x5287('0x1b')]['checkIsTrunkReachable']=function(_0x3ea458){var _0x30ea9a=this;return function(){if(!_0x30ea9a['isTrunkReachable'](_0x3ea458['Trunk'])){if(!_0x30ea9a[_0x5287('0xd4')](_0x3ea458[_0x5287('0x133')])){_0x3ea458[_0x5287('0x3a')]=_0x5287('0x134');throw _0x3ea458[_0x5287('0x3c')]+_0x5287('0x135');}}};};Dialer['prototype']['checkIfTime']=function(_0x16c080,_0x5a0d95,_0x5b780c,_0x53e991){var _0x3122f3=this;return function(){var _0x481095=!![];return _0x3122f3['ifTime'](_0x16c080,_0x5a0d95,_0x5b780c,_0x53e991,_0x481095);};};Dialer[_0x5287('0x1b')][_0x5287('0x136')]=function(_0x271ba2,_0x166945,_0x13b4aa,_0x142764){var _0x3f2e89=this;return function(){var _0x4129e7=![];return _0x3f2e89[_0x5287('0x137')](_0x271ba2['Intervals'],_0x166945,_0x13b4aa,_0x142764,_0x4129e7);};};Dialer[_0x5287('0x1b')][_0x5287('0x137')]=function(_0x260ee1,_0x493477,_0x5ccedf,_0x52e555,_0x2e4379){var _0x470f22=[];return new BPromise(function(_0x47611a,_0x340153){if(!isNotNull(_0x260ee1)){_0x52e555[_0x5287('0x3a')]=_0x5287('0x43');return _0x340153(msgResponse(_0x5287('0x137'),_0x5287('0x138'),_0x5ccedf+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x5287('0x42')](_0x260ee1)){_0x52e555[_0x5287('0x3a')]=_0x5287('0x139');return _0x340153(msgResponse(_0x5287('0x137'),'Failure',_0x5ccedf+'\x20Intervals\x20is\x20empty\x20'));}if(_0x493477&&_['isUndefined'](config[_0x5287('0x13a')][_0x493477])){_0x52e555[_0x5287('0x3a')]='TIMEZONE_UNKNOW';return _0x340153(msgResponse(_0x5287('0x137'),'Failure',_0x5ccedf+'\x20Timezone\x20unknow\x20'+_0x493477));}if(_[_0x5287('0x13b')](_0x260ee1)){for(var _0x22b839=0x0;_0x22b839<_0x260ee1[_0x5287('0x12a')];_0x22b839+=0x1){_0x470f22[_0x5287('0x120')](ami[_0x5287('0xae')]({'action':_0x5287('0x13c'),'command':util[_0x5287('0x74')](_0x5287('0x13d'),_0x260ee1[_0x22b839][_0x5287('0x13e')],!_[_0x5287('0x80')](config[_0x5287('0x13a')][_0x493477])?_0x493477:'')})[_0x5287('0xb7')](function(_0x3cd76a){return _0x3cd76a[_0x5287('0x13f')]['indexOf'](_0x5287('0x140'))>=0x0;})[_0x5287('0xaf')](myreject(_0x340153)));}}else{_0x470f22['push'](ami[_0x5287('0xae')]({'action':_0x5287('0x13c'),'command':util[_0x5287('0x74')](_0x5287('0x13d'),_0x260ee1,!_['isUndefined'](config[_0x5287('0x13a')][_0x493477])?_0x493477:'')})['then'](function(_0x37d3e0){return _0x37d3e0[_0x5287('0x13f')][_0x5287('0x141')](_0x5287('0x140'))>=0x0;})[_0x5287('0xaf')](myreject(_0x340153)));}BPromise['all'](_0x470f22)[_0x5287('0xb7')](function(_0x3b0fb1){var _0x24845e=_['some'](_0x3b0fb1);if(_0x24845e){return _0x47611a(_0x24845e);}else{_0x52e555[_0x5287('0x3a')]=_0x2e4379?'GLOBAL_INTERVAL_IS_OVERTIME':'INTERVAL_IS_OVERTIME';return _0x340153(msgResponse(_0x5287('0x142'),_0x5287('0x138'),_0x5287('0x143')+_0x2e4379+'\x20'+_0x5ccedf+_0x5287('0x144')+util[_0x5287('0x91')](_0x260ee1,{'showHidden':![],'depth':null})+_0x5287('0x145')+_0x493477));}})[_0x5287('0xaf')](function(_0x198545){return _0x340153(msgResponse(_0x5287('0x137'),_0x5287('0x138'),JSON[_0x5287('0x45')](_0x198545)));});});};Dialer[_0x5287('0x1b')][_0x5287('0x146')]=function(_0x3e9cc4){var _0x442675=this;return function(){switch(_0x3e9cc4[_0x5287('0x55')]){case _0x5287('0x147'):freeVariablesPredictive(_0x3e9cc4);_0x442675['handlePower'](_0x3e9cc4,0x1);break;case _0x5287('0x148'):freeVariablesPredictive(_0x3e9cc4);_0x442675[_0x5287('0x149')](_0x3e9cc4,_0x3e9cc4[_0x5287('0x14a')]);break;case _0x5287('0xb'):_0x442675[_0x5287('0xb')](_0x3e9cc4);break;case'booked':freeVariablesPredictive(_0x3e9cc4);_0x442675[_0x5287('0x149')](_0x3e9cc4,0x1);break;default:freeVariablesPredictive(_0x3e9cc4);logger['error'](_0x5287('0x14b'),_0x3e9cc4['name'],_0x5287('0x14c'));}};};Dialer[_0x5287('0x1b')][_0x5287('0x14d')]=function(_0x12c282){var _0x122ebd=this;return function(){_0x122ebd[_0x5287('0x14e')](_0x12c282);};};Dialer[_0x5287('0x1b')][_0x5287('0x14f')]=function(_0x3088ac){var _0x5c5544=this;if(isNotPreview(_0x3088ac['dialMethod'])){if(isVoiceQueueOutbound(_0x3088ac[_0x5287('0x51')])&&isActive(_0x3088ac[_0x5287('0x54')])){_0x3088ac[_0x5287('0x9b')]=!![];BPromise[_0x5287('0xb5')]()['then'](checkIsLoggedIn(_0x3088ac,_0x3088ac[_0x5287('0x150')]))[_0x5287('0xb7')](checkIsActive(_0x3088ac,_0x3088ac[_0x5287('0x54')]))[_0x5287('0xb7')](checkInterval(_0x3088ac))[_0x5287('0xb7')](_0x5c5544[_0x5287('0x151')](_0x3088ac))['then'](_0x5c5544['checkIfTime'](_0x3088ac[_0x5287('0x152')],_0x3088ac[_0x5287('0x153')],_0x3088ac['name'],_0x3088ac))['then'](_0x5c5544[_0x5287('0x136')](_0x3088ac[_0x5287('0x40')],_0x3088ac[_0x5287('0x153')],_0x3088ac[_0x5287('0x3c')],_0x3088ac))['then'](_0x5c5544[_0x5287('0x146')](_0x3088ac))[_0x5287('0xaf')](loggerCatchQueueSummary(_0x5287('0x154'),_0x3088ac));}else{notSendMessagesQueue(_0x3088ac);}}else{freeVariablesPredictive(_0x3088ac);}};Dialer[_0x5287('0x1b')]['syncCampaigns']=function(){var _0x4ba64f=this;var _0x518d39;for(var _0x14391c in this[_0x5287('0x21')]){if(typeof this[_0x5287('0x21')][_0x14391c]!==_0x5287('0xab')){_0x518d39=this[_0x5287('0x21')][_0x14391c];if(isCampaignIvr(_0x518d39[_0x5287('0x51')])&&isActive(_0x518d39['active'])){_0x518d39[_0x5287('0x9b')]=!![];BPromise[_0x5287('0xb5')]()[_0x5287('0xb7')](checkIsActive(_0x518d39,_0x518d39[_0x5287('0x70')]))[_0x5287('0xb7')](checkInterval(_0x518d39))['then'](_0x4ba64f['checkIsTrunkReachable'](_0x518d39))[_0x5287('0xb7')](_0x4ba64f[_0x5287('0x155')](_0x518d39[_0x5287('0x152')],_0x518d39[_0x5287('0x153')],_0x518d39[_0x5287('0x3c')],_0x518d39))[_0x5287('0xb7')](_0x4ba64f[_0x5287('0x136')](_0x518d39['Interval'],_0x518d39[_0x5287('0x153')],_0x518d39[_0x5287('0x3c')],_0x518d39))['then'](_0x4ba64f[_0x5287('0x14d')](_0x518d39))[_0x5287('0xaf')](loggerCatchQueueSummary('[syncCampaigns]',_0x518d39));}else{notSendMessagesCampaign(_0x518d39);}}}};function getCallerIdRandom(_0x4846fa,_0x49cd39){var _0x20bcbc;var _0x5a62b5;var _0x515dd1;if(_0x49cd39<=0x0){_0x49cd39=0x1;}_0x20bcbc=new RegExp(_0x5287('0x156')+_0x49cd39+'}$');_0x5a62b5=Math['pow'](0xa,_0x49cd39-0x1);_0x515dd1=Math[_0x5287('0x157')](0xa,_0x49cd39)-0x1;return util[_0x5287('0x74')]('%s',_['replace'](_0x4846fa,_0x20bcbc,_[_0x5287('0x158')](_0x5a62b5,_0x515dd1)));}function extractCalleridName(_0x81223){var _0x45fbff=_0x81223[_0x5287('0x159')](/"(.*?)"/);return _0x45fbff?_0x45fbff[0x1]:_0x81223;}function extractCalleridNumber(_0x27807f){var _0x1cddda=_0x27807f[_0x5287('0x159')](/<(.*?)>/);return _0x1cddda?_0x1cddda[0x1]:_0x27807f;}Dialer[_0x5287('0x1b')]['actionOriginate']=function(_0x4f0e35,_0x3fb748){var _0x3959d2=this;var _0x1a0cc3=uuid['v4']();this[_0x5287('0x24')][_0x1a0cc3]=new Action(_0x4f0e35,_0x3fb748,_0x1a0cc3);return new BPromise(function(_0x40e5f9,_0x11bca5){if(_[_0x5287('0x80')](_0x4f0e35)&&typeof _0x4f0e35!==_0x5287('0x15a')){return _0x11bca5(msgResponse('originate',_0x5287('0x138'),_0x5287('0x15b')));}if(_[_0x5287('0x80')](_0x3fb748[_0x5287('0x15c')]['phone'])||_0x3fb748[_0x5287('0x15c')]['phone']===null){return _0x11bca5(msgResponse(_0x5287('0x15d'),_0x5287('0x138'),_0x5287('0x15e')));}var _0x4df194={'XMD-CALLERID':_0x3959d2[_0x5287('0x24')][_0x1a0cc3]['getCaller'](),'XMD-AGI':_0x4f0e35[_0x5287('0x103')]?util[_0x5287('0x74')](_0x5287('0x15f'),ipAgi,_0x4f0e35[_0x5287('0x103')]):_0x5287('0x160'),'XMD-AGIAFTER':_0x4f0e35[_0x5287('0x110')]?util['format'](_0x5287('0x15f'),ipAgi,_0x4f0e35[_0x5287('0x110')]):_0x5287('0x160'),'XMD-QUEUE':_0x4f0e35['type']===_0x5287('0x49')?util[_0x5287('0x74')]('\x22%s,%s%s,,,%s\x22',_0x4f0e35[_0x5287('0x3c')],_0x4f0e35['dialQueueOptions']||'',_0x4f0e35[_0x5287('0x107')]?'c':'',_0x4f0e35[_0x5287('0x10d')]||0x3):_0x5287('0x160'),'XMD-CONTACTID':_0x3fb748[_0x5287('0xce')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3959d2[_0x5287('0x24')][_0x1a0cc3][_0x5287('0x161')](),'XMD-AMD':_0x4f0e35[_0x5287('0xdd')]?'ACTIVE':_0x5287('0x160'),'XMD-DESTINATION':_0x5287('0xdc')};if(_0x4f0e35[_0x5287('0xdd')]){_0x4df194[_0x5287('0x162')]=_0x4f0e35[_0x5287('0x163')]||0x9c4;_0x4df194['XMD-AMDGREETING']=_0x4f0e35[_0x5287('0x164')]||0x5dc;_0x4df194[_0x5287('0x165')]=_0x4f0e35[_0x5287('0x166')]||0x320;_0x4df194[_0x5287('0x167')]=_0x4f0e35['dialAMDTotalAnalysisTime']||0x1388;_0x4df194[_0x5287('0x168')]=_0x4f0e35['dialAMDMinWordLength']||0x64;_0x4df194[_0x5287('0x169')]=_0x4f0e35[_0x5287('0x16a')]||0x32;_0x4df194[_0x5287('0x16b')]=_0x4f0e35[_0x5287('0x16c')]||0x3;_0x4df194[_0x5287('0x16d')]=_0x4f0e35['dialAMDSilenceThreshold']||0x100;_0x4df194['XMD-AMDMAXIMUMWORDLENGTH']=_0x4f0e35[_0x5287('0x16e')]||0x1388;}if(_0x4f0e35[_0x5287('0x51')]===_0x5287('0x49')){_0x4df194[_0x5287('0x16f')]=_0x3fb748[_0x5287('0xd1')];}else{_0x4df194[_0x5287('0x170')]=_0x3fb748[_0x5287('0xd2')];}for(var _0x477289 in _0x3fb748[_0x5287('0x15c')]){if(typeof _0x3fb748[_0x5287('0x15c')][_0x477289]!==_0x5287('0xab')){if(isNotNull(_0x3fb748[_0x5287('0x15c')][_0x477289])&&_0x477289!=='id'&&_0x477289!==_0x5287('0x171')&&_0x477289!==_0x5287('0x172')&&_0x477289!==_0x5287('0x173')){_0x4df194[util[_0x5287('0x74')]('%s%s',_0x5287('0x174'),_[_0x5287('0x175')](_0x477289))]=_0x3fb748['Contact'][_0x477289];}}}var _0x8b44c0=_0x3959d2[_0x5287('0xd4')](_0x4f0e35[_0x5287('0x6f')])?getCallerId(_0x4f0e35['Trunk'][_0x5287('0x71')],_0x4f0e35[_0x5287('0x176')],_0x4f0e35['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4f0e35[_0x5287('0x177')],_0x4f0e35[_0x5287('0x178')]):_0x4f0e35[_0x5287('0x177')]):getCallerId(_['isNil'](_0x4f0e35[_0x5287('0x133')])?_0x4f0e35[_0x5287('0x6f')][_0x5287('0x71')]:_0x4f0e35['TrunkBackup']['callerid'],_0x4f0e35[_0x5287('0x176')],_0x4f0e35[_0x5287('0x178')]>0x0?getCallerIdRandom(_0x4f0e35[_0x5287('0x177')],_0x4f0e35[_0x5287('0x178')]):_0x4f0e35['dialOriginateCallerIdNumber']);if(_0x8b44c0){_0x4df194['XMD-ORIGINATECALLERIDNAME']=_0x3959d2['actions'][_0x1a0cc3][_0x5287('0x179')]=extractCalleridName(_0x8b44c0);_0x4df194[_0x5287('0x17a')]=_0x3959d2['actions'][_0x1a0cc3]['originatecalleridnum']=extractCalleridNumber(_0x8b44c0);}return ami[_0x5287('0xae')]({'actionid':_0x1a0cc3,'action':_0x5287('0x15d'),'channel':_0x3959d2[_0x5287('0xd4')](_0x4f0e35[_0x5287('0x6f')])?util[_0x5287('0x74')](_0x5287('0x17b'),_0x4f0e35[_0x5287('0x6f')][_0x5287('0x3c')],isNotNull(_0x4f0e35['dialPrefix'])?_0x4f0e35[_0x5287('0x57')][_0x5287('0x17c')]()||'':'',_0x4f0e35['dialCutDigit']>0x0?_0x3fb748['Contact'][_0x5287('0x17d')][_0x5287('0x17e')](_0x4f0e35[_0x5287('0x17f')]):_0x3fb748['Contact'][_0x5287('0x17d')]):util[_0x5287('0x74')](_0x5287('0x17b'),_['isNil'](_0x4f0e35['TrunkBackup'])?_0x4f0e35[_0x5287('0x6f')][_0x5287('0x3c')]:_0x4f0e35[_0x5287('0x133')][_0x5287('0x3c')],isNotNull(_0x4f0e35[_0x5287('0x57')])?_0x4f0e35[_0x5287('0x57')][_0x5287('0x17c')]()||'':'',_0x4f0e35[_0x5287('0x17f')]>0x0?_0x3fb748[_0x5287('0x15c')]['phone'][_0x5287('0x17e')](_0x4f0e35[_0x5287('0x17f')]):_0x3fb748[_0x5287('0x15c')]['phone']),'callerid':_0x8b44c0,'Exten':'xcally-motion-dialer','Context':_0x5287('0x180'),'Priority':'1','variable':_0x4df194,'timeout':(_0x4f0e35['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1a0cc3})[_0x5287('0xb7')](function(_0x56b967){return _0x40e5f9(_0x56b967);})[_0x5287('0xaf')](function(_0x3bf0bb){_0x4f0e35[_0x5287('0x5d')]+=0x1;var _0x50735b=new History(_0x3959d2[_0x5287('0x24')][_0x1a0cc3]);logger[_0x5287('0x92')](util[_0x5287('0x74')](_0x5287('0x181'),JSON['stringify'](_0x3bf0bb)));_0x50735b[_0x5287('0xa2')]=0xe;_0x50735b[_0x5287('0xa3')]=_0x5287('0x182');_0x50735b[_0x5287('0xa5')]=moment()[_0x5287('0x74')](_0x5287('0xf9'));_0x50735b['endtime']=_0x50735b[_0x5287('0xa5')];_0x3959d2[_0x5287('0xc8')](_0x50735b)[_0x5287('0xaf')](loggerCatch(_0x5287('0x183')));_0x3959d2[_0x5287('0xc7')](_0x50735b)[_0x5287('0xaf')](loggerCatch(_0x5287('0x183')))[_0x5287('0x1e')](function(){delete _0x3959d2[_0x5287('0x24')][_0x1a0cc3];return _0x11bca5(msgResponse('originate',_0x5287('0x44'),'originate\x20action\x20Error'));});});});};Dialer[_0x5287('0x1b')][_0x5287('0x2f')]=function(_0x43b9c5){var _0x4d4826=this[_0x5287('0x24')][_0x43b9c5[_0x5287('0x11c')]];if(_0x4d4826){delete this[_0x5287('0x24')][_0x43b9c5['actionid']];_0x4d4826['responsetime']=moment()[_0x5287('0x74')]('YYYY-MM-DD\x20HH:mm:ss');var _0x14182d=_0x4d4826['type']==='ivr'?this[_0x5287('0x21')][_0x4d4826[_0x5287('0xb1')]]:this[_0x5287('0x20')][_0x4d4826[_0x5287('0x184')]()];if(!this[_0x5287('0xd3')](_0x43b9c5[_0x5287('0x185')])){this[_0x5287('0xb3')](_0x14182d);return this[_0x5287('0x186')](_0x4d4826,_0x14182d,_0x43b9c5)[_0x5287('0xaf')](loggerCatch('[callProgressDetecting]\x20'));}this[_0x5287('0xa7')][_0x43b9c5[_0x5287('0xe0')]]=_0x4d4826;}};Dialer[_0x5287('0x1b')]['checkRetriveMax']=function(_0x2b3b24,_0x485285,_0x348d5c){var _0x57cbc9=new History(_0x485285);if(_0x57cbc9[_0x5287('0xeb')]+_0x57cbc9[_0x5287('0xec')]+_0x57cbc9['countnoanswerretry']+_0x57cbc9[_0x5287('0xfc')]+_0x57cbc9[_0x5287('0xee')]+_0x57cbc9[_0x5287('0xfd')]+_0x57cbc9['countmachineretry']+_0x57cbc9[_0x5287('0xf0')]>=_0x348d5c[_0x5287('0xf1')]-0x1){return!![];}switch(_0x2b3b24){case 0x3:if(_0x57cbc9[_0x5287('0xed')]>=_0x348d5c['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x5287('0xbe')]({'active':![],'countnoanswerretry':_0x57cbc9['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x5287('0xf6')](_0x348d5c[_0x5287('0x187')],_0x5287('0xf8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x57cbc9[_0x5287('0xce')],'ListId':_0x57cbc9[_0x5287('0xcf')],'VoiceQueueId':_0x57cbc9[_0x5287('0xd1')]||undefined,'CampaignId':_0x57cbc9[_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x188')));break;case 0x5:if(_0x57cbc9[_0x5287('0xeb')]>=_0x348d5c[_0x5287('0x189')]-0x1){return!![];}this[_0x5287('0xbe')]({'active':![],'countbusyretry':_0x57cbc9['countbusyretry']+=0x1,'scheduledat':moment()[_0x5287('0xf6')](_0x348d5c[_0x5287('0x18a')],_0x5287('0xf8'))[_0x5287('0x74')](_0x5287('0xf9')),'ContactId':_0x57cbc9[_0x5287('0xce')],'ListId':_0x57cbc9[_0x5287('0xcf')],'VoiceQueueId':_0x57cbc9['VoiceQueueId']||undefined,'CampaignId':_0x57cbc9[_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x18b')));break;case 0x8:if(_0x57cbc9[_0x5287('0xec')]>=_0x348d5c[_0x5287('0x18c')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x57cbc9[_0x5287('0xec')]+=0x1,'scheduledat':moment()[_0x5287('0xf6')](_0x348d5c[_0x5287('0x18d')],_0x5287('0xf8'))[_0x5287('0x74')](_0x5287('0xf9')),'ContactId':_0x57cbc9[_0x5287('0xce')],'ListId':_0x57cbc9[_0x5287('0xcf')],'VoiceQueueId':_0x57cbc9[_0x5287('0xd1')]||undefined,'CampaignId':_0x57cbc9[_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x18e')));break;case 0x0:if(_0x57cbc9[_0x5287('0xfc')]>=_0x348d5c['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x57cbc9[_0x5287('0xfc')]+=0x1,'scheduledat':moment()['add'](_0x348d5c[_0x5287('0x18f')],_0x5287('0xf8'))['format'](_0x5287('0xf9')),'ContactId':_0x57cbc9[_0x5287('0xce')],'ListId':_0x57cbc9['ListId'],'VoiceQueueId':_0x57cbc9[_0x5287('0xd1')]||undefined,'CampaignId':_0x57cbc9[_0x5287('0xd2')]||undefined})['catch'](loggerCatch(_0x5287('0x190')));}break;case 0xa:if(_0x57cbc9[_0x5287('0xee')]>=_0x348d5c[_0x5287('0x111')]-0x1){return!![];}this[_0x5287('0xbe')]({'active':![],'countdropretry':_0x57cbc9[_0x5287('0xee')]+=0x1,'scheduledat':moment()[_0x5287('0xf6')](_0x348d5c[_0x5287('0x112')],'minutes')[_0x5287('0x74')](_0x5287('0xf9')),'ContactId':_0x57cbc9[_0x5287('0xce')],'ListId':_0x57cbc9['ListId'],'VoiceQueueId':_0x57cbc9[_0x5287('0xd1')]||undefined,'CampaignId':_0x57cbc9[_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x191')));break;case 0xb:if(_0x57cbc9[_0x5287('0xfd')]>=_0x348d5c[_0x5287('0x192')]-0x1){return!![];}this[_0x5287('0xbe')]({'active':![],'countabandonedretry':_0x57cbc9['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x348d5c[_0x5287('0x118')],'minutes')['format'](_0x5287('0xf9')),'ContactId':_0x57cbc9['ContactId'],'ListId':_0x57cbc9[_0x5287('0xcf')],'VoiceQueueId':_0x57cbc9['VoiceQueueId']||undefined,'CampaignId':_0x57cbc9[_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x119')));break;case 0x13:if(_0x57cbc9[_0x5287('0xef')]>=_0x348d5c[_0x5287('0xf4')]-0x1){return!![];}this[_0x5287('0xbe')]({'active':![],'countmachineretry':_0x57cbc9[_0x5287('0xef')]+=0x1,'scheduledat':moment()[_0x5287('0xf6')](_0x348d5c['dialMachineRetryFrequency'],'minutes')[_0x5287('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x57cbc9[_0x5287('0xce')],'ListId':_0x57cbc9[_0x5287('0xcf')],'VoiceQueueId':_0x57cbc9['VoiceQueueId']||undefined,'CampaignId':_0x57cbc9['CampaignId']||undefined})['catch'](loggerCatch(_0x5287('0xfa')));break;case 0x14:if(_0x57cbc9['countagentrejectretry']>=_0x348d5c['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x5287('0xbe')]({'active':![],'countagentrejectretry':_0x57cbc9['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x5287('0xf6')](_0x348d5c[_0x5287('0x193')],_0x5287('0xf8'))[_0x5287('0x74')](_0x5287('0xf9')),'ContactId':_0x57cbc9['ContactId'],'ListId':_0x57cbc9[_0x5287('0xcf')],'VoiceQueueId':_0x57cbc9[_0x5287('0xd1')]||undefined,'CampaignId':_0x57cbc9['CampaignId']||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x194')));break;default:return!![];}};Dialer[_0x5287('0x1b')][_0x5287('0x186')]=function(_0x14fda7,_0x49dd2e,_0x5b74a6){var _0x3bfb01=this;var _0x370428=new History(_0x14fda7);return new BPromise(function(_0x408062,_0x142144){if(_[_0x5287('0x80')](_0x49dd2e)&&typeof _0x49dd2e!==_0x5287('0x15a')){return _0x142144(msgResponse(_0x5287('0x195'),_0x5287('0x138'),_0x5287('0x196')));}if(_[_0x5287('0x80')](_0x5b74a6)&&typeof _0x5b74a6!==_0x5287('0x15a')){return _0x142144(msgResponse(_0x5287('0x195'),_0x5287('0x138'),_0x5287('0x197')));}switch(_0x5b74a6[_0x5287('0x198')]){case'0':_0x49dd2e[_0x5287('0x5c')]+=0x1;_0x370428[_0x5287('0xa2')]=0x0;_0x370428[_0x5287('0xa3')]='NoSuchNumber';_0x370428[_0x5287('0xfc')]+=0x1;_0x370428[_0x5287('0xe9')]+=0x1;ami[_0x5287('0x48')](_0x5287('0x199'),ut[_0x5287('0x19a')](_0x14fda7,_0x5287('0x19b')));_0x3bfb01['createHistory'](_0x370428)[_0x5287('0xaf')](loggerCatch(_0x5287('0x19c')));if(_0x3bfb01[_0x5287('0x19d')](0x0,_0x14fda7,_0x49dd2e)){if(_0x370428[_0x5287('0xfc')]>=_0x49dd2e[_0x5287('0x19e')]){_0x3bfb01[_0x5287('0x19f')](_0x370428,_0x408062,_0x142144,_0x5287('0x1a0'));}else{_0x3bfb01[_0x5287('0xf2')](_0x370428,_0x408062,_0x142144,_0x5287('0x1a0'));}}break;case'3':_0x49dd2e[_0x5287('0x1a1')]+=0x1;_0x370428[_0x5287('0xa2')]=0x3;_0x370428[_0x5287('0xa3')]=_0x5287('0x1a2');_0x370428[_0x5287('0xed')]+=0x1;_0x370428[_0x5287('0xe9')]+=0x1;ami[_0x5287('0x48')]('custom:agentnoanswer',ut[_0x5287('0x19a')](_0x14fda7,_0x5287('0x1a3')));_0x3bfb01[_0x5287('0xc8')](_0x370428)[_0x5287('0xaf')](loggerCatch(_0x5287('0x1a4')));if(_0x3bfb01['checkRetriveMax'](0x3,_0x14fda7,_0x49dd2e)){if(_0x370428['countnoanswerretry']>=_0x49dd2e[_0x5287('0x1a5')]){_0x3bfb01[_0x5287('0x19f')](_0x370428,_0x408062,_0x142144,_0x5287('0x1a6'));}else{_0x3bfb01[_0x5287('0xf2')](_0x370428,_0x408062,_0x142144,_0x5287('0x1a6'));}}break;case'5':_0x49dd2e[_0x5287('0x1a7')]+=0x1;_0x370428[_0x5287('0xa2')]=0x5;_0x370428[_0x5287('0xa3')]='Busy';_0x370428[_0x5287('0xeb')]+=0x1;_0x370428[_0x5287('0xe9')]+=0x1;ami['emit'](_0x5287('0x1a8'),ut['buildObj'](_0x14fda7,_0x5287('0x1a9')));_0x3bfb01['createHistory'](_0x370428)[_0x5287('0xaf')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3bfb01[_0x5287('0x19d')](0x5,_0x14fda7,_0x49dd2e)){if(_0x370428[_0x5287('0xeb')]>=_0x49dd2e[_0x5287('0x189')]){_0x3bfb01[_0x5287('0x19f')](_0x370428,_0x408062,_0x142144,'reason\x205\x20busy');}else{_0x3bfb01[_0x5287('0xf2')](_0x370428,_0x408062,_0x142144,_0x5287('0x1aa'));}}break;case'8':_0x49dd2e[_0x5287('0x1ab')]+=0x1;_0x370428[_0x5287('0xa2')]=0x8;_0x370428['statedesc']='Congestion';_0x370428[_0x5287('0xec')]+=0x1;_0x370428[_0x5287('0xe9')]+=0x1;ami[_0x5287('0x48')](_0x5287('0x1ac'),ut['buildObj'](_0x14fda7,_0x5287('0x1ad')));_0x3bfb01[_0x5287('0xc8')](_0x370428)[_0x5287('0xaf')](loggerCatch(_0x5287('0x1ae')));if(_0x3bfb01[_0x5287('0x19d')](0x8,_0x14fda7,_0x49dd2e)){if(_0x370428['countcongestionretry']>=_0x49dd2e[_0x5287('0x18c')]){_0x3bfb01['createStateFinal'](_0x370428,_0x408062,_0x142144,'reason\x208\x20congestion');}else{_0x3bfb01['stateGlobal'](_0x370428,_0x408062,_0x142144,_0x5287('0x1af'));}}break;case'11':_0x49dd2e[_0x5287('0x1b0')]+=0x1;_0x370428['state']=0xb;_0x370428[_0x5287('0xa3')]=_0x5287('0x117');_0x370428['countabandonedretry']+=0x1;_0x370428['countglobal']+=0x1;_0x3bfb01['createHistory'](_0x370428)[_0x5287('0xaf')](loggerCatch(_0x5287('0x11a')));if(_0x3bfb01[_0x5287('0x19d')](0xb,_0x14fda7,_0x49dd2e)){if(_0x370428['countabandonedretry']>=_0x49dd2e[_0x5287('0x192')]){_0x3bfb01[_0x5287('0x19f')](_0x370428,_0x408062,_0x142144,_0x5287('0x1b1'));}else{_0x3bfb01['stateGlobal'](_0x370428,_0x408062,_0x142144,_0x5287('0x1b1'));}}break;case'20':_0x49dd2e[_0x5287('0x1b2')]+=0x1;_0x370428['state']=0x14;_0x370428[_0x5287('0xa3')]='AgentReject';_0x370428[_0x5287('0xf0')]+=0x1;_0x370428['countglobal']+=0x1;ami[_0x5287('0x48')]('custom:agentreject',ut[_0x5287('0x19a')](_0x14fda7,_0x5287('0x1b3')));_0x3bfb01[_0x5287('0xc8')](_0x370428)[_0x5287('0xaf')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x3bfb01[_0x5287('0x19d')](0x14,_0x14fda7,_0x49dd2e)){if(_0x370428[_0x5287('0xf0')]>=_0x49dd2e[_0x5287('0x1b4')]){_0x3bfb01[_0x5287('0x19f')](_0x370428,_0x408062,_0x142144,_0x5287('0x1b5'));}else{_0x3bfb01[_0x5287('0xf2')](_0x370428,_0x408062,_0x142144,_0x5287('0x1b5'));}}break;default:_0x49dd2e['outboundUnknownCallsDay']+=0x1;_0x370428[_0x5287('0xa2')]=0xc;_0x370428[_0x5287('0xa3')]=_0x5b74a6[_0x5287('0x198')];_0x3bfb01[_0x5287('0xc8')](_0x370428)[_0x5287('0xaf')](loggerCatch(_0x5287('0x1b6')));if(_0x3bfb01[_0x5287('0x19d')](_0x5b74a6[_0x5287('0x198')],_0x14fda7,_0x49dd2e)){if(_0x370428['countbusyretry']+_0x370428[_0x5287('0xec')]+_0x370428[_0x5287('0xed')]+_0x370428[_0x5287('0xfc')]+_0x370428[_0x5287('0xee')]+_0x370428[_0x5287('0xfd')]+_0x370428[_0x5287('0xef')]+_0x370428['countagentrejectretry']>=_0x49dd2e[_0x5287('0xf1')]){_0x3bfb01[_0x5287('0xf2')](_0x370428,_0x408062,_0x142144,_0x5b74a6['reason']);}else{_0x3bfb01[_0x5287('0x19f')](_0x370428,_0x408062,_0x142144,_0x5b74a6['reason']);}}}});};Dialer[_0x5287('0x1b')][_0x5287('0xf2')]=function(_0x5553ef,_0x14bae3,_0x167266,_0xad89ba){var _0x520f30=new Final(_0x5553ef);_0x520f30['state']=0xf;_0x520f30[_0x5287('0xa3')]=_0x5287('0x1b7');this['createStateFinal'](_0x520f30,_0x14bae3,_0x167266,_0xad89ba);};Dialer[_0x5287('0x1b')][_0x5287('0x19f')]=function(_0x3b3d4a,_0xebbe72,_0x3fe990,_0x5624ac){this[_0x5287('0xc7')](_0x3b3d4a)['then'](function(){return _0xebbe72(msgResponse(_0x5287('0x195'),_0x5287('0x1b8'),_0x5624ac));})[_0x5287('0xaf')](function(){return _0x3fe990(msgResponse(_0x5287('0x1b9'),_0x5287('0x138'),_0x5287('0x1ba')));});};Dialer[_0x5287('0x1b')][_0x5287('0xb')]=function(_0x3afacb){var _0x38ad5c=_0x3afacb[_0x5287('0x1bb')]/0x64;var _0xf71590=_0x3afacb[_0x5287('0x5b')]/(_0x3afacb['outboundDropCallsDayTimeout']+_0x3afacb[_0x5287('0xe1')]);var _0x309c3d=Math[_0x5287('0x1bc')](_0x3afacb[_0x5287('0x69')]*(_0x3afacb[_0x5287('0x1bd')]/0x64));var _0xb5c7dd=Math[_0x5287('0x1bc')](_0x3afacb[_0x5287('0x69')]*(_0x3afacb[_0x5287('0x1be')]/0x64));var _0x4ee65a=_0x3afacb['available']+_0x3afacb[_0x5287('0x1bf')];var _0x56ee33=Math[_0x5287('0x1c0')](_0x3afacb[_0x5287('0x6b')]*_0x3afacb[_0x5287('0x6c')]*_0x3afacb['predictiveIntervalHitRate']*_0x3afacb[_0x5287('0x67')]);if(_[_0x5287('0x80')](_0x3afacb[_0x5287('0x6e')])){if(!_[_0x5287('0x80')](_0x3afacb[_0x5287('0x27')])){_0x3afacb[_0x5287('0x27')]=undefined;loggerPredictive[_0x5287('0x92')](_0x5287('0x1c1'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x5287('0x80')](_0x3afacb[_0x5287('0x8d')])){loggerPredictive[_0x5287('0x92')]('[startMethodPredictive][StartProgressive]',_0x5287('0x1c2'));clearInterval(_0x3afacb['handlePredictive']);_0x3afacb['handlePredictive']=undefined;}_0x3afacb[_0x5287('0x6e')]=moment()['format'](_0x5287('0xf9'));loggerPredictive[_0x5287('0x78')](_0x3afacb[_0x5287('0x3c')],_0x5287('0x1c3'),_0x3afacb[_0x5287('0x6e')]);this[_0x5287('0x149')](_0x3afacb,0x1);}else if(ifInterval(_0x3afacb[_0x5287('0x1c4')],_0x3afacb[_0x5287('0x6e')])){this[_0x5287('0x149')](_0x3afacb,0x1);loggerPredictiveCalls['info'](_0x5287('0x1c5'),_0x3afacb[_0x5287('0x6e')],_0x3afacb[_0x5287('0x3c')]);_0x3afacb[_0x5287('0x6b')]=0x0;_0x3afacb['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x38ad5c<_0xf71590&&_0x3afacb[_0x5287('0x1c6')]===_0x5287('0x1c7')){freeVariablesPredictive(_0x3afacb);loggerPredictive[_0x5287('0x78')](_0x5287('0x1c8'),_0x5287('0x1c9'),_0xf71590,'startProgressive',_0x3afacb[_0x5287('0x3c')]);}else if(_0x56ee33<_0x3afacb['predictiveIntervalErlangCallsDroppedCalls']&&_0x3afacb[_0x5287('0x1c6')]===_0x5287('0x1c7')){freeVariablesPredictive(_0x3afacb);loggerPredictive[_0x5287('0x78')](_0x5287('0x1ca'),'Max\x20Drop\x20',_0x56ee33,_0x5287('0x1cb'),_0x3afacb[_0x5287('0x65')],_0x5287('0x6e'),_0x3afacb[_0x5287('0x3c')]);}else if(!ifInterval(_0x3afacb[_0x5287('0x1c4')],_0x3afacb[_0x5287('0x6e')])&&_[_0x5287('0x80')](_0x3afacb[_0x5287('0x27')])&&!_[_0x5287('0x80')](_0x3afacb['startProgressive'])){_0x3afacb[_0x5287('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x5287('0x78')](_0x3afacb[_0x5287('0x3c')],_0x5287('0x1cc'),_0x3afacb[_0x5287('0x27')]);this[_0x5287('0x1cd')](_0x3afacb[_0x5287('0x1c4')])[_0x5287('0xb7')](this[_0x5287('0x1ce')](_0x3afacb))[_0x5287('0xb7')](mergeDataErlangB(_0x3afacb))[_0x5287('0xb7')](this['startMethodPredictive'](_0x3afacb))[_0x5287('0xaf')](loggerCatchPredictive(_0x5287('0x1cf'),_0x3afacb));}else if(!ifInterval(_0x3afacb[_0x5287('0x1c4')],_0x3afacb[_0x5287('0x27')])){_0x3afacb[_0x5287('0x65')]=0x0;_0x3afacb[_0x5287('0x27')]=moment()[_0x5287('0x74')](_0x5287('0xf9'));loggerPredictive[_0x5287('0x78')](_0x3afacb['name'],_0x5287('0x1d0'),_0x3afacb[_0x5287('0x27')]);clearInterval(_0x3afacb[_0x5287('0x8d')]);_0x3afacb[_0x5287('0x8d')]=undefined;this['averageHandleTime'](_0x3afacb[_0x5287('0x1c4')])['then'](this[_0x5287('0x1ce')](_0x3afacb))[_0x5287('0xb7')](mergeDataErlangB(_0x3afacb))[_0x5287('0xb7')](this[_0x5287('0x1d1')](_0x3afacb))[_0x5287('0xaf')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3afacb));}else if(_0x3afacb[_0x5287('0x69')]&&_0x4ee65a<_0x3afacb['predictiveIntervalAvailable']-_0xb5c7dd){freeVariablesPredictive(_0x3afacb);loggerPredictive['info'](_0x3afacb['name'],_0x5287('0x1d2'),_0x4ee65a,')\x20are\x20less\x20than\x20threshold\x20(',_0x3afacb[_0x5287('0x69')],'-',_0xb5c7dd,'=',_0x3afacb[_0x5287('0x69')]-_0xb5c7dd,')');}else if(_0x3afacb[_0x5287('0x69')]&&_0x4ee65a>_0x3afacb[_0x5287('0x69')]+_0x309c3d){freeVariablesPredictive(_0x3afacb);loggerPredictive['info'](_0x3afacb['name'],_0x5287('0x1d2'),_0x4ee65a,_0x5287('0x1d3'),_0x3afacb[_0x5287('0x69')],'+',_0x309c3d,'=',_0x3afacb['predictiveIntervalAvailable']+_0x309c3d,')');}};Dialer[_0x5287('0x1b')]['getDataPredictive']=function(_0x47c4d3){var _0x1bb557=this;return function(_0x10cd25){return new BPromise(function(_0x2e78c5,_0xf3d907){_[_0x5287('0x8b')](_0x47c4d3,_0x10cd25[0x0]);if(checkGetDataPredictive(_0x10cd25[0x0])){var _0x24d65=_0x47c4d3[_0x5287('0x69')]=_0x47c4d3['talking']+_0x47c4d3[_0x5287('0x4c')];var _0xc7450a=_0x47c4d3['dialPredictiveInterval']*0x3c;var _0x1f3db6=_0x10cd25[0x0][_0x5287('0x61')]+_0x10cd25[0x0][_0x5287('0x60')];var _0x385480=(_0x10cd25[0x0][_0x5287('0x7b')]+_0x10cd25[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x10cd25[0x0][_0x5287('0x62')])/_0x10cd25[0x0]['predictiveIntervalTotalCalls'];_0x47c4d3[_0x5287('0x66')]=_0x385480>0x0?_0x385480:0x1;switch(_0x47c4d3[_0x5287('0x1c6')]){case'dropRate':var _0x33b435=_0x47c4d3['dialPredictiveOptimizationPercentage']/0x64;return _0x1bb557[_0x5287('0x1d4')](_0x24d65,_0xc7450a,_0x1f3db6,_0x385480,_0x33b435)['then'](function(_0x5db68f){return _0x2e78c5(_0x5db68f);});case _0x5287('0x1d5'):var _0x46343e=_0x47c4d3['dialPredictiveOptimizationPercentage']/0x64;return _0x1bb557[_0x5287('0x1d6')](_0x24d65,_0xc7450a,_0x1f3db6,_0x385480,_0x46343e)[_0x5287('0xb7')](function(_0x53778e){return _0x2e78c5(_0x53778e);});default:return _0xf3d907(msgResponse('[getDataPredictive]',_0x5287('0x138'),_0x5287('0x1d7')));}}else{return _0xf3d907(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x5287('0x1b')][_0x5287('0x1d8')]=function(_0x57d64b){var _0x7e1603=this;return function(_0x5154ea){return new BPromise(function(_0x5d1619,_0x3f4b52){_[_0x5287('0x8b')](_0x57d64b,_0x5154ea[0x0]);if(checkGetDataPredictive(_0x5154ea[0x0])){loggerPredictive[_0x5287('0x78')](JSON['stringify'](_0x5154ea[0x0]));if(_0x57d64b['dialPredictiveOptimization']===_0x5287('0x1c7')){return _0x7e1603[_0x5287('0xc5')](_0x57d64b['id'])[_0x5287('0xb7')](function(_0xd3c9f5){var _0x10113f=_0x57d64b[_0x5287('0x150')]-_0xd3c9f5[0x0][_0x5287('0x1d9')];var _0x5afaef=_0x57d64b['dialPredictiveInterval']*0x3c;var _0x4206ec=_0x5154ea[0x0][_0x5287('0x61')]+_0x5154ea[0x0][_0x5287('0x60')];var _0x17bc5b=(_0x5154ea[0x0]['predictiveIntervalAnsweredCalls']+_0x5154ea[0x0][_0x5287('0x63')]+_0x5154ea[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x5154ea[0x0][_0x5287('0x6a')];var _0x43d3c6=_0x57d64b[_0x5287('0x1bb')]/0x64;_0x57d64b['predictiveIntervalPauses']=_0xd3c9f5[0x0]['outboundQueuePauses']||0x0;_0x57d64b[_0x5287('0x66')]=_0x17bc5b>0x0?_0x17bc5b:0x1;return _0x7e1603[_0x5287('0x1d4')](_0x10113f,_0x5afaef,_0x4206ec,_0x17bc5b,_0x43d3c6);})[_0x5287('0xb7')](function(_0xe4f667){return _0x5d1619(_0xe4f667);})[_0x5287('0xaf')](function(_0xf69504){return _0x3f4b52(msgResponse(_0x5287('0x1da'),_0x5287('0x138'),JSON['stringify'](_0xf69504)));});}if(_0x57d64b['dialPredictiveOptimization']===_0x5287('0x1d5')){return _0x7e1603[_0x5287('0xc5')](_0x57d64b['id'])[_0x5287('0xb7')](function(_0x4f0db3){var _0x8684a6=_0x57d64b[_0x5287('0x150')]-_0x4f0db3[0x0]['outboundQueuePauses'];var _0x132abb=_0x57d64b[_0x5287('0x1c4')]*0x3c;var _0x17ac54=_0x5154ea[0x0][_0x5287('0x61')]+_0x5154ea[0x0]['predictiveIntervalAvgHoldtime'];var _0x11c84e=(_0x5154ea[0x0]['predictiveIntervalAnsweredCalls']+_0x5154ea[0x0][_0x5287('0x63')]+_0x5154ea[0x0][_0x5287('0x62')])/_0x5154ea[0x0][_0x5287('0x6a')];var _0x2cbb93=_0x57d64b['dialPredictiveOptimizationPercentage']/0x64;_0x57d64b[_0x5287('0x68')]=_0x4f0db3[0x0][_0x5287('0x1d9')]||0x0;_0x57d64b[_0x5287('0x66')]=_0x11c84e>0x0?_0x11c84e:0x1;return _0x7e1603[_0x5287('0x1d6')](_0x8684a6,_0x132abb,_0x17ac54,_0x11c84e,_0x2cbb93);})[_0x5287('0xb7')](function(_0x1012b4){return _0x5d1619(_0x1012b4);})[_0x5287('0xaf')](function(_0x452336){return _0x3f4b52(msgResponse('[CatchErlangB]',_0x5287('0x138'),JSON[_0x5287('0x45')](_0x452336)));});}}else{return _0x3f4b52(msgResponse(_0x5287('0x1db'),_0x5287('0x138'),'check\x20failure'));}});};};Dialer[_0x5287('0x1b')][_0x5287('0x1d1')]=function(_0x3e81e1){var _0xbd414=this;return function(){var _0x4a2be0=0x0;var _0x13c924=Math[_0x5287('0x1c0')](_0x3e81e1['erlangCallToSecond']*0x3e8);if(_0x13c924>0x0){_0x13c924=_0x13c924<0x64?0x64:_0x13c924;loggerPredictive['info'](_0x3e81e1[_0x5287('0x3c')],_0x5287('0x1dc'),_0x13c924,_0x5287('0x46'));_0x3e81e1[_0x5287('0x8d')]=setInterval(function(){_0xbd414['handlePredictive'](_0x3e81e1);loggerPredictiveCalls[_0x5287('0x78')]('[handlePredictive]',_0x4a2be0+=0x1);},_0x13c924);}else{loggerPredictive[_0x5287('0x78')](_0x3e81e1[_0x5287('0x3c')],_0x5287('0x1dd'));}};};Dialer['prototype'][_0x5287('0x1de')]=function(_0x289b03,_0x1ce66d){var _0x2d91d7=this;return function(_0x4140fc){if(_[_0x5287('0x42')](_0x4140fc)){if(_[_0x5287('0xad')](_0x1ce66d[_0x5287('0xd0')])||!_0x1ce66d[_0x5287('0x1df')]){if(_0x289b03[_0x5287('0x55')]===_0x5287('0xa')){_0x289b03[_0x5287('0x124')]=_[_0x5287('0x80')](_0x289b03[_0x5287('0x124')])?!![]:_0x289b03[_0x5287('0x124')];var _0x45bc8e=uuid['v4']();_0x2d91d7['actions'][_0x45bc8e]=new Action(_0x289b03,_0x1ce66d,_0x45bc8e);loggerBooked[_0x5287('0x78')]('[booked][checkContactBlack]',_0x45bc8e,_0x5287('0x1e0'),JSON['stringify'](_0x289b03[_0x5287('0x124')]),_0x5287('0x1e1'),_0x289b03['name']);if(_0x289b03[_0x5287('0x124')]){_0x289b03[_0x5287('0x124')]=![];_0x2d91d7[_0x5287('0x28')][_0x2d91d7[_0x5287('0x24')][_0x45bc8e][_0x5287('0xb1')]]=[];ami[_0x5287('0xae')]({'actionid':_0x45bc8e,'action':_0x5287('0x1e2'),'queue':_0x289b03[_0x5287('0x3c')]})[_0x5287('0xaf')](function(){_0x2d91d7[_0x5287('0xb3')](_0x289b03);_0x2d91d7['rescheduleContact']({'active':![],'ContactId':_0x2d91d7[_0x5287('0x24')][_0x45bc8e][_0x5287('0xce')],'ListId':_0x2d91d7[_0x5287('0x24')][_0x45bc8e][_0x5287('0xcf')],'VoiceQueueId':_0x2d91d7[_0x5287('0x24')][_0x45bc8e]['VoiceQueueId']||undefined,'CampaignId':_0x2d91d7['actions'][_0x45bc8e][_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x1e3')));delete _0x2d91d7[_0x5287('0x24')][_0x45bc8e];});}else{loggerBooked[_0x5287('0x78')](_0x5287('0x1e4'),JSON[_0x5287('0x45')](_0x289b03['queueStatusComplete']),'Queue:\x20',_0x289b03[_0x5287('0x3c')]);_0x2d91d7[_0x5287('0xb3')](_0x289b03);_0x2d91d7[_0x5287('0xbe')]({'active':![],'ContactId':_0x2d91d7[_0x5287('0x24')][_0x45bc8e][_0x5287('0xce')],'ListId':_0x2d91d7[_0x5287('0x24')][_0x45bc8e][_0x5287('0xcf')],'VoiceQueueId':_0x2d91d7[_0x5287('0x24')][_0x45bc8e][_0x5287('0xd1')]||undefined,'CampaignId':_0x2d91d7[_0x5287('0x24')][_0x45bc8e][_0x5287('0xd2')]||undefined})[_0x5287('0xaf')](loggerCatch(_0x5287('0x1e3')));delete _0x2d91d7[_0x5287('0x24')][_0x45bc8e];}}else{return _0x2d91d7[_0x5287('0x1e5')](_0x289b03,_0x1ce66d);}}else{if(getDiff(_0x1ce66d[_0x5287('0x1e6')])<_0x289b03['dialRecallMeTimeout']*0x3c){if(_0x1ce66d[_0x5287('0x1e7')]&&!_0x1ce66d[_0x5287('0x1e7')][_0x5287('0x1e8')]){_0x2d91d7[_0x5287('0x1f')][_0x5287('0x126')](_0x1ce66d['id'])[_0x5287('0x1e')](function(){_0x2d91d7['updateOriginated'](_0x289b03);});}else{_0x2d91d7[_0x5287('0xc0')]({'active':![]},_0x1ce66d['id'],0x1)['finally'](function(){_0x2d91d7['updateOriginated'](_0x289b03);});}}else{_0x289b03[_0x5287('0x5e')]+=0x1;_0x2d91d7[_0x5287('0xb3')](_0x289b03);if(_0x289b03[_0x5287('0x1e9')]){_0x2d91d7[_0x5287('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1ce66d[_0x5287('0xce')],'ListId':_0x1ce66d[_0x5287('0xcf')],'VoiceQueueId':_0x1ce66d['VoiceQueueId']||undefined,'CampaignId':_0x1ce66d[_0x5287('0xd2')]||undefined})['catch'](loggerCatch(_0x5287('0x1ea')));_0x2d91d7['createHistory'](createObjHistory(_0x289b03,_0x1ce66d,_0x5287('0x1eb'),0x17,'RecallInQueue'))[_0x5287('0xaf')](loggerCatch(_0x5287('0x1ec')));}else{_0x2d91d7['saveInDb'](createObjHistory(_0x289b03,_0x1ce66d,_0x5287('0x1ed'),0x16,_0x5287('0x1ee')),_0x5287('0x1ef'),_0x5287('0x1f0'));}}}}else{_0x289b03[_0x5287('0x59')]+=0x1;_0x2d91d7[_0x5287('0xcd')](createObjHistory(_0x289b03,_0x1ce66d,_0x5287('0x1f1'),0xd,_0x5287('0x1f2')),_0x5287('0x1f3'),_0x5287('0x1f4'));throw _0x5287('0x1f5');}};};Dialer[_0x5287('0x1b')][_0x5287('0x14e')]=function(_0x358cd8){var _0x51a849=this;var _0x5199a1=_0x358cd8[_0x5287('0x1f6')]-_0x358cd8['originated']-_0x358cd8[_0x5287('0x1f7')];emitCampaignSummary(_0x358cd8);if(_0x5199a1>0x0){if(_0x5199a1>this[_0x5287('0x1f8')]){_0x5199a1=this[_0x5287('0x1f8')];}_0x358cd8['temp']+=_0x5199a1;this[_0x5287('0xc4')](_0x358cd8['id'],_0x5199a1,_0x358cd8[_0x5287('0x1f9')])['then'](function(_0x494489){_0x358cd8[_0x5287('0x1f7')]-=_0x5199a1;_0x358cd8[_0x5287('0x1f7')]=_0x358cd8[_0x5287('0x1f7')]>0x0?_0x358cd8['temp']:0x0;if(!checkContactEmpty(_0x494489)){_0x358cd8[_0x5287('0x3a')]=_0x5287('0x1fa');logger[_0x5287('0x78')]('[getContactCampaign2][Empty]'+_0x358cd8[_0x5287('0x3c')]);}else{_0x358cd8[_0x5287('0x94')]+=_0x494489[_0x5287('0x12a')];_0x358cd8[_0x5287('0x3a')]=_0x5287('0x1fb');for(var _0x238182=0x0;_0x238182<_0x494489[_0x5287('0x12a')];_0x238182+=0x1){_0x358cd8[_0x5287('0x1fc')]+=0x1;if(_[_0x5287('0xad')](_0x494489[_0x238182])||_['isNil'](_0x494489[_0x238182]['Contact'])||_[_0x5287('0xad')](_0x494489[_0x238182][_0x5287('0x15c')]['phone'])){_0x51a849[_0x5287('0x1fd')]('[actionOriginate]\x20',_0x358cd8,_0x494489[_0x238182]);}else{_0x51a849['checkIsBlackListIvr'](_[_0x5287('0x121')](_0x494489[_0x238182],[_0x5287('0xd2'),'Contact.phone']))['then'](_0x51a849[_0x5287('0x1de')](_0x358cd8,_0x494489[_0x238182]))[_0x5287('0xaf')](_0x51a849[_0x5287('0xcb')](_0x5287('0x1fe'),_0x358cd8));}}}})['catch'](loggerGetContactDialer(_0x5287('0x1ff'),_0x358cd8,_0x5199a1));}};Dialer[_0x5287('0x1b')][_0x5287('0x149')]=function(_0x29b873,_0x2e4d3c){var _0x357f49=this;var _0xcf0b6f=[];var _0x325031=_0x2e4d3c>=0x1?_0x2e4d3c:0x1;if(_0x29b873[_0x5287('0x55')]==='booked'){_0x325031=0x1;}var _0x51848c=Math[_0x5287('0x1c0')](_0x29b873[_0x5287('0x4c')]*_0x325031)-_0x29b873[_0x5287('0x94')]-_0x29b873['temp'];emitVoiceQueueSummary(_0x29b873);if(_0x29b873['dialLimitQueue']>0x0){var _0x397c41=_0x29b873[_0x5287('0x200')]-_0x29b873[_0x5287('0x94')]-_0x29b873[_0x5287('0x1bf')]-_0x29b873[_0x5287('0x1f7')]-_0x29b873[_0x5287('0x4d')];if(_0x51848c>_0x397c41){_0x51848c=_0x397c41;}}if(_0x51848c>0x0){if(_0x29b873[_0x5287('0x55')]===_0x5287('0xa')){_0x51848c=0x1;}if(_0x51848c>this[_0x5287('0x1f8')]){_0x51848c=this[_0x5287('0x1f8')];}_0x29b873[_0x5287('0x1f7')]+=_0x51848c;for(var _0x28f8ce in this[_0x5287('0x22')]){if(typeof this['agents'][_0x28f8ce]!=='undefined'){if(this[_0x5287('0x22')][_0x28f8ce][_0x5287('0xa2')]===_0x5287('0x201')&&this[_0x5287('0x22')][_0x28f8ce][_0x5287('0xd7')]==='reachable'){_0xcf0b6f['push'](this['agents'][_0x28f8ce]['id']);}}}this[_0x5287('0xc2')](_0x29b873['id'],_0xcf0b6f,_0x51848c,_0x29b873[_0x5287('0x1f9')])['then'](function(_0x45a4a4){_0x29b873[_0x5287('0x1f7')]-=_0x51848c;_0x29b873[_0x5287('0x1f7')]=_0x29b873['temp']>0x0?_0x29b873[_0x5287('0x1f7')]:0x0;if(!checkContactEmpty(_0x45a4a4)){_0x357f49[_0x5287('0xb4')](_0x29b873)[_0x5287('0xb7')](sendMessageReschedule(_0x29b873))[_0x5287('0xaf')](loggerCatch(_0x5287('0xb6')));}else{_0x29b873['originated']+=_0x45a4a4[_0x5287('0x12a')];_0x29b873['message']=_0x29b873[_0x5287('0x55')]===_0x5287('0xa')?_0x5287('0x202'):_0x5287('0x1fb');for(var _0x45e8dc=0x0;_0x45e8dc<_0x45a4a4[_0x5287('0x12a')];_0x45e8dc+=0x1){if(_[_0x5287('0xad')](_0x45a4a4[_0x45e8dc])||_['isNil'](_0x45a4a4[_0x45e8dc]['Contact'])||_[_0x5287('0xad')](_0x45a4a4[_0x45e8dc]['Contact'][_0x5287('0x17d')])){_0x357f49['emptyContact']('[actionOriginate]\x20',_0x29b873,_0x45a4a4[_0x45e8dc]);}else{_0x357f49[_0x5287('0xb8')](_[_0x5287('0x121')](_0x45a4a4[_0x45e8dc],['VoiceQueueId',_0x5287('0x203')]))[_0x5287('0xb7')](_0x357f49[_0x5287('0x1de')](_0x29b873,_0x45a4a4[_0x45e8dc]))[_0x5287('0xaf')](_0x357f49[_0x5287('0xcb')](_0x5287('0x204'),_0x29b873));}}}})[_0x5287('0xaf')](loggerGetContactDialer(_0x5287('0x205'),_0x29b873,_0x51848c));}};Dialer[_0x5287('0x1b')]['handlePredictive']=function(_0x5f4ca0){if(_0x5f4ca0[_0x5287('0x200')]>0x0){var _0x301527=_0x5f4ca0[_0x5287('0x200')]-_0x5f4ca0[_0x5287('0x94')]-_0x5f4ca0[_0x5287('0x1bf')];if(_0x301527>0x0){this[_0x5287('0x206')](_0x5f4ca0);}else{loggerPredictiveCalls[_0x5287('0x78')](_0x5287('0x207'));}}else{this[_0x5287('0x206')](_0x5f4ca0);}};Dialer[_0x5287('0x1b')][_0x5287('0x206')]=function(_0x36943b){var _0x419e3a=this;var _0x1e2755=[];_0x36943b[_0x5287('0x94')]+=0x1;for(var _0x5559b3 in this[_0x5287('0x22')]){if(typeof this[_0x5287('0x22')][_0x5559b3]!=='undefined'){if(this[_0x5287('0x22')][_0x5559b3][_0x5287('0xa2')]==='not_inuse'&&this[_0x5287('0x22')][_0x5559b3]['status']==='reachable'){_0x1e2755[_0x5287('0x120')](this[_0x5287('0x22')][_0x5559b3]['id']);}}}this[_0x5287('0xc2')](_0x36943b['id'],_0x1e2755,0x1,_0x36943b[_0x5287('0x1f9')])[_0x5287('0xb7')](function(_0x4d5bc1){if(!checkContactEmpty(_0x4d5bc1)){checkContactLowerLimitOriginate(_0x36943b,0x1,0x0);_0x419e3a[_0x5287('0xb4')](_0x36943b)[_0x5287('0xb7')](sendMessageReschedule(_0x36943b))[_0x5287('0xaf')](loggerCatch(_0x5287('0xb6')));}else{_0x36943b['message']='RUNNING';if(_[_0x5287('0xad')](_0x4d5bc1[0x0])||_['isNil'](_0x4d5bc1[0x0][_0x5287('0x15c')])||_[_0x5287('0xad')](_0x4d5bc1[0x0][_0x5287('0x15c')][_0x5287('0x17d')])){_0x419e3a[_0x5287('0x1fd')](_0x5287('0x204'),_0x36943b,_0x4d5bc1[0x0]);}else{_0x419e3a[_0x5287('0xb8')](_[_0x5287('0x121')](_0x4d5bc1[0x0],[_0x5287('0xd1'),_0x5287('0x203')]))[_0x5287('0xb7')](_0x419e3a[_0x5287('0x1de')](_0x36943b,_0x4d5bc1[0x0]))[_0x5287('0xaf')](_0x419e3a[_0x5287('0xcb')](_0x5287('0x208'),_0x36943b));}}})[_0x5287('0xaf')](loggerGetContactDialer(_0x5287('0x209'),_0x36943b,0x1));emitVoiceQueueSummary(_0x36943b);};Dialer[_0x5287('0x1b')][_0x5287('0x1d4')]=function(_0x568118,_0x3b9eab,_0xba6097,_0x4b6219,_0x470efc,_0x425c4f){loggerPredictive['info'](_0x5287('0x20a'));loggerPredictive[_0x5287('0x78')](_0x5287('0x20b'),_0x568118);loggerPredictive[_0x5287('0x78')](_0x5287('0x20c'),_0x3b9eab);loggerPredictive[_0x5287('0x78')](_0x5287('0x20d'),_0xba6097);loggerPredictive[_0x5287('0x78')](_0x5287('0x20e'),_0x4b6219);loggerPredictive[_0x5287('0x78')](_0x5287('0x20f'),_0x470efc);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x3c8649,_0xd0c9ad){if(_0x568118<=0x0||isNaN(_0x568118)){return _0xd0c9ad(msgResponse(_0x5287('0x210'),_0x5287('0x44'),_0x5287('0x211')+_0x568118));}if(_0xba6097<=0x0||isNaN(_0xba6097)){return _0xd0c9ad(msgResponse(_0x5287('0x210'),_0x5287('0x44'),_0x5287('0x212')+_0xba6097));}if(_0x4b6219<=0x0||isNaN(_0x4b6219)){return _0xd0c9ad(msgResponse(_0x5287('0x210'),_0x5287('0x44'),_0x5287('0x213')+_0x4b6219));}if(_0x3b9eab<=0x0||isNaN(_0x3b9eab)){return _0xd0c9ad(msgResponse(_0x5287('0x210'),_0x5287('0x44'),'interval\x20=\x20'+_0x3b9eab));}if(_0x470efc<=0x0||isNaN(_0x470efc)){return _0xd0c9ad(msgResponse('[abandonmentRate]',_0x5287('0x44'),'Amax\x20=\x20'+_0x470efc));}_0x425c4f=_0x425c4f||0x0;var _0x53aa51=0x1/_0xba6097;var _0x139f13=0x0;var _0x1cb935=0x0;var _0x25f1a3=0x0;var _0x230ccc=0x0;for(var _0x573210=0x0;_0x25f1a3<_0x470efc;_0x573210+=0x1){_0x1cb935=_0x573210/_0x3b9eab;_0x139f13=(_0x4b6219*_0x1cb935+_0x425c4f)/_0x53aa51;_0x25f1a3=erlangb(_0x139f13,_0x568118);_0x230ccc=_0x139f13/_0x568118*(0x1-erlangb(_0x139f13,_0x568118));}return _0x3c8649({'erlangCalls':_0x573210,'erlangCallToSecond':_0x3b9eab/_0x573210,'erlangAbandonmentRate':_0x25f1a3,'erlangBusyFactor':_0x230ccc});});};Dialer[_0x5287('0x1b')][_0x5287('0x1d6')]=function(_0x4362e4,_0x113f68,_0x2da66b,_0x58c6c7,_0x31f17b,_0x4cd60a){loggerPredictive[_0x5287('0x78')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x5287('0x20b'),_0x4362e4);loggerPredictive[_0x5287('0x78')](_0x5287('0x20c'),_0x113f68);loggerPredictive[_0x5287('0x78')](_0x5287('0x20d'),_0x2da66b);loggerPredictive[_0x5287('0x78')]('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',_0x58c6c7);loggerPredictive[_0x5287('0x78')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x31f17b);loggerPredictive[_0x5287('0x78')](_0x5287('0x8a'));return new BPromise(function(_0xacb551,_0x38780d){if(_0x4362e4<=0x0||isNaN(_0x4362e4)){return _0x38780d(msgResponse(_0x5287('0x214'),'Error','m\x20=\x20'+_0x4362e4));}if(_0x2da66b<=0x0||isNaN(_0x2da66b)){return _0x38780d(msgResponse(_0x5287('0x214'),'Error',_0x5287('0x212')+_0x2da66b));}if(_0x58c6c7<=0x0||isNaN(_0x58c6c7)){return _0x38780d(msgResponse(_0x5287('0x214'),_0x5287('0x44'),_0x5287('0x213')+_0x58c6c7));}if(_0x113f68<=0x0||isNaN(_0x113f68)){return _0x38780d(msgResponse(_0x5287('0x214'),'Error',_0x5287('0x215')+_0x113f68));}if(_0x31f17b<=0x0||isNaN(_0x31f17b)){return _0x38780d(msgResponse('[busyFactor]',_0x5287('0x44'),'Umin\x20=\x20'+_0x31f17b));}_0x4cd60a=_0x4cd60a||0x0;var _0x51be7d=0x1/_0x2da66b;var _0x42fae2=0x0;var _0x3073fc=0x0;var _0x43bcd7=0x0;var _0x1c82fd=0x0;for(var _0x128bc0=0x0;_0x1c82fd<_0x31f17b;_0x128bc0+=0x1){_0x3073fc=_0x128bc0/_0x113f68;_0x42fae2=(_0x58c6c7*_0x3073fc+_0x4cd60a)/_0x51be7d;_0x43bcd7=erlangb(_0x42fae2,_0x4362e4);_0x1c82fd=_0x42fae2/_0x4362e4*(0x1-erlangb(_0x42fae2,_0x4362e4));}return _0xacb551({'erlangCalls':_0x128bc0,'erlangCallToSecond':_0x113f68/_0x128bc0,'erlangAbandonmentRate':_0x43bcd7,'erlangBusyFactor':_0x1c82fd});});};module[_0x5287('0x216')]=Dialer;
\ No newline at end of file
+var _0xeb54=['strategy','actionid','locked','paused','stateinterface','rrmemory','queueBooked','push','idHopper','queueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','Failure','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','method\x20not\x20recognized','launchHandleIvr','checkIsTrunkReachable','dialTimezone','[syncQueueSummary]','dialGlobalInterval','checkIfTimeIntervals','[syncCampaigns]','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','trim','substring','dialCutDigit','from-sip','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countagentrejectretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','emit','custom:agentnosuchnumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','NoAnswer','buildObj','noanswer','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','Abandoned','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','talking','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','handleIvr','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','ACTIVE','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\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]','interval\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','./hangup','XCALLY_IP_AGI','127.0.0.1','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Interval','Intervals','[ifTime][Action]','Error','stringify','diff','outbound','answered','loggedIn','pTalking','sumDuration','sumHoldTime','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','format','voice:queue:%s','ivr','campaign:ivr:%s','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','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','milliseconds','seconds','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','endtime','starttime','[uniqueid]','clearZombieChannels','[actions]','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','then','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','undefined','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','membername','[syncHangupInAMD]','MACHINE','statedesc','Machine','AMD','countmachineretry','countglobal','amd','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','reason19\x20machine....','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','countabandonedretry','stateGlobal','dialMachineMaxRetry','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','Unknow','reason','agent','dialQueueProject2','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','responsetime','predictiveIntervalErlangCallsDroppedCalls','dropreason','agiafterat','dialDropMaxRetry','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','[syncAgentComplete][createHistory][11]'];(function(_0x21e8a0,_0x5b193e){var _0x344dc5=function(_0x58e43c){while(--_0x58e43c){_0x21e8a0['push'](_0x21e8a0['shift']());}};_0x344dc5(++_0x5b193e);}(_0xeb54,0xfa));var _0x4eb5=function(_0x5c4278,_0x4c9a3a){_0x5c4278=_0x5c4278-0x0;var _0x1da10f=_0xeb54[_0x5c4278];return _0x1da10f;};'use strict';var util=require(_0x4eb5('0x0'));var _=require('lodash');var BPromise=require(_0x4eb5('0x1'));var uuid=require(_0x4eb5('0x2'));var moment=require(_0x4eb5('0x3'));var rr=require('rr');var md5=require(_0x4eb5('0x4'));var Redis=require('ioredis');var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x4eb5('0x5'))(_0x4eb5('0x6'));var loggerBooked=require(_0x4eb5('0x5'))(_0x4eb5('0x7'));var loggerPredictive=require(_0x4eb5('0x5'))('predictive');var loggerPredictiveCalls=require(_0x4eb5('0x5'))(_0x4eb5('0x8'));var loggerSyncQueueSummary=require(_0x4eb5('0x5'))(_0x4eb5('0x9'));var ami=require(_0x4eb5('0xa'));config[_0x4eb5('0xb')]=_[_0x4eb5('0xc')](config[_0x4eb5('0xb')],{'host':_0x4eb5('0xd'),'port':0x18eb});var io=require(_0x4eb5('0xe'))(new Redis(config[_0x4eb5('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x4eb5('0xf'));var cmHopperBlack=require(_0x4eb5('0x10'));var voiceQueueRt=require(_0x4eb5('0x11'));var Action=require('./action');var History=require('./history');var Final=require(_0x4eb5('0x12'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x4eb5('0x13'));var ipAgi=process['env'][_0x4eb5('0x14')]||_0x4eb5('0x15');var strategy={'rrmemory':'rrmemory','roundrobin':_0x4eb5('0x16')};var Sequence=function(){};Sequence[_0x4eb5('0x17')][_0x4eb5('0x18')]=function(_0x5671f5){this[_0x4eb5('0x19')]=this['tail']?this['tail'][_0x4eb5('0x1a')](_0x5671f5):_0x5671f5();};function Dialer(_0x287b22,_0x1a0a7c){this[_0x4eb5('0x1b')]=new Sequence();this[_0x4eb5('0x1c')]=_0x1a0a7c;this[_0x4eb5('0x1d')]=_0x287b22[_0x4eb5('0x1d')];this[_0x4eb5('0x1e')]=_0x287b22[_0x4eb5('0x1e')];this[_0x4eb5('0x1f')]=_0x287b22[_0x4eb5('0x1f')];this[_0x4eb5('0x20')]=_0x287b22['trunks'];this[_0x4eb5('0x21')]=config[_0x4eb5('0x21')]||0x2;this[_0x4eb5('0x22')]={};this[_0x4eb5('0x23')]={};this[_0x4eb5('0x24')]={};this[_0x4eb5('0x25')]={};this[_0x4eb5('0x26')]={};this['startPredictive']={};this[_0x4eb5('0x27')]={};this[_0x4eb5('0x28')]={};this['queueBooked']={};this[_0x4eb5('0x29')]={};ami['on']('agentconnect',this[_0x4eb5('0x2a')][_0x4eb5('0x2b')](this));ami['on'](_0x4eb5('0x2c'),this['syncQueueCallerAbandon'][_0x4eb5('0x2b')](this));ami['on'](_0x4eb5('0x2d'),this[_0x4eb5('0x2e')][_0x4eb5('0x2b')](this));ami['on'](_0x4eb5('0x2f'),this[_0x4eb5('0x30')][_0x4eb5('0x2b')](this));ami['on'](_0x4eb5('0x31'),this['syncQueueSummary'][_0x4eb5('0x2b')](this));ami['on']('hangup',this[_0x4eb5('0x32')][_0x4eb5('0x2b')](this));ami['on'](_0x4eb5('0x33'),this[_0x4eb5('0x34')]['bind'](this));ami['on'](_0x4eb5('0x35'),this['syncVarSet']['bind'](this));ami['on'](_0x4eb5('0x36'),this[_0x4eb5('0x37')][_0x4eb5('0x2b')](this));ami['on'](_0x4eb5('0x38'),this[_0x4eb5('0x39')][_0x4eb5('0x2b')](this));this[_0x4eb5('0x3a')]();this[_0x4eb5('0x3b')]();}function isNotNull(_0x33ee68){return _0x33ee68!==null&&!_[_0x4eb5('0x3c')](_0x33ee68);}function checkIsLoggedIn(_0x48a0c3,_0x49d497){return function(){if(_0x49d497<=0x0){_0x48a0c3[_0x4eb5('0x3d')]=_0x4eb5('0x3e');throw _0x48a0c3[_0x4eb5('0x3f')]+_0x4eb5('0x40');}};}function isActive(_0x5ede0c){return _0x5ede0c;}function checkIsActive(_0x4a596c,_0x35dd6c){return function(){if(!isActive(_0x35dd6c)){_0x4a596c[_0x4eb5('0x3d')]=_0x4eb5('0x41');throw _0x4a596c['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x5ae9c5){return function(){if(!isNotNull(_0x5ae9c5['Interval'])){_0x5ae9c5[_0x4eb5('0x3d')]=_0x4eb5('0x42');throw _0x5ae9c5[_0x4eb5('0x3f')]+_0x4eb5('0x43');}if(!isNotNull(_0x5ae9c5['Interval']['Intervals'])){_0x5ae9c5[_0x4eb5('0x3d')]='INTERVAL_IS_NULL';throw _0x5ae9c5[_0x4eb5('0x3f')]+_0x4eb5('0x43');}if(!isNotNull(_[_0x4eb5('0x44')](_0x5ae9c5[_0x4eb5('0x45')][_0x4eb5('0x46')]))){_0x5ae9c5[_0x4eb5('0x3d')]=_0x4eb5('0x42');throw _0x5ae9c5['name']+_0x4eb5('0x43');}};}function msgResponse(_0x3b8963,_0x2cee1d,_0x5bd4b2){return{'action':_0x3b8963,'response':_0x2cee1d,'message':_0x5bd4b2,'stack':_0x5bd4b2};}function myreject(_0x488f61){return function(_0x52c12c){return _0x488f61(msgResponse(_0x4eb5('0x47'),_0x4eb5('0x48'),JSON[_0x4eb5('0x49')](_0x52c12c)));};}function getSeconds(_0x38734e,_0x5e7b03){var _0x1425ca=moment(_0x38734e)['milliseconds'](0x0);var _0x243b41=moment(_0x5e7b03)['milliseconds'](0x0);return _0x1425ca[_0x4eb5('0x4a')](_0x243b41,'seconds');}function emit(_0x411703,_0x49ea5a,_0x123d20){io['to'](_0x411703)['emit'](_0x49ea5a,_0x123d20);}function emitVoiceQueueSummary(_0x1ce9a2){if(_0x1ce9a2['type']===_0x4eb5('0x4b')){var _0x233570={'id':_0x1ce9a2['id'],'name':_0x1ce9a2[_0x4eb5('0x3f')],'strategy':_0x1ce9a2['strategy'],'answered':_0x1ce9a2[_0x4eb5('0x4c')],'available':_0x1ce9a2['available'],'loggedIn':_0x1ce9a2[_0x4eb5('0x4d')],'pTalking':_0x1ce9a2[_0x4eb5('0x4e')],'sumBillable':_0x1ce9a2['sumBillable'],'sumDuration':_0x1ce9a2[_0x4eb5('0x4f')],'sumHoldTime':_0x1ce9a2[_0x4eb5('0x50')]||0x0,'talking':_0x1ce9a2['talking'],'total':_0x1ce9a2['total'],'type':_0x1ce9a2[_0x4eb5('0x51')],'unmanaged':_0x1ce9a2['unmanaged'],'abandoned':_0x1ce9a2[_0x4eb5('0x52')],'waiting':_0x1ce9a2[_0x4eb5('0x53')],'loggedInDb':_0x1ce9a2[_0x4eb5('0x54')],'dialActive':_0x1ce9a2[_0x4eb5('0x55')],'dialMethod':_0x1ce9a2[_0x4eb5('0x56')],'dialOriginateCallerIdName':_0x1ce9a2[_0x4eb5('0x57')],'dialOriginateCallerIdNumber':_0x1ce9a2[_0x4eb5('0x58')],'dialOriginateTimeout':_0x1ce9a2[_0x4eb5('0x59')],'dialPrefix':_0x1ce9a2[_0x4eb5('0x5a')],'outboundAnswerAgiCallsDay':_0x1ce9a2['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1ce9a2[_0x4eb5('0x5b')],'outboundBlacklistCallsDay':_0x1ce9a2[_0x4eb5('0x5c')],'outboundBusyCallsDay':_0x1ce9a2[_0x4eb5('0x5d')],'outboundCongestionCallsDay':_0x1ce9a2[_0x4eb5('0x5e')],'outboundDropCallsDayACS':_0x1ce9a2['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1ce9a2[_0x4eb5('0x5f')],'outboundDropCallsDayTimeout':_0x1ce9a2[_0x4eb5('0x60')],'outboundNoAnswerCallsDay':_0x1ce9a2[_0x4eb5('0x61')],'outboundNoSuchCallsDay':_0x1ce9a2[_0x4eb5('0x62')],'outboundOriginateFailureCallsDay':_0x1ce9a2[_0x4eb5('0x63')],'outboundReCallsDay':_0x1ce9a2[_0x4eb5('0x64')],'outboundRejectCallsDay':_0x1ce9a2[_0x4eb5('0x65')],'outboundUnknownCallsDay':_0x1ce9a2[_0x4eb5('0x66')],'predictiveIntervalAnsweredCalls':_0x1ce9a2[_0x4eb5('0x67')],'predictiveIntervalAvgHoldtime':_0x1ce9a2[_0x4eb5('0x68')],'predictiveIntervalAvgTalktime':_0x1ce9a2['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1ce9a2[_0x4eb5('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x1ce9a2[_0x4eb5('0x6a')],'predictiveIntervalErlangCalls':_0x1ce9a2[_0x4eb5('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x1ce9a2['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1ce9a2['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1ce9a2['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1ce9a2[_0x4eb5('0x6c')],'predictiveIntervalAvailable':_0x1ce9a2[_0x4eb5('0x6d')],'predictiveIntervalTotalCalls':_0x1ce9a2[_0x4eb5('0x6e')],'message':_0x1ce9a2[_0x4eb5('0x3d')],'originated':_0x1ce9a2['originated'],'erlangCalls':_0x1ce9a2[_0x4eb5('0x6f')],'erlangCallToSecond':_0x1ce9a2[_0x4eb5('0x70')],'erlangAbandonmentRate':_0x1ce9a2[_0x4eb5('0x71')],'erlangBusyFactor':_0x1ce9a2[_0x4eb5('0x72')],'startPredictive':_0x1ce9a2[_0x4eb5('0x73')],'startProgressive':_0x1ce9a2[_0x4eb5('0x27')]};if(_0x1ce9a2[_0x4eb5('0x74')]){_0x233570[_0x4eb5('0x74')]={'id':_0x1ce9a2[_0x4eb5('0x74')]['id'],'name':_0x1ce9a2[_0x4eb5('0x74')]['name'],'active':_0x1ce9a2[_0x4eb5('0x74')][_0x4eb5('0x75')],'callerid':_0x1ce9a2[_0x4eb5('0x74')][_0x4eb5('0x76')]};}if(_0x1ce9a2[_0x4eb5('0x45')]){_0x233570[_0x4eb5('0x45')]={'id':_0x1ce9a2[_0x4eb5('0x45')]['id'],'name':_0x1ce9a2[_0x4eb5('0x45')][_0x4eb5('0x3f')]};}var _0x26cdca=md5(JSON[_0x4eb5('0x49')](_0x233570));if(_0x1ce9a2['md5']!==_0x26cdca){_0x1ce9a2[_0x4eb5('0x4')]=_0x26cdca;emit(util[_0x4eb5('0x77')](_0x4eb5('0x78'),_0x233570['name']),'voice_queue:save',_0x233570);}}}function emitCampaignSummary(_0x3723ca){if(_0x3723ca[_0x4eb5('0x51')]===_0x4eb5('0x79')){emit(util[_0x4eb5('0x77')](_0x4eb5('0x7a'),_0x3723ca[_0x4eb5('0x3f')]),_0x4eb5('0x7b'),_0x3723ca);}}function checkGetDataPredictive(_0x208fc3){if(isNotNull(_0x208fc3)&&!_[_0x4eb5('0x44')](_0x208fc3)){loggerPredictive[_0x4eb5('0x7c')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0x4eb5('0x7d'),_0x208fc3[_0x4eb5('0x6e')]);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x7e'),_0x208fc3[_0x4eb5('0x67')]);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x7f'),_0x208fc3['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x4eb5('0x80'),_0x208fc3[_0x4eb5('0x69')]);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x81'),_0x208fc3[_0x4eb5('0x68')]);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x82'),_0x208fc3[_0x4eb5('0x83')]);loggerPredictive['info'](_0x4eb5('0x84'));if(_0x208fc3[_0x4eb5('0x6e')]>0x0){if(!_[_0x4eb5('0x3c')](_0x208fc3[_0x4eb5('0x83')])&&_0x208fc3[_0x4eb5('0x83')]>0x0){return!![];}loggerPredictive[_0x4eb5('0x7c')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x208fc3[_0x4eb5('0x68')])&&_0x208fc3['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x85'));}else{loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x86'));}}else{loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x87'));}return![];}function mergeDataErlangB(_0x7fdccd){return function(_0x24b330){loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x88'));loggerPredictive[_0x4eb5('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24b330[_0x4eb5('0x6f')]);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x89'),_0x24b330[_0x4eb5('0x70')]);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x8a'),_0x24b330[_0x4eb5('0x71')]);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x8b'),_0x24b330['erlangBusyFactor']);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24b330[_0x4eb5('0x71')]);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x84'));_[_0x4eb5('0x8c')](_0x7fdccd,_0x24b330);};}function getDiff(_0x55deec){var _0x256716=moment()['milliseconds'](0x0);var _0x26f094=moment(_0x55deec)[_0x4eb5('0x8d')](0x0);return _0x256716[_0x4eb5('0x4a')](_0x26f094,_0x4eb5('0x8e'));}function ifInterval(_0x4be479,_0x4ea87d){if(_[_0x4eb5('0x3c')](_0x4ea87d)){return![];}return getDiff(_0x4ea87d)<_0x4be479*0x3c;}function freeVariablesPredictive(_0xde1541){if(isNotNull(_0xde1541)){if(!_[_0x4eb5('0x3c')](_0xde1541[_0x4eb5('0x27')])){_0xde1541[_0x4eb5('0x27')]=undefined;loggerPredictive[_0x4eb5('0x7c')](_0xde1541[_0x4eb5('0x3f')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x4eb5('0x3c')](_0xde1541['startPredictive'])){_0xde1541[_0x4eb5('0x73')]=undefined;loggerPredictive[_0x4eb5('0x7c')](_0xde1541[_0x4eb5('0x3f')],_0x4eb5('0x8f'));}if(!_[_0x4eb5('0x3c')](_0xde1541['handlePredictive'])){clearInterval(_0xde1541['handlePredictive']);_0xde1541[_0x4eb5('0x90')]=undefined;loggerPredictive[_0x4eb5('0x7c')](_0xde1541[_0x4eb5('0x3f')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1eb03c,_0x46d0ac){if(_0x46d0ac===0x0){return 0x0;}var _0x28c39b=0x1;for(var _0x2a4dd3=0x1;_0x2a4dd3<=_0x46d0ac;_0x2a4dd3+=0x1){_0x28c39b=0x1+_0x28c39b*_0x2a4dd3/_0x1eb03c;}return 0x1/_0x28c39b;}function isVoiceQueueOutbound(_0x8766e1){return _0x8766e1===_0x4eb5('0x4b');}function isNotPreview(_0x13316a){return _0x13316a!==_0x4eb5('0x1c');}function isCampaignIvr(_0x35bb53){return _0x35bb53===_0x4eb5('0x79');}function getCallerId(_0x1fea0d,_0x3fc444,_0x16b360){if(!_[_0x4eb5('0x3c')](_0x16b360)&&typeof _0x16b360===_0x4eb5('0x91')&&!_['isEmpty'](_0x16b360)){if(!_['isUndefined'](_0x3fc444)&&typeof _0x3fc444==='string'&&!_[_0x4eb5('0x44')](_0x3fc444)){return util[_0x4eb5('0x77')](_0x4eb5('0x92'),_0x3fc444,_0x16b360);}return util[_0x4eb5('0x77')](_0x4eb5('0x92'),_0x16b360,_0x16b360);}if(!_[_0x4eb5('0x3c')](_0x1fea0d)&&typeof _0x1fea0d===_0x4eb5('0x91')&&!_[_0x4eb5('0x44')](_0x1fea0d)){return _0x1fea0d;}return _0x4eb5('0x93');}function loggerCatchQueueSummary(_0x573cc3,_0x3dd69d){return function(_0x4dd303){freeVariablesPredictive(_0x3dd69d);emitVoiceQueueSummary(_0x3dd69d);emitCampaignSummary(_0x3dd69d);loggerSyncQueueSummary[_0x4eb5('0x94')](_0x573cc3,util[_0x4eb5('0x95')](_0x4dd303,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x42f2fb,_0x10cb3d){return function(_0xc51785){loggerPredictive[_0x4eb5('0x94')](_0x10cb3d[_0x4eb5('0x3f')],_0x42f2fb);loggerPredictive[_0x4eb5('0x94')](_0xc51785[_0x4eb5('0x96')]);freeVariablesPredictive(_0x10cb3d);};}function loggerCatch(_0x19eb9b){return function(_0xa8ee2){logger[_0x4eb5('0x94')](_0x19eb9b,util['inspect'](_0xa8ee2,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x17e5ef){return _0x17e5ef&&!_[_0x4eb5('0x3c')](_0x17e5ef)&&_0x17e5ef[_0x4eb5('0x97')]>0x0;}function decremetOriginate(_0x2bc20d){if(!_[_0x4eb5('0x3c')](_0x2bc20d)&&_0x2bc20d!==null){if(typeof _0x2bc20d[_0x4eb5('0x98')]!=='undefined'){if(_0x2bc20d[_0x4eb5('0x98')]>0x0){_0x2bc20d[_0x4eb5('0x98')]-=0x1;}else{logger['error'](_0x4eb5('0x99'));}}}else{logger[_0x4eb5('0x94')](_0x4eb5('0x9a'));}}function checkContactLowerLimitOriginate(_0x114881,_0xc4f56d,_0x96b018){if(_0xc4f56d>_0x96b018){for(var _0x12a404=0x0;_0x12a404<_0xc4f56d-_0x96b018;_0x12a404+=0x1){decremetOriginate(_0x114881);}}}function loggerGetContactDialer(_0x588b23,_0x488283,_0x3cb09a){return function(_0xe9a33f){checkContactLowerLimitOriginate(_0x488283,_0x3cb09a,0x0);logger[_0x4eb5('0x94')](_0x588b23,util[_0x4eb5('0x95')](_0xe9a33f,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x529fec){return function(_0x4265f){if(isNotNull(_0x4265f)&&isNotNull(_0x4265f[0x0])){if(_0x4265f[0x0]['contactsRescheduled']>0x0){_0x529fec[_0x4eb5('0x3d')]=_0x4eb5('0x9b');logger['info'](_0x4eb5('0x9c')+_0x529fec[_0x4eb5('0x3f')],_0x4265f[0x0]['contactsRescheduled'],_0x4eb5('0x9d'));}else{_0x529fec[_0x4eb5('0x3d')]=_0x4eb5('0x9e');logger['info'](_0x4eb5('0x9f')+_0x529fec[_0x4eb5('0x3f')]);}}};}function notSendMessagesQueue(_0x2ff369){if(_0x2ff369[_0x4eb5('0xa0')]){freeVariablesPredictive(_0x2ff369);if(_0x2ff369[_0x4eb5('0x98')]===0x0&&_0x2ff369['talking']===0x0&&_0x2ff369['waiting']===0x0&&(_0x2ff369['pTalking']||0x0)===0x0){_0x2ff369[_0x4eb5('0xa0')]=![];_0x2ff369[_0x4eb5('0xa1')]=0x0;_0x2ff369[_0x4eb5('0x3d')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x4eb5('0xa2'),_0x2ff369[_0x4eb5('0x3f')],_0x4eb5('0xa3'));}else{_0x2ff369[_0x4eb5('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x4eb5('0x94')](_0x4eb5('0xa2'),_0x2ff369[_0x4eb5('0x3f')],'is\x20disactive');}emitVoiceQueueSummary(_0x2ff369);}}function notSendMessagesCampaign(_0x4556bc){if(_0x4556bc[_0x4eb5('0xa0')]){if(_0x4556bc[_0x4eb5('0x98')]===0x0){_0x4556bc['sendMessageOneNotActive']=![];_0x4556bc[_0x4eb5('0x3d')]=_0x4eb5('0x41');loggerSyncQueueSummary[_0x4eb5('0x94')](_0x4eb5('0xa4'),_0x4556bc[_0x4eb5('0x3f')],_0x4eb5('0xa3'));}else{_0x4556bc[_0x4eb5('0x3d')]=_0x4eb5('0xa5');loggerSyncQueueSummary[_0x4eb5('0x94')](_0x4eb5('0xa4'),_0x4556bc[_0x4eb5('0x3f')],'is\x20disactive');}emitCampaignSummary(_0x4556bc);}}function createObjHistory(_0x56b9c5,_0x47020e,_0x4aa1ad,_0x50426b,_0x2b05ec){_0x56b9c5['message']=_0x4aa1ad;var _0x10c787=new Action(_0x56b9c5,_0x47020e);var _0x239441=new History(_0x10c787);_0x239441[_0x4eb5('0xa6')]=_0x50426b;_0x239441['statedesc']=_0x2b05ec;_0x239441[_0x4eb5('0xa7')]=_0x10c787[_0x4eb5('0xa8')];return _0x239441;}Dialer[_0x4eb5('0x17')][_0x4eb5('0x3b')]=function(){var _0x25b575=this;setInterval(function(){_0x25b575['clearZombieChannels'](_0x25b575[_0x4eb5('0x25')],_0x4eb5('0xa9'));_0x25b575[_0x4eb5('0xaa')](_0x25b575[_0x4eb5('0x23')],_0x4eb5('0xab'));},0x32c8);};Dialer[_0x4eb5('0x17')]['clearZombieChannels']=function(_0x36a20c,_0x273cce){var _0xfb014=this;for(var _0x3284c8 in _0x36a20c){if(typeof _0x36a20c[_0x3284c8]!=='undefined'){this['sequence']['enqueue'](function(){if(!_['isNil'](_0x36a20c[_0x3284c8])){return ami[_0x4eb5('0xac')]({'action':_0x4eb5('0xad'),'channel':_0x36a20c[_0x3284c8][_0x4eb5('0xae')]})[_0x4eb5('0xaf')](function(_0x3aed1b){if(_0x3aed1b[_0x4eb5('0x3d')]===_0x4eb5('0xb0')){setTimeout(function(){if(_0x36a20c[_0x3284c8]&&_0x36a20c[_0x3284c8][_0x4eb5('0x51')]!==_0x4eb5('0x79')){_0xfb014[_0x4eb5('0xb1')](_0xfb014[_0x4eb5('0x1d')][_0x36a20c[_0x3284c8][_0x4eb5('0xb2')]]);logger[_0x4eb5('0x94')](_0x4eb5('0xb3'),_0x273cce,_0x3284c8,_0x36a20c[_0x3284c8]['queue']);delete _0x36a20c[_0x3284c8];}if(_0x36a20c[_0x3284c8]&&_0x36a20c[_0x3284c8][_0x4eb5('0x51')]===_0x4eb5('0x79')){_0xfb014[_0x4eb5('0xb1')](_0xfb014[_0x4eb5('0x1e')][_0x36a20c[_0x3284c8][_0x4eb5('0xb2')]]);logger[_0x4eb5('0x94')](_0x4eb5('0xb4'),_0x273cce,_0x3284c8,_0x36a20c[_0x3284c8][_0x4eb5('0xb2')]);delete _0x36a20c[_0x3284c8];}},0x2328);}});}});}}};Dialer[_0x4eb5('0x17')][_0x4eb5('0xb5')]=function(_0x4b2c90){return BPromise[_0x4eb5('0xb6')]()['then'](cmHopper['countReScheduled'](_0x4b2c90))['catch'](loggerCatch(_0x4eb5('0xb7')));};Dialer[_0x4eb5('0x17')]['checkIsBlackList']=function(_0x3bc232){return BPromise['resolve']()['then'](cmHopperBlack[_0x4eb5('0xb8')](_0x3bc232))['catch'](loggerCatch(_0x4eb5('0xb9')));};Dialer[_0x4eb5('0x17')][_0x4eb5('0xba')]=function(_0x411c29){return BPromise[_0x4eb5('0xb6')]()[_0x4eb5('0xbb')](cmHopperBlack['checkIsBlackListIvr'](_0x411c29))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xbc')));};Dialer[_0x4eb5('0x17')]['averageHandleTime']=function(_0x5a800e){return BPromise['resolve']()[_0x4eb5('0xbb')](cmHopperHistory[_0x4eb5('0xbd')](_0x5a800e))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xbe')));};Dialer['prototype']['rescheduleContact']=function(_0x3f6749){return BPromise['resolve']()[_0x4eb5('0xbb')](cmHopper[_0x4eb5('0xbf')](_0x3f6749))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xc0')));};Dialer[_0x4eb5('0x17')][_0x4eb5('0xc1')]=function(_0x47cb86,_0x5aa27e,_0x40fbb0){return BPromise[_0x4eb5('0xb6')]()['then'](cmHopper[_0x4eb5('0xc1')](_0x47cb86,_0x5aa27e,_0x40fbb0))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xc2')));};Dialer['prototype'][_0x4eb5('0xc3')]=function(_0x5d68ea,_0x31fec3,_0x49ca4e,_0x294d49){return BPromise[_0x4eb5('0xb6')]()[_0x4eb5('0xbb')](cmHopper[_0x4eb5('0xc3')](_0x5d68ea,_0x31fec3,_0x49ca4e,_0x294d49))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xc4')));};Dialer[_0x4eb5('0x17')][_0x4eb5('0xc5')]=function(_0x556f9b,_0x5c603c,_0x593f88){return BPromise[_0x4eb5('0xb6')]()['then'](cmHopper[_0x4eb5('0xc5')](_0x556f9b,_0x5c603c,_0x593f88))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xc4')));};Dialer['prototype'][_0x4eb5('0xc6')]=function(_0xbba9b7){return BPromise[_0x4eb5('0xb6')]()[_0x4eb5('0xbb')](voiceQueueRt['getVoiceQueueRtPauses'](_0xbba9b7))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xc7')));};Dialer[_0x4eb5('0x17')]['moveContactManagedDialer']=function(_0x40bd74){return BPromise[_0x4eb5('0xb6')]()[_0x4eb5('0xbb')](cmHopper[_0x4eb5('0xc8')](_0x40bd74))['catch'](loggerCatch(_0x4eb5('0xc9')));};Dialer[_0x4eb5('0x17')][_0x4eb5('0xca')]=function(_0x30051c){return BPromise[_0x4eb5('0xb6')]()['then'](cmHopperHistory[_0x4eb5('0xca')](_0x30051c))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xcb')));};Dialer[_0x4eb5('0x17')]['updateOriginated']=function(_0x3b6e27){if(!_[_0x4eb5('0x3c')](_0x3b6e27)&&_0x3b6e27!==null){if(typeof _0x3b6e27[_0x4eb5('0x98')]!==_0x4eb5('0xcc')){if(_0x3b6e27['originated']>0x0){_0x3b6e27[_0x4eb5('0x98')]-=0x1;}else{logger[_0x4eb5('0x94')](_0x4eb5('0xcd'));}}}else{logger[_0x4eb5('0x94')](_0x4eb5('0xce'));}};Dialer[_0x4eb5('0x17')][_0x4eb5('0xcf')]=function(_0x5cf0cc,_0x5964bf){var _0x13fa34=this;return function(_0x34d5b3){_0x13fa34[_0x4eb5('0xb1')](_0x5964bf);logger[_0x4eb5('0x94')](_0x5cf0cc,util[_0x4eb5('0x95')](_0x34d5b3,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x4eb5('0xd0')]=function(_0x4eef3b,_0xcf0b64,_0xc51ef2){var _0x522f68={'state':0x19,'statedesc':_0x4eb5('0xd1')};this[_0x4eb5('0xb1')](_0xcf0b64);this[_0x4eb5('0xd2')](_[_0x4eb5('0x8c')](_0x522f68,_[_0x4eb5('0xd3')](_0xc51ef2,[_0x4eb5('0xd4'),_0x4eb5('0xd5'),_0x4eb5('0xd6'),'VoiceQueueId',_0x4eb5('0xd7')])),_0x4eb5('0xd8'),_0x4eb5('0xd9'));logger[_0x4eb5('0x94')](_0x4eef3b);};Dialer[_0x4eb5('0x17')][_0x4eb5('0xda')]=function(_0x1dfd8c){return _0x1dfd8c===_0x4eb5('0xdb');};Dialer[_0x4eb5('0x17')][_0x4eb5('0xdc')]=function(_0x31de9f){return!_[_0x4eb5('0x3c')](_0x31de9f)&&_0x31de9f&&!_[_0x4eb5('0x3c')](_0x31de9f['name'])&&!_['isUndefined'](_0x31de9f['active'])&&_0x31de9f['active']&&(this[_0x4eb5('0x20')][util['format'](_0x4eb5('0xdd'),_0x31de9f['name'])][_0x4eb5('0xad')]===_0x4eb5('0xde')||this[_0x4eb5('0x20')][util[_0x4eb5('0x77')](_0x4eb5('0xdd'),_0x31de9f[_0x4eb5('0x3f')])][_0x4eb5('0xad')]==='unmonitored');};Dialer[_0x4eb5('0x17')][_0x4eb5('0xd2')]=function(_0x4cdf66,_0x539939,_0x10a06d){this[_0x4eb5('0xca')](_0x4cdf66)[_0x4eb5('0xaf')](loggerCatch(_0x539939));this['moveContactManagedDialer'](_0x4cdf66)[_0x4eb5('0xaf')](loggerCatch(_0x10a06d));};Dialer[_0x4eb5('0x17')][_0x4eb5('0xdf')]=function(_0x489e68){var _0x2b52b7=this[_0x4eb5('0x25')][_0x489e68[_0x4eb5('0xe0')]];var _0x2a996f;if(!_[_0x4eb5('0xe1')](_0x489e68)&&!_['isNil'](_0x489e68[_0x4eb5('0xe2')])&&!_[_0x4eb5('0xe1')](_0x489e68['variable'][_0x4eb5('0xe3')])&&_0x489e68[_0x4eb5('0xe4')]==='xcally-motion-dialer'&&_0x2b52b7){if(_0x2b52b7[_0x4eb5('0x51')]!==_0x4eb5('0x79')&&this[_0x4eb5('0x1d')][_0x2b52b7[_0x4eb5('0xb2')]][_0x4eb5('0xe5')]&&_0x489e68[_0x4eb5('0xe6')]===_0x4eb5('0xe7')){delete this['uniqueId'][_0x489e68['uniqueid']];this['updateOriginated'](this[_0x4eb5('0x1d')][_0x2b52b7[_0x4eb5('0xb2')]]);this[_0x4eb5('0x1d')][_0x2b52b7[_0x4eb5('0xb2')]][_0x4eb5('0x5b')]+=0x1;this[_0x4eb5('0x1d')][_0x2b52b7[_0x4eb5('0xb2')]][_0x4eb5('0xe8')]+=0x1;_0x2a996f=new Hangup(_0x2b52b7,_0x489e68);_0x2a996f[_0x4eb5('0xa6')]=0x12;_0x2a996f['statedesc']='HangupInAMD';_0x2a996f[_0x4eb5('0xe9')]='AMD';this['saveInDb'](_0x2a996f,'[syncHangupInAMD][createHistory]',_0x4eb5('0xea'));}if(_0x2b52b7[_0x4eb5('0x51')]!=='ivr'&&this[_0x4eb5('0x1d')][_0x2b52b7[_0x4eb5('0xb2')]][_0x4eb5('0xe5')]&&_0x489e68[_0x4eb5('0xe6')]===_0x4eb5('0xeb')){var _0x4677c6=this;return new BPromise(function(_0x157763,_0x1f8030){delete _0x4677c6['uniqueId'][_0x489e68[_0x4eb5('0xe0')]];_0x4677c6[_0x4eb5('0xb1')](_0x4677c6[_0x4eb5('0x1d')][_0x2b52b7[_0x4eb5('0xb2')]]);_0x4677c6[_0x4eb5('0x1d')][_0x2b52b7['queue']][_0x4eb5('0x5b')]+=0x1;_0x4677c6[_0x4eb5('0x1d')][_0x2b52b7[_0x4eb5('0xb2')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x488603=_0x4677c6[_0x4eb5('0x1d')][_0x2b52b7['queue']];var _0x401842=new Hangup(_0x2b52b7,_0x489e68);_0x401842[_0x4eb5('0xa6')]=0x13;_0x401842[_0x4eb5('0xec')]=_0x4eb5('0xed');_0x401842[_0x4eb5('0xe9')]=_0x4eb5('0xee');_0x401842[_0x4eb5('0xef')]+=0x1;_0x401842[_0x4eb5('0xf0')]+=0x1;_0x401842[_0x4eb5('0xf1')]=!![];_0x4677c6[_0x4eb5('0xca')](_0x401842)[_0x4eb5('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x401842[_0x4eb5('0xf2')]+_0x401842['countcongestionretry']+_0x401842[_0x4eb5('0xf3')]+_0x401842[_0x4eb5('0xf4')]+_0x401842[_0x4eb5('0xf5')]+_0x401842['countabandonedretry']+_0x401842[_0x4eb5('0xef')]+_0x401842['countagentrejectretry']>=_0x488603['dialGlobalMaxRetry']){_0x4677c6['stateGlobal'](_0x401842,_0x157763,_0x1f8030,_0x4eb5('0xf6'));}else{if(_0x401842['countmachineretry']>=_0x488603['dialMachineMaxRetry']){_0x4677c6['createStateFinal'](_0x401842,_0x157763,_0x1f8030,_0x4eb5('0xf7'));}else{_0x4677c6[_0x4eb5('0xbf')]({'active':![],'countmachineretry':_0x401842[_0x4eb5('0xef')],'scheduledat':moment()[_0x4eb5('0xf8')](_0x488603[_0x4eb5('0xf9')],_0x4eb5('0xfa'))['format'](_0x4eb5('0xfb')),'ContactId':_0x401842[_0x4eb5('0xd4')],'ListId':_0x401842[_0x4eb5('0xd5')],'VoiceQueueId':_0x401842[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x401842[_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xfd')));_0x157763({'reschedule':0x1});}}});}if(_0x2b52b7[_0x4eb5('0x51')]===_0x4eb5('0x79')&&this[_0x4eb5('0x1e')][_0x2b52b7[_0x4eb5('0xb2')]][_0x4eb5('0xe5')]&&_0x489e68[_0x4eb5('0xe6')]==='HANGUP'){delete this[_0x4eb5('0x25')][_0x489e68['uniqueid']];this[_0x4eb5('0xb1')](this['campaigns'][_0x2b52b7['queue']]);_0x2a996f=new Hangup(_0x2b52b7,_0x489e68);_0x2a996f[_0x4eb5('0xa6')]=0x12;_0x2a996f[_0x4eb5('0xec')]=_0x4eb5('0xfe');_0x2a996f[_0x4eb5('0xe9')]='AMD';this[_0x4eb5('0xd2')](_0x2a996f,_0x4eb5('0xff'),_0x4eb5('0x100'));}if(_0x2b52b7['type']===_0x4eb5('0x79')&&this[_0x4eb5('0x1e')][_0x2b52b7[_0x4eb5('0xb2')]][_0x4eb5('0xe5')]&&_0x489e68[_0x4eb5('0xe6')]===_0x4eb5('0xeb')){var _0x4677c6=this;return new BPromise(function(_0x7f5ef0,_0x4143c5){delete _0x4677c6[_0x4eb5('0x25')][_0x489e68[_0x4eb5('0xe0')]];_0x4677c6[_0x4eb5('0xb1')](_0x4677c6['campaigns'][_0x2b52b7[_0x4eb5('0xb2')]]);_0x4677c6[_0x4eb5('0x1e')][_0x2b52b7[_0x4eb5('0xb2')]][_0x4eb5('0x5b')]+=0x1;_0x4677c6[_0x4eb5('0x1e')][_0x2b52b7[_0x4eb5('0xb2')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x6a7704=_0x4677c6['campaigns'][_0x2b52b7[_0x4eb5('0xb2')]];var _0x1f35f1=new Hangup(_0x2b52b7,_0x489e68);_0x1f35f1[_0x4eb5('0xa6')]=0x13;_0x1f35f1['statedesc']=_0x4eb5('0xed');_0x1f35f1[_0x4eb5('0xe9')]=_0x4eb5('0xee');_0x1f35f1['countmachineretry']+=0x1;_0x1f35f1[_0x4eb5('0xf0')]+=0x1;_0x1f35f1['amd']=!![];_0x4677c6[_0x4eb5('0xca')](_0x1f35f1)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1f35f1[_0x4eb5('0xf2')]+_0x1f35f1[_0x4eb5('0x101')]+_0x1f35f1['countnoanswerretry']+_0x1f35f1['countnosuchnumberretry']+_0x1f35f1[_0x4eb5('0xf5')]+_0x1f35f1[_0x4eb5('0x102')]+_0x1f35f1[_0x4eb5('0xef')]+_0x1f35f1['countagentrejectretry']>=_0x6a7704['dialGlobalMaxRetry']){_0x4677c6[_0x4eb5('0x103')](_0x1f35f1,_0x7f5ef0,_0x4143c5,_0x4eb5('0xf6'));}else{if(_0x1f35f1[_0x4eb5('0xef')]>=_0x6a7704[_0x4eb5('0x104')]){_0x4677c6['createStateFinal'](_0x1f35f1,_0x7f5ef0,_0x4143c5,_0x4eb5('0xf7'));}else{_0x4677c6[_0x4eb5('0xbf')]({'active':![],'countmachineretry':_0x1f35f1[_0x4eb5('0xef')],'scheduledat':moment()[_0x4eb5('0xf8')](_0x6a7704[_0x4eb5('0xf9')],'minutes')[_0x4eb5('0x77')](_0x4eb5('0xfb')),'ContactId':_0x1f35f1[_0x4eb5('0xd4')],'ListId':_0x1f35f1[_0x4eb5('0xd5')],'VoiceQueueId':_0x1f35f1[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x1f35f1[_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xfd')));_0x7f5ef0({'reschedule':0x1});}}});}}};Dialer[_0x4eb5('0x17')][_0x4eb5('0x32')]=function(_0x1a3aa8){var _0x39cebc=this[_0x4eb5('0x25')][_0x1a3aa8[_0x4eb5('0xe0')]];var _0x209c6a=this;var _0x44d402;if(_0x39cebc&&_0x39cebc[_0x4eb5('0x51')]===_0x4eb5('0x79')){delete this['uniqueId'][_0x1a3aa8[_0x4eb5('0xe0')]];this['updateOriginated'](this['campaigns'][_0x39cebc[_0x4eb5('0xb2')]]);this[_0x4eb5('0x1e')][_0x39cebc[_0x4eb5('0xb2')]]['ivrAnswerCallsDay']+=0x1;_0x44d402=new Hangup(_0x39cebc,_0x1a3aa8);this[_0x4eb5('0xca')](_0x44d402)[_0x4eb5('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x4eb5('0xc8')](_0x44d402)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x105')));}if(_0x39cebc&&_0x39cebc[_0x4eb5('0x51')]!=='ivr'&&isNotNull(this[_0x4eb5('0x1d')][_0x39cebc[_0x4eb5('0xb2')]][_0x4eb5('0x106')])){delete this[_0x4eb5('0x25')][_0x1a3aa8[_0x4eb5('0xe0')]];this['updateOriginated'](this[_0x4eb5('0x1d')][_0x39cebc[_0x4eb5('0xb2')]]);this[_0x4eb5('0x1d')][_0x39cebc['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x39cebc[_0x4eb5('0xb2')]][_0x4eb5('0xe8')]+=0x1;_0x44d402=new Hangup(_0x39cebc,_0x1a3aa8);_0x44d402[_0x4eb5('0xa6')]=0x10;_0x44d402['statedesc']=_0x4eb5('0x107');_0x44d402[_0x4eb5('0xe9')]=_0x4eb5('0x108');this[_0x4eb5('0xca')](_0x44d402)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x109')));this[_0x4eb5('0xc8')](_0x44d402)['catch'](loggerCatch(_0x4eb5('0x105')));}if(_0x39cebc&&_0x39cebc[_0x4eb5('0x51')]!==_0x4eb5('0x79')&&!isNotNull(this['voiceQueues'][_0x39cebc[_0x4eb5('0xb2')]]['dialQueueProject'])){delete this[_0x4eb5('0x25')][_0x1a3aa8['uniqueid']];this[_0x4eb5('0xb1')](this['voiceQueues'][_0x39cebc[_0x4eb5('0xb2')]]);this[_0x4eb5('0x1d')][_0x39cebc[_0x4eb5('0xb2')]][_0x4eb5('0x66')]+=0x1;_0x44d402=new Hangup(_0x39cebc,_0x1a3aa8);_0x44d402[_0x4eb5('0xa6')]=0xc;_0x44d402['statedesc']=_0x1a3aa8[_0x4eb5('0x10a')];_0x44d402[_0x4eb5('0xe9')]=_0x4eb5('0x10b');this[_0x4eb5('0xca')](_0x44d402)['catch'](loggerCatch(_0x4eb5('0x109')));this[_0x4eb5('0xc8')](_0x44d402)[_0x4eb5('0xaf')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x4eb5('0x17')][_0x4eb5('0x30')]=function(_0x4290f8){var _0x218708=this['uniqueId'][_0x4290f8[_0x4eb5('0xe0')]];var _0x45daab=this;if(this[_0x4eb5('0x1d')][_0x4290f8['queue']]){if(_0x218708&&_0x218708[_0x4eb5('0x51')]!==_0x4eb5('0x79')){delete this[_0x4eb5('0x25')][_0x4290f8['uniqueid']];this[_0x4eb5('0x1d')][_0x4290f8[_0x4eb5('0xb2')]][_0x4eb5('0x5b')]+=0x1;var _0x59974=new AgentComplete(_0x218708,_0x4290f8);if(_0x4290f8[_0x4eb5('0x10c')]===_0x4eb5('0x10d')){_0x59974['agiafterat']=this[_0x4eb5('0x1d')][_0x4290f8[_0x4eb5('0xb2')]][_0x4eb5('0x10e')]&&this[_0x4eb5('0x1d')][_0x4290f8[_0x4eb5('0xb2')]]['dialAgiAfterHangupAgent']?moment()[_0x4eb5('0x77')](_0x4eb5('0xfb')):undefined;}this[_0x4eb5('0xca')](_0x59974)[_0x4eb5('0xaf')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x4eb5('0xc8')](_0x59974)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x10f')));}}};Dialer[_0x4eb5('0x17')][_0x4eb5('0x2a')]=function(_0x1f19e1){if(this[_0x4eb5('0x1d')][_0x1f19e1[_0x4eb5('0xb2')]]){if(this[_0x4eb5('0x25')][_0x1f19e1['uniqueid']]&&this['uniqueId'][_0x1f19e1[_0x4eb5('0xe0')]]['type']!==_0x4eb5('0x79')){this[_0x4eb5('0xb1')](this[_0x4eb5('0x1d')][_0x1f19e1[_0x4eb5('0xb2')]]);this['uniqueId'][_0x1f19e1[_0x4eb5('0xe0')]][_0x4eb5('0x110')]=moment()[_0x4eb5('0x77')](_0x4eb5('0xfb'));}}};Dialer[_0x4eb5('0x17')][_0x4eb5('0x111')]=function(_0x561fcf){this['createHistory'](_0x561fcf)[_0x4eb5('0xaf')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x4eb5('0xc8')](_0x561fcf)['catch'](loggerCatch(_0x4eb5('0x112')));};Dialer[_0x4eb5('0x17')][_0x4eb5('0x113')]=function(_0x46136c){var _0x1e0028=this[_0x4eb5('0x25')][_0x46136c[_0x4eb5('0xe0')]];var _0x17bf18=this;if(this[_0x4eb5('0x1d')][_0x46136c[_0x4eb5('0xb2')]]){if(_0x1e0028&&_0x1e0028['type']!==_0x4eb5('0x79')){delete this[_0x4eb5('0x25')][_0x46136c[_0x4eb5('0xe0')]];this[_0x4eb5('0xb1')](this[_0x4eb5('0x1d')][_0x46136c[_0x4eb5('0xb2')]]);_0x1e0028['droptime']=moment()['format'](_0x4eb5('0xfb'));var _0x2e4e08=new QueueCallerAbandon(_0x1e0028,_0x46136c);if(getSeconds(_0x1e0028['droptime'],_0x1e0028[_0x4eb5('0x114')])>=_0x1e0028['dialQueueTimeout']){this['voiceQueues'][_0x46136c[_0x4eb5('0xb2')]][_0x4eb5('0x6a')]+=0x1;this[_0x4eb5('0x1d')][_0x46136c[_0x4eb5('0xb2')]][_0x4eb5('0x60')]+=0x1;this['voiceQueues'][_0x46136c[_0x4eb5('0xb2')]][_0x4eb5('0x115')]+=0x1;_0x2e4e08['state']=0xa;_0x2e4e08['statedesc']='Drop';_0x2e4e08[_0x4eb5('0x116')]='TIMEOUT';_0x2e4e08[_0x4eb5('0x117')]=this[_0x4eb5('0x1d')][_0x46136c['queue']][_0x4eb5('0x10e')]?moment()[_0x4eb5('0x77')](_0x4eb5('0xfb')):undefined;_0x2e4e08[_0x4eb5('0xf5')]+=0x1;_0x2e4e08[_0x4eb5('0xf0')]+=0x1;if(_0x2e4e08['countdropretry']>=this[_0x4eb5('0x1d')][_0x46136c[_0x4eb5('0xb2')]][_0x4eb5('0x118')]){this[_0x4eb5('0x111')](_0x2e4e08);}else{this[_0x4eb5('0xbf')]({'active':![],'countdropretry':_0x2e4e08[_0x4eb5('0xf5')],'scheduledat':moment()[_0x4eb5('0xf8')](this['voiceQueues'][_0x46136c[_0x4eb5('0xb2')]]['dialDropRetryFrequency'],'minutes')['format'](_0x4eb5('0xfb')),'ContactId':_0x1e0028['ContactId'],'ListId':_0x1e0028[_0x4eb5('0xd5')],'VoiceQueueId':_0x1e0028[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x1e0028[_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x119')));var _0x1675d2=new History(_0x2e4e08);_0x1675d2[_0x4eb5('0xa6')]=0xa;_0x1675d2[_0x4eb5('0xec')]='Drop';_0x1675d2['starttime']=moment()[_0x4eb5('0x77')](_0x4eb5('0xfb'));_0x1675d2[_0x4eb5('0xa7')]=_0x1675d2[_0x4eb5('0xa8')];_0x1675d2[_0x4eb5('0x11a')]=_0x2e4e08[_0x4eb5('0x11a')];_0x1675d2['calleridnum']=_0x2e4e08[_0x4eb5('0x11b')];this[_0x4eb5('0xca')](_0x1675d2)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x11c')));}}else{this[_0x4eb5('0x1d')][_0x46136c['queue']][_0x4eb5('0x69')]+=0x1;this[_0x4eb5('0x1d')][_0x46136c[_0x4eb5('0xb2')]][_0x4eb5('0x5f')]+=0x1;_0x2e4e08[_0x4eb5('0xa6')]=0xb;_0x2e4e08[_0x4eb5('0xec')]='Abandoned';_0x2e4e08[_0x4eb5('0x116')]=_0x4eb5('0x11d');_0x2e4e08[_0x4eb5('0x102')]+=0x1;_0x2e4e08['countglobal']+=0x1;if(_0x2e4e08[_0x4eb5('0x102')]>=this['voiceQueues'][_0x46136c[_0x4eb5('0xb2')]][_0x4eb5('0x11e')]){this['queueCallerAbandonCreateState'](_0x2e4e08);}else{this[_0x4eb5('0xbf')]({'active':![],'countabandonedretry':_0x2e4e08[_0x4eb5('0x102')],'scheduledat':moment()['add'](this[_0x4eb5('0x1d')][_0x46136c[_0x4eb5('0xb2')]]['dialAbandonedRetryFrequency'],_0x4eb5('0xfa'))[_0x4eb5('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1e0028['ContactId'],'ListId':_0x1e0028['ListId'],'VoiceQueueId':_0x1e0028[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x1e0028[_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x1675d2=new History(_0x2e4e08);_0x1675d2[_0x4eb5('0xa6')]=0xb;_0x1675d2['statedesc']='Abandoned';_0x1675d2[_0x4eb5('0xa8')]=moment()[_0x4eb5('0x77')]('YYYY-MM-DD\x20HH:mm:ss');_0x1675d2[_0x4eb5('0xa7')]=_0x1675d2[_0x4eb5('0xa8')];_0x1675d2[_0x4eb5('0x11a')]=_0x2e4e08[_0x4eb5('0x11a')];_0x1675d2['calleridnum']=_0x2e4e08['calleridnum'];this['createHistory'](_0x1675d2)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x11f')));}}}}};Dialer['prototype'][_0x4eb5('0x34')]=function(_0x502cb4){if(this[_0x4eb5('0x23')][_0x502cb4[_0x4eb5('0xe0')]]){this[_0x4eb5('0x23')][_0x502cb4[_0x4eb5('0xe0')]][_0x4eb5('0xae')]=_0x502cb4[_0x4eb5('0xae')];}if(this[_0x4eb5('0x25')][_0x502cb4[_0x4eb5('0xe0')]]){this['uniqueId'][_0x502cb4[_0x4eb5('0xe0')]][_0x4eb5('0xae')]=_0x502cb4[_0x4eb5('0xae')];}};Dialer[_0x4eb5('0x17')][_0x4eb5('0x37')]=function(_0x117237){if(strategy[this[_0x4eb5('0x1d')][this[_0x4eb5('0x23')][_0x117237['actionid']][_0x4eb5('0xb2')]][_0x4eb5('0x120')]]===_0x4eb5('0x16')){if(this[_0x4eb5('0x23')][_0x117237[_0x4eb5('0x121')]]&&_['isNil'](this['actions'][_0x117237[_0x4eb5('0x121')]][_0x4eb5('0x122')])&&_0x117237[_0x4eb5('0xad')]==='1'&&_0x117237[_0x4eb5('0x123')]==='0'){if(this[_0x4eb5('0x1f')][_0x117237['stateinterface']]){if(!this['agents'][_0x117237['stateinterface']]['locked']){this[_0x4eb5('0x1f')][_0x117237[_0x4eb5('0x124')]][_0x4eb5('0x122')]=!![];this[_0x4eb5('0x23')][_0x117237[_0x4eb5('0x121')]]['locked']=!![];this['actions'][_0x117237[_0x4eb5('0x121')]][_0x4eb5('0x124')]=_0x117237[_0x4eb5('0x124')];}}}}else if((strategy[this[_0x4eb5('0x1d')][this[_0x4eb5('0x23')][_0x117237[_0x4eb5('0x121')]][_0x4eb5('0xb2')]][_0x4eb5('0x120')]]||'rrmemory')===_0x4eb5('0x125')){if(this[_0x4eb5('0x23')][_0x117237[_0x4eb5('0x121')]]){if(this[_0x4eb5('0x1f')][_0x117237[_0x4eb5('0x124')]]){this[_0x4eb5('0x23')][_0x117237[_0x4eb5('0x121')]][_0x4eb5('0x124')]=_0x117237[_0x4eb5('0x124')];if(_['isNil'](this[_0x4eb5('0x126')][this['actions'][_0x117237[_0x4eb5('0x121')]][_0x4eb5('0xb2')]])){this[_0x4eb5('0x126')][this[_0x4eb5('0x23')][_0x117237[_0x4eb5('0x121')]]['queue']]=[];}this[_0x4eb5('0x126')][this[_0x4eb5('0x23')][_0x117237['actionid']][_0x4eb5('0xb2')]][_0x4eb5('0x127')](_[_0x4eb5('0x8c')](_['pick'](this[_0x4eb5('0x23')][_0x117237[_0x4eb5('0x121')]],[_0x4eb5('0x128'),_0x4eb5('0x124')]),{'status':_0x117237[_0x4eb5('0xad')],'paused':_0x117237[_0x4eb5('0x123')]}));}}}};function unlockQueueStatus(_0x1af774,_0x1d3e2e){setTimeout(function(){if(_['isUndefined'](_0x1af774[_0x4eb5('0x129')])){loggerBooked[_0x4eb5('0x94')]('[unlockQueueStatus][undefined]',_0x1d3e2e);}_0x1af774[_0x4eb5('0x129')]=!![];loggerBooked[_0x4eb5('0x7c')]('[booked][unlockQueueStatus]',_0x1d3e2e,JSON[_0x4eb5('0x49')](_[_0x4eb5('0xd3')](_0x1af774,[_0x4eb5('0x3f'),_0x4eb5('0x129')])));},0x1f3);}Dialer[_0x4eb5('0x17')][_0x4eb5('0x39')]=function(_0x181eda){var _0x57dc0e=this;var _0x4eaff2=_0x57dc0e[_0x4eb5('0x1d')][_0x57dc0e[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]]['queue']];if(strategy[this['voiceQueues'][this[_0x4eb5('0x23')][_0x181eda['actionid']][_0x4eb5('0xb2')]]['strategy']]==='roundrobin'){if(this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]]&&this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0x124')]){this[_0x4eb5('0x1c')][_0x4eb5('0x12a')](this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]]['idHopper'],this[_0x4eb5('0x23')][_0x181eda['actionid']][_0x4eb5('0x124')])[_0x4eb5('0xaf')](function(_0x48f89e){logger[_0x4eb5('0x94')](_0x4eb5('0x12b'),util[_0x4eb5('0x95')](_0x48f89e,{'showHidden':![],'depth':null}));})[_0x4eb5('0x1a')](function(){_0x57dc0e[_0x4eb5('0xb1')](_0x57dc0e[_0x4eb5('0x1d')][_0x57dc0e[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]);_0x57dc0e['agents'][_0x57dc0e[_0x4eb5('0x23')][_0x181eda['actionid']]['stateinterface']]['locked']=![];delete _0x57dc0e[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]];unlockQueueStatus(_0x4eaff2);});}else{this['updateOriginated'](this[_0x4eb5('0x1d')][this[_0x4eb5('0x23')][_0x181eda['actionid']][_0x4eb5('0xb2')]]);this[_0x4eb5('0xbf')]({'active':![],'ContactId':this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]]['ContactId'],'ListId':this['actions'][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xd5')],'VoiceQueueId':this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xfc')]||undefined,'CampaignId':this[_0x4eb5('0x23')][_0x181eda['actionid']][_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]];unlockQueueStatus(_0x4eaff2);}}else if((strategy[this[_0x4eb5('0x1d')][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]][_0x4eb5('0x120')]]||_0x4eb5('0x125'))===_0x4eb5('0x125')){var _0x3d02af;if(this['actions'][_0x181eda[_0x4eb5('0x121')]]&&!_[_0x4eb5('0x44')](this[_0x4eb5('0x126')][this['actions'][_0x181eda[_0x4eb5('0x121')]]['queue']])){if(this[_0x4eb5('0x29')][_0x57dc0e[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]){this['queueBookedRR'][_0x57dc0e[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]=this[_0x4eb5('0x29')][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]?this[_0x4eb5('0x29')][this[_0x4eb5('0x23')][_0x181eda['actionid']]['queue']]:this['queueBooked'][this['actions'][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]?this[_0x4eb5('0x126')][this['actions'][_0x181eda[_0x4eb5('0x121')]]['queue']][_0x4eb5('0x12c')]||0x0:0x0;}this[_0x4eb5('0x126')][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]]['queue']][_0x4eb5('0x12c')]=this['queueBookedRR'][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]];for(var _0x2fe4b1=0x0;_0x2fe4b1<this['queueBooked'][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]['length'];_0x2fe4b1+=0x1){_0x3d02af=rr(this[_0x4eb5('0x126')][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]);this[_0x4eb5('0x29')][_0x57dc0e[_0x4eb5('0x23')][_0x181eda['actionid']][_0x4eb5('0xb2')]]=this[_0x4eb5('0x126')][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]][_0x4eb5('0x12c')];if(_0x3d02af[_0x4eb5('0xad')]==='1'&&_0x3d02af[_0x4eb5('0x123')]==='0'){break;}}if(!_['isNil'](_0x3d02af)){this['agents'][_0x3d02af[_0x4eb5('0x124')]]['unlockRR']=_['isUndefined'](this[_0x4eb5('0x1f')][_0x3d02af[_0x4eb5('0x124')]][_0x4eb5('0x12d')])?!![]:this['agents'][_0x3d02af[_0x4eb5('0x124')]][_0x4eb5('0x12d')];}loggerBooked[_0x4eb5('0x7c')]('[booked][RR]',_0x181eda[_0x4eb5('0x121')],_0x4eb5('0x12e'),JSON[_0x4eb5('0x49')](_[_0x4eb5('0xd3')](this[_0x4eb5('0x1f')][_0x3d02af[_0x4eb5('0x124')]],[_0x4eb5('0x3f'),_0x4eb5('0x12d')])),'contactAgent-idHopper:\x20',JSON['stringify'](_0x3d02af[_0x4eb5('0x128')]));if(!_[_0x4eb5('0xe1')](_0x3d02af)&&_0x3d02af[_0x4eb5('0xad')]==='1'&&_0x3d02af[_0x4eb5('0x123')]==='0'&&this[_0x4eb5('0x1f')][_0x3d02af['stateinterface']][_0x4eb5('0x12d')]){this[_0x4eb5('0x1f')][_0x3d02af[_0x4eb5('0x124')]][_0x4eb5('0x12d')]=![];this[_0x4eb5('0x126')][_0x57dc0e[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]]['queue']]=[];this[_0x4eb5('0x1c')]['run'](_0x3d02af['idHopper'],_0x3d02af[_0x4eb5('0x124')])['catch'](function(_0xb08ca9){logger[_0x4eb5('0x94')](_0x4eb5('0x12b'),util[_0x4eb5('0x95')](_0xb08ca9,{'showHidden':![],'depth':null}));})[_0x4eb5('0x1a')](function(){_0x57dc0e[_0x4eb5('0xb1')](_0x57dc0e[_0x4eb5('0x1d')][_0x57dc0e['actions'][_0x181eda['actionid']][_0x4eb5('0xb2')]]);setTimeout(function(){_0x57dc0e[_0x4eb5('0x1f')][_0x3d02af[_0x4eb5('0x124')]]['unlockRR']=!![];loggerBooked['info'](_0x4eb5('0x12f'),_0x181eda['actionid'],_0x4eb5('0x12e'),JSON[_0x4eb5('0x49')](_[_0x4eb5('0xd3')](_0x57dc0e[_0x4eb5('0x1f')][_0x3d02af['stateinterface']],['name',_0x4eb5('0x12d')])),_0x4eb5('0x130'),JSON[_0x4eb5('0x49')](_0x3d02af['idHopper']));},0xc7);delete _0x57dc0e[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]];unlockQueueStatus(_0x4eaff2,_0x181eda['actionid']);});}else{loggerBooked[_0x4eb5('0x7c')](_0x4eb5('0x131'));this[_0x4eb5('0xb1')](this[_0x4eb5('0x1d')][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]);this[_0x4eb5('0xbf')]({'active':![],'ContactId':this[_0x4eb5('0x23')][_0x181eda['actionid']][_0x4eb5('0xd4')],'ListId':this[_0x4eb5('0x23')][_0x181eda['actionid']][_0x4eb5('0xd5')],'VoiceQueueId':this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x4eb5('0x23')][_0x181eda['actionid']];unlockQueueStatus(_0x4eaff2);}}else{loggerBooked[_0x4eb5('0x7c')](_0x4eb5('0x132'));this[_0x4eb5('0xb1')](this['voiceQueues'][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]);this[_0x4eb5('0xbf')]({'active':![],'ContactId':this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xd4')],'ListId':this['actions'][_0x181eda[_0x4eb5('0x121')]]['ListId'],'VoiceQueueId':this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xfc')]||undefined,'CampaignId':this[_0x4eb5('0x23')][_0x181eda['actionid']][_0x4eb5('0xd7')]||undefined})['catch'](loggerCatch(_0x4eb5('0x133')));delete this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]];unlockQueueStatus(_0x4eaff2);}}else{loggerBooked[_0x4eb5('0x7c')]('[booked][unlock3]');this[_0x4eb5('0xb1')](this[_0x4eb5('0x1d')][this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xb2')]]);this[_0x4eb5('0xbf')]({'active':![],'ContactId':this['actions'][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xd4')],'ListId':this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xd5')],'VoiceQueueId':this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xfc')]||undefined,'CampaignId':this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]][_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x134')));delete this[_0x4eb5('0x23')][_0x181eda[_0x4eb5('0x121')]];unlockQueueStatus(_0x4eaff2);}};Dialer['prototype'][_0x4eb5('0x3a')]=function(){var _0x4e7897=this;setInterval(function(){_0x4e7897[_0x4eb5('0x135')]();},0x3e8);};Dialer[_0x4eb5('0x17')]['checkIsTrunkReachable']=function(_0x47861e){var _0x1de1e1=this;return function(){if(!_0x1de1e1['isTrunkReachable'](_0x47861e[_0x4eb5('0x74')])){if(!_0x1de1e1[_0x4eb5('0xdc')](_0x47861e['TrunkBackup'])){_0x47861e[_0x4eb5('0x3d')]=_0x4eb5('0x136');throw _0x47861e[_0x4eb5('0x3f')]+_0x4eb5('0x137');}}};};Dialer[_0x4eb5('0x17')][_0x4eb5('0x138')]=function(_0x584eec,_0x2a6fc3,_0xa8db9f,_0x50318f){var _0x5c85b4=this;return function(){var _0x69516c=!![];return _0x5c85b4[_0x4eb5('0x139')](_0x584eec,_0x2a6fc3,_0xa8db9f,_0x50318f,_0x69516c);};};Dialer[_0x4eb5('0x17')]['checkIfTimeIntervals']=function(_0x3ae614,_0x5637cb,_0x45d2e6,_0x4f0bdf){var _0x1c58ca=this;return function(){var _0x31b9a4=![];return _0x1c58ca[_0x4eb5('0x139')](_0x3ae614[_0x4eb5('0x46')],_0x5637cb,_0x45d2e6,_0x4f0bdf,_0x31b9a4);};};Dialer[_0x4eb5('0x17')][_0x4eb5('0x139')]=function(_0x2b6f44,_0x2c7e69,_0x1da65a,_0x2bd97a,_0x46d809){var _0x377d30=[];return new BPromise(function(_0x2d22ad,_0x5ee977){if(!isNotNull(_0x2b6f44)){_0x2bd97a[_0x4eb5('0x3d')]=_0x4eb5('0x42');return _0x5ee977(msgResponse(_0x4eb5('0x139'),'Failure',_0x1da65a+_0x4eb5('0x13a')));}if(_[_0x4eb5('0x44')](_0x2b6f44)){_0x2bd97a['message']=_0x4eb5('0x13b');return _0x5ee977(msgResponse(_0x4eb5('0x139'),'Failure',_0x1da65a+_0x4eb5('0x13c')));}if(_0x2c7e69&&_[_0x4eb5('0x3c')](config['timezones'][_0x2c7e69])){_0x2bd97a[_0x4eb5('0x3d')]=_0x4eb5('0x13d');return _0x5ee977(msgResponse(_0x4eb5('0x139'),_0x4eb5('0x13e'),_0x1da65a+_0x4eb5('0x13f')+_0x2c7e69));}if(_[_0x4eb5('0x140')](_0x2b6f44)){for(var _0x117177=0x0;_0x117177<_0x2b6f44['length'];_0x117177+=0x1){_0x377d30[_0x4eb5('0x127')](ami[_0x4eb5('0xac')]({'action':_0x4eb5('0x141'),'command':util[_0x4eb5('0x77')](_0x4eb5('0x142'),_0x2b6f44[_0x117177][_0x4eb5('0x143')],!_[_0x4eb5('0x3c')](config[_0x4eb5('0x144')][_0x2c7e69])?_0x2c7e69:'')})[_0x4eb5('0xbb')](function(_0x41e3a4){return _0x41e3a4[_0x4eb5('0x145')][_0x4eb5('0x146')](_0x4eb5('0x147'))>=0x0;})[_0x4eb5('0xaf')](myreject(_0x5ee977)));}}else{_0x377d30[_0x4eb5('0x127')](ami[_0x4eb5('0xac')]({'action':_0x4eb5('0x141'),'command':util[_0x4eb5('0x77')](_0x4eb5('0x142'),_0x2b6f44,!_['isUndefined'](config[_0x4eb5('0x144')][_0x2c7e69])?_0x2c7e69:'')})[_0x4eb5('0xbb')](function(_0x80f588){return _0x80f588[_0x4eb5('0x145')][_0x4eb5('0x146')](_0x4eb5('0x147'))>=0x0;})['catch'](myreject(_0x5ee977)));}BPromise[_0x4eb5('0x148')](_0x377d30)[_0x4eb5('0xbb')](function(_0x8ffb40){var _0x4c74ca=_[_0x4eb5('0x149')](_0x8ffb40);if(_0x4c74ca){return _0x2d22ad(_0x4c74ca);}else{_0x2bd97a['message']=_0x46d809?_0x4eb5('0x14a'):_0x4eb5('0x14b');return _0x5ee977(msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x46d809+'\x20'+_0x1da65a+_0x4eb5('0x14c')+util['inspect'](_0x2b6f44,{'showHidden':![],'depth':null})+_0x4eb5('0x14d')+_0x2c7e69));}})[_0x4eb5('0xaf')](function(_0x4c88a3){return _0x5ee977(msgResponse(_0x4eb5('0x139'),'Failure',JSON[_0x4eb5('0x49')](_0x4c88a3)));});});};Dialer[_0x4eb5('0x17')][_0x4eb5('0x14e')]=function(_0x2ef2b7){var _0x210ee9=this;return function(){switch(_0x2ef2b7[_0x4eb5('0x56')]){case _0x4eb5('0x14f'):freeVariablesPredictive(_0x2ef2b7);_0x210ee9[_0x4eb5('0x150')](_0x2ef2b7,0x1);break;case _0x4eb5('0x151'):freeVariablesPredictive(_0x2ef2b7);_0x210ee9[_0x4eb5('0x150')](_0x2ef2b7,_0x2ef2b7[_0x4eb5('0x152')]);break;case _0x4eb5('0x153'):_0x210ee9[_0x4eb5('0x153')](_0x2ef2b7);break;case _0x4eb5('0x7'):freeVariablesPredictive(_0x2ef2b7);_0x210ee9[_0x4eb5('0x150')](_0x2ef2b7,0x1);break;default:freeVariablesPredictive(_0x2ef2b7);logger[_0x4eb5('0x94')]('Queue',_0x2ef2b7[_0x4eb5('0x3f')],_0x4eb5('0x154'));}};};Dialer['prototype'][_0x4eb5('0x155')]=function(_0x2cbf08){var _0x2ced60=this;return function(){_0x2ced60['handleIvr'](_0x2cbf08);};};Dialer[_0x4eb5('0x17')][_0x4eb5('0x9')]=function(_0x544a8c){var _0x41f257=this;if(isNotPreview(_0x544a8c['dialMethod'])){if(isVoiceQueueOutbound(_0x544a8c['type'])&&isActive(_0x544a8c['dialActive'])){_0x544a8c[_0x4eb5('0xa0')]=!![];BPromise[_0x4eb5('0xb6')]()[_0x4eb5('0xbb')](checkIsLoggedIn(_0x544a8c,_0x544a8c[_0x4eb5('0x4d')]))[_0x4eb5('0xbb')](checkIsActive(_0x544a8c,_0x544a8c['dialActive']))[_0x4eb5('0xbb')](checkInterval(_0x544a8c))[_0x4eb5('0xbb')](_0x41f257[_0x4eb5('0x156')](_0x544a8c))[_0x4eb5('0xbb')](_0x41f257[_0x4eb5('0x138')](_0x544a8c['dialGlobalInterval'],_0x544a8c[_0x4eb5('0x157')],_0x544a8c[_0x4eb5('0x3f')],_0x544a8c))['then'](_0x41f257['checkIfTimeIntervals'](_0x544a8c[_0x4eb5('0x45')],_0x544a8c[_0x4eb5('0x157')],_0x544a8c['name'],_0x544a8c))[_0x4eb5('0xbb')](_0x41f257[_0x4eb5('0x14e')](_0x544a8c))['catch'](loggerCatchQueueSummary(_0x4eb5('0x158'),_0x544a8c));}else{notSendMessagesQueue(_0x544a8c);}}else{freeVariablesPredictive(_0x544a8c);}};Dialer[_0x4eb5('0x17')]['syncCampaigns']=function(){var _0x40d8de=this;var _0x37997c;for(var _0x45a610 in this[_0x4eb5('0x1e')]){if(typeof this[_0x4eb5('0x1e')][_0x45a610]!==_0x4eb5('0xcc')){_0x37997c=this['campaigns'][_0x45a610];if(isCampaignIvr(_0x37997c[_0x4eb5('0x51')])&&isActive(_0x37997c[_0x4eb5('0x75')])){_0x37997c[_0x4eb5('0xa0')]=!![];BPromise[_0x4eb5('0xb6')]()[_0x4eb5('0xbb')](checkIsActive(_0x37997c,_0x37997c[_0x4eb5('0x75')]))[_0x4eb5('0xbb')](checkInterval(_0x37997c))[_0x4eb5('0xbb')](_0x40d8de[_0x4eb5('0x156')](_0x37997c))[_0x4eb5('0xbb')](_0x40d8de[_0x4eb5('0x138')](_0x37997c[_0x4eb5('0x159')],_0x37997c[_0x4eb5('0x157')],_0x37997c[_0x4eb5('0x3f')],_0x37997c))[_0x4eb5('0xbb')](_0x40d8de[_0x4eb5('0x15a')](_0x37997c['Interval'],_0x37997c[_0x4eb5('0x157')],_0x37997c['name'],_0x37997c))['then'](_0x40d8de[_0x4eb5('0x155')](_0x37997c))[_0x4eb5('0xaf')](loggerCatchQueueSummary(_0x4eb5('0x15b'),_0x37997c));}else{notSendMessagesCampaign(_0x37997c);}}}};function getCallerIdRandom(_0x597654,_0x3a9124){var _0x1b5779;var _0x1b8654;var _0x498cfc;if(_0x3a9124<=0x0){_0x3a9124=0x1;}_0x1b5779=new RegExp('\x5cw{0,'+_0x3a9124+'}$');_0x1b8654=Math['pow'](0xa,_0x3a9124-0x1);_0x498cfc=Math['pow'](0xa,_0x3a9124)-0x1;return util['format']('%s',_[_0x4eb5('0x15c')](_0x597654,_0x1b5779,_[_0x4eb5('0x15d')](_0x1b8654,_0x498cfc)));}function extractCalleridName(_0x33d4e2){var _0x333ac9=_0x33d4e2[_0x4eb5('0x15e')](/"(.*?)"/);return _0x333ac9?_0x333ac9[0x1]:_0x33d4e2;}function extractCalleridNumber(_0x1fc700){var _0x3abec1=_0x1fc700['match'](/<(.*?)>/);return _0x3abec1?_0x3abec1[0x1]:_0x1fc700;}Dialer[_0x4eb5('0x17')][_0x4eb5('0x15f')]=function(_0x4ce16a,_0x510a34){var _0x44500c=this;var _0x3d5b7d=uuid['v4']();this[_0x4eb5('0x23')][_0x3d5b7d]=new Action(_0x4ce16a,_0x510a34,_0x3d5b7d);return new BPromise(function(_0xd3fc6d,_0x2f7e04){if(_[_0x4eb5('0x3c')](_0x4ce16a)&&typeof _0x4ce16a!==_0x4eb5('0x160')){return _0x2f7e04(msgResponse(_0x4eb5('0x161'),'Failure',_0x4eb5('0x162')));}if(_[_0x4eb5('0x3c')](_0x510a34[_0x4eb5('0x163')][_0x4eb5('0x164')])||_0x510a34[_0x4eb5('0x163')][_0x4eb5('0x164')]===null){return _0x2f7e04(msgResponse('originate','Failure',_0x4eb5('0x165')));}var _0x133c4f={'XMD-CALLERID':_0x44500c[_0x4eb5('0x23')][_0x3d5b7d][_0x4eb5('0x166')](),'XMD-AGI':_0x4ce16a[_0x4eb5('0x106')]?util[_0x4eb5('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4ce16a[_0x4eb5('0x106')]):_0x4eb5('0x167'),'XMD-AGIAFTER':_0x4ce16a[_0x4eb5('0x10e')]?util[_0x4eb5('0x77')]('\x22agi://%s/square,%s\x22',ipAgi,_0x4ce16a[_0x4eb5('0x10e')]):_0x4eb5('0x167'),'XMD-QUEUE':_0x4ce16a[_0x4eb5('0x51')]===_0x4eb5('0x4b')?util[_0x4eb5('0x77')](_0x4eb5('0x168'),_0x4ce16a[_0x4eb5('0x3f')],_0x4ce16a[_0x4eb5('0x169')]||'',_0x4ce16a['dialAgiAfterHangupAgent']?'c':'',_0x4ce16a[_0x4eb5('0x16a')]||0x3):_0x4eb5('0x167'),'XMD-CONTACTID':_0x510a34[_0x4eb5('0xd4')],'XMD-CDRTYPE':_0x4eb5('0x6'),'CALLERID(all)':_0x44500c[_0x4eb5('0x23')][_0x3d5b7d][_0x4eb5('0x166')](),'XMD-AMD':_0x4ce16a[_0x4eb5('0xe5')]?'ACTIVE':_0x4eb5('0x167'),'XMD-DESTINATION':_0x4eb5('0x16b')};if(_0x4ce16a[_0x4eb5('0xe5')]){_0x133c4f[_0x4eb5('0x16c')]=_0x4ce16a[_0x4eb5('0x16d')]||0x9c4;_0x133c4f[_0x4eb5('0x16e')]=_0x4ce16a['dialAMDGreeting']||0x5dc;_0x133c4f[_0x4eb5('0x16f')]=_0x4ce16a[_0x4eb5('0x170')]||0x320;_0x133c4f[_0x4eb5('0x171')]=_0x4ce16a[_0x4eb5('0x172')]||0x1388;_0x133c4f[_0x4eb5('0x173')]=_0x4ce16a[_0x4eb5('0x174')]||0x64;_0x133c4f[_0x4eb5('0x175')]=_0x4ce16a[_0x4eb5('0x176')]||0x32;_0x133c4f[_0x4eb5('0x177')]=_0x4ce16a[_0x4eb5('0x178')]||0x3;_0x133c4f[_0x4eb5('0x179')]=_0x4ce16a[_0x4eb5('0x17a')]||0x100;_0x133c4f[_0x4eb5('0x17b')]=_0x4ce16a['dialAMDMaximumWordLength']||0x1388;}if(_0x4ce16a[_0x4eb5('0x51')]===_0x4eb5('0x4b')){_0x133c4f[_0x4eb5('0x17c')]=_0x510a34[_0x4eb5('0xfc')];}else{_0x133c4f[_0x4eb5('0x17d')]=_0x510a34['CampaignId'];}for(var _0x248a78 in _0x510a34[_0x4eb5('0x163')]){if(typeof _0x510a34[_0x4eb5('0x163')][_0x248a78]!=='undefined'){if(isNotNull(_0x510a34[_0x4eb5('0x163')][_0x248a78])&&_0x248a78!=='id'&&_0x248a78!==_0x4eb5('0x17e')&&_0x248a78!=='createdAt'&&_0x248a78!=='updatedAt'){_0x133c4f[util[_0x4eb5('0x77')](_0x4eb5('0x17f'),_0x4eb5('0x180'),_['toUpper'](_0x248a78))]=_0x510a34[_0x4eb5('0x163')][_0x248a78];}}}var _0x17d679=_0x44500c[_0x4eb5('0xdc')](_0x4ce16a[_0x4eb5('0x74')])?getCallerId(_0x4ce16a[_0x4eb5('0x74')][_0x4eb5('0x76')],_0x4ce16a['dialOriginateCallerIdName'],_0x4ce16a[_0x4eb5('0x181')]>0x0?getCallerIdRandom(_0x4ce16a[_0x4eb5('0x58')],_0x4ce16a[_0x4eb5('0x181')]):_0x4ce16a['dialOriginateCallerIdNumber']):getCallerId(_[_0x4eb5('0xe1')](_0x4ce16a[_0x4eb5('0x182')])?_0x4ce16a[_0x4eb5('0x74')][_0x4eb5('0x76')]:_0x4ce16a['TrunkBackup'][_0x4eb5('0x76')],_0x4ce16a[_0x4eb5('0x57')],_0x4ce16a[_0x4eb5('0x181')]>0x0?getCallerIdRandom(_0x4ce16a[_0x4eb5('0x58')],_0x4ce16a['dialRandomLastDigitCallerIdNumber']):_0x4ce16a[_0x4eb5('0x58')]);if(_0x17d679){_0x133c4f[_0x4eb5('0x183')]=_0x44500c[_0x4eb5('0x23')][_0x3d5b7d][_0x4eb5('0x184')]=extractCalleridName(_0x17d679);_0x133c4f[_0x4eb5('0x185')]=_0x44500c[_0x4eb5('0x23')][_0x3d5b7d]['originatecalleridnum']=extractCalleridNumber(_0x17d679);}return ami['Action']({'actionid':_0x3d5b7d,'action':_0x4eb5('0x161'),'channel':_0x44500c[_0x4eb5('0xdc')](_0x4ce16a[_0x4eb5('0x74')])?util[_0x4eb5('0x77')](_0x4eb5('0x186'),_0x4ce16a[_0x4eb5('0x74')]['name'],isNotNull(_0x4ce16a[_0x4eb5('0x5a')])?_0x4ce16a[_0x4eb5('0x5a')][_0x4eb5('0x187')]()||'':'',_0x4ce16a['dialCutDigit']>0x0?_0x510a34[_0x4eb5('0x163')][_0x4eb5('0x164')]['substring'](_0x4ce16a['dialCutDigit']):_0x510a34['Contact'][_0x4eb5('0x164')]):util['format'](_0x4eb5('0x186'),_[_0x4eb5('0xe1')](_0x4ce16a[_0x4eb5('0x182')])?_0x4ce16a[_0x4eb5('0x74')]['name']:_0x4ce16a[_0x4eb5('0x182')][_0x4eb5('0x3f')],isNotNull(_0x4ce16a[_0x4eb5('0x5a')])?_0x4ce16a['dialPrefix'][_0x4eb5('0x187')]()||'':'',_0x4ce16a['dialCutDigit']>0x0?_0x510a34[_0x4eb5('0x163')][_0x4eb5('0x164')][_0x4eb5('0x188')](_0x4ce16a[_0x4eb5('0x189')]):_0x510a34[_0x4eb5('0x163')][_0x4eb5('0x164')]),'callerid':_0x17d679,'Exten':'xcally-motion-dialer','Context':_0x4eb5('0x18a'),'Priority':'1','variable':_0x133c4f,'timeout':(_0x4ce16a[_0x4eb5('0x59')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3d5b7d})[_0x4eb5('0xbb')](function(_0x281559){return _0xd3fc6d(_0x281559);})['catch'](function(_0x416dcd){_0x4ce16a[_0x4eb5('0x63')]+=0x1;var _0x348e88=new History(_0x44500c[_0x4eb5('0x23')][_0x3d5b7d]);logger[_0x4eb5('0x94')](util[_0x4eb5('0x77')]('[originateError]:\x20%s',JSON[_0x4eb5('0x49')](_0x416dcd)));_0x348e88['state']=0xe;_0x348e88[_0x4eb5('0xec')]='OriginateError';_0x348e88[_0x4eb5('0xa8')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x348e88['endtime']=_0x348e88['starttime'];_0x44500c[_0x4eb5('0xca')](_0x348e88)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x18b')));_0x44500c[_0x4eb5('0xc8')](_0x348e88)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x18b')))[_0x4eb5('0x1a')](function(){delete _0x44500c[_0x4eb5('0x23')][_0x3d5b7d];return _0x2f7e04(msgResponse(_0x4eb5('0x161'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x4eb5('0x17')][_0x4eb5('0x2e')]=function(_0x523881){var _0x539180=this['actions'][_0x523881['actionid']];if(_0x539180){delete this[_0x4eb5('0x23')][_0x523881[_0x4eb5('0x121')]];_0x539180[_0x4eb5('0x114')]=moment()[_0x4eb5('0x77')]('YYYY-MM-DD\x20HH:mm:ss');var _0x50f6f3=_0x539180[_0x4eb5('0x51')]==='ivr'?this['campaigns'][_0x539180[_0x4eb5('0xb2')]]:this[_0x4eb5('0x1d')][_0x539180[_0x4eb5('0x18c')]()];if(!this[_0x4eb5('0xda')](_0x523881[_0x4eb5('0x18d')])){this['updateOriginated'](_0x50f6f3);return this[_0x4eb5('0x18e')](_0x539180,_0x50f6f3,_0x523881)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x18f')));}this['uniqueId'][_0x523881[_0x4eb5('0xe0')]]=_0x539180;}};Dialer[_0x4eb5('0x17')][_0x4eb5('0x190')]=function(_0x5a137f,_0x441747,_0x2e8722){var _0x3e4140=new History(_0x441747);if(_0x3e4140[_0x4eb5('0xf2')]+_0x3e4140[_0x4eb5('0x101')]+_0x3e4140[_0x4eb5('0xf3')]+_0x3e4140['countnosuchnumberretry']+_0x3e4140['countdropretry']+_0x3e4140[_0x4eb5('0x102')]+_0x3e4140['countmachineretry']+_0x3e4140[_0x4eb5('0x191')]>=_0x2e8722[_0x4eb5('0x192')]-0x1){return!![];}switch(_0x5a137f){case 0x3:if(_0x3e4140[_0x4eb5('0xf3')]>=_0x2e8722[_0x4eb5('0x193')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x3e4140[_0x4eb5('0xf3')]+=0x1,'scheduledat':moment()[_0x4eb5('0xf8')](_0x2e8722[_0x4eb5('0x194')],'minutes')[_0x4eb5('0x77')](_0x4eb5('0xfb')),'ContactId':_0x3e4140['ContactId'],'ListId':_0x3e4140['ListId'],'VoiceQueueId':_0x3e4140['VoiceQueueId']||undefined,'CampaignId':_0x3e4140['CampaignId']||undefined})[_0x4eb5('0xaf')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x3e4140[_0x4eb5('0xf2')]>=_0x2e8722[_0x4eb5('0x195')]-0x1){return!![];}this[_0x4eb5('0xbf')]({'active':![],'countbusyretry':_0x3e4140[_0x4eb5('0xf2')]+=0x1,'scheduledat':moment()[_0x4eb5('0xf8')](_0x2e8722[_0x4eb5('0x196')],'minutes')[_0x4eb5('0x77')](_0x4eb5('0xfb')),'ContactId':_0x3e4140[_0x4eb5('0xd4')],'ListId':_0x3e4140[_0x4eb5('0xd5')],'VoiceQueueId':_0x3e4140['VoiceQueueId']||undefined,'CampaignId':_0x3e4140['CampaignId']||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x197')));break;case 0x8:if(_0x3e4140[_0x4eb5('0x101')]>=_0x2e8722[_0x4eb5('0x198')]-0x1){return!![];}this[_0x4eb5('0xbf')]({'active':![],'countcongestionretry':_0x3e4140[_0x4eb5('0x101')]+=0x1,'scheduledat':moment()[_0x4eb5('0xf8')](_0x2e8722[_0x4eb5('0x199')],'minutes')[_0x4eb5('0x77')](_0x4eb5('0xfb')),'ContactId':_0x3e4140[_0x4eb5('0xd4')],'ListId':_0x3e4140[_0x4eb5('0xd5')],'VoiceQueueId':_0x3e4140[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x3e4140['CampaignId']||undefined})[_0x4eb5('0xaf')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3e4140[_0x4eb5('0xf4')]>=_0x2e8722[_0x4eb5('0x19a')]-0x1){return!![];}else{this[_0x4eb5('0xbf')]({'active':![],'countnosuchnumberretry':_0x3e4140['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x2e8722['dialNoSuchNumberRetryFrequency'],'minutes')['format'](_0x4eb5('0xfb')),'ContactId':_0x3e4140[_0x4eb5('0xd4')],'ListId':_0x3e4140[_0x4eb5('0xd5')],'VoiceQueueId':_0x3e4140[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x3e4140['CampaignId']||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x19b')));}break;case 0xa:if(_0x3e4140['countdropretry']>=_0x2e8722[_0x4eb5('0x118')]-0x1){return!![];}this[_0x4eb5('0xbf')]({'active':![],'countdropretry':_0x3e4140[_0x4eb5('0xf5')]+=0x1,'scheduledat':moment()[_0x4eb5('0xf8')](_0x2e8722[_0x4eb5('0x19c')],'minutes')[_0x4eb5('0x77')](_0x4eb5('0xfb')),'ContactId':_0x3e4140[_0x4eb5('0xd4')],'ListId':_0x3e4140[_0x4eb5('0xd5')],'VoiceQueueId':_0x3e4140[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x3e4140[_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x119')));break;case 0xb:if(_0x3e4140[_0x4eb5('0x102')]>=_0x2e8722[_0x4eb5('0x11e')]-0x1){return!![];}this[_0x4eb5('0xbf')]({'active':![],'countabandonedretry':_0x3e4140[_0x4eb5('0x102')]+=0x1,'scheduledat':moment()[_0x4eb5('0xf8')](_0x2e8722[_0x4eb5('0x19d')],_0x4eb5('0xfa'))[_0x4eb5('0x77')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3e4140[_0x4eb5('0xd4')],'ListId':_0x3e4140[_0x4eb5('0xd5')],'VoiceQueueId':_0x3e4140[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x3e4140[_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x19e')));break;case 0x13:if(_0x3e4140[_0x4eb5('0xef')]>=_0x2e8722[_0x4eb5('0x104')]-0x1){return!![];}this[_0x4eb5('0xbf')]({'active':![],'countmachineretry':_0x3e4140['countmachineretry']+=0x1,'scheduledat':moment()[_0x4eb5('0xf8')](_0x2e8722[_0x4eb5('0xf9')],_0x4eb5('0xfa'))[_0x4eb5('0x77')](_0x4eb5('0xfb')),'ContactId':_0x3e4140[_0x4eb5('0xd4')],'ListId':_0x3e4140[_0x4eb5('0xd5')],'VoiceQueueId':_0x3e4140[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x3e4140[_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xfd')));break;case 0x14:if(_0x3e4140['countagentrejectretry']>=_0x2e8722[_0x4eb5('0x19f')]-0x1){return!![];}this[_0x4eb5('0xbf')]({'active':![],'countagentrejectretry':_0x3e4140['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x4eb5('0xf8')](_0x2e8722['dialAgentRejectRetryFrequency'],'minutes')[_0x4eb5('0x77')](_0x4eb5('0xfb')),'ContactId':_0x3e4140[_0x4eb5('0xd4')],'ListId':_0x3e4140[_0x4eb5('0xd5')],'VoiceQueueId':_0x3e4140[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x3e4140[_0x4eb5('0xd7')]||undefined})['catch'](loggerCatch(_0x4eb5('0x1a0')));break;default:return!![];}};Dialer[_0x4eb5('0x17')]['callProgressDetecting']=function(_0x4e6074,_0xb8b34d,_0x250fd4){var _0x5d597b=this;var _0x3e912d=new History(_0x4e6074);return new BPromise(function(_0x699d7f,_0x123384){if(_[_0x4eb5('0x3c')](_0xb8b34d)&&typeof _0xb8b34d!==_0x4eb5('0x160')){return _0x123384(msgResponse(_0x4eb5('0x1a1'),'Failure',_0x4eb5('0x1a2')));}if(_[_0x4eb5('0x3c')](_0x250fd4)&&typeof _0x250fd4!==_0x4eb5('0x160')){return _0x123384(msgResponse(_0x4eb5('0x1a1'),_0x4eb5('0x13e'),_0x4eb5('0x1a3')));}switch(_0x250fd4[_0x4eb5('0x10c')]){case'0':_0xb8b34d[_0x4eb5('0x62')]+=0x1;_0x3e912d[_0x4eb5('0xa6')]=0x0;_0x3e912d['statedesc']=_0x4eb5('0x1a4');_0x3e912d['countnosuchnumberretry']+=0x1;_0x3e912d['countglobal']+=0x1;ami[_0x4eb5('0x1a5')](_0x4eb5('0x1a6'),ut['buildObj'](_0x4e6074,'nosuchnumber'));_0x5d597b[_0x4eb5('0xca')](_0x3e912d)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x1a7')));if(_0x5d597b[_0x4eb5('0x190')](0x0,_0x4e6074,_0xb8b34d)){if(_0x3e912d['countnosuchnumberretry']>=_0xb8b34d['dialNoSuchNumberMaxRetry']){_0x5d597b['createStateFinal'](_0x3e912d,_0x699d7f,_0x123384,'reason\x200\x20no\x20such\x20number....');}else{_0x5d597b['stateGlobal'](_0x3e912d,_0x699d7f,_0x123384,_0x4eb5('0x1a8'));}}break;case'3':_0xb8b34d[_0x4eb5('0x61')]+=0x1;_0x3e912d[_0x4eb5('0xa6')]=0x3;_0x3e912d['statedesc']=_0x4eb5('0x1a9');_0x3e912d['countnoanswerretry']+=0x1;_0x3e912d[_0x4eb5('0xf0')]+=0x1;ami[_0x4eb5('0x1a5')]('custom:agentnoanswer',ut[_0x4eb5('0x1aa')](_0x4e6074,_0x4eb5('0x1ab')));_0x5d597b[_0x4eb5('0xca')](_0x3e912d)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x1ac')));if(_0x5d597b['checkRetriveMax'](0x3,_0x4e6074,_0xb8b34d)){if(_0x3e912d[_0x4eb5('0xf3')]>=_0xb8b34d['dialNoAnswerMaxRetry']){_0x5d597b[_0x4eb5('0x1ad')](_0x3e912d,_0x699d7f,_0x123384,_0x4eb5('0x1ae'));}else{_0x5d597b['stateGlobal'](_0x3e912d,_0x699d7f,_0x123384,_0x4eb5('0x1ae'));}}break;case'5':_0xb8b34d[_0x4eb5('0x5d')]+=0x1;_0x3e912d[_0x4eb5('0xa6')]=0x5;_0x3e912d[_0x4eb5('0xec')]=_0x4eb5('0x1af');_0x3e912d[_0x4eb5('0xf2')]+=0x1;_0x3e912d[_0x4eb5('0xf0')]+=0x1;ami[_0x4eb5('0x1a5')](_0x4eb5('0x1b0'),ut[_0x4eb5('0x1aa')](_0x4e6074,'busy'));_0x5d597b[_0x4eb5('0xca')](_0x3e912d)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x1b1')));if(_0x5d597b[_0x4eb5('0x190')](0x5,_0x4e6074,_0xb8b34d)){if(_0x3e912d[_0x4eb5('0xf2')]>=_0xb8b34d['dialBusyMaxRetry']){_0x5d597b[_0x4eb5('0x1ad')](_0x3e912d,_0x699d7f,_0x123384,_0x4eb5('0x1b2'));}else{_0x5d597b[_0x4eb5('0x103')](_0x3e912d,_0x699d7f,_0x123384,_0x4eb5('0x1b2'));}}break;case'8':_0xb8b34d[_0x4eb5('0x5e')]+=0x1;_0x3e912d[_0x4eb5('0xa6')]=0x8;_0x3e912d[_0x4eb5('0xec')]=_0x4eb5('0x1b3');_0x3e912d[_0x4eb5('0x101')]+=0x1;_0x3e912d[_0x4eb5('0xf0')]+=0x1;ami[_0x4eb5('0x1a5')](_0x4eb5('0x1b4'),ut[_0x4eb5('0x1aa')](_0x4e6074,'congestion'));_0x5d597b[_0x4eb5('0xca')](_0x3e912d)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x1b5')));if(_0x5d597b[_0x4eb5('0x190')](0x8,_0x4e6074,_0xb8b34d)){if(_0x3e912d[_0x4eb5('0x101')]>=_0xb8b34d['dialCongestionMaxRetry']){_0x5d597b[_0x4eb5('0x1ad')](_0x3e912d,_0x699d7f,_0x123384,'reason\x208\x20congestion');}else{_0x5d597b[_0x4eb5('0x103')](_0x3e912d,_0x699d7f,_0x123384,_0x4eb5('0x1b6'));}}break;case'11':_0xb8b34d[_0x4eb5('0x1b7')]+=0x1;_0x3e912d['state']=0xb;_0x3e912d[_0x4eb5('0xec')]=_0x4eb5('0x1b8');_0x3e912d['countabandonedretry']+=0x1;_0x3e912d[_0x4eb5('0xf0')]+=0x1;_0x5d597b[_0x4eb5('0xca')](_0x3e912d)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x11f')));if(_0x5d597b[_0x4eb5('0x190')](0xb,_0x4e6074,_0xb8b34d)){if(_0x3e912d[_0x4eb5('0x102')]>=_0xb8b34d[_0x4eb5('0x11e')]){_0x5d597b[_0x4eb5('0x1ad')](_0x3e912d,_0x699d7f,_0x123384,_0x4eb5('0x1b9'));}else{_0x5d597b[_0x4eb5('0x103')](_0x3e912d,_0x699d7f,_0x123384,'reason\x2011\x20abandoned');}}break;case'20':_0xb8b34d['outboundRejectCallsDay']+=0x1;_0x3e912d[_0x4eb5('0xa6')]=0x14;_0x3e912d[_0x4eb5('0xec')]=_0x4eb5('0x1ba');_0x3e912d[_0x4eb5('0x191')]+=0x1;_0x3e912d['countglobal']+=0x1;ami[_0x4eb5('0x1a5')](_0x4eb5('0x1bb'),ut['buildObj'](_0x4e6074,_0x4eb5('0x1bc')));_0x5d597b['createHistory'](_0x3e912d)[_0x4eb5('0xaf')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x5d597b[_0x4eb5('0x190')](0x14,_0x4e6074,_0xb8b34d)){if(_0x3e912d['countagentrejectretry']>=_0xb8b34d[_0x4eb5('0x19f')]){_0x5d597b[_0x4eb5('0x1ad')](_0x3e912d,_0x699d7f,_0x123384,_0x4eb5('0x1bd'));}else{_0x5d597b['stateGlobal'](_0x3e912d,_0x699d7f,_0x123384,_0x4eb5('0x1bd'));}}break;default:_0xb8b34d[_0x4eb5('0x66')]+=0x1;_0x3e912d['state']=0xc;_0x3e912d['statedesc']=_0x250fd4[_0x4eb5('0x10c')];_0x5d597b[_0x4eb5('0xca')](_0x3e912d)[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x1be')));if(_0x5d597b[_0x4eb5('0x190')](_0x250fd4['reason'],_0x4e6074,_0xb8b34d)){if(_0x3e912d[_0x4eb5('0xf2')]+_0x3e912d[_0x4eb5('0x101')]+_0x3e912d[_0x4eb5('0xf3')]+_0x3e912d['countnosuchnumberretry']+_0x3e912d[_0x4eb5('0xf5')]+_0x3e912d[_0x4eb5('0x102')]+_0x3e912d[_0x4eb5('0xef')]+_0x3e912d[_0x4eb5('0x191')]>=_0xb8b34d[_0x4eb5('0x192')]){_0x5d597b[_0x4eb5('0x103')](_0x3e912d,_0x699d7f,_0x123384,_0x250fd4[_0x4eb5('0x10c')]);}else{_0x5d597b[_0x4eb5('0x1ad')](_0x3e912d,_0x699d7f,_0x123384,_0x250fd4[_0x4eb5('0x10c')]);}}}});};Dialer[_0x4eb5('0x17')][_0x4eb5('0x103')]=function(_0x5d7f1d,_0x59be2c,_0x46b878,_0xa74ede){var _0x3fa612=new Final(_0x5d7f1d);_0x3fa612[_0x4eb5('0xa6')]=0xf;_0x3fa612[_0x4eb5('0xec')]=_0x4eb5('0x1bf');this['createStateFinal'](_0x3fa612,_0x59be2c,_0x46b878,_0xa74ede);};Dialer['prototype'][_0x4eb5('0x1ad')]=function(_0x404de6,_0x4777af,_0x40f9a2,_0x3b9f80){this[_0x4eb5('0xc8')](_0x404de6)['then'](function(){return _0x4777af(msgResponse(_0x4eb5('0x1a1'),_0x4eb5('0xdb'),_0x3b9f80));})[_0x4eb5('0xaf')](function(){return _0x40f9a2(msgResponse('[moveContactManagedDialer][0]',_0x4eb5('0x13e'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x4eb5('0x153')]=function(_0x51ed07){var _0x5cb41b=_0x51ed07[_0x4eb5('0x1c0')]/0x64;var _0x44c462=_0x51ed07['outboundDropCallsDayTimeout']/(_0x51ed07[_0x4eb5('0x60')]+_0x51ed07[_0x4eb5('0x5b')]);var _0x177656=Math['round'](_0x51ed07[_0x4eb5('0x6d')]*(_0x51ed07[_0x4eb5('0x1c1')]/0x64));var _0x4e370f=Math[_0x4eb5('0x1c2')](_0x51ed07[_0x4eb5('0x6d')]*(_0x51ed07['predictiveIntervalMinThreshold']/0x64));var _0x5b3203=_0x51ed07[_0x4eb5('0xa1')]+_0x51ed07[_0x4eb5('0x1c3')];var _0x5a434d=Math[_0x4eb5('0x1c4')](_0x51ed07['erlangCalls']*_0x51ed07['erlangAbandonmentRate']*_0x51ed07['predictiveIntervalHitRate']*_0x51ed07['predictiveIntervalMultiplicativeFactor']);if(_[_0x4eb5('0x3c')](_0x51ed07[_0x4eb5('0x27')])){if(!_[_0x4eb5('0x3c')](_0x51ed07['startPredictive'])){_0x51ed07[_0x4eb5('0x73')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x4eb5('0x1c5'));}if(!_[_0x4eb5('0x3c')](_0x51ed07[_0x4eb5('0x90')])){loggerPredictive[_0x4eb5('0x94')](_0x4eb5('0x1c6'),_0x4eb5('0x1c7'));clearInterval(_0x51ed07[_0x4eb5('0x90')]);_0x51ed07[_0x4eb5('0x90')]=undefined;}_0x51ed07[_0x4eb5('0x27')]=moment()[_0x4eb5('0x77')](_0x4eb5('0xfb'));loggerPredictive[_0x4eb5('0x7c')](_0x51ed07['name'],_0x4eb5('0x1c8'),_0x51ed07[_0x4eb5('0x27')]);this[_0x4eb5('0x150')](_0x51ed07,0x1);}else if(ifInterval(_0x51ed07[_0x4eb5('0x1c9')],_0x51ed07[_0x4eb5('0x27')])){this[_0x4eb5('0x150')](_0x51ed07,0x1);loggerPredictiveCalls[_0x4eb5('0x7c')](_0x4eb5('0x1ca'),_0x51ed07['startProgressive'],_0x51ed07[_0x4eb5('0x3f')]);_0x51ed07[_0x4eb5('0x6f')]=0x0;_0x51ed07['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x5cb41b<_0x44c462&&_0x51ed07[_0x4eb5('0x1cb')]===_0x4eb5('0x1cc')){freeVariablesPredictive(_0x51ed07);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x1cd'),_0x4eb5('0x1ce'),_0x44c462,_0x4eb5('0x27'),_0x51ed07[_0x4eb5('0x3f')]);}else if(_0x5a434d<_0x51ed07[_0x4eb5('0x115')]&&_0x51ed07[_0x4eb5('0x1cb')]==='dropRate'){freeVariablesPredictive(_0x51ed07);loggerPredictive[_0x4eb5('0x7c')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x4eb5('0x1cf'),_0x5a434d,_0x4eb5('0x1d0'),_0x51ed07[_0x4eb5('0x115')],_0x4eb5('0x27'),_0x51ed07[_0x4eb5('0x3f')]);}else if(!ifInterval(_0x51ed07[_0x4eb5('0x1c9')],_0x51ed07[_0x4eb5('0x27')])&&_[_0x4eb5('0x3c')](_0x51ed07[_0x4eb5('0x73')])&&!_[_0x4eb5('0x3c')](_0x51ed07[_0x4eb5('0x27')])){_0x51ed07[_0x4eb5('0x73')]=moment()[_0x4eb5('0x77')](_0x4eb5('0xfb'));loggerPredictive[_0x4eb5('0x7c')](_0x51ed07['name'],_0x4eb5('0x1d1'),_0x51ed07[_0x4eb5('0x73')]);this[_0x4eb5('0x1d2')](_0x51ed07[_0x4eb5('0x1c9')])['then'](this['getDataPredictive'](_0x51ed07))['then'](mergeDataErlangB(_0x51ed07))[_0x4eb5('0xbb')](this[_0x4eb5('0x1d3')](_0x51ed07))[_0x4eb5('0xaf')](loggerCatchPredictive(_0x4eb5('0x1d4'),_0x51ed07));}else if(!ifInterval(_0x51ed07[_0x4eb5('0x1c9')],_0x51ed07[_0x4eb5('0x73')])){_0x51ed07[_0x4eb5('0x115')]=0x0;_0x51ed07[_0x4eb5('0x73')]=moment()['format'](_0x4eb5('0xfb'));loggerPredictive[_0x4eb5('0x7c')](_0x51ed07[_0x4eb5('0x3f')],'recalculate\x20predictive\x20at',_0x51ed07[_0x4eb5('0x73')]);clearInterval(_0x51ed07[_0x4eb5('0x90')]);_0x51ed07[_0x4eb5('0x90')]=undefined;this[_0x4eb5('0x1d2')](_0x51ed07[_0x4eb5('0x1c9')])[_0x4eb5('0xbb')](this['getDataPredictive'](_0x51ed07))[_0x4eb5('0xbb')](mergeDataErlangB(_0x51ed07))[_0x4eb5('0xbb')](this[_0x4eb5('0x1d3')](_0x51ed07))[_0x4eb5('0xaf')](loggerCatchPredictive(_0x4eb5('0x1d5'),_0x51ed07));}else if(_0x51ed07[_0x4eb5('0x6d')]&&_0x5b3203<_0x51ed07['predictiveIntervalAvailable']-_0x4e370f){freeVariablesPredictive(_0x51ed07);loggerPredictive[_0x4eb5('0x7c')](_0x51ed07[_0x4eb5('0x3f')],_0x4eb5('0x1d6'),_0x5b3203,_0x4eb5('0x1d7'),_0x51ed07[_0x4eb5('0x6d')],'-',_0x4e370f,'=',_0x51ed07[_0x4eb5('0x6d')]-_0x4e370f,')');}else if(_0x51ed07[_0x4eb5('0x6d')]&&_0x5b3203>_0x51ed07['predictiveIntervalAvailable']+_0x177656){freeVariablesPredictive(_0x51ed07);loggerPredictive[_0x4eb5('0x7c')](_0x51ed07[_0x4eb5('0x3f')],_0x4eb5('0x1d6'),_0x5b3203,_0x4eb5('0x1d8'),_0x51ed07[_0x4eb5('0x6d')],'+',_0x177656,'=',_0x51ed07[_0x4eb5('0x6d')]+_0x177656,')');}};Dialer[_0x4eb5('0x17')]['getDataPredictive']=function(_0x5008da){var _0x31d334=this;return function(_0x2bc4ea){return new BPromise(function(_0x3ad86d,_0x2a8e6b){_[_0x4eb5('0x8c')](_0x5008da,_0x2bc4ea[0x0]);if(checkGetDataPredictive(_0x2bc4ea[0x0])){var _0x3a706f=_0x5008da['predictiveIntervalAvailable']=_0x5008da[_0x4eb5('0x1c3')]+_0x5008da[_0x4eb5('0xa1')];var _0x4f1f13=_0x5008da[_0x4eb5('0x1c9')]*0x3c;var _0x35b78=_0x2bc4ea[0x0][_0x4eb5('0x83')]+_0x2bc4ea[0x0][_0x4eb5('0x68')];var _0x5b05f9=(_0x2bc4ea[0x0]['predictiveIntervalAnsweredCalls']+_0x2bc4ea[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2bc4ea[0x0][_0x4eb5('0x69')])/_0x2bc4ea[0x0]['predictiveIntervalTotalCalls'];_0x5008da[_0x4eb5('0x1d9')]=_0x5b05f9>0x0?_0x5b05f9:0x1;switch(_0x5008da['dialPredictiveOptimization']){case _0x4eb5('0x1cc'):var _0x5e4467=_0x5008da[_0x4eb5('0x1c0')]/0x64;return _0x31d334[_0x4eb5('0x1da')](_0x3a706f,_0x4f1f13,_0x35b78,_0x5b05f9,_0x5e4467)['then'](function(_0x5606be){return _0x3ad86d(_0x5606be);});case _0x4eb5('0x1db'):var _0x4e94e4=_0x5008da['dialPredictiveOptimizationPercentage']/0x64;return _0x31d334[_0x4eb5('0x1dc')](_0x3a706f,_0x4f1f13,_0x35b78,_0x5b05f9,_0x4e94e4)[_0x4eb5('0xbb')](function(_0x2cef82){return _0x3ad86d(_0x2cef82);});default:return _0x2a8e6b(msgResponse(_0x4eb5('0x1dd'),_0x4eb5('0x13e'),_0x4eb5('0x1de')));}}else{return _0x2a8e6b(msgResponse('[getDataPredictive]',_0x4eb5('0x13e'),_0x4eb5('0x1df')));}});};};Dialer['prototype'][_0x4eb5('0x1e0')]=function(_0xbb8d8d){var _0x43d58f=this;return function(_0x445720){return new BPromise(function(_0x1e3d63,_0x140ec1){_[_0x4eb5('0x8c')](_0xbb8d8d,_0x445720[0x0]);if(checkGetDataPredictive(_0x445720[0x0])){loggerPredictive[_0x4eb5('0x7c')](JSON[_0x4eb5('0x49')](_0x445720[0x0]));if(_0xbb8d8d[_0x4eb5('0x1cb')]==='dropRate'){return _0x43d58f[_0x4eb5('0xc6')](_0xbb8d8d['id'])['then'](function(_0x2c4b48){var _0x29d7ab=_0xbb8d8d[_0x4eb5('0x4d')]-_0x2c4b48[0x0]['outboundQueuePauses'];var _0x1148f6=_0xbb8d8d[_0x4eb5('0x1c9')]*0x3c;var _0x169ea5=_0x445720[0x0][_0x4eb5('0x83')]+_0x445720[0x0]['predictiveIntervalAvgHoldtime'];var _0x15ec91=(_0x445720[0x0][_0x4eb5('0x67')]+_0x445720[0x0][_0x4eb5('0x6a')]+_0x445720[0x0][_0x4eb5('0x69')])/_0x445720[0x0]['predictiveIntervalTotalCalls'];var _0x571c03=_0xbb8d8d[_0x4eb5('0x1c0')]/0x64;_0xbb8d8d[_0x4eb5('0x6c')]=_0x2c4b48[0x0][_0x4eb5('0x1e1')]||0x0;_0xbb8d8d['predictiveIntervalHitRate']=_0x15ec91>0x0?_0x15ec91:0x1;return _0x43d58f[_0x4eb5('0x1da')](_0x29d7ab,_0x1148f6,_0x169ea5,_0x15ec91,_0x571c03);})[_0x4eb5('0xbb')](function(_0xe13373){return _0x1e3d63(_0xe13373);})[_0x4eb5('0xaf')](function(_0x5d3174){return _0x140ec1(msgResponse(_0x4eb5('0x1e2'),'Failure',JSON[_0x4eb5('0x49')](_0x5d3174)));});}if(_0xbb8d8d[_0x4eb5('0x1cb')]==='agentBusyFactor'){return _0x43d58f['getVoiceQueueRtPauses'](_0xbb8d8d['id'])['then'](function(_0x37d080){var _0x81ba0e=_0xbb8d8d[_0x4eb5('0x4d')]-_0x37d080[0x0][_0x4eb5('0x1e1')];var _0x583570=_0xbb8d8d[_0x4eb5('0x1c9')]*0x3c;var _0x3e1214=_0x445720[0x0][_0x4eb5('0x83')]+_0x445720[0x0][_0x4eb5('0x68')];var _0x1f4310=(_0x445720[0x0][_0x4eb5('0x67')]+_0x445720[0x0][_0x4eb5('0x6a')]+_0x445720[0x0][_0x4eb5('0x69')])/_0x445720[0x0][_0x4eb5('0x6e')];var _0x57942c=_0xbb8d8d[_0x4eb5('0x1c0')]/0x64;_0xbb8d8d[_0x4eb5('0x6c')]=_0x37d080[0x0]['outboundQueuePauses']||0x0;_0xbb8d8d[_0x4eb5('0x1d9')]=_0x1f4310>0x0?_0x1f4310:0x1;return _0x43d58f[_0x4eb5('0x1dc')](_0x81ba0e,_0x583570,_0x3e1214,_0x1f4310,_0x57942c);})[_0x4eb5('0xbb')](function(_0x1177a2){return _0x1e3d63(_0x1177a2);})['catch'](function(_0x233e84){return _0x140ec1(msgResponse(_0x4eb5('0x1e2'),_0x4eb5('0x13e'),JSON[_0x4eb5('0x49')](_0x233e84)));});}}else{return _0x140ec1(msgResponse(_0x4eb5('0x1dd'),_0x4eb5('0x13e'),'check\x20failure'));}});};};Dialer[_0x4eb5('0x17')]['startMethodPredictive']=function(_0x23f7ea){var _0x43cac3=this;return function(){var _0xaeca12=0x0;var _0x492785=Math[_0x4eb5('0x1c4')](_0x23f7ea[_0x4eb5('0x70')]*0x3e8);if(_0x492785>0x0){_0x492785=_0x492785<0x64?0x64:_0x492785;loggerPredictive[_0x4eb5('0x7c')](_0x23f7ea[_0x4eb5('0x3f')],'one\x20call\x20every:',_0x492785,_0x4eb5('0x8d'));_0x23f7ea[_0x4eb5('0x90')]=setInterval(function(){_0x43cac3[_0x4eb5('0x90')](_0x23f7ea);loggerPredictiveCalls[_0x4eb5('0x7c')](_0x4eb5('0x1e3'),_0xaeca12+=0x1);},_0x492785);}else{loggerPredictive['info'](_0x23f7ea[_0x4eb5('0x3f')],_0x4eb5('0x1e4'));}};};Dialer[_0x4eb5('0x17')][_0x4eb5('0x1e5')]=function(_0x25bd0b,_0x49a57c){var _0x32dbaa=this;return function(_0x115543){if(_[_0x4eb5('0x44')](_0x115543)){if(_[_0x4eb5('0xe1')](_0x49a57c[_0x4eb5('0xd6')])||!_0x49a57c[_0x4eb5('0x1e6')]){if(_0x25bd0b[_0x4eb5('0x56')]===_0x4eb5('0x7')){_0x25bd0b['queueStatusComplete']=_[_0x4eb5('0x3c')](_0x25bd0b[_0x4eb5('0x129')])?!![]:_0x25bd0b[_0x4eb5('0x129')];var _0x5a832a=uuid['v4']();_0x32dbaa[_0x4eb5('0x23')][_0x5a832a]=new Action(_0x25bd0b,_0x49a57c,_0x5a832a);loggerBooked[_0x4eb5('0x7c')](_0x4eb5('0x1e7'),_0x5a832a,'queueStatusComplete:\x20',JSON[_0x4eb5('0x49')](_0x25bd0b['queueStatusComplete']),'Queue:\x20',_0x25bd0b['name']);if(_0x25bd0b['queueStatusComplete']){_0x25bd0b['queueStatusComplete']=![];_0x32dbaa[_0x4eb5('0x126')][_0x32dbaa[_0x4eb5('0x23')][_0x5a832a][_0x4eb5('0xb2')]]=[];ami[_0x4eb5('0xac')]({'actionid':_0x5a832a,'action':_0x4eb5('0x1e8'),'queue':_0x25bd0b[_0x4eb5('0x3f')]})[_0x4eb5('0xaf')](function(){_0x32dbaa[_0x4eb5('0xb1')](_0x25bd0b);_0x32dbaa[_0x4eb5('0xbf')]({'active':![],'ContactId':_0x32dbaa[_0x4eb5('0x23')][_0x5a832a][_0x4eb5('0xd4')],'ListId':_0x32dbaa[_0x4eb5('0x23')][_0x5a832a]['ListId'],'VoiceQueueId':_0x32dbaa[_0x4eb5('0x23')][_0x5a832a][_0x4eb5('0xfc')]||undefined,'CampaignId':_0x32dbaa[_0x4eb5('0x23')][_0x5a832a][_0x4eb5('0xd7')]||undefined})['catch'](loggerCatch(_0x4eb5('0x1e9')));delete _0x32dbaa[_0x4eb5('0x23')][_0x5a832a];});}else{loggerBooked[_0x4eb5('0x7c')](_0x4eb5('0x1ea'),JSON[_0x4eb5('0x49')](_0x25bd0b[_0x4eb5('0x129')]),'Queue:\x20',_0x25bd0b[_0x4eb5('0x3f')]);_0x32dbaa[_0x4eb5('0xb1')](_0x25bd0b);_0x32dbaa[_0x4eb5('0xbf')]({'active':![],'ContactId':_0x32dbaa['actions'][_0x5a832a][_0x4eb5('0xd4')],'ListId':_0x32dbaa[_0x4eb5('0x23')][_0x5a832a][_0x4eb5('0xd5')],'VoiceQueueId':_0x32dbaa['actions'][_0x5a832a][_0x4eb5('0xfc')]||undefined,'CampaignId':_0x32dbaa[_0x4eb5('0x23')][_0x5a832a][_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x1e9')));delete _0x32dbaa['actions'][_0x5a832a];}}else{return _0x32dbaa[_0x4eb5('0x15f')](_0x25bd0b,_0x49a57c);}}else{if(getDiff(_0x49a57c[_0x4eb5('0x1eb')])<_0x25bd0b[_0x4eb5('0x1ec')]*0x3c){if(_0x49a57c[_0x4eb5('0x1ed')]&&!_0x49a57c['Agent'][_0x4eb5('0x1ee')]){_0x32dbaa['preview'][_0x4eb5('0x12a')](_0x49a57c['id'])['finally'](function(){_0x32dbaa[_0x4eb5('0xb1')](_0x25bd0b);});}else{_0x32dbaa['unlockContact']({'active':![]},_0x49a57c['id'],0x1)['finally'](function(){_0x32dbaa[_0x4eb5('0xb1')](_0x25bd0b);});}}else{_0x25bd0b['outboundReCallsDay']+=0x1;_0x32dbaa['updateOriginated'](_0x25bd0b);if(_0x25bd0b['dialRecallInQueue']){_0x32dbaa[_0x4eb5('0xbf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x49a57c[_0x4eb5('0xd4')],'ListId':_0x49a57c[_0x4eb5('0xd5')],'VoiceQueueId':_0x49a57c[_0x4eb5('0xfc')]||undefined,'CampaignId':_0x49a57c[_0x4eb5('0xd7')]||undefined})[_0x4eb5('0xaf')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x32dbaa[_0x4eb5('0xca')](createObjHistory(_0x25bd0b,_0x49a57c,_0x4eb5('0x1ef'),0x17,_0x4eb5('0x1f0')))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0x1f1')));}else{_0x32dbaa['saveInDb'](createObjHistory(_0x25bd0b,_0x49a57c,_0x4eb5('0x1f2'),0x16,_0x4eb5('0x1f3')),_0x4eb5('0x1f4'),'[Originate][HistoryRecallClose]');}}}}else{_0x25bd0b[_0x4eb5('0x5c')]+=0x1;_0x32dbaa[_0x4eb5('0xd2')](createObjHistory(_0x25bd0b,_0x49a57c,_0x4eb5('0x1f5'),0xd,_0x4eb5('0x1f6')),_0x4eb5('0x1f7'),_0x4eb5('0x1f8'));throw'inBlackList';}};};Dialer[_0x4eb5('0x17')][_0x4eb5('0x1f9')]=function(_0x166613){var _0x539217=this;var _0x456cb5=_0x166613[_0x4eb5('0x1fa')]-_0x166613['originated']-_0x166613['temp'];emitCampaignSummary(_0x166613);if(_0x456cb5>0x0){if(_0x456cb5>this['maxNumberOriginate']){_0x456cb5=this[_0x4eb5('0x21')];}_0x166613[_0x4eb5('0x1fb')]+=_0x456cb5;this[_0x4eb5('0xc5')](_0x166613['id'],_0x456cb5,_0x166613[_0x4eb5('0x1fc')])['then'](function(_0xa48233){_0x166613['temp']-=_0x456cb5;_0x166613['temp']=_0x166613['temp']>0x0?_0x166613[_0x4eb5('0x1fb')]:0x0;if(!checkContactEmpty(_0xa48233)){_0x166613[_0x4eb5('0x3d')]=_0x4eb5('0x9e');logger['info'](_0x4eb5('0x1fd')+_0x166613[_0x4eb5('0x3f')]);}else{_0x166613['originated']+=_0xa48233[_0x4eb5('0x97')];_0x166613['message']=_0x4eb5('0x1fe');for(var _0x5705f4=0x0;_0x5705f4<_0xa48233['length'];_0x5705f4+=0x1){_0x166613['ivrTotalCallsDays']+=0x1;if(_[_0x4eb5('0xe1')](_0xa48233[_0x5705f4])||_['isNil'](_0xa48233[_0x5705f4][_0x4eb5('0x163')])||_[_0x4eb5('0xe1')](_0xa48233[_0x5705f4][_0x4eb5('0x163')]['phone'])){_0x539217['emptyContact'](_0x4eb5('0x1ff'),_0x166613,_0xa48233[_0x5705f4]);}else{_0x539217['checkIsBlackListIvr'](_[_0x4eb5('0xd3')](_0xa48233[_0x5705f4],['CampaignId',_0x4eb5('0x200')]))['then'](_0x539217[_0x4eb5('0x1e5')](_0x166613,_0xa48233[_0x5705f4]))[_0x4eb5('0xaf')](_0x539217[_0x4eb5('0xcf')]('[actionOriginateIvr]\x20',_0x166613));}}}})['catch'](loggerGetContactDialer(_0x4eb5('0x201'),_0x166613,_0x456cb5));}};Dialer[_0x4eb5('0x17')]['handlePower']=function(_0xf04f87,_0x4d96fc){var _0x47c1dd=this;var _0x3ca984=[];var _0x462172=_0x4d96fc>=0x1?_0x4d96fc:0x1;if(_0xf04f87[_0x4eb5('0x56')]===_0x4eb5('0x7')){_0x462172=0x1;}var _0x4a052c=Math[_0x4eb5('0x1c4')](_0xf04f87[_0x4eb5('0xa1')]*_0x462172)-_0xf04f87[_0x4eb5('0x98')]-_0xf04f87[_0x4eb5('0x1fb')];emitVoiceQueueSummary(_0xf04f87);if(_0xf04f87[_0x4eb5('0x202')]>0x0){var _0x5bb4df=_0xf04f87[_0x4eb5('0x202')]-_0xf04f87[_0x4eb5('0x98')]-_0xf04f87[_0x4eb5('0x1c3')]-_0xf04f87[_0x4eb5('0x1fb')]-_0xf04f87[_0x4eb5('0x4e')];if(_0x4a052c>_0x5bb4df){_0x4a052c=_0x5bb4df;}}if(_0x4a052c>0x0){if(_0xf04f87[_0x4eb5('0x56')]===_0x4eb5('0x7')){_0x4a052c=0x1;}if(_0x4a052c>this[_0x4eb5('0x21')]){_0x4a052c=this[_0x4eb5('0x21')];}_0xf04f87['temp']+=_0x4a052c;for(var _0x429f46 in this['agents']){if(typeof this['agents'][_0x429f46]!==_0x4eb5('0xcc')){if(this[_0x4eb5('0x1f')][_0x429f46][_0x4eb5('0xa6')]==='not_inuse'&&this[_0x4eb5('0x1f')][_0x429f46][_0x4eb5('0xad')]===_0x4eb5('0xde')){_0x3ca984[_0x4eb5('0x127')](this[_0x4eb5('0x1f')][_0x429f46]['id']);}}}this['getContactDialer'](_0xf04f87['id'],_0x3ca984,_0x4a052c,_0xf04f87['dialOrderByScheduledAt'])['then'](function(_0xaa66a8){_0xf04f87['temp']-=_0x4a052c;_0xf04f87['temp']=_0xf04f87[_0x4eb5('0x1fb')]>0x0?_0xf04f87[_0x4eb5('0x1fb')]:0x0;if(!checkContactEmpty(_0xaa66a8)){_0x47c1dd[_0x4eb5('0xb5')](_0xf04f87)['then'](sendMessageReschedule(_0xf04f87))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xb7')));}else{_0xf04f87[_0x4eb5('0x98')]+=_0xaa66a8[_0x4eb5('0x97')];_0xf04f87['message']=_0xf04f87[_0x4eb5('0x56')]===_0x4eb5('0x7')?_0x4eb5('0x203'):'RUNNING';for(var _0x145ab0=0x0;_0x145ab0<_0xaa66a8[_0x4eb5('0x97')];_0x145ab0+=0x1){if(_['isNil'](_0xaa66a8[_0x145ab0])||_[_0x4eb5('0xe1')](_0xaa66a8[_0x145ab0]['Contact'])||_[_0x4eb5('0xe1')](_0xaa66a8[_0x145ab0][_0x4eb5('0x163')][_0x4eb5('0x164')])){_0x47c1dd['emptyContact'](_0x4eb5('0x1ff'),_0xf04f87,_0xaa66a8[_0x145ab0]);}else{_0x47c1dd[_0x4eb5('0xb8')](_[_0x4eb5('0xd3')](_0xaa66a8[_0x145ab0],[_0x4eb5('0xfc'),_0x4eb5('0x200')]))['then'](_0x47c1dd[_0x4eb5('0x1e5')](_0xf04f87,_0xaa66a8[_0x145ab0]))['catch'](_0x47c1dd[_0x4eb5('0xcf')]('[actionOriginate]\x20',_0xf04f87));}}}})[_0x4eb5('0xaf')](loggerGetContactDialer(_0x4eb5('0x204'),_0xf04f87,_0x4a052c));}};Dialer[_0x4eb5('0x17')][_0x4eb5('0x90')]=function(_0x5af3d4){if(_0x5af3d4[_0x4eb5('0x202')]>0x0){var _0x5ebf7d=_0x5af3d4[_0x4eb5('0x202')]-_0x5af3d4[_0x4eb5('0x98')]-_0x5af3d4[_0x4eb5('0x1c3')];if(_0x5ebf7d>0x0){this[_0x4eb5('0x205')](_0x5af3d4);}else{loggerPredictiveCalls[_0x4eb5('0x7c')](_0x4eb5('0x206'));}}else{this[_0x4eb5('0x205')](_0x5af3d4);}};Dialer[_0x4eb5('0x17')]['tryOriginatePredictive']=function(_0x2e7396){var _0x26668a=this;var _0x40685f=[];_0x2e7396[_0x4eb5('0x98')]+=0x1;for(var _0x22e5bc in this['agents']){if(typeof this[_0x4eb5('0x1f')][_0x22e5bc]!=='undefined'){if(this[_0x4eb5('0x1f')][_0x22e5bc][_0x4eb5('0xa6')]===_0x4eb5('0x207')&&this[_0x4eb5('0x1f')][_0x22e5bc]['status']===_0x4eb5('0xde')){_0x40685f[_0x4eb5('0x127')](this[_0x4eb5('0x1f')][_0x22e5bc]['id']);}}}this[_0x4eb5('0xc3')](_0x2e7396['id'],_0x40685f,0x1,_0x2e7396[_0x4eb5('0x1fc')])[_0x4eb5('0xbb')](function(_0x146779){if(!checkContactEmpty(_0x146779)){checkContactLowerLimitOriginate(_0x2e7396,0x1,0x0);_0x26668a[_0x4eb5('0xb5')](_0x2e7396)[_0x4eb5('0xbb')](sendMessageReschedule(_0x2e7396))[_0x4eb5('0xaf')](loggerCatch(_0x4eb5('0xb7')));}else{_0x2e7396[_0x4eb5('0x3d')]=_0x4eb5('0x1fe');if(_[_0x4eb5('0xe1')](_0x146779[0x0])||_[_0x4eb5('0xe1')](_0x146779[0x0][_0x4eb5('0x163')])||_[_0x4eb5('0xe1')](_0x146779[0x0][_0x4eb5('0x163')]['phone'])){_0x26668a[_0x4eb5('0xd0')](_0x4eb5('0x1ff'),_0x2e7396,_0x146779[0x0]);}else{_0x26668a[_0x4eb5('0xb8')](_[_0x4eb5('0xd3')](_0x146779[0x0],[_0x4eb5('0xfc'),_0x4eb5('0x200')]))['then'](_0x26668a[_0x4eb5('0x1e5')](_0x2e7396,_0x146779[0x0]))['catch'](_0x26668a[_0x4eb5('0xcf')](_0x4eb5('0x208'),_0x2e7396));}}})[_0x4eb5('0xaf')](loggerGetContactDialer(_0x4eb5('0x209'),_0x2e7396,0x1));emitVoiceQueueSummary(_0x2e7396);};Dialer[_0x4eb5('0x17')]['abandonmentRate']=function(_0x5263b3,_0x4801f6,_0x1283b9,_0x5e7fc3,_0x104217,_0x103e0f){loggerPredictive[_0x4eb5('0x7c')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x20a'),_0x5263b3);loggerPredictive['info'](_0x4eb5('0x20b'),_0x4801f6);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x20c'),_0x1283b9);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x20d'),_0x5e7fc3);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x20e'),_0x104217);loggerPredictive[_0x4eb5('0x7c')]('---------------------------');return new BPromise(function(_0x4e28a0,_0x5a19ad){if(_0x5263b3<=0x0||isNaN(_0x5263b3)){return _0x5a19ad(msgResponse(_0x4eb5('0x20f'),_0x4eb5('0x48'),_0x4eb5('0x210')+_0x5263b3));}if(_0x1283b9<=0x0||isNaN(_0x1283b9)){return _0x5a19ad(msgResponse('[abandonmentRate]','Error',_0x4eb5('0x211')+_0x1283b9));}if(_0x5e7fc3<=0x0||isNaN(_0x5e7fc3)){return _0x5a19ad(msgResponse('[abandonmentRate]',_0x4eb5('0x48'),_0x4eb5('0x212')+_0x5e7fc3));}if(_0x4801f6<=0x0||isNaN(_0x4801f6)){return _0x5a19ad(msgResponse(_0x4eb5('0x20f'),'Error','interval\x20=\x20'+_0x4801f6));}if(_0x104217<=0x0||isNaN(_0x104217)){return _0x5a19ad(msgResponse('[abandonmentRate]','Error',_0x4eb5('0x213')+_0x104217));}_0x103e0f=_0x103e0f||0x0;var _0x4dbcf1=0x1/_0x1283b9;var _0x25864a=0x0;var _0x185e8f=0x0;var _0x5a335f=0x0;var _0x25ae66=0x0;for(var _0x343455=0x0;_0x5a335f<_0x104217;_0x343455+=0x1){_0x185e8f=_0x343455/_0x4801f6;_0x25864a=(_0x5e7fc3*_0x185e8f+_0x103e0f)/_0x4dbcf1;_0x5a335f=erlangb(_0x25864a,_0x5263b3);_0x25ae66=_0x25864a/_0x5263b3*(0x1-erlangb(_0x25864a,_0x5263b3));}return _0x4e28a0({'erlangCalls':_0x343455,'erlangCallToSecond':_0x4801f6/_0x343455,'erlangAbandonmentRate':_0x5a335f,'erlangBusyFactor':_0x25ae66});});};Dialer[_0x4eb5('0x17')][_0x4eb5('0x1dc')]=function(_0x400e4d,_0x51fdd4,_0x2295a5,_0x25b448,_0x45f9a3,_0x3bd578){loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x214'));loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x20a'),_0x400e4d);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x20b'),_0x51fdd4);loggerPredictive['info']('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',_0x2295a5);loggerPredictive['info'](_0x4eb5('0x20d'),_0x25b448);loggerPredictive['info'](_0x4eb5('0x215'),_0x45f9a3);loggerPredictive[_0x4eb5('0x7c')](_0x4eb5('0x84'));return new BPromise(function(_0x558731,_0x1f7dd7){if(_0x400e4d<=0x0||isNaN(_0x400e4d)){return _0x1f7dd7(msgResponse(_0x4eb5('0x216'),_0x4eb5('0x48'),'m\x20=\x20'+_0x400e4d));}if(_0x2295a5<=0x0||isNaN(_0x2295a5)){return _0x1f7dd7(msgResponse('[busyFactor]',_0x4eb5('0x48'),'Ts\x20=\x20'+_0x2295a5));}if(_0x25b448<=0x0||isNaN(_0x25b448)){return _0x1f7dd7(msgResponse('[busyFactor]',_0x4eb5('0x48'),'p\x20=\x20'+_0x25b448));}if(_0x51fdd4<=0x0||isNaN(_0x51fdd4)){return _0x1f7dd7(msgResponse(_0x4eb5('0x216'),_0x4eb5('0x48'),_0x4eb5('0x217')+_0x51fdd4));}if(_0x45f9a3<=0x0||isNaN(_0x45f9a3)){return _0x1f7dd7(msgResponse(_0x4eb5('0x216'),_0x4eb5('0x48'),_0x4eb5('0x218')+_0x45f9a3));}_0x3bd578=_0x3bd578||0x0;var _0x2d07e4=0x1/_0x2295a5;var _0x4a03fd=0x0;var _0xd756dd=0x0;var _0xae5c47=0x0;var _0x4e33a2=0x0;for(var _0x55d869=0x0;_0x4e33a2<_0x45f9a3;_0x55d869+=0x1){_0xd756dd=_0x55d869/_0x51fdd4;_0x4a03fd=(_0x25b448*_0xd756dd+_0x3bd578)/_0x2d07e4;_0xae5c47=erlangb(_0x4a03fd,_0x400e4d);_0x4e33a2=_0x4a03fd/_0x400e4d*(0x1-erlangb(_0x4a03fd,_0x400e4d));}return _0x558731({'erlangCalls':_0x55d869,'erlangCallToSecond':_0x51fdd4/_0x55d869,'erlangAbandonmentRate':_0xae5c47,'erlangBusyFactor':_0x4e33a2});});};module[_0x4eb5('0x219')]=Dialer;
\ No newline at end of file