Built motion from commit a9fb64cc6defd8fb3a5cc199221f878e91c0e969. Version 3.0.0...
[motion-next.git] / server / services / ami / dialer / index.js
1 const a1056_0xcb89=['getContactDialer','[unlockQueueStatus][undefined]','checkDialMethod','membername','outboundAnswerCallsDay','[busyFactor]','Blacklist','dialAMDAfterGreetingSilence','../rpc/cmHopperHistory','congestion','---------\x20ErlangB\x20---------','loopClearZombieChannels','countmachineretry','XMD-AMDGREETING','dialDropRetryFrequency','clearing\x20variable\x20start\x20progressive','actionid','trim','reason\x208\x20congestion','voicePause','pTalking','noanswer','Busy','\x20Timezone\x20unknow\x20','dialCutDigit','inBlackList','syncQueueMember','loggedIn','[syncAgentComplete][createHistory][0]','clearing\x20variable\x20handle\x20predictive','amd','[booked][RR]','ivrAnswerCallsDay','avgHandleTime','[Originate][HistoryRecallClose][historyCatch]','XMD-CAMPAIGNID','\x22%s\x22\x20<%s>','isSuccess','XMD-AMDAFTERGREETINGSILENCE','recallme','reason','Intervals','Trunk','../rpc/cmHopper','unlockRR','outboundReCallsDay','\x20INTERVAL_IS_NULL','Global:\x20','available','dialPredictiveOptimization','[createHistory]\x20','reason\x2020\x20agentreject','OriginateError','AVAILABLE_CONTACTS_FINISHED','VoiceQueueId','iftime\x20%s,%s','[uniqueid]','dialAgiAfterHangupAgent','[syncHangupInAMDIvr]','[originateError]:\x20%s','temp','updatedAt','[rescheduleContact][AgentReject]','seconds','actions','[getVoiceQueueRtPauses]\x20','dropreason','unlockContact','object','AGENTS_NOT_LOGGED','[syncAgentComplete][createHistory]','Contact.phone','voiceQueues','[decremetOriginate]\x20object\x20originated\x20is\x20negative','sendMessageOneNotActive','saveInDb','./history','dialAbandonedMaxRetry','progressive','startPredictive','predictiveIntervalTotalCalls','dialNoSuchNumberMaxRetry','predictiveIntervalHitRate','Failure','../../../config/config.service','[Catch][Preview][syncQueueStatusComplete]','checkIsTrunkReachable','../rpc/cmHopperBlack','tail','NoSuchNumber','preview','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','dialPredictiveOptimizationPercentage','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Success','checkIfTimeIntervals','\x20NOT\x20Active','amdstatus','-----\x20Stats\x20Predictive\x20---','Agent','[unlockContact]\x20','XMD-AMDTOTALANALYSISTIME','IS_DISACTIVED','[decremetOriginate]\x20is\x20null\x20or\x20undefined','answertime','../../../config/logger','outboundOriginateFailureCallsDay','RecallFailedTimeout','custom:agentreject','dialBusyRetryFrequency','[syncAgentComplete][createHistory][3]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','_rr','originate\x20action\x20Error','reachable','reason19\x20machine....','[syncHangupIvr][createHistory]','error','[syncQueueSummary]\x20Campaign\x20Queue:\x20','tags','dialAMDSilenceThreshold','replace','Unknown\x20Predictive','bind','[moveContactManagedDialer][0]','custom:agentnoanswer','abandonmentRate','[rescheduleContact]\x20[Busy]','dialNoAnswerMaxRetry','[rescheduleContact][Machine]','[booked][unlock]','roundrobin','sequence','[actionOriginatePredictive]\x20','[unlock][syncQueueStatusComplete]','[countReScheduled]\x20','originateresponse','[ifTime][Action]','handlePower','dialPredictiveInterval','voice:queue:%s','Contact','predictiveIntervalMaxThreshold','syncQueueStatusComplete','status','uniqueId','idHopper','Drop','queuemember','../../../config/environment/','predictiveIntervalAvgHoldtime','md5','agentBusyFactor','[syncAgentComplete][createHistory][11]','syncAgentComplete','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','then','reason\x2019\x20machine....','\x20Intervals\x20is\x20null\x20','Amax\x20=\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[actions]','check\x20handlePredictive\x20is\x20not\x20undefine','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','run','optionPredictive','[rescheduleContact][dialRecallInQueue]','calleridname','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[booked][checkContactBlack]','check\x20failure','recalculate\x20predictive\x20at','startProgressive','dialAgentRejectRetryFrequency','isNil','dialer','total','checkContactBlack','[booked][unlock3]','resolve','ivrTotalCallsDays','notFound','[getContactCampaign2]','predictiveIntervalErlangCallsDroppedCalls','Drop\x20in\x20this\x20interval','[rescheduleContact]\x20[Congestion]','stateinterface','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','../../../rediscache','finally','[rescheduleContact][Drop]','lodash','locked','SIP/%s/%s%s','outboundBlacklistCallsDay','predictiveIntervalMinThreshold','p\x20=\x20','[abandonmentRate]','util','one\x20call\x20every:','moment','syncQueueCallerAbandon','dialAMDBetweenWordsSilence','booked','reason\x205\x20busy','[booked][unlockQueueStatus]','trunks','predictiveIntervalDroppedCallsCallersExit','outboundQueuePauses','XMD-','name','Ts\x20=\x20','ifTime','./action','rrmemory','diff','originate','info','emit','inspect','queue','active','NONE','[Dialer][checkChannel]','[callProgressDetecting]\x20','originatecalleridnum','dialGlobalMaxRetry','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','[callProgressDetecting]','responsetime','dialAMDGreeting','outbound','[Dialer][checkChannel][ivr]','erlangCalls','countbusyretry','channel','dialBusyMaxRetry','length','evt\x20is\x20undefine','abandoned','agents','voice_queue:save','AGI','[startMethodPredictive][StartProgressive][Loop]','AnswerAGI','merge','outboundRejectCallsDay','ivr','HangupInAMD','[syncAgentComplete][createHistory][?]','\x22agi://%s/square,%s\x22','agiIp','droptime','string','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','agiafterat','dialRandomLastDigitCallerIdNumber','Action','dialOriginateCallerIdNumber','TIMEZONE_UNKNOW','xcally-motion-dialer','custom:agentbusy','Congestion','MACHINE','Agent:\x20','getContactDialerIvr','erlangCallToSecond','isTrunkReachable','[originate][error]','INTERVAL_IS_NULL','predictiveIntervalPauses','busyFactor','queueBookedRR','dialCongestionMaxRetry','dialNoSuchNumberRetryFrequency','ivrOriginated','predictive','maxNumberOriginate','[syncHangupInAMD][createHistory]','UserId','Machine','createStateFinal','dialQueueTimeout','getDataPredictiveOld','[syncHangupInAMDIvr][createHistory]','dialOriginateTimeout','paused','from-sip','custom:agentcongestion','ACTIVE','XMD-AMDMINWORDLENGTH','outboundDropCallsDayACS','newexten','Predictive\x20after\x20first\x20interval','AgentReject','unmanaged','uniqueid','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','handlePredictive','launchHandleIvr','outboundDropCallsDayTimeout','callProgressDetecting','message','entity\x20is\x20undefine','--------\x20Drop\x20Rate\x20--------','sumBillable','\x22\x22\x20<>','dialOriginateCallerIdName','Predictive\x20for\x20every\x20interval','loggedInDb','dialMethod','[booked][unlock2]','getQueue','checkRetriveMax','rescheduleContact','queueBooked','queueStatusComplete:\x20','countglobal','loggerHandler','moveContactManagedDialer','callerid','round','command','exports','campaign:ivr:%s','TRUNK_IS_NOT_REACHABLE','response','talking','floor','ContactId','dialMachineMaxRetry','[CatchErlangB]','collection\x20data\x20in\x20progressive\x20at','clearing\x20variable\x20start\x20predictive','stack','stringify','pow','outboundNoSuchCallsDay','NoAnswer','HANGUP','interval\x20=\x20','unmonitored','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','SIP/%s','checkIsBlackListIvr','campaigns','XMD-AMDBETWEENWORDSSILENCE','AMD','RUNNING','INTERVAL_IS_OVERTIME','outboundNoAnswerCallsDay','milliseconds','contacts','dialQueueProject2','undefined','[getContactDialer2]','started\x20in\x20predictive\x20at','syncOriginateResponse','voiceQueue\x20is\x20undefine','answered','\x20AGENTS\x20NOT\x20LOGGED','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','RecallInQueue','isEmpty',')\x20are\x20more\x20than\x20threshold\x20(','timezones','Error','reason\x203\x20ringing\x20no\x20answer','../rpc/voiceQueueRt','dialAMDTotalAnalysisTime','content','syncNewExten','fail\x20to\x20scheduled\x20calls','queueCallerAbandonCreateState','checkIsBlackList','[updateOriginated]\x20object\x20originated\x20is\x20negative','ListId','[rescheduleContact][Abandoned]','----\x20Agent\x20Busy\x20Factor\x20----','variable','BLACKLIST','dialPrefix','endtime','dialAMDInitialSilence','loopCampaigns','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','log','[unlockOriginate][syncQueueStatusComplete]','[checkIsBlackList]\x20','strategy','[Originate][HistoryDialRecallInQueue][historyCatch]','getCaller','Queue:\x20','[syncAgentComplete][createHistory][5]','countnoanswerretry','tryOriginatePredictive','Queue','originated','stateGlobal','startMethodPredictive','some','isUndefined','dialMachineRetryFrequency','XMD-AMDMAXIMUMWORDLENGTH','[syncQueueSummary]','minutes','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','format','checkIfTime','[unlock3][syncQueueStatusComplete]','m\x20=\x20','state','countagentrejectretry','interval','syncHangup','[handlePredictive][limitChannel]','dialQueueProject','syncAgentConnect','push','CampaignId','[syncQueueCallerAbandon]\x20[Drop]','phone','agentreject','[syncHangupIvr]','RECALLFAILEDTIMEOUT','dialLimitQueue','emptyContact','method\x20not\x20recognized','outboundBusyCallsDay','[booked][checkContactBlack][else]','createHistory','predictiveIntervalDroppedCallsTimeout','[startMethodPredictive][StartProgressive]','getVoiceQueueRtPauses','XMD-AMDMAXIMUMNUMBEROFWORDS','dialTimezone','[actionOriginate]\x20','statedesc','campaign:save','add','NOT_ACTIVE','updateOriginated','Interval','actionOriginate','averageHandleTime','[syncAgentComplete][createHistory][10]','check\x20predictive\x20is\x20not\x20undefine','value','XMD-AMDINITIALSILENCE','prototype','syncQueueSummary','erlangBusyFactor','clearZombieChannels','getDataPredictive','Contact\x20updated','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','pick','\x22%s,%s%s,,,%s\x22','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','dialDropMaxRetry','agentcomplete','History\x20information\x20are\x20empty','[syncAgentComplete][createHistory][8]','[unlock2][syncQueueStatusComplete]','dialAMDActive','calleridnum','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','[getContactDialer]\x20','nosuchnumber','true','dropRate','predictiveIntervalAvailable','queuestatus','dialAbandonedRetryFrequency','dialNoAnswerRetryFrequency','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','type','contactsRescheduled','XMD-ORIGINATECALLERIDNUM','TrunkBackup','hangup','power','countnosuchnumberretry','countabandonedretry','[syncHangupInAMD]','starttime','[getContactDialer2][ReScheduled]','queueStatusComplete','predictiveIntervalAvgTalktime','outboundDropCallsDayCallersExit','[getContactCampaign2][Empty]','reason\x200\x20no\x20such\x20number....','predictiveCalls','[getContactDialer2][Empty]','outboundUnknownCallsDay','dialGlobalInterval','contactAgent-idHopper:\x20','indexOf','catch','[getDataPredictive]','syncVarSet','Abandoned','not_inuse','YYYY-MM-DD\x20HH:mm:ss','dialQueueOptions','channels','is\x20not\x20active','predictiveIntervalMultiplicativeFactor','erlangAbandonmentRate','---------------------------','countdropretry','busy','enqueue','agentconnect','agent','[getContactDialerPredictive]','cause-txt','countReScheduled','scheduledat','[actionOriginateIvr]\x20','buildObj','predictiveIntervalAnsweredCalls','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','isArray','substring','countcongestionretry'];(function(_0x2041f1,_0xcb89ac){const _0x6f605a=function(_0x5bd9f2){while(--_0x5bd9f2){_0x2041f1['push'](_0x2041f1['shift']());}};_0x6f605a(++_0xcb89ac);}(a1056_0xcb89,0x1d6));const a1056_0x6f60=function(_0x2041f1,_0xcb89ac){_0x2041f1=_0x2041f1-0x0;let _0x6f605a=a1056_0xcb89[_0x2041f1];return _0x6f605a;};const _0x593c09=a1056_0x6f60;'use strict';const util=require(_0x593c09('0x101')),_=require(_0x593c09('0xfa')),uuid=require('uuid'),moment=require(_0x593c09('0x103')),rr=require('rr'),md5=require(_0x593c09('0xd2')),ut=require('../preview/util/util'),config=require(_0x593c09('0xd0')),logger=require(_0x593c09('0xa4'))(_0x593c09('0xea')),loggerBooked=require('../../../config/logger')(_0x593c09('0x106')),loggerPredictive=require('../../../config/logger')('predictive'),loggerPredictiveCalls=require(_0x593c09('0xa4'))(_0x593c09('0x19')),loggerSyncQueueSummary=require(_0x593c09('0xa4'))(_0x593c09('0x1ff')),ami=require('../ami'),{getSocket}=require(_0x593c09('0xf7')),io=getSocket(),cmHopper=require(_0x593c09('0x66')),cmHopperHistory=require(_0x593c09('0x43')),cmHopperBlack=require(_0x593c09('0x92')),voiceQueueRt=require(_0x593c09('0x1ad')),Action=require(_0x593c09('0x110')),History=require(_0x593c09('0x87')),Final=require('./final'),AgentComplete=require('./agentComplete'),QueueCallerAbandon=require('./queueCallerAbandon'),Hangup=require('./hangup'),{getConfigService}=require(_0x593c09('0x8f')),strategy={'rrmemory':_0x593c09('0x111'),'roundrobin':_0x593c09('0xbe')},Sequence=function(){};Sequence[_0x593c09('0x1fe')][_0x593c09('0x2d')]=function(_0x5bd9f2){const _0x19f1f3=_0x593c09;this[_0x19f1f3('0x93')]=this['tail']?this['tail'][_0x19f1f3('0xf8')](_0x5bd9f2):_0x5bd9f2();};function Dialer(_0x1e6788,_0x5947d2){const _0x10353d=_0x593c09;this[_0x10353d('0xbf')]=new Sequence(),this['preview']=_0x5947d2,this[_0x10353d('0x83')]=_0x1e6788['voiceQueues'],this['campaigns']=_0x1e6788[_0x10353d('0x196')],this[_0x10353d('0x12b')]=_0x1e6788['agents'],this[_0x10353d('0x109')]=_0x1e6788[_0x10353d('0x109')],this[_0x10353d('0x152')]=config[_0x10353d('0x152')]||0x2,this[_0x10353d('0x26')]={},this[_0x10353d('0x7b')]={},this['contactsId']={},this[_0x10353d('0xcc')]={},this[_0x10353d('0xe0')]={},this[_0x10353d('0x8a')]={},this[_0x10353d('0xe7')]={},this[_0x10353d('0x150')]={},this['queueBooked']={},this[_0x10353d('0x14d')]={},ami['on'](_0x10353d('0x2e'),this[_0x10353d('0x1de')]['bind'](this)),ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x10353d('0xb6')](this)),ami['on'](_0x10353d('0xc3'),this[_0x10353d('0x1a2')][_0x10353d('0xb6')](this)),ami['on'](_0x10353d('0x20a'),this[_0x10353d('0xd5')][_0x10353d('0xb6')](this)),ami['on']('custom:queuesummary',this[_0x10353d('0x1ff')][_0x10353d('0xb6')](this)),ami['on'](_0x10353d('0xd'),this['syncHangup'][_0x10353d('0xb6')](this)),ami['on'](_0x10353d('0x161'),this[_0x10353d('0x1b0')][_0x10353d('0xb6')](this)),ami['on']('varset',this[_0x10353d('0x21')][_0x10353d('0xb6')](this)),ami['on'](_0x10353d('0xcf'),this['syncQueueMember'][_0x10353d('0xb6')](this)),ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x10353d('0xb6')](this)),this['loopCampaigns'](),this['loopClearZombieChannels']();}function isNotNull(_0x15bd0c){const _0x2c5910=_0x593c09;return _0x15bd0c!==null&&!_[_0x2c5910('0x1ce')](_0x15bd0c);}function checkIsLoggedIn(_0x36088d,_0x15bd9e){return function(){const _0x266905=a1056_0x6f60;if(_0x15bd9e<=0x0){_0x36088d[_0x266905('0x16b')]=_0x266905('0x80');throw _0x36088d[_0x266905('0x10d')]+_0x266905('0x1a5');}};}function isActive(_0x396e9c){return _0x396e9c;}function checkIsActive(_0x279832,_0x4db71d){return function(){const _0x5c90c7=a1056_0x6f60;if(!isActive(_0x4db71d)){_0x279832[_0x5c90c7('0x16b')]=_0x5c90c7('0x1f5');throw _0x279832[_0x5c90c7('0x10d')]+_0x5c90c7('0x9b');}};}function checkInterval(_0x181ebf){return function(){const _0x3ccc16=a1056_0x6f60;if(!isNotNull(_0x181ebf[_0x3ccc16('0x1f7')])){_0x181ebf[_0x3ccc16('0x16b')]='INTERVAL_IS_NULL';throw _0x181ebf['name']+_0x3ccc16('0x69');}if(!isNotNull(_0x181ebf[_0x3ccc16('0x1f7')][_0x3ccc16('0x64')])){_0x181ebf[_0x3ccc16('0x16b')]=_0x3ccc16('0x14a');throw _0x181ebf[_0x3ccc16('0x10d')]+_0x3ccc16('0x69');}if(!isNotNull(_[_0x3ccc16('0x1a8')](_0x181ebf[_0x3ccc16('0x1f7')][_0x3ccc16('0x64')]))){_0x181ebf[_0x3ccc16('0x16b')]=_0x3ccc16('0x14a');throw _0x181ebf['name']+_0x3ccc16('0x69');}};}function msgResponse(_0x2fcb3e,_0x36e0cf,_0x13dc6e){return{'action':_0x2fcb3e,'response':_0x36e0cf,'message':_0x13dc6e,'stack':_0x13dc6e};}function myreject(_0x1436c9){return function(_0x52783d){const _0x5c46a9=a1056_0x6f60;return _0x1436c9(msgResponse(_0x5c46a9('0xc4'),_0x5c46a9('0x1ab'),JSON['stringify'](_0x52783d)));};}function getSeconds(_0x565b71,_0x290982){const _0x14a9fd=_0x593c09,_0x5a9fc8=moment(_0x565b71)['milliseconds'](0x0),_0x4da8be=moment(_0x290982)['milliseconds'](0x0);return _0x5a9fc8[_0x14a9fd('0x112')](_0x4da8be,'seconds');}function emit(_0x52839f,_0x56e5b6,_0x169784){io['to'](_0x52839f)['emit'](_0x56e5b6,_0x169784);}function emitVoiceQueueSummary(_0x22d680){const _0x3654bd=_0x593c09;if(_0x22d680[_0x3654bd('0x9')]===_0x3654bd('0x122')){const _0x283f41={'id':_0x22d680['id'],'name':_0x22d680[_0x3654bd('0x10d')],'strategy':_0x22d680[_0x3654bd('0x1c2')],'answered':_0x22d680[_0x3654bd('0x1a4')],'available':_0x22d680[_0x3654bd('0x6b')],'loggedIn':_0x22d680[_0x3654bd('0x56')],'pTalking':_0x22d680['pTalking'],'sumBillable':_0x22d680[_0x3654bd('0x16e')],'sumDuration':_0x22d680['sumDuration'],'sumHoldTime':_0x22d680['sumHoldTime']||0x0,'talking':_0x22d680['talking'],'total':_0x22d680[_0x3654bd('0xeb')],'type':_0x22d680['type'],'unmanaged':_0x22d680[_0x3654bd('0x164')],'abandoned':_0x22d680[_0x3654bd('0x12a')],'waiting':_0x22d680['waiting'],'loggedInDb':_0x22d680[_0x3654bd('0x172')],'dialActive':_0x22d680['dialActive'],'dialMethod':_0x22d680[_0x3654bd('0x173')],'dialOriginateCallerIdName':_0x22d680['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x22d680[_0x3654bd('0x13f')],'dialOriginateTimeout':_0x22d680[_0x3654bd('0x15a')],'dialPrefix':_0x22d680[_0x3654bd('0x1ba')],'outboundAnswerAgiCallsDay':_0x22d680['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x22d680[_0x3654bd('0x3f')],'outboundBlacklistCallsDay':_0x22d680['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x22d680[_0x3654bd('0x1e9')],'outboundCongestionCallsDay':_0x22d680[_0x3654bd('0x13b')],'outboundDropCallsDayACS':_0x22d680[_0x3654bd('0x160')],'outboundDropCallsDayCallersExit':_0x22d680[_0x3654bd('0x16')],'outboundDropCallsDayTimeout':_0x22d680['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x22d680[_0x3654bd('0x19b')],'outboundNoSuchCallsDay':_0x22d680[_0x3654bd('0x18e')],'outboundOriginateFailureCallsDay':_0x22d680['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x22d680[_0x3654bd('0x68')],'outboundRejectCallsDay':_0x22d680[_0x3654bd('0x131')],'outboundUnknownCallsDay':_0x22d680['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x22d680[_0x3654bd('0x36')],'predictiveIntervalAvgHoldtime':_0x22d680[_0x3654bd('0xd1')],'predictiveIntervalAvgTalktime':_0x22d680[_0x3654bd('0x15')],'predictiveIntervalDroppedCallsCallersExit':_0x22d680[_0x3654bd('0x10a')],'predictiveIntervalDroppedCallsTimeout':_0x22d680[_0x3654bd('0x1ec')],'predictiveIntervalErlangCalls':_0x22d680['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x22d680[_0x3654bd('0xf2')],'predictiveIntervalHitRate':_0x22d680[_0x3654bd('0x8d')],'predictiveIntervalMultiplicativeFactor':_0x22d680[_0x3654bd('0x28')],'predictiveIntervalPauses':_0x22d680[_0x3654bd('0x14b')],'predictiveIntervalAvailable':_0x22d680['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x22d680[_0x3654bd('0x8b')],'message':_0x22d680[_0x3654bd('0x16b')],'originated':_0x22d680[_0x3654bd('0x1ca')],'erlangCalls':_0x22d680[_0x3654bd('0x124')],'erlangCallToSecond':_0x22d680[_0x3654bd('0x147')],'erlangAbandonmentRate':_0x22d680[_0x3654bd('0x29')],'erlangBusyFactor':_0x22d680[_0x3654bd('0x200')],'startPredictive':_0x22d680['startPredictive'],'startProgressive':_0x22d680[_0x3654bd('0xe7')]};_0x22d680['Trunk']&&(_0x283f41['Trunk']={'id':_0x22d680[_0x3654bd('0x65')]['id'],'name':_0x22d680[_0x3654bd('0x65')][_0x3654bd('0x10d')],'active':_0x22d680[_0x3654bd('0x65')][_0x3654bd('0x118')],'callerid':_0x22d680[_0x3654bd('0x65')][_0x3654bd('0x17d')]});_0x22d680[_0x3654bd('0x1f7')]&&(_0x283f41[_0x3654bd('0x1f7')]={'id':_0x22d680[_0x3654bd('0x1f7')]['id'],'name':_0x22d680[_0x3654bd('0x1f7')][_0x3654bd('0x10d')]});const _0x165b12=md5(JSON[_0x3654bd('0x18c')](_0x283f41));_0x22d680['md5']!==_0x165b12&&(_0x22d680[_0x3654bd('0xd2')]=_0x165b12,emit(util[_0x3654bd('0x1d4')](_0x3654bd('0xc7'),_0x283f41[_0x3654bd('0x10d')]),_0x3654bd('0x12c'),_0x283f41));}}function emitCampaignSummary(_0x51a1d4){const _0x145e14=_0x593c09;_0x51a1d4[_0x145e14('0x9')]===_0x145e14('0x132')&&emit(util[_0x145e14('0x1d4')](_0x145e14('0x181'),_0x51a1d4[_0x145e14('0x10d')]),_0x145e14('0x1f3'),_0x51a1d4);}function checkGetDataPredictive(_0x3d01ed){const _0x2dc74d=_0x593c09;if(isNotNull(_0x3d01ed)){if(!_[_0x2dc74d('0x1a8')](_0x3d01ed)){loggerPredictive['info'](_0x2dc74d('0x9d')),loggerPredictive[_0x2dc74d('0x114')](_0x2dc74d('0xf6'),_0x3d01ed['predictiveIntervalTotalCalls']),loggerPredictive[_0x2dc74d('0x114')](_0x2dc74d('0xde'),_0x3d01ed['predictiveIntervalAnsweredCalls']),loggerPredictive[_0x2dc74d('0x114')](_0x2dc74d('0x8'),_0x3d01ed[_0x2dc74d('0x1ec')]),loggerPredictive[_0x2dc74d('0x114')](_0x2dc74d('0xdb'),_0x3d01ed[_0x2dc74d('0x10a')]),loggerPredictive[_0x2dc74d('0x114')](_0x2dc74d('0x96'),_0x3d01ed[_0x2dc74d('0xd1')]),loggerPredictive[_0x2dc74d('0x114')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3d01ed[_0x2dc74d('0x15')]),loggerPredictive[_0x2dc74d('0x114')]('---------------------------');if(_0x3d01ed['predictiveIntervalTotalCalls']>0x0){if(!_[_0x2dc74d('0x1ce')](_0x3d01ed['predictiveIntervalAvgTalktime'])&&_0x3d01ed['predictiveIntervalAvgTalktime']>0x0)return!![];else loggerPredictive['info'](_0x2dc74d('0x193'));if(!_[_0x2dc74d('0x1ce')](_0x3d01ed[_0x2dc74d('0xd1')])&&_0x3d01ed[_0x2dc74d('0xd1')]>0x0)return!![];else loggerPredictive[_0x2dc74d('0x114')](_0x2dc74d('0x139'));}else loggerPredictive[_0x2dc74d('0x114')](_0x2dc74d('0x210'));}else loggerPredictive[_0x2dc74d('0x114')](_0x2dc74d('0x20b'));}else loggerPredictive[_0x2dc74d('0x114')]('History\x20information\x20are\x20empty');return![];}function mergeDataErlangB(_0x1c2926){return function(_0x5b769e){const _0x5948da=a1056_0x6f60;loggerPredictive[_0x5948da('0x114')](_0x5948da('0x45')),loggerPredictive[_0x5948da('0x114')](_0x5948da('0x208'),_0x5b769e[_0x5948da('0x124')]),loggerPredictive[_0x5948da('0x114')](_0x5948da('0xd6'),_0x5b769e[_0x5948da('0x147')]),loggerPredictive[_0x5948da('0x114')](_0x5948da('0x98'),_0x5b769e[_0x5948da('0x29')]),loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b769e[_0x5948da('0x200')]),loggerPredictive[_0x5948da('0x114')](_0x5948da('0x98'),_0x5b769e[_0x5948da('0x29')]),loggerPredictive[_0x5948da('0x114')](_0x5948da('0x2a')),_[_0x5948da('0x130')](_0x1c2926,_0x5b769e);};}function getDiff(_0x4eebc7){const _0x1a725c=_0x593c09,_0x40aa50=moment()[_0x1a725c('0x19c')](0x0),_0x46ffea=moment(_0x4eebc7)['milliseconds'](0x0);return _0x40aa50['diff'](_0x46ffea,_0x1a725c('0x7a'));}function ifInterval(_0x3b5d49,_0x956a13){const _0x10fffb=_0x593c09;if(_[_0x10fffb('0x1ce')](_0x956a13))return![];return getDiff(_0x956a13)<_0x3b5d49*0x3c?!![]:![];}function freeVariablesPredictive(_0x4d929d){const _0x45ad57=_0x593c09;isNotNull(_0x4d929d)&&(!_[_0x45ad57('0x1ce')](_0x4d929d[_0x45ad57('0xe7')])&&(_0x4d929d['startProgressive']=undefined,loggerPredictive[_0x45ad57('0x114')](_0x4d929d['name'],_0x45ad57('0x4a'))),!_['isUndefined'](_0x4d929d[_0x45ad57('0x8a')])&&(_0x4d929d['startPredictive']=undefined,loggerPredictive[_0x45ad57('0x114')](_0x4d929d[_0x45ad57('0x10d')],_0x45ad57('0x18a'))),!_['isUndefined'](_0x4d929d['handlePredictive'])&&(clearInterval(_0x4d929d[_0x45ad57('0x167')]),_0x4d929d[_0x45ad57('0x167')]=undefined,loggerPredictive[_0x45ad57('0x114')](_0x4d929d[_0x45ad57('0x10d')],_0x45ad57('0x58'))));}function erlangb(_0x575a54,_0x56b158){if(_0x56b158===0x0)return 0x0;let _0xa8313b=0x1;for(let _0x3adac1=0x1;_0x3adac1<=_0x56b158;_0x3adac1+=0x1){_0xa8313b=0x1+_0xa8313b*_0x3adac1/_0x575a54;}return 0x1/_0xa8313b;}function isVoiceQueueOutbound(_0x4f0dc3){const _0x557d55=_0x593c09;return _0x4f0dc3===_0x557d55('0x122');}function isNotPreview(_0x3042d3){const _0x11cddb=_0x593c09;return _0x3042d3!==_0x11cddb('0x95');}function isCampaignIvr(_0x437120){const _0x1c3eb7=_0x593c09;return _0x437120===_0x1c3eb7('0x132');}function getCallerId(_0x574bad,_0x477efa,_0x4b4fdd){const _0x58da58=_0x593c09;if(!_['isUndefined'](_0x4b4fdd)&&'string'===typeof _0x4b4fdd&&!_[_0x58da58('0x1a8')](_0x4b4fdd)){if(!_['isUndefined'](_0x477efa)&&_0x58da58('0x138')===typeof _0x477efa&&!_[_0x58da58('0x1a8')](_0x477efa))return util[_0x58da58('0x1d4')](_0x58da58('0x5f'),_0x477efa,_0x4b4fdd);return util[_0x58da58('0x1d4')]('\x22%s\x22\x20<%s>',_0x4b4fdd,_0x4b4fdd);}if(!_[_0x58da58('0x1ce')](_0x574bad)&&_0x58da58('0x138')===typeof _0x574bad&&!_[_0x58da58('0x1a8')](_0x574bad))return _0x574bad;return _0x58da58('0x16f');}function loggerCatchQueueSummary(_0x4d969d,_0x3f72f2){return function(_0x4136c3){const _0x91e2f3=a1056_0x6f60;freeVariablesPredictive(_0x3f72f2),emitVoiceQueueSummary(_0x3f72f2),emitCampaignSummary(_0x3f72f2),loggerSyncQueueSummary[_0x91e2f3('0xb0')](_0x4d969d,util[_0x91e2f3('0x116')](_0x4136c3,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x61317d,_0x1b685b){return function(_0xc93e36){const _0xf5843f=a1056_0x6f60;loggerPredictive[_0xf5843f('0xb0')](_0x1b685b[_0xf5843f('0x10d')],_0x61317d),loggerPredictive[_0xf5843f('0xb0')](_0xc93e36[_0xf5843f('0x18b')]),freeVariablesPredictive(_0x1b685b);};}function loggerCatch(_0xc706f5){return function(_0x215754){const _0x5b5f88=a1056_0x6f60;logger[_0x5b5f88('0xb0')](_0xc706f5,util[_0x5b5f88('0x116')](_0x215754,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2fa996){const _0x430ada=_0x593c09;return _0x2fa996&&!_['isUndefined'](_0x2fa996)&&_0x2fa996[_0x430ada('0x128')]>0x0;}function decremetOriginate(_0x3645dd){const _0x337bce=_0x593c09;!_[_0x337bce('0x1ce')](_0x3645dd)&&_0x3645dd!==null?typeof _0x3645dd['originated']!==_0x337bce('0x19f')&&(_0x3645dd[_0x337bce('0x1ca')]>0x0?_0x3645dd['originated']-=0x1:logger['error'](_0x337bce('0x84'))):logger['error'](_0x337bce('0xa2'));}function checkContactLowerLimitOriginate(_0x2e8c78,_0xb2049e,_0x27b1d9){if(_0xb2049e>_0x27b1d9)for(let _0x2263e8=0x0;_0x2263e8<_0xb2049e-_0x27b1d9;_0x2263e8+=0x1){decremetOriginate(_0x2e8c78);}}function loggerGetContactDialer(_0x302eb8,_0x141e30,_0x2454f5){return function(_0xb84048){const _0x4b58b8=a1056_0x6f60;checkContactLowerLimitOriginate(_0x141e30,_0x2454f5,0x0),logger[_0x4b58b8('0xb0')](_0x302eb8,util[_0x4b58b8('0x116')](_0xb84048,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x35f5c8){return function(_0x34f5ac){const _0x5da587=a1056_0x6f60;isNotNull(_0x34f5ac)&&isNotNull(_0x34f5ac[0x0])&&(_0x34f5ac[0x0][_0x5da587('0xa')]>0x0?(_0x35f5c8[_0x5da587('0x16b')]='RESCHEDULED_CONTACTS',logger[_0x5da587('0x114')](_0x5da587('0x13')+_0x35f5c8[_0x5da587('0x10d')],_0x34f5ac[0x0]['contactsRescheduled'],_0x5da587('0x19d'))):(_0x35f5c8['message']=_0x5da587('0x70'),logger['info'](_0x5da587('0x1a')+_0x35f5c8[_0x5da587('0x10d')])));};}function notSendMessagesQueue(_0x118150){const _0x31935e=_0x593c09;_0x118150[_0x31935e('0x85')]&&(freeVariablesPredictive(_0x118150),_0x118150[_0x31935e('0x1ca')]===0x0&&_0x118150['talking']===0x0&&_0x118150['waiting']===0x0&&(_0x118150[_0x31935e('0x4f')]||0x0)===0x0?(_0x118150['sendMessageOneNotActive']=![],_0x118150['available']=0x0,_0x118150[_0x31935e('0x16b')]=_0x31935e('0x1f5'),loggerSyncQueueSummary[_0x31935e('0xb0')](_0x31935e('0xb1'),_0x118150[_0x31935e('0x10d')],'is\x20not\x20active')):(_0x118150['message']=_0x31935e('0xa1'),loggerSyncQueueSummary[_0x31935e('0xb0')](_0x31935e('0xb1'),_0x118150[_0x31935e('0x10d')],'is\x20disactive')),emitVoiceQueueSummary(_0x118150));}function notSendMessagesCampaign(_0x48aaaa){const _0x12d8a2=_0x593c09;_0x48aaaa['sendMessageOneNotActive']&&(_0x48aaaa[_0x12d8a2('0x1ca')]===0x0?(_0x48aaaa['sendMessageOneNotActive']=![],_0x48aaaa[_0x12d8a2('0x16b')]=_0x12d8a2('0x1f5'),loggerSyncQueueSummary['error'](_0x12d8a2('0xe3'),_0x48aaaa[_0x12d8a2('0x10d')],_0x12d8a2('0x27'))):(_0x48aaaa[_0x12d8a2('0x16b')]=_0x12d8a2('0xa1'),loggerSyncQueueSummary['error'](_0x12d8a2('0xe3'),_0x48aaaa['name'],'is\x20disactive')),emitCampaignSummary(_0x48aaaa));}function createObjHistory(_0x372505,_0x4d5eb1,_0x36e440,_0x51f969,_0x2e1f7c){const _0x254988=_0x593c09;_0x372505['message']=_0x36e440;const _0x457ac4=new Action(_0x372505,_0x4d5eb1),_0x50f7a9=new History(_0x457ac4);return _0x50f7a9['state']=_0x51f969,_0x50f7a9[_0x254988('0x1f2')]=_0x2e1f7c,_0x50f7a9['endtime']=_0x457ac4['starttime'],_0x50f7a9;}Dialer[_0x593c09('0x1fe')][_0x593c09('0x46')]=function(){const _0x332ee2=this;setInterval(function(){const _0x10f4e3=a1056_0x6f60;_0x332ee2[_0x10f4e3('0x201')](_0x332ee2[_0x10f4e3('0xcc')],_0x10f4e3('0x73')),_0x332ee2[_0x10f4e3('0x201')](_0x332ee2[_0x10f4e3('0x7b')],_0x10f4e3('0xdc'));},0x32c8);},Dialer[_0x593c09('0x1fe')]['clearZombieChannels']=function(_0x17ee3c,_0x62a8a5){const _0x4b0da3=_0x593c09,_0x1fc3b8=this;for(const _0x4e3d97 in _0x17ee3c){typeof _0x17ee3c[_0x4e3d97]!==_0x4b0da3('0x19f')&&this[_0x4b0da3('0xbf')][_0x4b0da3('0x2d')](function(){const _0x288ad3=_0x4b0da3;if(!_[_0x288ad3('0xe9')](_0x17ee3c[_0x4e3d97]))return ami['Action']({'action':'status','channel':_0x17ee3c[_0x4e3d97]['channel']})['catch'](function(_0x3415ae){const _0x9023a1=_0x288ad3;_0x3415ae[_0x9023a1('0x16b')]==='No\x20such\x20channel'&&setTimeout(function(){const _0x19a9c4=_0x9023a1;_0x17ee3c[_0x4e3d97]&&_0x17ee3c[_0x4e3d97]['type']!==_0x19a9c4('0x132')&&(_0x1fc3b8[_0x19a9c4('0x1f6')](_0x1fc3b8[_0x19a9c4('0x83')][_0x17ee3c[_0x4e3d97]['queue']]),logger[_0x19a9c4('0xb0')](_0x19a9c4('0x11a'),_0x62a8a5,_0x4e3d97,_0x17ee3c[_0x4e3d97][_0x19a9c4('0x117')]),delete _0x17ee3c[_0x4e3d97]),_0x17ee3c[_0x4e3d97]&&_0x17ee3c[_0x4e3d97][_0x19a9c4('0x9')]===_0x19a9c4('0x132')&&(_0x1fc3b8['updateOriginated'](_0x1fc3b8[_0x19a9c4('0x196')][_0x17ee3c[_0x4e3d97][_0x19a9c4('0x117')]]),logger[_0x19a9c4('0xb0')](_0x19a9c4('0x123'),_0x62a8a5,_0x4e3d97,_0x17ee3c[_0x4e3d97][_0x19a9c4('0x117')]),delete _0x17ee3c[_0x4e3d97]);},0x2328);});});}},Dialer[_0x593c09('0x1fe')]['countReScheduled']=function(_0x57197c){const _0x19e97d=_0x593c09;return Promise[_0x19e97d('0xee')]()[_0x19e97d('0xd7')](cmHopper[_0x19e97d('0x32')](_0x57197c))[_0x19e97d('0x1f')](loggerCatch(_0x19e97d('0xc2')));},Dialer[_0x593c09('0x1fe')]['checkIsBlackList']=function(_0xae413c){const _0x3f8185=_0x593c09;return Promise[_0x3f8185('0xee')]()[_0x3f8185('0xd7')](cmHopperBlack['checkIsBlackList'](_0xae413c))[_0x3f8185('0x1f')](loggerCatch(_0x3f8185('0x1c1')));},Dialer['prototype'][_0x593c09('0x195')]=function(_0x412eea){const _0x405ab3=_0x593c09;return Promise['resolve']()[_0x405ab3('0xd7')](cmHopperBlack[_0x405ab3('0x195')](_0x412eea))[_0x405ab3('0x1f')](loggerCatch('[checkIsBlackListIvr]\x20'));},Dialer['prototype']['averageHandleTime']=function(_0x2ec300){const _0x2167e0=_0x593c09;return Promise[_0x2167e0('0xee')]()[_0x2167e0('0xd7')](cmHopperHistory[_0x2167e0('0x5c')](_0x2ec300))[_0x2167e0('0x1f')](loggerCatch('[averageHandleTime]\x20'));},Dialer[_0x593c09('0x1fe')][_0x593c09('0x177')]=function(_0x461ca1){const _0x13c358=_0x593c09;return Promise['resolve']()['then'](cmHopper[_0x13c358('0x177')](_0x461ca1))[_0x13c358('0x1f')](loggerCatch('[rescheduleContact]\x20'));},Dialer[_0x593c09('0x1fe')][_0x593c09('0x7e')]=function(_0x1236e8,_0x59f246,_0x66dd73){const _0x2510b5=_0x593c09;return Promise[_0x2510b5('0xee')]()['then'](cmHopper[_0x2510b5('0x7e')](_0x1236e8,_0x59f246,_0x66dd73))[_0x2510b5('0x1f')](loggerCatch(_0x2510b5('0x9f')));},Dialer[_0x593c09('0x1fe')][_0x593c09('0x3b')]=function(_0x57f4a6,_0x4bc617,_0x1a6e1e,_0x201a23){const _0x26c468=_0x593c09;return Promise[_0x26c468('0xee')]()[_0x26c468('0xd7')](cmHopper[_0x26c468('0x3b')](_0x57f4a6,_0x4bc617,_0x1a6e1e,_0x201a23))[_0x26c468('0x1f')](loggerCatch(_0x26c468('0x0')));},Dialer[_0x593c09('0x1fe')]['getContactDialerIvr']=function(_0x2c7a4a,_0x5895ad,_0xdfc58a){const _0x2be4b8=_0x593c09;return Promise[_0x2be4b8('0xee')]()[_0x2be4b8('0xd7')](cmHopper[_0x2be4b8('0x146')](_0x2c7a4a,_0x5895ad,_0xdfc58a))['catch'](loggerCatch(_0x2be4b8('0x0')));},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1ee')]=function(_0x52ae87){const _0xb054c=_0x593c09;return Promise[_0xb054c('0xee')]()[_0xb054c('0xd7')](voiceQueueRt[_0xb054c('0x1ee')](_0x52ae87))[_0xb054c('0x1f')](loggerCatch(_0xb054c('0x7c')));},Dialer[_0x593c09('0x1fe')]['moveContactManagedDialer']=function(_0x4beb32){const _0x84f23a=_0x593c09;return Promise[_0x84f23a('0xee')]()[_0x84f23a('0xd7')](cmHopper[_0x84f23a('0x17c')](_0x4beb32))[_0x84f23a('0x1f')](loggerCatch('[moveContactManagedDialer]\x20'));},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1eb')]=function(_0x5f5360){const _0x4a6205=_0x593c09;return Promise[_0x4a6205('0xee')]()[_0x4a6205('0xd7')](cmHopperHistory[_0x4a6205('0x1eb')](_0x5f5360))[_0x4a6205('0x1f')](loggerCatch(_0x4a6205('0x6d')));},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1f6')]=function(_0x2e0fab){const _0x7a79f6=_0x593c09;!_[_0x7a79f6('0x1ce')](_0x2e0fab)&&_0x2e0fab!==null?typeof _0x2e0fab[_0x7a79f6('0x1ca')]!==_0x7a79f6('0x19f')&&(_0x2e0fab[_0x7a79f6('0x1ca')]>0x0?_0x2e0fab['originated']-=0x1:logger['error'](_0x7a79f6('0x1b4'))):logger[_0x7a79f6('0xb0')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');},Dialer[_0x593c09('0x1fe')][_0x593c09('0x17b')]=function(_0x532aed,_0x3dafc0){const _0x49cd7f=this;return function(_0x3cdd7d){const _0x2b06f4=a1056_0x6f60;_0x49cd7f[_0x2b06f4('0x1f6')](_0x3dafc0),logger['error'](_0x532aed,util[_0x2b06f4('0x116')](_0x3cdd7d,{'showHidden':![],'depth':null}));};},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1e7')]=function(_0xdca223,_0x1fe41c,_0x2fcb21){const _0x57a722=_0x593c09,_0x365974={'state':0x19,'statedesc':_0x57a722('0xf0')};this[_0x57a722('0x1f6')](_0x1fe41c),this['saveInDb'](_[_0x57a722('0x130')](_0x365974,_[_0x57a722('0x205')](_0x2fcb21,[_0x57a722('0x186'),'ListId',_0x57a722('0x154'),'VoiceQueueId',_0x57a722('0x1e0')])),'[emptyContact][createHistory]','[emptyContact]'),logger['error'](_0xdca223);},Dialer['prototype']['isSuccess']=function(_0x115d11){const _0xc14cf0=_0x593c09;return _0x115d11===_0xc14cf0('0x99');},Dialer[_0x593c09('0x1fe')]['isTrunkReachable']=function(_0x57346a){const _0x137eb0=_0x593c09;return!_['isUndefined'](_0x57346a)&&_0x57346a&&!_[_0x137eb0('0x1ce')](_0x57346a[_0x137eb0('0x10d')])&&!_['isUndefined'](_0x57346a['active'])&&_0x57346a['active']&&(this[_0x137eb0('0x109')][util['format'](_0x137eb0('0x194'),_0x57346a[_0x137eb0('0x10d')])][_0x137eb0('0xcb')]===_0x137eb0('0xad')||this[_0x137eb0('0x109')][util[_0x137eb0('0x1d4')](_0x137eb0('0x194'),_0x57346a[_0x137eb0('0x10d')])]['status']===_0x137eb0('0x192'));},Dialer[_0x593c09('0x1fe')]['saveInDb']=function(_0x311fa9,_0x6178c8,_0x32fe91){const _0x5b59d8=_0x593c09;this[_0x5b59d8('0x1eb')](_0x311fa9)[_0x5b59d8('0x1f')](loggerCatch(_0x6178c8)),this['moveContactManagedDialer'](_0x311fa9)['catch'](loggerCatch(_0x32fe91));},Dialer['prototype'][_0x593c09('0x21')]=function(_0x1ca06f){const _0x59ad7d=_0x593c09,_0x28ca4f=this['uniqueId'][_0x1ca06f[_0x59ad7d('0x165')]];let _0x11d16d;if(!_[_0x59ad7d('0xe9')](_0x1ca06f)&&!_[_0x59ad7d('0xe9')](_0x1ca06f[_0x59ad7d('0x1b8')])&&!_[_0x59ad7d('0xe9')](_0x1ca06f[_0x59ad7d('0x1b8')][_0x59ad7d('0x9c')])&&_0x1ca06f['exten']===_0x59ad7d('0x141')&&_0x28ca4f){_0x28ca4f[_0x59ad7d('0x9')]!==_0x59ad7d('0x132')&&this[_0x59ad7d('0x83')][_0x28ca4f[_0x59ad7d('0x117')]][_0x59ad7d('0x20e')]&&_0x1ca06f['value']===_0x59ad7d('0x190')&&(delete this[_0x59ad7d('0xcc')][_0x1ca06f[_0x59ad7d('0x165')]],this['updateOriginated'](this[_0x59ad7d('0x83')][_0x28ca4f[_0x59ad7d('0x117')]]),this[_0x59ad7d('0x83')][_0x28ca4f['queue']][_0x59ad7d('0x3f')]+=0x1,this[_0x59ad7d('0x83')][_0x28ca4f['queue']]['outboundAnswerAgiCallsDay']+=0x1,_0x11d16d=new Hangup(_0x28ca4f,_0x1ca06f),_0x11d16d[_0x59ad7d('0x1d8')]=0x12,_0x11d16d[_0x59ad7d('0x1f2')]=_0x59ad7d('0x133'),_0x11d16d[_0x59ad7d('0x3e')]=_0x59ad7d('0x198'),this[_0x59ad7d('0x86')](_0x11d16d,_0x59ad7d('0x153'),_0x59ad7d('0x11')));if(_0x28ca4f['type']!==_0x59ad7d('0x132')&&this[_0x59ad7d('0x83')][_0x28ca4f[_0x59ad7d('0x117')]][_0x59ad7d('0x20e')]&&_0x1ca06f['value']==='MACHINE'){const _0x1a8a23=this;return new Promise(function(_0x5e5707,_0x1c026c){const _0x2660e0=_0x59ad7d;delete _0x1a8a23[_0x2660e0('0xcc')][_0x1ca06f['uniqueid']],_0x1a8a23[_0x2660e0('0x1f6')](_0x1a8a23[_0x2660e0('0x83')][_0x28ca4f[_0x2660e0('0x117')]]),_0x1a8a23['voiceQueues'][_0x28ca4f[_0x2660e0('0x117')]]['outboundAnswerCallsDay']+=0x1,_0x1a8a23[_0x2660e0('0x83')][_0x28ca4f[_0x2660e0('0x117')]][_0x2660e0('0x13a')]+=0x1;const _0x2c5de4=_0x1a8a23['voiceQueues'][_0x28ca4f['queue']],_0x1a3214=new Hangup(_0x28ca4f,_0x1ca06f);_0x1a3214['state']=0x13,_0x1a3214['statedesc']=_0x2660e0('0x155'),_0x1a3214[_0x2660e0('0x3e')]=_0x2660e0('0x198'),_0x1a3214['countmachineretry']+=0x1,_0x1a3214[_0x2660e0('0x17a')]+=0x1,_0x1a3214['amd']=!![],_0x1a8a23[_0x2660e0('0x1eb')](_0x1a3214)[_0x2660e0('0x1f')](loggerCatch('[syncAgentComplete][createHistory][0]')),_0x1a3214[_0x2660e0('0x125')]+_0x1a3214[_0x2660e0('0x3a')]+_0x1a3214[_0x2660e0('0x1c7')]+_0x1a3214[_0x2660e0('0xf')]+_0x1a3214[_0x2660e0('0x2b')]+_0x1a3214[_0x2660e0('0x10')]+_0x1a3214[_0x2660e0('0x47')]+_0x1a3214['countagentrejectretry']>=_0x2c5de4[_0x2660e0('0x11d')]?_0x1a8a23['stateGlobal'](_0x1a3214,_0x5e5707,_0x1c026c,_0x2660e0('0xae')):_0x1a3214[_0x2660e0('0x47')]>=_0x2c5de4['dialMachineMaxRetry']?_0x1a8a23[_0x2660e0('0x156')](_0x1a3214,_0x5e5707,_0x1c026c,_0x2660e0('0xd8')):(_0x1a8a23[_0x2660e0('0x177')]({'active':![],'countmachineretry':_0x1a3214[_0x2660e0('0x47')],'scheduledat':moment()[_0x2660e0('0x1f4')](_0x2c5de4['dialMachineRetryFrequency'],_0x2660e0('0x1d2'))[_0x2660e0('0x1d4')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1a3214['ContactId'],'ListId':_0x1a3214[_0x2660e0('0x1b5')],'VoiceQueueId':_0x1a3214[_0x2660e0('0x71')]||undefined,'CampaignId':_0x1a3214[_0x2660e0('0x1e0')]||undefined})[_0x2660e0('0x1f')](loggerCatch(_0x2660e0('0xbc'))),_0x5e5707({'reschedule':0x1}));});}_0x28ca4f[_0x59ad7d('0x9')]==='ivr'&&this[_0x59ad7d('0x196')][_0x28ca4f[_0x59ad7d('0x117')]][_0x59ad7d('0x20e')]&&_0x1ca06f[_0x59ad7d('0x1fc')]===_0x59ad7d('0x190')&&(delete this[_0x59ad7d('0xcc')][_0x1ca06f['uniqueid']],this[_0x59ad7d('0x1f6')](this[_0x59ad7d('0x196')][_0x28ca4f[_0x59ad7d('0x117')]]),_0x11d16d=new Hangup(_0x28ca4f,_0x1ca06f),_0x11d16d[_0x59ad7d('0x1d8')]=0x12,_0x11d16d[_0x59ad7d('0x1f2')]=_0x59ad7d('0x133'),_0x11d16d[_0x59ad7d('0x3e')]=_0x59ad7d('0x198'),this['saveInDb'](_0x11d16d,_0x59ad7d('0x159'),_0x59ad7d('0x75')));if(_0x28ca4f[_0x59ad7d('0x9')]==='ivr'&&this[_0x59ad7d('0x196')][_0x28ca4f[_0x59ad7d('0x117')]][_0x59ad7d('0x20e')]&&_0x1ca06f[_0x59ad7d('0x1fc')]===_0x59ad7d('0x144')){const _0x563fc9=this;return new Promise(function(_0x331a71,_0xa5f559){const _0x3a1bcd=_0x59ad7d;delete _0x563fc9[_0x3a1bcd('0xcc')][_0x1ca06f[_0x3a1bcd('0x165')]],_0x563fc9[_0x3a1bcd('0x1f6')](_0x563fc9[_0x3a1bcd('0x196')][_0x28ca4f[_0x3a1bcd('0x117')]]),_0x563fc9[_0x3a1bcd('0x196')][_0x28ca4f[_0x3a1bcd('0x117')]]['outboundAnswerCallsDay']+=0x1,_0x563fc9[_0x3a1bcd('0x196')][_0x28ca4f[_0x3a1bcd('0x117')]]['outboundAnswerAgiCallsDay']+=0x1;const _0x3ba7d1=_0x563fc9[_0x3a1bcd('0x196')][_0x28ca4f[_0x3a1bcd('0x117')]],_0x1e43cf=new Hangup(_0x28ca4f,_0x1ca06f);_0x1e43cf[_0x3a1bcd('0x1d8')]=0x13,_0x1e43cf[_0x3a1bcd('0x1f2')]=_0x3a1bcd('0x155'),_0x1e43cf[_0x3a1bcd('0x3e')]=_0x3a1bcd('0x198'),_0x1e43cf['countmachineretry']+=0x1,_0x1e43cf[_0x3a1bcd('0x17a')]+=0x1,_0x1e43cf[_0x3a1bcd('0x59')]=!![],_0x563fc9[_0x3a1bcd('0x1eb')](_0x1e43cf)[_0x3a1bcd('0x1f')](loggerCatch(_0x3a1bcd('0x57'))),_0x1e43cf['countbusyretry']+_0x1e43cf['countcongestionretry']+_0x1e43cf['countnoanswerretry']+_0x1e43cf[_0x3a1bcd('0xf')]+_0x1e43cf[_0x3a1bcd('0x2b')]+_0x1e43cf[_0x3a1bcd('0x10')]+_0x1e43cf[_0x3a1bcd('0x47')]+_0x1e43cf[_0x3a1bcd('0x1d9')]>=_0x3ba7d1[_0x3a1bcd('0x11d')]?_0x563fc9[_0x3a1bcd('0x1cb')](_0x1e43cf,_0x331a71,_0xa5f559,'reason19\x20machine....'):_0x1e43cf[_0x3a1bcd('0x47')]>=_0x3ba7d1['dialMachineMaxRetry']?_0x563fc9[_0x3a1bcd('0x156')](_0x1e43cf,_0x331a71,_0xa5f559,_0x3a1bcd('0xd8')):(_0x563fc9[_0x3a1bcd('0x177')]({'active':![],'countmachineretry':_0x1e43cf['countmachineretry'],'scheduledat':moment()['add'](_0x3ba7d1[_0x3a1bcd('0x1cf')],_0x3a1bcd('0x1d2'))[_0x3a1bcd('0x1d4')](_0x3a1bcd('0x24')),'ContactId':_0x1e43cf[_0x3a1bcd('0x186')],'ListId':_0x1e43cf[_0x3a1bcd('0x1b5')],'VoiceQueueId':_0x1e43cf['VoiceQueueId']||undefined,'CampaignId':_0x1e43cf[_0x3a1bcd('0x1e0')]||undefined})[_0x3a1bcd('0x1f')](loggerCatch(_0x3a1bcd('0xbc'))),_0x331a71({'reschedule':0x1}));});}}},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1db')]=function(_0x5247c5){const _0x4b8169=_0x593c09,_0x2f20a6=this[_0x4b8169('0xcc')][_0x5247c5['uniqueid']];let _0x1015e5;_0x2f20a6&&_0x2f20a6['type']==='ivr'&&(delete this[_0x4b8169('0xcc')][_0x5247c5[_0x4b8169('0x165')]],this[_0x4b8169('0x1f6')](this[_0x4b8169('0x196')][_0x2f20a6['queue']]),this['campaigns'][_0x2f20a6[_0x4b8169('0x117')]][_0x4b8169('0x5b')]+=0x1,_0x1015e5=new Hangup(_0x2f20a6,_0x5247c5),this[_0x4b8169('0x1eb')](_0x1015e5)[_0x4b8169('0x1f')](loggerCatch(_0x4b8169('0xaf'))),this['moveContactManagedDialer'](_0x1015e5)['catch'](loggerCatch('[syncHangupIvr]'))),_0x2f20a6&&_0x2f20a6[_0x4b8169('0x9')]!=='ivr'&&isNotNull(this[_0x4b8169('0x83')][_0x2f20a6['queue']]['dialQueueProject'])&&(delete this[_0x4b8169('0xcc')][_0x5247c5[_0x4b8169('0x165')]],this['updateOriginated'](this[_0x4b8169('0x83')][_0x2f20a6[_0x4b8169('0x117')]]),this[_0x4b8169('0x83')][_0x2f20a6[_0x4b8169('0x117')]][_0x4b8169('0x3f')]+=0x1,this[_0x4b8169('0x83')][_0x2f20a6[_0x4b8169('0x117')]][_0x4b8169('0x13a')]+=0x1,_0x1015e5=new Hangup(_0x2f20a6,_0x5247c5),_0x1015e5[_0x4b8169('0x1d8')]=0x10,_0x1015e5[_0x4b8169('0x1f2')]=_0x4b8169('0x12f'),_0x1015e5[_0x4b8169('0x3e')]=_0x4b8169('0x12d'),this[_0x4b8169('0x1eb')](_0x1015e5)[_0x4b8169('0x1f')](loggerCatch(_0x4b8169('0xaf'))),this[_0x4b8169('0x17c')](_0x1015e5)[_0x4b8169('0x1f')](loggerCatch(_0x4b8169('0x1e4')))),_0x2f20a6&&_0x2f20a6['type']!==_0x4b8169('0x132')&&!isNotNull(this['voiceQueues'][_0x2f20a6['queue']][_0x4b8169('0x1dd')])&&(delete this['uniqueId'][_0x5247c5[_0x4b8169('0x165')]],this[_0x4b8169('0x1f6')](this['voiceQueues'][_0x2f20a6[_0x4b8169('0x117')]]),this[_0x4b8169('0x83')][_0x2f20a6['queue']][_0x4b8169('0x1b')]+=0x1,_0x1015e5=new Hangup(_0x2f20a6,_0x5247c5),_0x1015e5[_0x4b8169('0x1d8')]=0xc,_0x1015e5[_0x4b8169('0x1f2')]=_0x5247c5[_0x4b8169('0x31')],_0x1015e5[_0x4b8169('0x3e')]='Unknow',this[_0x4b8169('0x1eb')](_0x1015e5)[_0x4b8169('0x1f')](loggerCatch(_0x4b8169('0xaf'))),this[_0x4b8169('0x17c')](_0x1015e5)['catch'](loggerCatch(_0x4b8169('0x1e4'))));},Dialer[_0x593c09('0x1fe')][_0x593c09('0xd5')]=function(_0x159727){const _0x38f158=_0x593c09,_0x4aed16=this['uniqueId'][_0x159727[_0x38f158('0x165')]];if(this[_0x38f158('0x83')][_0x159727[_0x38f158('0x117')]]){if(_0x4aed16&&_0x4aed16['type']!==_0x38f158('0x132')){delete this['uniqueId'][_0x159727['uniqueid']],this[_0x38f158('0x83')][_0x159727[_0x38f158('0x117')]][_0x38f158('0x3f')]+=0x1;const _0x296701=new AgentComplete(_0x4aed16,_0x159727);_0x159727[_0x38f158('0x63')]===_0x38f158('0x2f')&&(_0x296701['agiafterat']=this['voiceQueues'][_0x159727['queue']][_0x38f158('0x19e')]&&this[_0x38f158('0x83')][_0x159727[_0x38f158('0x117')]][_0x38f158('0x74')]?moment()[_0x38f158('0x1d4')]('YYYY-MM-DD\x20HH:mm:ss'):undefined),this[_0x38f158('0x1eb')](_0x296701)[_0x38f158('0x1f')](loggerCatch('[syncAgentComplete][createHistory]')),this[_0x38f158('0x17c')](_0x296701)[_0x38f158('0x1f')](loggerCatch('[syncAgentComplete]'));}}},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1de')]=function(_0x358ef3){const _0x403877=_0x593c09;this['voiceQueues'][_0x358ef3[_0x403877('0x117')]]&&(this['uniqueId'][_0x358ef3['uniqueid']]&&this[_0x403877('0xcc')][_0x358ef3[_0x403877('0x165')]][_0x403877('0x9')]!==_0x403877('0x132')&&(this[_0x403877('0x1f6')](this[_0x403877('0x83')][_0x358ef3[_0x403877('0x117')]]),this[_0x403877('0xcc')][_0x358ef3[_0x403877('0x165')]][_0x403877('0xa3')]=moment()[_0x403877('0x1d4')](_0x403877('0x24'))));},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1b2')]=function(_0x1ab7be){const _0x4dd1a9=_0x593c09;this[_0x4dd1a9('0x1eb')](_0x1ab7be)[_0x4dd1a9('0x1f')](loggerCatch(_0x4dd1a9('0x81'))),this[_0x4dd1a9('0x17c')](_0x1ab7be)['catch'](loggerCatch(_0x4dd1a9('0x1e1')));},Dialer['prototype'][_0x593c09('0x104')]=function(_0x338da6){const _0x32837b=_0x593c09,_0x32beb5=this['uniqueId'][_0x338da6['uniqueid']];if(this[_0x32837b('0x83')][_0x338da6[_0x32837b('0x117')]]){if(_0x32beb5&&_0x32beb5[_0x32837b('0x9')]!==_0x32837b('0x132')){delete this[_0x32837b('0xcc')][_0x338da6['uniqueid']],this[_0x32837b('0x1f6')](this[_0x32837b('0x83')][_0x338da6[_0x32837b('0x117')]]),_0x32beb5[_0x32837b('0x137')]=moment()[_0x32837b('0x1d4')](_0x32837b('0x24'));const _0x136c67=new QueueCallerAbandon(_0x32beb5,_0x338da6);if(getSeconds(_0x32beb5[_0x32837b('0x137')],_0x32beb5[_0x32837b('0x120')])>=_0x32beb5[_0x32837b('0x157')]){this[_0x32837b('0x83')][_0x338da6[_0x32837b('0x117')]][_0x32837b('0x1ec')]+=0x1,this[_0x32837b('0x83')][_0x338da6[_0x32837b('0x117')]][_0x32837b('0x169')]+=0x1,this[_0x32837b('0x83')][_0x338da6[_0x32837b('0x117')]][_0x32837b('0xf2')]+=0x1,_0x136c67['state']=0xa,_0x136c67['statedesc']=_0x32837b('0xce'),_0x136c67[_0x32837b('0x7d')]='TIMEOUT',_0x136c67[_0x32837b('0x13c')]=this[_0x32837b('0x83')][_0x338da6['queue']][_0x32837b('0x19e')]?moment()[_0x32837b('0x1d4')](_0x32837b('0x24')):undefined,_0x136c67[_0x32837b('0x2b')]+=0x1,_0x136c67[_0x32837b('0x17a')]+=0x1;if(_0x136c67[_0x32837b('0x2b')]>=this[_0x32837b('0x83')][_0x338da6[_0x32837b('0x117')]][_0x32837b('0x209')])this[_0x32837b('0x1b2')](_0x136c67);else{this[_0x32837b('0x177')]({'active':![],'countdropretry':_0x136c67['countdropretry'],'scheduledat':moment()[_0x32837b('0x1f4')](this['voiceQueues'][_0x338da6[_0x32837b('0x117')]][_0x32837b('0x49')],'minutes')[_0x32837b('0x1d4')](_0x32837b('0x24')),'ContactId':_0x32beb5['ContactId'],'ListId':_0x32beb5[_0x32837b('0x1b5')],'VoiceQueueId':_0x32beb5['VoiceQueueId']||undefined,'CampaignId':_0x32beb5[_0x32837b('0x1e0')]||undefined})[_0x32837b('0x1f')](loggerCatch('[rescheduleContact][Drop]'));const _0x2bbd39=new History(_0x136c67);_0x2bbd39[_0x32837b('0x1d8')]=0xa,_0x2bbd39[_0x32837b('0x1f2')]='Drop',_0x2bbd39[_0x32837b('0x12')]=moment()[_0x32837b('0x1d4')](_0x32837b('0x24')),_0x2bbd39[_0x32837b('0x1bb')]=_0x2bbd39[_0x32837b('0x12')],_0x2bbd39[_0x32837b('0xe2')]=_0x136c67['calleridname'],_0x2bbd39[_0x32837b('0x20f')]=_0x136c67[_0x32837b('0x20f')],this['createHistory'](_0x2bbd39)[_0x32837b('0x1f')](loggerCatch(_0x32837b('0x1fa')));}}else{this['voiceQueues'][_0x338da6[_0x32837b('0x117')]][_0x32837b('0x10a')]+=0x1,this[_0x32837b('0x83')][_0x338da6[_0x32837b('0x117')]][_0x32837b('0x16')]+=0x1,_0x136c67['state']=0xb,_0x136c67[_0x32837b('0x1f2')]='Abandoned',_0x136c67['dropreason']='CALLEREXIT',_0x136c67['countabandonedretry']+=0x1,_0x136c67['countglobal']+=0x1;if(_0x136c67['countabandonedretry']>=this[_0x32837b('0x83')][_0x338da6[_0x32837b('0x117')]][_0x32837b('0x88')])this['queueCallerAbandonCreateState'](_0x136c67);else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x136c67[_0x32837b('0x10')],'scheduledat':moment()[_0x32837b('0x1f4')](this[_0x32837b('0x83')][_0x338da6['queue']][_0x32837b('0x6')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x32beb5[_0x32837b('0x186')],'ListId':_0x32beb5['ListId'],'VoiceQueueId':_0x32beb5[_0x32837b('0x71')]||undefined,'CampaignId':_0x32beb5[_0x32837b('0x1e0')]||undefined})[_0x32837b('0x1f')](loggerCatch(_0x32837b('0x1b6')));const _0x5cde42=new History(_0x136c67);_0x5cde42[_0x32837b('0x1d8')]=0xb,_0x5cde42[_0x32837b('0x1f2')]=_0x32837b('0x22'),_0x5cde42[_0x32837b('0x12')]=moment()[_0x32837b('0x1d4')](_0x32837b('0x24')),_0x5cde42['endtime']=_0x5cde42[_0x32837b('0x12')],_0x5cde42['calleridname']=_0x136c67['calleridname'],_0x5cde42[_0x32837b('0x20f')]=_0x136c67['calleridnum'],this['createHistory'](_0x5cde42)[_0x32837b('0x1f')](loggerCatch(_0x32837b('0xd4')));}}}}},Dialer['prototype'][_0x593c09('0x1b0')]=function(_0x11bf5d){const _0x3e6d3e=_0x593c09;this[_0x3e6d3e('0x7b')][_0x11bf5d[_0x3e6d3e('0x165')]]&&(this['actions'][_0x11bf5d[_0x3e6d3e('0x165')]][_0x3e6d3e('0x126')]=_0x11bf5d[_0x3e6d3e('0x126')]),this[_0x3e6d3e('0xcc')][_0x11bf5d[_0x3e6d3e('0x165')]]&&(this[_0x3e6d3e('0xcc')][_0x11bf5d[_0x3e6d3e('0x165')]]['channel']=_0x11bf5d[_0x3e6d3e('0x126')]);},Dialer['prototype'][_0x593c09('0x55')]=function(_0x7648d8){const _0x46b4de=_0x593c09;if(strategy[this['voiceQueues'][this[_0x46b4de('0x7b')][_0x7648d8['actionid']]['queue']][_0x46b4de('0x1c2')]]==='roundrobin')this[_0x46b4de('0x7b')][_0x7648d8['actionid']]&&_[_0x46b4de('0xe9')](this[_0x46b4de('0x7b')][_0x7648d8['actionid']][_0x46b4de('0xfb')])&&_0x7648d8[_0x46b4de('0xcb')]==='1'&&_0x7648d8[_0x46b4de('0x15b')]==='0'&&(this[_0x46b4de('0x12b')][_0x7648d8[_0x46b4de('0xf5')]]&&(!this['agents'][_0x7648d8['stateinterface']][_0x46b4de('0xfb')]&&(this[_0x46b4de('0x12b')][_0x7648d8[_0x46b4de('0xf5')]][_0x46b4de('0xfb')]=!![],this[_0x46b4de('0x7b')][_0x7648d8[_0x46b4de('0x4b')]][_0x46b4de('0xfb')]=!![],this['actions'][_0x7648d8[_0x46b4de('0x4b')]][_0x46b4de('0xf5')]=_0x7648d8[_0x46b4de('0xf5')])));else(strategy[this[_0x46b4de('0x83')][this['actions'][_0x7648d8[_0x46b4de('0x4b')]][_0x46b4de('0x117')]][_0x46b4de('0x1c2')]]||_0x46b4de('0x111'))==='rrmemory'&&(this[_0x46b4de('0x7b')][_0x7648d8[_0x46b4de('0x4b')]]&&(this[_0x46b4de('0x12b')][_0x7648d8[_0x46b4de('0xf5')]]&&(this[_0x46b4de('0x7b')][_0x7648d8[_0x46b4de('0x4b')]][_0x46b4de('0xf5')]=_0x7648d8[_0x46b4de('0xf5')],_[_0x46b4de('0xe9')](this[_0x46b4de('0x178')][this['actions'][_0x7648d8['actionid']][_0x46b4de('0x117')]])&&(this[_0x46b4de('0x178')][this['actions'][_0x7648d8[_0x46b4de('0x4b')]]['queue']]=[]),this['queueBooked'][this['actions'][_0x7648d8['actionid']][_0x46b4de('0x117')]]['push'](_[_0x46b4de('0x130')](_[_0x46b4de('0x205')](this[_0x46b4de('0x7b')][_0x7648d8[_0x46b4de('0x4b')]],['idHopper',_0x46b4de('0xf5')]),{'status':_0x7648d8[_0x46b4de('0xcb')],'paused':_0x7648d8[_0x46b4de('0x15b')]})))));};function unlockQueueStatus(_0x4f3147,_0x56de78){setTimeout(function(){const _0x29ec10=a1056_0x6f60;_['isUndefined'](_0x4f3147[_0x29ec10('0x14')])&&loggerBooked[_0x29ec10('0xb0')](_0x29ec10('0x3c'),_0x56de78),_0x4f3147[_0x29ec10('0x14')]=!![],loggerBooked[_0x29ec10('0x114')](_0x29ec10('0x108'),_0x56de78,JSON[_0x29ec10('0x18c')](_['pick'](_0x4f3147,[_0x29ec10('0x10d'),_0x29ec10('0x14')])));},0x1f3);}Dialer[_0x593c09('0x1fe')][_0x593c09('0xca')]=function(_0x378f7e){const _0x3dbc95=_0x593c09,_0x571761=this,_0x4d2b1d=_0x571761[_0x3dbc95('0x83')][_0x571761[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]];if(strategy[this[_0x3dbc95('0x83')][this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]]['strategy']]===_0x3dbc95('0xbe'))this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]]&&this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0xf5')]?this[_0x3dbc95('0x95')][_0x3dbc95('0xdf')](this[_0x3dbc95('0x7b')][_0x378f7e['actionid']][_0x3dbc95('0xcd')],this['actions'][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0xf5')])[_0x3dbc95('0x1f')](function(_0x1d0a4c){const _0x5dbaee=_0x3dbc95;logger['error'](_0x5dbaee('0x90'),util[_0x5dbaee('0x116')](_0x1d0a4c,{'showHidden':![],'depth':null}));})['finally'](function(){const _0x343092=_0x3dbc95;_0x571761['updateOriginated'](_0x571761[_0x343092('0x83')][_0x571761['actions'][_0x378f7e[_0x343092('0x4b')]][_0x343092('0x117')]]),_0x571761[_0x343092('0x12b')][_0x571761[_0x343092('0x7b')][_0x378f7e[_0x343092('0x4b')]][_0x343092('0xf5')]][_0x343092('0xfb')]=![],delete _0x571761[_0x343092('0x7b')][_0x378f7e[_0x343092('0x4b')]],unlockQueueStatus(_0x4d2b1d);}):(this['updateOriginated'](this['voiceQueues'][this['actions'][_0x378f7e['actionid']][_0x3dbc95('0x117')]]),this[_0x3dbc95('0x177')]({'active':![],'ContactId':this[_0x3dbc95('0x7b')][_0x378f7e['actionid']][_0x3dbc95('0x186')],'ListId':this['actions'][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x1b5')],'VoiceQueueId':this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x71')]||undefined,'CampaignId':this['actions'][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x1e0')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]')),delete this[_0x3dbc95('0x7b')][_0x378f7e['actionid']],unlockQueueStatus(_0x4d2b1d));else{if((strategy[this[_0x3dbc95('0x83')][this['actions'][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]][_0x3dbc95('0x1c2')]]||_0x3dbc95('0x111'))==='rrmemory'){let _0x52bf2a;if(this[_0x3dbc95('0x7b')][_0x378f7e['actionid']]&&!_['isEmpty'](this[_0x3dbc95('0x178')][this[_0x3dbc95('0x7b')][_0x378f7e['actionid']][_0x3dbc95('0x117')]])){this[_0x3dbc95('0x14d')][_0x571761[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]]&&(this[_0x3dbc95('0x14d')][_0x571761[_0x3dbc95('0x7b')][_0x378f7e['actionid']][_0x3dbc95('0x117')]]=this[_0x3dbc95('0x14d')][this['actions'][_0x378f7e['actionid']][_0x3dbc95('0x117')]]?this[_0x3dbc95('0x14d')][this['actions'][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]]:this[_0x3dbc95('0x178')][this[_0x3dbc95('0x7b')][_0x378f7e['actionid']]['queue']]?this[_0x3dbc95('0x178')][this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]][_0x3dbc95('0xab')]||0x0:0x0);this[_0x3dbc95('0x178')][this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]][_0x3dbc95('0xab')]=this[_0x3dbc95('0x14d')][this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]];for(let _0x134095=0x0;_0x134095<this['queueBooked'][this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]][_0x3dbc95('0x128')];_0x134095+=0x1){_0x52bf2a=rr(this['queueBooked'][this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]]['queue']]),this['queueBookedRR'][_0x571761[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]]['queue']]=this[_0x3dbc95('0x178')][this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]]['queue']]['_rr'];if(_0x52bf2a[_0x3dbc95('0xcb')]==='1'&&_0x52bf2a[_0x3dbc95('0x15b')]==='0')break;}!_[_0x3dbc95('0xe9')](_0x52bf2a)&&(this[_0x3dbc95('0x12b')][_0x52bf2a[_0x3dbc95('0xf5')]][_0x3dbc95('0x67')]=_[_0x3dbc95('0x1ce')](this[_0x3dbc95('0x12b')][_0x52bf2a['stateinterface']][_0x3dbc95('0x67')])?!![]:this[_0x3dbc95('0x12b')][_0x52bf2a[_0x3dbc95('0xf5')]][_0x3dbc95('0x67')]),loggerBooked[_0x3dbc95('0x114')](_0x3dbc95('0x5a'),_0x378f7e[_0x3dbc95('0x4b')],_0x3dbc95('0x145'),JSON[_0x3dbc95('0x18c')](_[_0x3dbc95('0x205')](this[_0x3dbc95('0x12b')][_0x52bf2a[_0x3dbc95('0xf5')]],['name',_0x3dbc95('0x67')])),_0x3dbc95('0x1d'),JSON[_0x3dbc95('0x18c')](_0x52bf2a['idHopper'])),!_[_0x3dbc95('0xe9')](_0x52bf2a)&&_0x52bf2a[_0x3dbc95('0xcb')]==='1'&&_0x52bf2a['paused']==='0'&&this[_0x3dbc95('0x12b')][_0x52bf2a[_0x3dbc95('0xf5')]][_0x3dbc95('0x67')]?(this[_0x3dbc95('0x12b')][_0x52bf2a[_0x3dbc95('0xf5')]][_0x3dbc95('0x67')]=![],this['queueBooked'][_0x571761['actions'][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]]=[],this[_0x3dbc95('0x95')]['run'](_0x52bf2a[_0x3dbc95('0xcd')],_0x52bf2a[_0x3dbc95('0xf5')])[_0x3dbc95('0x1f')](function(_0x582d77){const _0x2a5052=_0x3dbc95;logger[_0x2a5052('0xb0')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x2a5052('0x116')](_0x582d77,{'showHidden':![],'depth':null}));})[_0x3dbc95('0xf8')](function(){const _0x255e41=_0x3dbc95;_0x571761[_0x255e41('0x1f6')](_0x571761[_0x255e41('0x83')][_0x571761[_0x255e41('0x7b')][_0x378f7e['actionid']][_0x255e41('0x117')]]),setTimeout(function(){const _0x60a8d0=_0x255e41;_0x571761[_0x60a8d0('0x12b')][_0x52bf2a[_0x60a8d0('0xf5')]][_0x60a8d0('0x67')]=!![],loggerBooked[_0x60a8d0('0x114')]('[booked][RR][finaly]',_0x378f7e['actionid'],_0x60a8d0('0x145'),JSON[_0x60a8d0('0x18c')](_['pick'](_0x571761[_0x60a8d0('0x12b')][_0x52bf2a[_0x60a8d0('0xf5')]],[_0x60a8d0('0x10d'),'unlockRR'])),_0x60a8d0('0x1d'),JSON[_0x60a8d0('0x18c')](_0x52bf2a[_0x60a8d0('0xcd')]));},0xc7),delete _0x571761['actions'][_0x378f7e[_0x255e41('0x4b')]],unlockQueueStatus(_0x4d2b1d,_0x378f7e['actionid']);})):(loggerBooked['info'](_0x3dbc95('0xbd')),this[_0x3dbc95('0x1f6')](this[_0x3dbc95('0x83')][this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]]['queue']]),this[_0x3dbc95('0x177')]({'active':![],'ContactId':this[_0x3dbc95('0x7b')][_0x378f7e['actionid']][_0x3dbc95('0x186')],'ListId':this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x1b5')],'VoiceQueueId':this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x71')]||undefined,'CampaignId':this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x1e0')]||undefined})['catch'](loggerCatch(_0x3dbc95('0xc1'))),delete this['actions'][_0x378f7e['actionid']],unlockQueueStatus(_0x4d2b1d));}else loggerBooked[_0x3dbc95('0x114')](_0x3dbc95('0x174')),this[_0x3dbc95('0x1f6')](this[_0x3dbc95('0x83')][this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x117')]]),this[_0x3dbc95('0x177')]({'active':![],'ContactId':this[_0x3dbc95('0x7b')][_0x378f7e['actionid']][_0x3dbc95('0x186')],'ListId':this['actions'][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x1b5')],'VoiceQueueId':this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]]['CampaignId']||undefined})[_0x3dbc95('0x1f')](loggerCatch(_0x3dbc95('0x20d'))),delete this[_0x3dbc95('0x7b')][_0x378f7e['actionid']],unlockQueueStatus(_0x4d2b1d);}else loggerBooked[_0x3dbc95('0x114')](_0x3dbc95('0xed')),this['updateOriginated'](this[_0x3dbc95('0x83')][this[_0x3dbc95('0x7b')][_0x378f7e['actionid']]['queue']]),this[_0x3dbc95('0x177')]({'active':![],'ContactId':this[_0x3dbc95('0x7b')][_0x378f7e['actionid']][_0x3dbc95('0x186')],'ListId':this['actions'][_0x378f7e[_0x3dbc95('0x4b')]]['ListId'],'VoiceQueueId':this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]][_0x3dbc95('0x71')]||undefined,'CampaignId':this[_0x3dbc95('0x7b')][_0x378f7e['actionid']][_0x3dbc95('0x1e0')]||undefined})['catch'](loggerCatch(_0x3dbc95('0x1d6'))),delete this[_0x3dbc95('0x7b')][_0x378f7e[_0x3dbc95('0x4b')]],unlockQueueStatus(_0x4d2b1d);}},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1bd')]=function(){const _0x22e0b1=this;setInterval(function(){_0x22e0b1['syncCampaigns']();},0x3e8);},Dialer[_0x593c09('0x1fe')][_0x593c09('0x91')]=function(_0x197fe8){const _0x3e155e=this;return function(){const _0x11be87=a1056_0x6f60;if(!_0x3e155e[_0x11be87('0x148')](_0x197fe8[_0x11be87('0x65')])){if(!_0x3e155e[_0x11be87('0x148')](_0x197fe8[_0x11be87('0xc')])){_0x197fe8[_0x11be87('0x16b')]=_0x11be87('0x182');throw _0x197fe8[_0x11be87('0x10d')]+'\x20trunk\x20is\x20not\x20reachable';}}};},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1d5')]=function(_0x510242,_0x4a292b,_0x139ec7,_0xf61dc8){const _0x137314=this;return function(){const _0x24d43e=a1056_0x6f60,_0x42ab95=!![];return _0x137314[_0x24d43e('0x10f')](_0x510242,_0x4a292b,_0x139ec7,_0xf61dc8,_0x42ab95);};},Dialer[_0x593c09('0x1fe')]['checkIfTimeIntervals']=function(_0x3f375f,_0x172013,_0x4b1cc5,_0x415290){const _0x4a1edf=this;return function(){const _0xaae3ad=a1056_0x6f60,_0x5bdd8c=![];return _0x4a1edf[_0xaae3ad('0x10f')](_0x3f375f[_0xaae3ad('0x64')],_0x172013,_0x4b1cc5,_0x415290,_0x5bdd8c);};},Dialer[_0x593c09('0x1fe')][_0x593c09('0x10f')]=function(_0x132eae,_0x20e4e2,_0x57b828,_0x17d0b9,_0x271337){const _0x3dd141=[];return new Promise(function(_0xf50626,_0xe2d83a){const _0x405337=a1056_0x6f60;if(!isNotNull(_0x132eae))return _0x17d0b9[_0x405337('0x16b')]=_0x405337('0x14a'),_0xe2d83a(msgResponse(_0x405337('0x10f'),_0x405337('0x8e'),_0x57b828+_0x405337('0xd9')));if(_['isEmpty'](_0x132eae))return _0x17d0b9[_0x405337('0x16b')]='INTERVAL_IS_EMPTY',_0xe2d83a(msgResponse(_0x405337('0x10f'),'Failure',_0x57b828+'\x20Intervals\x20is\x20empty\x20'));if(_0x20e4e2&&_['isUndefined'](config[_0x405337('0x1aa')][_0x20e4e2]))return _0x17d0b9[_0x405337('0x16b')]=_0x405337('0x140'),_0xe2d83a(msgResponse('ifTime','Failure',_0x57b828+_0x405337('0x52')+_0x20e4e2));if(_[_0x405337('0x38')](_0x132eae))for(let _0x44ae1e=0x0;_0x44ae1e<_0x132eae['length'];_0x44ae1e+=0x1){_0x3dd141[_0x405337('0x1df')](ami[_0x405337('0x13e')]({'action':_0x405337('0x17f'),'command':util[_0x405337('0x1d4')](_0x405337('0x72'),_0x132eae[_0x44ae1e][_0x405337('0x1da')],!_[_0x405337('0x1ce')](config[_0x405337('0x1aa')][_0x20e4e2])?_0x20e4e2:'')})['then'](function(_0xe3510d){const _0x32cfdd=_0x405337;return _0xe3510d[_0x32cfdd('0x1af')][_0x32cfdd('0x1e')](_0x32cfdd('0x2'))>=0x0?!![]:![];})[_0x405337('0x1f')](myreject(_0xe2d83a)));}else _0x3dd141[_0x405337('0x1df')](ami[_0x405337('0x13e')]({'action':'command','command':util['format']('iftime\x20%s,%s',_0x132eae,!_[_0x405337('0x1ce')](config[_0x405337('0x1aa')][_0x20e4e2])?_0x20e4e2:'')})[_0x405337('0xd7')](function(_0x465ab7){const _0x6b16b1=_0x405337;return _0x465ab7[_0x6b16b1('0x1af')][_0x6b16b1('0x1e')](_0x6b16b1('0x2'))>=0x0?!![]:![];})['catch'](myreject(_0xe2d83a)));Promise['all'](_0x3dd141)[_0x405337('0xd7')](function(_0x26a4ff){const _0xf1ad54=_0x405337,_0x2d4f18=_[_0xf1ad54('0x1cd')](_0x26a4ff);return _0x2d4f18?_0xf50626(_0x2d4f18):(_0x17d0b9['message']=_0x271337?'GLOBAL_INTERVAL_IS_OVERTIME':_0xf1ad54('0x19a'),_0xe2d83a(msgResponse('[ifTime][promiseAll]','Failure',_0xf1ad54('0x6a')+_0x271337+'\x20'+_0x57b828+'\x20Interval\x20is\x20overtime:\x20'+util[_0xf1ad54('0x116')](_0x132eae,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x20e4e2)));})['catch'](function(_0x5144ee){const _0x257c86=_0x405337;return _0xe2d83a(msgResponse(_0x257c86('0x10f'),_0x257c86('0x8e'),JSON['stringify'](_0x5144ee)));});});},Dialer[_0x593c09('0x1fe')][_0x593c09('0x3d')]=function(_0x136794){const _0x440ee5=this;return function(){const _0x7986b2=a1056_0x6f60;switch(_0x136794[_0x7986b2('0x173')]){case _0x7986b2('0x89'):freeVariablesPredictive(_0x136794),_0x440ee5[_0x7986b2('0xc5')](_0x136794,0x1);break;case _0x7986b2('0xe'):freeVariablesPredictive(_0x136794),_0x440ee5[_0x7986b2('0xc5')](_0x136794,_0x136794['dialPowerLevel']);break;case'predictive':_0x440ee5['predictive'](_0x136794);break;case _0x7986b2('0x106'):freeVariablesPredictive(_0x136794),_0x440ee5['handlePower'](_0x136794,0x1);break;default:freeVariablesPredictive(_0x136794),logger[_0x7986b2('0xb0')](_0x7986b2('0x1c9'),_0x136794[_0x7986b2('0x10d')],_0x7986b2('0x1e8'));}};},Dialer[_0x593c09('0x1fe')][_0x593c09('0x168')]=function(_0x446925){const _0x38eb5b=this;return function(){_0x38eb5b['handleIvr'](_0x446925);};},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1ff')]=function(_0x30f3b5){const _0x4b2d17=_0x593c09,_0x458ad0=this;isNotPreview(_0x30f3b5[_0x4b2d17('0x173')])?isVoiceQueueOutbound(_0x30f3b5[_0x4b2d17('0x9')])&&isActive(_0x30f3b5['dialActive'])?(_0x30f3b5[_0x4b2d17('0x85')]=!![],Promise[_0x4b2d17('0xee')]()[_0x4b2d17('0xd7')](checkIsLoggedIn(_0x30f3b5,_0x30f3b5['loggedIn']))[_0x4b2d17('0xd7')](checkIsActive(_0x30f3b5,_0x30f3b5['dialActive']))['then'](checkInterval(_0x30f3b5))[_0x4b2d17('0xd7')](_0x458ad0['checkIsTrunkReachable'](_0x30f3b5))['then'](_0x458ad0[_0x4b2d17('0x1d5')](_0x30f3b5[_0x4b2d17('0x1c')],_0x30f3b5['dialTimezone'],_0x30f3b5[_0x4b2d17('0x10d')],_0x30f3b5))[_0x4b2d17('0xd7')](_0x458ad0[_0x4b2d17('0x9a')](_0x30f3b5['Interval'],_0x30f3b5[_0x4b2d17('0x1f0')],_0x30f3b5[_0x4b2d17('0x10d')],_0x30f3b5))[_0x4b2d17('0xd7')](_0x458ad0[_0x4b2d17('0x3d')](_0x30f3b5))['catch'](loggerCatchQueueSummary(_0x4b2d17('0x1d1'),_0x30f3b5))):notSendMessagesQueue(_0x30f3b5):freeVariablesPredictive(_0x30f3b5);},Dialer[_0x593c09('0x1fe')]['syncCampaigns']=function(){const _0x5e162e=_0x593c09,_0x36b84c=this;let _0xd90646;for(const _0x2bac24 in this[_0x5e162e('0x196')]){typeof this['campaigns'][_0x2bac24]!=='undefined'&&(_0xd90646=this['campaigns'][_0x2bac24],isCampaignIvr(_0xd90646[_0x5e162e('0x9')])&&isActive(_0xd90646[_0x5e162e('0x118')])?(_0xd90646[_0x5e162e('0x85')]=!![],Promise[_0x5e162e('0xee')]()[_0x5e162e('0xd7')](checkIsActive(_0xd90646,_0xd90646['active']))['then'](checkInterval(_0xd90646))[_0x5e162e('0xd7')](_0x36b84c[_0x5e162e('0x91')](_0xd90646))[_0x5e162e('0xd7')](_0x36b84c['checkIfTime'](_0xd90646[_0x5e162e('0x1c')],_0xd90646['dialTimezone'],_0xd90646[_0x5e162e('0x10d')],_0xd90646))[_0x5e162e('0xd7')](_0x36b84c[_0x5e162e('0x9a')](_0xd90646[_0x5e162e('0x1f7')],_0xd90646[_0x5e162e('0x1f0')],_0xd90646[_0x5e162e('0x10d')],_0xd90646))['then'](_0x36b84c[_0x5e162e('0x168')](_0xd90646))[_0x5e162e('0x1f')](loggerCatchQueueSummary('[syncCampaigns]',_0xd90646))):notSendMessagesCampaign(_0xd90646));}};function getCallerIdRandom(_0x15da94,_0xefbc37){const _0x49af43=_0x593c09;_0xefbc37<=0x0&&(_0xefbc37=0x1);const _0x1ec024=new RegExp('\x5cw{0,'+_0xefbc37+'}$'),_0x1720c0=Math[_0x49af43('0x18d')](0xa,_0xefbc37-0x1),_0x4f3fe7=Math['pow'](0xa,_0xefbc37)-0x1;return util['format']('%s',_[_0x49af43('0xb4')](_0x15da94,_0x1ec024,_['random'](_0x1720c0,_0x4f3fe7)));}function extractCalleridName(_0x54efe5){const _0x4af967=_0x54efe5['match'](/"(.*?)"/);return _0x4af967?_0x4af967[0x1]:_0x54efe5;}function extractCalleridNumber(_0x24d81d){const _0xfbb6a4=_0x24d81d['match'](/<(.*?)>/);return _0xfbb6a4?_0xfbb6a4[0x1]:_0x24d81d;}Dialer['prototype']['actionOriginate']=function(_0x56a923,_0x1df0e){const _0x37a785=_0x593c09,_0x1294f0=getConfigService(),_0x458c6e=this,_0x161939=uuid['v4']();return this[_0x37a785('0x7b')][_0x161939]=new Action(_0x56a923,_0x1df0e,_0x161939),new Promise(function(_0x10010c,_0x16a057){const _0x12b711=_0x37a785;if(_[_0x12b711('0x1ce')](_0x56a923)&&_0x12b711('0x7f')!==typeof _0x56a923)return _0x16a057(msgResponse(_0x12b711('0x113'),'Failure',_0x12b711('0x1a3')));if(_['isUndefined'](_0x1df0e[_0x12b711('0xc8')][_0x12b711('0x1e2')])||_0x1df0e[_0x12b711('0xc8')][_0x12b711('0x1e2')]===null)return _0x16a057(msgResponse(_0x12b711('0x113'),_0x12b711('0x8e'),'contact\x20is\x20undefine'));const _0x430e94={'XMD-CALLERID':_0x458c6e['actions'][_0x161939][_0x12b711('0x1c4')](),'XMD-AGI':_0x56a923[_0x12b711('0x1dd')]?util[_0x12b711('0x1d4')](_0x12b711('0x135'),_0x1294f0[_0x12b711('0x136')],_0x56a923[_0x12b711('0x1dd')]):_0x12b711('0x119'),'XMD-AGIAFTER':_0x56a923['dialQueueProject2']?util[_0x12b711('0x1d4')](_0x12b711('0x135'),_0x1294f0[_0x12b711('0x136')],_0x56a923[_0x12b711('0x19e')]):'NONE','XMD-QUEUE':_0x56a923[_0x12b711('0x9')]==='outbound'?util[_0x12b711('0x1d4')](_0x12b711('0x206'),_0x56a923[_0x12b711('0x10d')],_0x56a923[_0x12b711('0x25')]||'',_0x56a923[_0x12b711('0x74')]?'c':'',_0x56a923[_0x12b711('0x157')]||0x3):_0x12b711('0x119'),'XMD-CONTACTID':_0x1df0e[_0x12b711('0x186')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x458c6e[_0x12b711('0x7b')][_0x161939]['getCaller'](),'XMD-AMD':_0x56a923['dialAMDActive']?_0x12b711('0x15e'):_0x12b711('0x119'),'XMD-DESTINATION':_0x12b711('0x141')};_0x56a923['dialAMDActive']&&(_0x430e94[_0x12b711('0x1fd')]=_0x56a923[_0x12b711('0x1bc')]||0x9c4,_0x430e94[_0x12b711('0x48')]=_0x56a923[_0x12b711('0x121')]||0x5dc,_0x430e94[_0x12b711('0x61')]=_0x56a923[_0x12b711('0x42')]||0x320,_0x430e94[_0x12b711('0xa0')]=_0x56a923[_0x12b711('0x1ae')]||0x1388,_0x430e94[_0x12b711('0x15f')]=_0x56a923['dialAMDMinWordLength']||0x64,_0x430e94[_0x12b711('0x197')]=_0x56a923[_0x12b711('0x105')]||0x32,_0x430e94[_0x12b711('0x1ef')]=_0x56a923['dialAMDMaximumNumberOfWords']||0x3,_0x430e94['XMD-AMDSILENCETHRESHOLD']=_0x56a923[_0x12b711('0xb3')]||0x100,_0x430e94[_0x12b711('0x1d0')]=_0x56a923['dialAMDMaximumWordLength']||0x1388);_0x56a923['type']==='outbound'?_0x430e94['XMD-VOICEQUEUEID']=_0x1df0e[_0x12b711('0x71')]:_0x430e94[_0x12b711('0x5e')]=_0x1df0e['CampaignId'];for(const _0x2cfae0 in _0x1df0e['Contact']){typeof _0x1df0e[_0x12b711('0xc8')][_0x2cfae0]!==_0x12b711('0x19f')&&(isNotNull(_0x1df0e[_0x12b711('0xc8')][_0x2cfae0])&&_0x2cfae0!=='id'&&_0x2cfae0!==_0x12b711('0xb2')&&_0x2cfae0!=='createdAt'&&_0x2cfae0!==_0x12b711('0x78')&&(_0x430e94[util[_0x12b711('0x1d4')]('%s%s',_0x12b711('0x10c'),_['toUpper'](_0x2cfae0))]=_0x1df0e[_0x12b711('0xc8')][_0x2cfae0]));}const _0x54591b=_0x458c6e[_0x12b711('0x148')](_0x56a923[_0x12b711('0x65')])?getCallerId(_0x56a923[_0x12b711('0x65')]['callerid'],_0x56a923[_0x12b711('0x170')],_0x56a923['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x56a923[_0x12b711('0x13f')],_0x56a923[_0x12b711('0x13d')]):_0x56a923[_0x12b711('0x13f')]):getCallerId(_[_0x12b711('0xe9')](_0x56a923['TrunkBackup'])?_0x56a923[_0x12b711('0x65')][_0x12b711('0x17d')]:_0x56a923[_0x12b711('0xc')][_0x12b711('0x17d')],_0x56a923[_0x12b711('0x170')],_0x56a923[_0x12b711('0x13d')]>0x0?getCallerIdRandom(_0x56a923[_0x12b711('0x13f')],_0x56a923[_0x12b711('0x13d')]):_0x56a923[_0x12b711('0x13f')]);if(_0x54591b){const _0x3caccd=extractCalleridName(_0x54591b);_0x430e94['XMD-ORIGINATECALLERIDNAME']=_0x3caccd,_0x458c6e['actions'][_0x161939]['originatecalleridname']=_0x3caccd;const _0x111c00=extractCalleridNumber(_0x54591b);_0x430e94[_0x12b711('0xb')]==_0x111c00,_0x458c6e['actions'][_0x161939][_0x12b711('0x11c')]=_0x111c00;}return ami[_0x12b711('0x13e')]({'actionid':_0x161939,'action':_0x12b711('0x113'),'channel':_0x458c6e[_0x12b711('0x148')](_0x56a923[_0x12b711('0x65')])?util[_0x12b711('0x1d4')]('SIP/%s/%s%s',_0x56a923['Trunk']['name'],isNotNull(_0x56a923[_0x12b711('0x1ba')])?_0x56a923[_0x12b711('0x1ba')]['trim']()||'':'',_0x56a923['dialCutDigit']>0x0?_0x1df0e[_0x12b711('0xc8')][_0x12b711('0x1e2')][_0x12b711('0x39')](_0x56a923[_0x12b711('0x53')]):_0x1df0e['Contact'][_0x12b711('0x1e2')]):util[_0x12b711('0x1d4')](_0x12b711('0xfc'),_[_0x12b711('0xe9')](_0x56a923[_0x12b711('0xc')])?_0x56a923[_0x12b711('0x65')][_0x12b711('0x10d')]:_0x56a923['TrunkBackup'][_0x12b711('0x10d')],isNotNull(_0x56a923[_0x12b711('0x1ba')])?_0x56a923[_0x12b711('0x1ba')][_0x12b711('0x4c')]()||'':'',_0x56a923[_0x12b711('0x53')]>0x0?_0x1df0e[_0x12b711('0xc8')][_0x12b711('0x1e2')]['substring'](_0x56a923[_0x12b711('0x53')]):_0x1df0e['Contact'][_0x12b711('0x1e2')]),'callerid':_0x54591b,'Exten':_0x12b711('0x141'),'Context':_0x12b711('0x15c'),'Priority':'1','variable':_0x430e94,'timeout':(_0x56a923[_0x12b711('0x15a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x161939})[_0x12b711('0xd7')](function(_0x5f6404){return _0x10010c(_0x5f6404);})['catch'](function(_0x42cb66){const _0x52b08e=_0x12b711;_0x56a923[_0x52b08e('0xa5')]+=0x1;const _0x5461a8=new History(_0x458c6e['actions'][_0x161939]);logger[_0x52b08e('0xb0')](util[_0x52b08e('0x1d4')](_0x52b08e('0x76'),JSON[_0x52b08e('0x18c')](_0x42cb66))),_0x5461a8[_0x52b08e('0x1d8')]=0xe,_0x5461a8[_0x52b08e('0x1f2')]=_0x52b08e('0x6f'),_0x5461a8[_0x52b08e('0x12')]=moment()[_0x52b08e('0x1d4')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5461a8[_0x52b08e('0x1bb')]=_0x5461a8[_0x52b08e('0x12')],_0x458c6e[_0x52b08e('0x1eb')](_0x5461a8)[_0x52b08e('0x1f')](loggerCatch('[originate][error]')),_0x458c6e[_0x52b08e('0x17c')](_0x5461a8)['catch'](loggerCatch(_0x52b08e('0x149')))[_0x52b08e('0xf8')](function(){const _0x5085b6=_0x52b08e;return delete _0x458c6e[_0x5085b6('0x7b')][_0x161939],_0x16a057(msgResponse(_0x5085b6('0x113'),_0x5085b6('0x1ab'),_0x5085b6('0xac')));});});});},Dialer[_0x593c09('0x1fe')]['syncOriginateResponse']=function(_0x3462e5){const _0x487b8a=_0x593c09,_0x5af5b0=this['actions'][_0x3462e5[_0x487b8a('0x4b')]];if(_0x5af5b0){delete this[_0x487b8a('0x7b')][_0x3462e5[_0x487b8a('0x4b')]],_0x5af5b0[_0x487b8a('0x120')]=moment()['format'](_0x487b8a('0x24'));const _0x5538cd=_0x5af5b0[_0x487b8a('0x9')]===_0x487b8a('0x132')?this['campaigns'][_0x5af5b0[_0x487b8a('0x117')]]:this[_0x487b8a('0x83')][_0x5af5b0[_0x487b8a('0x175')]()];if(!this[_0x487b8a('0x60')](_0x3462e5[_0x487b8a('0x183')]))return this[_0x487b8a('0x1f6')](_0x5538cd),this['callProgressDetecting'](_0x5af5b0,_0x5538cd,_0x3462e5)['then'](function(){})[_0x487b8a('0x1f')](loggerCatch(_0x487b8a('0x11b')));else this[_0x487b8a('0xcc')][_0x3462e5[_0x487b8a('0x165')]]=_0x5af5b0;}},Dialer[_0x593c09('0x1fe')][_0x593c09('0x176')]=function(_0x4857a8,_0x308ebd,_0x5f3d57){const _0x3c7ec5=_0x593c09,_0x75e6ad=new History(_0x308ebd);if(_0x75e6ad[_0x3c7ec5('0x125')]+_0x75e6ad[_0x3c7ec5('0x3a')]+_0x75e6ad['countnoanswerretry']+_0x75e6ad[_0x3c7ec5('0xf')]+_0x75e6ad[_0x3c7ec5('0x2b')]+_0x75e6ad[_0x3c7ec5('0x10')]+_0x75e6ad[_0x3c7ec5('0x47')]+_0x75e6ad[_0x3c7ec5('0x1d9')]>=_0x5f3d57[_0x3c7ec5('0x11d')]-0x1)return!![];switch(_0x4857a8){case 0x3:if(_0x75e6ad[_0x3c7ec5('0x1c7')]>=_0x5f3d57[_0x3c7ec5('0xbb')]-0x1)return!![];else this[_0x3c7ec5('0x177')]({'active':![],'countnoanswerretry':_0x75e6ad[_0x3c7ec5('0x1c7')]+=0x1,'scheduledat':moment()[_0x3c7ec5('0x1f4')](_0x5f3d57[_0x3c7ec5('0x7')],_0x3c7ec5('0x1d2'))[_0x3c7ec5('0x1d4')](_0x3c7ec5('0x24')),'ContactId':_0x75e6ad['ContactId'],'ListId':_0x75e6ad[_0x3c7ec5('0x1b5')],'VoiceQueueId':_0x75e6ad[_0x3c7ec5('0x71')]||undefined,'CampaignId':_0x75e6ad[_0x3c7ec5('0x1e0')]||undefined})[_0x3c7ec5('0x1f')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x75e6ad['countbusyretry']>=_0x5f3d57[_0x3c7ec5('0x127')]-0x1)return!![];else this[_0x3c7ec5('0x177')]({'active':![],'countbusyretry':_0x75e6ad['countbusyretry']+=0x1,'scheduledat':moment()[_0x3c7ec5('0x1f4')](_0x5f3d57[_0x3c7ec5('0xa8')],_0x3c7ec5('0x1d2'))[_0x3c7ec5('0x1d4')](_0x3c7ec5('0x24')),'ContactId':_0x75e6ad[_0x3c7ec5('0x186')],'ListId':_0x75e6ad[_0x3c7ec5('0x1b5')],'VoiceQueueId':_0x75e6ad[_0x3c7ec5('0x71')]||undefined,'CampaignId':_0x75e6ad[_0x3c7ec5('0x1e0')]||undefined})[_0x3c7ec5('0x1f')](loggerCatch(_0x3c7ec5('0xba')));break;case 0x8:if(_0x75e6ad[_0x3c7ec5('0x3a')]>=_0x5f3d57[_0x3c7ec5('0x14e')]-0x1)return!![];else this[_0x3c7ec5('0x177')]({'active':![],'countcongestionretry':_0x75e6ad[_0x3c7ec5('0x3a')]+=0x1,'scheduledat':moment()[_0x3c7ec5('0x1f4')](_0x5f3d57['dialCongestionRetryFrequency'],'minutes')[_0x3c7ec5('0x1d4')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x75e6ad[_0x3c7ec5('0x186')],'ListId':_0x75e6ad[_0x3c7ec5('0x1b5')],'VoiceQueueId':_0x75e6ad[_0x3c7ec5('0x71')]||undefined,'CampaignId':_0x75e6ad[_0x3c7ec5('0x1e0')]||undefined})['catch'](loggerCatch(_0x3c7ec5('0xf4')));break;case 0x0:if(_0x75e6ad[_0x3c7ec5('0xf')]>=_0x5f3d57[_0x3c7ec5('0x8c')]-0x1)return!![];else this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x75e6ad[_0x3c7ec5('0xf')]+=0x1,'scheduledat':moment()[_0x3c7ec5('0x1f4')](_0x5f3d57[_0x3c7ec5('0x14f')],_0x3c7ec5('0x1d2'))[_0x3c7ec5('0x1d4')](_0x3c7ec5('0x24')),'ContactId':_0x75e6ad['ContactId'],'ListId':_0x75e6ad[_0x3c7ec5('0x1b5')],'VoiceQueueId':_0x75e6ad['VoiceQueueId']||undefined,'CampaignId':_0x75e6ad['CampaignId']||undefined})[_0x3c7ec5('0x1f')](loggerCatch('[rescheduleContact][NoSuchNumber]'));break;case 0xa:if(_0x75e6ad[_0x3c7ec5('0x2b')]>=_0x5f3d57['dialDropMaxRetry']-0x1)return!![];else this['rescheduleContact']({'active':![],'countdropretry':_0x75e6ad[_0x3c7ec5('0x2b')]+=0x1,'scheduledat':moment()[_0x3c7ec5('0x1f4')](_0x5f3d57[_0x3c7ec5('0x49')],_0x3c7ec5('0x1d2'))['format'](_0x3c7ec5('0x24')),'ContactId':_0x75e6ad[_0x3c7ec5('0x186')],'ListId':_0x75e6ad['ListId'],'VoiceQueueId':_0x75e6ad['VoiceQueueId']||undefined,'CampaignId':_0x75e6ad[_0x3c7ec5('0x1e0')]||undefined})[_0x3c7ec5('0x1f')](loggerCatch(_0x3c7ec5('0xf9')));break;case 0xb:if(_0x75e6ad['countabandonedretry']>=_0x5f3d57[_0x3c7ec5('0x88')]-0x1)return!![];else this[_0x3c7ec5('0x177')]({'active':![],'countabandonedretry':_0x75e6ad[_0x3c7ec5('0x10')]+=0x1,'scheduledat':moment()[_0x3c7ec5('0x1f4')](_0x5f3d57[_0x3c7ec5('0x6')],_0x3c7ec5('0x1d2'))[_0x3c7ec5('0x1d4')](_0x3c7ec5('0x24')),'ContactId':_0x75e6ad[_0x3c7ec5('0x186')],'ListId':_0x75e6ad[_0x3c7ec5('0x1b5')],'VoiceQueueId':_0x75e6ad['VoiceQueueId']||undefined,'CampaignId':_0x75e6ad[_0x3c7ec5('0x1e0')]||undefined})[_0x3c7ec5('0x1f')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x75e6ad['countmachineretry']>=_0x5f3d57[_0x3c7ec5('0x187')]-0x1)return!![];else this[_0x3c7ec5('0x177')]({'active':![],'countmachineretry':_0x75e6ad[_0x3c7ec5('0x47')]+=0x1,'scheduledat':moment()['add'](_0x5f3d57['dialMachineRetryFrequency'],_0x3c7ec5('0x1d2'))[_0x3c7ec5('0x1d4')](_0x3c7ec5('0x24')),'ContactId':_0x75e6ad['ContactId'],'ListId':_0x75e6ad[_0x3c7ec5('0x1b5')],'VoiceQueueId':_0x75e6ad[_0x3c7ec5('0x71')]||undefined,'CampaignId':_0x75e6ad[_0x3c7ec5('0x1e0')]||undefined})[_0x3c7ec5('0x1f')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x75e6ad[_0x3c7ec5('0x1d9')]>=_0x5f3d57['dialAgentRejectMaxRetry']-0x1)return!![];else this[_0x3c7ec5('0x177')]({'active':![],'countagentrejectretry':_0x75e6ad[_0x3c7ec5('0x1d9')]+=0x1,'scheduledat':moment()[_0x3c7ec5('0x1f4')](_0x5f3d57[_0x3c7ec5('0xe8')],_0x3c7ec5('0x1d2'))[_0x3c7ec5('0x1d4')](_0x3c7ec5('0x24')),'ContactId':_0x75e6ad['ContactId'],'ListId':_0x75e6ad[_0x3c7ec5('0x1b5')],'VoiceQueueId':_0x75e6ad[_0x3c7ec5('0x71')]||undefined,'CampaignId':_0x75e6ad['CampaignId']||undefined})[_0x3c7ec5('0x1f')](loggerCatch(_0x3c7ec5('0x79')));break;default:return!![];}},Dialer['prototype'][_0x593c09('0x16a')]=function(_0x40c86e,_0x3e6a8b,_0x3243ee){const _0x35894d=this,_0x1a1a6a=new History(_0x40c86e);return new Promise(function(_0x5be47f,_0x112462){const _0x4ccb1b=a1056_0x6f60;if(_['isUndefined'](_0x3e6a8b)&&_0x4ccb1b('0x7f')!==typeof _0x3e6a8b)return _0x112462(msgResponse(_0x4ccb1b('0x11f'),'Failure',_0x4ccb1b('0x16c')));if(_[_0x4ccb1b('0x1ce')](_0x3243ee)&&_0x4ccb1b('0x7f')!==typeof _0x3243ee)return _0x112462(msgResponse(_0x4ccb1b('0x11f'),'Failure',_0x4ccb1b('0x129')));switch(_0x3243ee[_0x4ccb1b('0x63')]){case'0':_0x3e6a8b[_0x4ccb1b('0x18e')]+=0x1,_0x1a1a6a[_0x4ccb1b('0x1d8')]=0x0,_0x1a1a6a['statedesc']=_0x4ccb1b('0x94'),_0x1a1a6a[_0x4ccb1b('0xf')]+=0x1,_0x1a1a6a[_0x4ccb1b('0x17a')]+=0x1,ami[_0x4ccb1b('0x115')]('custom:agentnosuchnumber',ut[_0x4ccb1b('0x35')](_0x40c86e,_0x4ccb1b('0x1'))),_0x35894d[_0x4ccb1b('0x1eb')](_0x1a1a6a)[_0x4ccb1b('0x1f')](loggerCatch(_0x4ccb1b('0x57')));_0x35894d[_0x4ccb1b('0x176')](0x0,_0x40c86e,_0x3e6a8b)&&(_0x1a1a6a[_0x4ccb1b('0xf')]>=_0x3e6a8b[_0x4ccb1b('0x8c')]?_0x35894d['createStateFinal'](_0x1a1a6a,_0x5be47f,_0x112462,_0x4ccb1b('0x18')):_0x35894d['stateGlobal'](_0x1a1a6a,_0x5be47f,_0x112462,_0x4ccb1b('0x18')));break;case'3':_0x3e6a8b[_0x4ccb1b('0x19b')]+=0x1,_0x1a1a6a[_0x4ccb1b('0x1d8')]=0x3,_0x1a1a6a[_0x4ccb1b('0x1f2')]=_0x4ccb1b('0x18f'),_0x1a1a6a[_0x4ccb1b('0x1c7')]+=0x1,_0x1a1a6a['countglobal']+=0x1,ami[_0x4ccb1b('0x115')](_0x4ccb1b('0xb8'),ut[_0x4ccb1b('0x35')](_0x40c86e,_0x4ccb1b('0x50'))),_0x35894d[_0x4ccb1b('0x1eb')](_0x1a1a6a)[_0x4ccb1b('0x1f')](loggerCatch(_0x4ccb1b('0xa9')));_0x35894d[_0x4ccb1b('0x176')](0x3,_0x40c86e,_0x3e6a8b)&&(_0x1a1a6a[_0x4ccb1b('0x1c7')]>=_0x3e6a8b['dialNoAnswerMaxRetry']?_0x35894d[_0x4ccb1b('0x156')](_0x1a1a6a,_0x5be47f,_0x112462,_0x4ccb1b('0x1ac')):_0x35894d['stateGlobal'](_0x1a1a6a,_0x5be47f,_0x112462,_0x4ccb1b('0x1ac')));break;case'5':_0x3e6a8b[_0x4ccb1b('0x1e9')]+=0x1,_0x1a1a6a[_0x4ccb1b('0x1d8')]=0x5,_0x1a1a6a[_0x4ccb1b('0x1f2')]=_0x4ccb1b('0x51'),_0x1a1a6a[_0x4ccb1b('0x125')]+=0x1,_0x1a1a6a[_0x4ccb1b('0x17a')]+=0x1,ami[_0x4ccb1b('0x115')](_0x4ccb1b('0x142'),ut[_0x4ccb1b('0x35')](_0x40c86e,_0x4ccb1b('0x2c'))),_0x35894d[_0x4ccb1b('0x1eb')](_0x1a1a6a)[_0x4ccb1b('0x1f')](loggerCatch(_0x4ccb1b('0x1c6')));_0x35894d['checkRetriveMax'](0x5,_0x40c86e,_0x3e6a8b)&&(_0x1a1a6a['countbusyretry']>=_0x3e6a8b[_0x4ccb1b('0x127')]?_0x35894d[_0x4ccb1b('0x156')](_0x1a1a6a,_0x5be47f,_0x112462,_0x4ccb1b('0x107')):_0x35894d[_0x4ccb1b('0x1cb')](_0x1a1a6a,_0x5be47f,_0x112462,_0x4ccb1b('0x107')));break;case'8':_0x3e6a8b[_0x4ccb1b('0x13b')]+=0x1,_0x1a1a6a[_0x4ccb1b('0x1d8')]=0x8,_0x1a1a6a[_0x4ccb1b('0x1f2')]=_0x4ccb1b('0x143'),_0x1a1a6a[_0x4ccb1b('0x3a')]+=0x1,_0x1a1a6a[_0x4ccb1b('0x17a')]+=0x1,ami[_0x4ccb1b('0x115')](_0x4ccb1b('0x15d'),ut[_0x4ccb1b('0x35')](_0x40c86e,_0x4ccb1b('0x44'))),_0x35894d[_0x4ccb1b('0x1eb')](_0x1a1a6a)['catch'](loggerCatch(_0x4ccb1b('0x20c')));_0x35894d['checkRetriveMax'](0x8,_0x40c86e,_0x3e6a8b)&&(_0x1a1a6a[_0x4ccb1b('0x3a')]>=_0x3e6a8b['dialCongestionMaxRetry']?_0x35894d[_0x4ccb1b('0x156')](_0x1a1a6a,_0x5be47f,_0x112462,_0x4ccb1b('0x4d')):_0x35894d[_0x4ccb1b('0x1cb')](_0x1a1a6a,_0x5be47f,_0x112462,'reason\x208\x20congestion'));break;case'11':_0x3e6a8b['outboundAbandonedCallsDay']+=0x1,_0x1a1a6a[_0x4ccb1b('0x1d8')]=0xb,_0x1a1a6a['statedesc']='Abandoned',_0x1a1a6a[_0x4ccb1b('0x10')]+=0x1,_0x1a1a6a[_0x4ccb1b('0x17a')]+=0x1,_0x35894d[_0x4ccb1b('0x1eb')](_0x1a1a6a)[_0x4ccb1b('0x1f')](loggerCatch(_0x4ccb1b('0xd4')));_0x35894d[_0x4ccb1b('0x176')](0xb,_0x40c86e,_0x3e6a8b)&&(_0x1a1a6a[_0x4ccb1b('0x10')]>=_0x3e6a8b['dialAbandonedMaxRetry']?_0x35894d[_0x4ccb1b('0x156')](_0x1a1a6a,_0x5be47f,_0x112462,'reason\x2011\x20abandoned'):_0x35894d[_0x4ccb1b('0x1cb')](_0x1a1a6a,_0x5be47f,_0x112462,'reason\x2011\x20abandoned'));break;case'20':_0x3e6a8b[_0x4ccb1b('0x131')]+=0x1,_0x1a1a6a[_0x4ccb1b('0x1d8')]=0x14,_0x1a1a6a[_0x4ccb1b('0x1f2')]=_0x4ccb1b('0x163'),_0x1a1a6a['countagentrejectretry']+=0x1,_0x1a1a6a[_0x4ccb1b('0x17a')]+=0x1,ami['emit'](_0x4ccb1b('0xa7'),ut[_0x4ccb1b('0x35')](_0x40c86e,_0x4ccb1b('0x1e3'))),_0x35894d[_0x4ccb1b('0x1eb')](_0x1a1a6a)[_0x4ccb1b('0x1f')](loggerCatch('[syncAgentComplete][createHistory][20]'));_0x35894d['checkRetriveMax'](0x14,_0x40c86e,_0x3e6a8b)&&(_0x1a1a6a[_0x4ccb1b('0x1d9')]>=_0x3e6a8b['dialAgentRejectMaxRetry']?_0x35894d[_0x4ccb1b('0x156')](_0x1a1a6a,_0x5be47f,_0x112462,_0x4ccb1b('0x6e')):_0x35894d['stateGlobal'](_0x1a1a6a,_0x5be47f,_0x112462,_0x4ccb1b('0x6e')));break;default:_0x3e6a8b['outboundUnknownCallsDay']+=0x1,_0x1a1a6a[_0x4ccb1b('0x1d8')]=0xc,_0x1a1a6a[_0x4ccb1b('0x1f2')]=_0x3243ee[_0x4ccb1b('0x63')],_0x35894d['createHistory'](_0x1a1a6a)[_0x4ccb1b('0x1f')](loggerCatch(_0x4ccb1b('0x134')));_0x35894d[_0x4ccb1b('0x176')](_0x3243ee[_0x4ccb1b('0x63')],_0x40c86e,_0x3e6a8b)&&(_0x1a1a6a[_0x4ccb1b('0x125')]+_0x1a1a6a['countcongestionretry']+_0x1a1a6a[_0x4ccb1b('0x1c7')]+_0x1a1a6a[_0x4ccb1b('0xf')]+_0x1a1a6a[_0x4ccb1b('0x2b')]+_0x1a1a6a[_0x4ccb1b('0x10')]+_0x1a1a6a['countmachineretry']+_0x1a1a6a['countagentrejectretry']>=_0x3e6a8b['dialGlobalMaxRetry']?_0x35894d[_0x4ccb1b('0x1cb')](_0x1a1a6a,_0x5be47f,_0x112462,_0x3243ee[_0x4ccb1b('0x63')]):_0x35894d[_0x4ccb1b('0x156')](_0x1a1a6a,_0x5be47f,_0x112462,_0x3243ee[_0x4ccb1b('0x63')]));}});},Dialer[_0x593c09('0x1fe')][_0x593c09('0x1cb')]=function(_0x4cacbd,_0x33ee0e,_0x5467ab,_0x72225c){const _0x47bdfe=_0x593c09,_0x2be52d=new Final(_0x4cacbd);_0x2be52d['state']=0xf,_0x2be52d[_0x47bdfe('0x1f2')]='Global',this[_0x47bdfe('0x156')](_0x2be52d,_0x33ee0e,_0x5467ab,_0x72225c);},Dialer['prototype'][_0x593c09('0x156')]=function(_0x3dde2f,_0x99daae,_0x3a497c,_0x1d88cf){const _0x2e636d=_0x593c09;this[_0x2e636d('0x17c')](_0x3dde2f)[_0x2e636d('0xd7')](function(){const _0x4e4374=_0x2e636d;return _0x99daae(msgResponse('[callProgressDetecting]',_0x4e4374('0x99'),_0x1d88cf));})[_0x2e636d('0x1f')](function(){const _0x4d9103=_0x2e636d;return _0x3a497c(msgResponse(_0x4d9103('0xb7'),_0x4d9103('0x8e'),'contact\x20not\x20moved'));});},Dialer[_0x593c09('0x1fe')][_0x593c09('0x151')]=function(_0x195ff3){const _0x14f52d=_0x593c09,_0x47231c=_0x195ff3['dialPredictiveOptimizationPercentage']/0x64,_0x43792a=_0x195ff3['outboundDropCallsDayTimeout']/(_0x195ff3[_0x14f52d('0x169')]+_0x195ff3['outboundAnswerCallsDay']),_0x5e4b05=Math['round'](_0x195ff3[_0x14f52d('0x4')]*(_0x195ff3[_0x14f52d('0xc9')]/0x64)),_0x2dc12c=Math[_0x14f52d('0x17e')](_0x195ff3[_0x14f52d('0x4')]*(_0x195ff3[_0x14f52d('0xfe')]/0x64)),_0x2e6ddf=_0x195ff3['available']+_0x195ff3[_0x14f52d('0x184')],_0x402e81=Math[_0x14f52d('0x185')](_0x195ff3[_0x14f52d('0x124')]*_0x195ff3[_0x14f52d('0x29')]*_0x195ff3[_0x14f52d('0x8d')]*_0x195ff3[_0x14f52d('0x28')]);if(_[_0x14f52d('0x1ce')](_0x195ff3['startProgressive']))!_['isUndefined'](_0x195ff3[_0x14f52d('0x8a')])&&(_0x195ff3['startPredictive']=undefined,loggerPredictive[_0x14f52d('0xb0')]('[startMethodPredictive][StartProgressive]',_0x14f52d('0x1fb'))),!_[_0x14f52d('0x1ce')](_0x195ff3[_0x14f52d('0x167')])&&(loggerPredictive[_0x14f52d('0xb0')](_0x14f52d('0x1ed'),_0x14f52d('0xdd')),clearInterval(_0x195ff3[_0x14f52d('0x167')]),_0x195ff3[_0x14f52d('0x167')]=undefined),_0x195ff3[_0x14f52d('0xe7')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),loggerPredictive[_0x14f52d('0x114')](_0x195ff3[_0x14f52d('0x10d')],_0x14f52d('0x189'),_0x195ff3[_0x14f52d('0xe7')]),this[_0x14f52d('0xc5')](_0x195ff3,0x1);else{if(ifInterval(_0x195ff3[_0x14f52d('0xc6')],_0x195ff3[_0x14f52d('0xe7')]))this[_0x14f52d('0xc5')](_0x195ff3,0x1),loggerPredictiveCalls['info'](_0x14f52d('0x12e'),_0x195ff3['startProgressive'],_0x195ff3[_0x14f52d('0x10d')]),_0x195ff3[_0x14f52d('0x124')]=0x0,_0x195ff3['predictiveIntervalErlangCallsDroppedCalls']=0x0;else{if(_0x47231c<_0x43792a&&_0x195ff3[_0x14f52d('0x6c')]==='dropRate')freeVariablesPredictive(_0x195ff3),loggerPredictive[_0x14f52d('0x114')](_0x14f52d('0x1a6'),'Dropped\x20calls\x20day',_0x43792a,'startProgressive',_0x195ff3[_0x14f52d('0x10d')]);else{if(_0x402e81<_0x195ff3[_0x14f52d('0xf2')]&&_0x195ff3[_0x14f52d('0x6c')]===_0x14f52d('0x3'))freeVariablesPredictive(_0x195ff3),loggerPredictive[_0x14f52d('0x114')](_0x14f52d('0x11e'),'Max\x20Drop\x20',_0x402e81,_0x14f52d('0xf3'),_0x195ff3[_0x14f52d('0xf2')],_0x14f52d('0xe7'),_0x195ff3[_0x14f52d('0x10d')]);else{if(!ifInterval(_0x195ff3[_0x14f52d('0xc6')],_0x195ff3[_0x14f52d('0xe7')])&&_[_0x14f52d('0x1ce')](_0x195ff3[_0x14f52d('0x8a')])&&!_[_0x14f52d('0x1ce')](_0x195ff3[_0x14f52d('0xe7')]))_0x195ff3['startPredictive']=moment()[_0x14f52d('0x1d4')]('YYYY-MM-DD\x20HH:mm:ss'),loggerPredictive[_0x14f52d('0x114')](_0x195ff3[_0x14f52d('0x10d')],_0x14f52d('0x1a1'),_0x195ff3[_0x14f52d('0x8a')]),this[_0x14f52d('0x1f9')](_0x195ff3['dialPredictiveInterval'])[_0x14f52d('0xd7')](this['getDataPredictive'](_0x195ff3))['then'](mergeDataErlangB(_0x195ff3))[_0x14f52d('0xd7')](this[_0x14f52d('0x1cc')](_0x195ff3))[_0x14f52d('0x1f')](loggerCatchPredictive(_0x14f52d('0x162'),_0x195ff3));else{if(!ifInterval(_0x195ff3[_0x14f52d('0xc6')],_0x195ff3[_0x14f52d('0x8a')]))_0x195ff3['predictiveIntervalErlangCallsDroppedCalls']=0x0,_0x195ff3['startPredictive']=moment()[_0x14f52d('0x1d4')](_0x14f52d('0x24')),loggerPredictive[_0x14f52d('0x114')](_0x195ff3['name'],_0x14f52d('0xe6'),_0x195ff3['startPredictive']),clearInterval(_0x195ff3[_0x14f52d('0x167')]),_0x195ff3['handlePredictive']=undefined,this[_0x14f52d('0x1f9')](_0x195ff3[_0x14f52d('0xc6')])['then'](this['getDataPredictive'](_0x195ff3))[_0x14f52d('0xd7')](mergeDataErlangB(_0x195ff3))[_0x14f52d('0xd7')](this['startMethodPredictive'](_0x195ff3))[_0x14f52d('0x1f')](loggerCatchPredictive(_0x14f52d('0x171'),_0x195ff3));else{if(_0x195ff3[_0x14f52d('0x4')]&&_0x2e6ddf<_0x195ff3[_0x14f52d('0x4')]-_0x2dc12c)freeVariablesPredictive(_0x195ff3),loggerPredictive['info'](_0x195ff3[_0x14f52d('0x10d')],_0x14f52d('0x204'),_0x2e6ddf,')\x20are\x20less\x20than\x20threshold\x20(',_0x195ff3[_0x14f52d('0x4')],'-',_0x2dc12c,'=',_0x195ff3[_0x14f52d('0x4')]-_0x2dc12c,')');else _0x195ff3[_0x14f52d('0x4')]&&_0x2e6ddf>_0x195ff3[_0x14f52d('0x4')]+_0x5e4b05&&(freeVariablesPredictive(_0x195ff3),loggerPredictive[_0x14f52d('0x114')](_0x195ff3[_0x14f52d('0x10d')],_0x14f52d('0x204'),_0x2e6ddf,_0x14f52d('0x1a9'),_0x195ff3['predictiveIntervalAvailable'],'+',_0x5e4b05,'=',_0x195ff3[_0x14f52d('0x4')]+_0x5e4b05,')'));}}}}}}},Dialer['prototype'][_0x593c09('0x202')]=function(_0x3a65de){const _0x36d81e=this;return function(_0x1090a3){return new Promise(function(_0x3b62df,_0x481a40){const _0x96a2cc=a1056_0x6f60;_[_0x96a2cc('0x130')](_0x3a65de,_0x1090a3[0x0]);if(checkGetDataPredictive(_0x1090a3[0x0])){const _0x4b2b3c=_0x3a65de['talking']+_0x3a65de[_0x96a2cc('0x6b')];_0x3a65de['predictiveIntervalAvailable']=_0x4b2b3c;const _0x13912c=_0x4b2b3c,_0xd69c29=_0x3a65de[_0x96a2cc('0xc6')]*0x3c,_0x1aaf43=_0x1090a3[0x0][_0x96a2cc('0x15')]+_0x1090a3[0x0][_0x96a2cc('0xd1')],_0x355576=(_0x1090a3[0x0]['predictiveIntervalAnsweredCalls']+_0x1090a3[0x0][_0x96a2cc('0x1ec')]+_0x1090a3[0x0][_0x96a2cc('0x10a')])/_0x1090a3[0x0]['predictiveIntervalTotalCalls'];_0x3a65de[_0x96a2cc('0x8d')]=_0x355576>0x0?_0x355576:0x1;switch(_0x3a65de['dialPredictiveOptimization']){case _0x96a2cc('0x3'):{const _0x2cbb3c=_0x3a65de[_0x96a2cc('0x97')]/0x64;return _0x36d81e[_0x96a2cc('0xb9')](_0x13912c,_0xd69c29,_0x1aaf43,_0x355576,_0x2cbb3c)['then'](function(_0x398456){return _0x3b62df(_0x398456);});}case _0x96a2cc('0xd3'):{const _0x51d8c7=_0x3a65de['dialPredictiveOptimizationPercentage']/0x64;return _0x36d81e[_0x96a2cc('0x14c')](_0x13912c,_0xd69c29,_0x1aaf43,_0x355576,_0x51d8c7)['then'](function(_0x3b0256){return _0x3b62df(_0x3b0256);});}default:return _0x481a40(msgResponse('[getDataPredictive]',_0x96a2cc('0x8e'),_0x96a2cc('0xb5')));}}else return _0x481a40(msgResponse(_0x96a2cc('0x20'),'Failure',_0x96a2cc('0xe5')));});};},Dialer[_0x593c09('0x1fe')][_0x593c09('0x158')]=function(_0x3c308a){const _0x30d0d9=this;return function(_0x1cbe57){return new Promise(function(_0x3ccb9c,_0x5625d1){const _0x1ce464=a1056_0x6f60;_[_0x1ce464('0x130')](_0x3c308a,_0x1cbe57[0x0]);if(checkGetDataPredictive(_0x1cbe57[0x0])){loggerPredictive[_0x1ce464('0x114')](JSON['stringify'](_0x1cbe57[0x0]));if(_0x3c308a[_0x1ce464('0x6c')]===_0x1ce464('0x3'))return _0x30d0d9[_0x1ce464('0x1ee')](_0x3c308a['id'])[_0x1ce464('0xd7')](function(_0x9f49c1){const _0x81c733=_0x1ce464,_0x4dce3b=_0x3c308a['loggedIn']-_0x9f49c1[0x0][_0x81c733('0x10b')],_0x199948=_0x3c308a[_0x81c733('0xc6')]*0x3c,_0x3ffa05=_0x1cbe57[0x0][_0x81c733('0x15')]+_0x1cbe57[0x0][_0x81c733('0xd1')],_0x3b4816=(_0x1cbe57[0x0]['predictiveIntervalAnsweredCalls']+_0x1cbe57[0x0][_0x81c733('0x1ec')]+_0x1cbe57[0x0][_0x81c733('0x10a')])/_0x1cbe57[0x0][_0x81c733('0x8b')],_0x14e8b1=_0x3c308a[_0x81c733('0x97')]/0x64;return _0x3c308a['predictiveIntervalPauses']=_0x9f49c1[0x0]['outboundQueuePauses']||0x0,_0x3c308a[_0x81c733('0x8d')]=_0x3b4816>0x0?_0x3b4816:0x1,_0x30d0d9['abandonmentRate'](_0x4dce3b,_0x199948,_0x3ffa05,_0x3b4816,_0x14e8b1);})[_0x1ce464('0xd7')](function(_0x35efba){return _0x3ccb9c(_0x35efba);})[_0x1ce464('0x1f')](function(_0xf9f37b){const _0x1a3abc=_0x1ce464;return _0x5625d1(msgResponse(_0x1a3abc('0x188'),_0x1a3abc('0x8e'),JSON[_0x1a3abc('0x18c')](_0xf9f37b)));});if(_0x3c308a[_0x1ce464('0x6c')]===_0x1ce464('0xd3'))return _0x30d0d9[_0x1ce464('0x1ee')](_0x3c308a['id'])[_0x1ce464('0xd7')](function(_0x1a0939){const _0x3a1570=_0x1ce464,_0x4c7e3d=_0x3c308a[_0x3a1570('0x56')]-_0x1a0939[0x0]['outboundQueuePauses'],_0xb14057=_0x3c308a[_0x3a1570('0xc6')]*0x3c,_0x5c03ea=_0x1cbe57[0x0][_0x3a1570('0x15')]+_0x1cbe57[0x0]['predictiveIntervalAvgHoldtime'],_0x3ac638=(_0x1cbe57[0x0][_0x3a1570('0x36')]+_0x1cbe57[0x0][_0x3a1570('0x1ec')]+_0x1cbe57[0x0][_0x3a1570('0x10a')])/_0x1cbe57[0x0]['predictiveIntervalTotalCalls'],_0x489841=_0x3c308a['dialPredictiveOptimizationPercentage']/0x64;return _0x3c308a[_0x3a1570('0x14b')]=_0x1a0939[0x0][_0x3a1570('0x10b')]||0x0,_0x3c308a[_0x3a1570('0x8d')]=_0x3ac638>0x0?_0x3ac638:0x1,_0x30d0d9[_0x3a1570('0x14c')](_0x4c7e3d,_0xb14057,_0x5c03ea,_0x3ac638,_0x489841);})[_0x1ce464('0xd7')](function(_0x4eaea9){return _0x3ccb9c(_0x4eaea9);})[_0x1ce464('0x1f')](function(_0x4c61e0){const _0x3728d5=_0x1ce464;return _0x5625d1(msgResponse(_0x3728d5('0x188'),_0x3728d5('0x8e'),JSON[_0x3728d5('0x18c')](_0x4c61e0)));});}else return _0x5625d1(msgResponse('[getDataPredictive]','Failure','check\x20failure'));});};},Dialer['prototype'][_0x593c09('0x1cc')]=function(_0x1253ab){const _0x438431=this;return function(){const _0x578088=a1056_0x6f60;let _0x20d0cd=0x0,_0x1299d1=Math['floor'](_0x1253ab[_0x578088('0x147')]*0x3e8);_0x1299d1>0x0?(_0x1299d1=_0x1299d1<0x64?0x64:_0x1299d1,loggerPredictive[_0x578088('0x114')](_0x1253ab[_0x578088('0x10d')],_0x578088('0x102'),_0x1299d1,_0x578088('0x19c')),_0x1253ab[_0x578088('0x167')]=setInterval(function(){const _0x54981c=_0x578088;_0x438431[_0x54981c('0x167')](_0x1253ab),loggerPredictiveCalls[_0x54981c('0x114')]('[handlePredictive]',_0x20d0cd+=0x1);},_0x1299d1)):loggerPredictive['info'](_0x1253ab[_0x578088('0x10d')],_0x578088('0x1b1'));};},Dialer[_0x593c09('0x1fe')][_0x593c09('0xec')]=function(_0x480551,_0x463ec2){const _0x56c114=this;return function(_0x5199d5){const _0x91d2b4=a1056_0x6f60;if(_[_0x91d2b4('0x1a8')](_0x5199d5)){if(_[_0x91d2b4('0xe9')](_0x463ec2[_0x91d2b4('0x154')])||!_0x463ec2[_0x91d2b4('0x62')]){if(_0x480551[_0x91d2b4('0x173')]===_0x91d2b4('0x106')){_0x480551[_0x91d2b4('0x14')]=_[_0x91d2b4('0x1ce')](_0x480551['queueStatusComplete'])?!![]:_0x480551['queueStatusComplete'];const _0x555113=uuid['v4']();_0x56c114[_0x91d2b4('0x7b')][_0x555113]=new Action(_0x480551,_0x463ec2,_0x555113),loggerBooked[_0x91d2b4('0x114')](_0x91d2b4('0xe4'),_0x555113,_0x91d2b4('0x179'),JSON[_0x91d2b4('0x18c')](_0x480551[_0x91d2b4('0x14')]),_0x91d2b4('0x1c5'),_0x480551[_0x91d2b4('0x10d')]),_0x480551[_0x91d2b4('0x14')]?(_0x480551[_0x91d2b4('0x14')]=![],_0x56c114[_0x91d2b4('0x178')][_0x56c114['actions'][_0x555113][_0x91d2b4('0x117')]]=[],ami[_0x91d2b4('0x13e')]({'actionid':_0x555113,'action':_0x91d2b4('0x5'),'queue':_0x480551[_0x91d2b4('0x10d')]})[_0x91d2b4('0x1f')](function(){const _0x35ef58=_0x91d2b4;_0x56c114[_0x35ef58('0x1f6')](_0x480551),_0x56c114[_0x35ef58('0x177')]({'active':![],'ContactId':_0x56c114[_0x35ef58('0x7b')][_0x555113]['ContactId'],'ListId':_0x56c114[_0x35ef58('0x7b')][_0x555113][_0x35ef58('0x1b5')],'VoiceQueueId':_0x56c114[_0x35ef58('0x7b')][_0x555113][_0x35ef58('0x71')]||undefined,'CampaignId':_0x56c114[_0x35ef58('0x7b')][_0x555113][_0x35ef58('0x1e0')]||undefined})[_0x35ef58('0x1f')](loggerCatch(_0x35ef58('0x1c0'))),delete _0x56c114['actions'][_0x555113];})):(loggerBooked[_0x91d2b4('0x114')](_0x91d2b4('0x1ea'),JSON[_0x91d2b4('0x18c')](_0x480551[_0x91d2b4('0x14')]),_0x91d2b4('0x1c5'),_0x480551['name']),_0x56c114[_0x91d2b4('0x1f6')](_0x480551),_0x56c114[_0x91d2b4('0x177')]({'active':![],'ContactId':_0x56c114['actions'][_0x555113][_0x91d2b4('0x186')],'ListId':_0x56c114['actions'][_0x555113][_0x91d2b4('0x1b5')],'VoiceQueueId':_0x56c114['actions'][_0x555113][_0x91d2b4('0x71')]||undefined,'CampaignId':_0x56c114[_0x91d2b4('0x7b')][_0x555113]['CampaignId']||undefined})[_0x91d2b4('0x1f')](loggerCatch(_0x91d2b4('0x1c0'))),delete _0x56c114[_0x91d2b4('0x7b')][_0x555113]);}else return _0x56c114[_0x91d2b4('0x1f8')](_0x480551,_0x463ec2);}else getDiff(_0x463ec2[_0x91d2b4('0x33')])<_0x480551['dialRecallMeTimeout']*0x3c?_0x463ec2[_0x91d2b4('0x9e')]&&!_0x463ec2['Agent'][_0x91d2b4('0x4e')]?_0x56c114['preview']['run'](_0x463ec2['id'])[_0x91d2b4('0xf8')](function(){_0x56c114['updateOriginated'](_0x480551);}):_0x56c114[_0x91d2b4('0x7e')]({'active':![]},_0x463ec2['id'],0x1)[_0x91d2b4('0xf8')](function(){const _0x1f08d2=_0x91d2b4;console[_0x1f08d2('0x1bf')](_0x1f08d2('0x203')),_0x56c114[_0x1f08d2('0x1f6')](_0x480551);}):(_0x480551[_0x91d2b4('0x68')]+=0x1,_0x56c114[_0x91d2b4('0x1f6')](_0x480551),_0x480551['dialRecallInQueue']?(_0x56c114[_0x91d2b4('0x177')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x463ec2[_0x91d2b4('0x186')],'ListId':_0x463ec2[_0x91d2b4('0x1b5')],'VoiceQueueId':_0x463ec2[_0x91d2b4('0x71')]||undefined,'CampaignId':_0x463ec2[_0x91d2b4('0x1e0')]||undefined})[_0x91d2b4('0x1f')](loggerCatch(_0x91d2b4('0xe1'))),_0x56c114[_0x91d2b4('0x1eb')](createObjHistory(_0x480551,_0x463ec2,'RECALLINQUEUE',0x17,_0x91d2b4('0x1a7')))['catch'](loggerCatch(_0x91d2b4('0x1c3')))):_0x56c114['saveInDb'](createObjHistory(_0x480551,_0x463ec2,_0x91d2b4('0x1e5'),0x16,_0x91d2b4('0xa6')),_0x91d2b4('0x5d'),'[Originate][HistoryRecallClose]'));}else{_0x480551[_0x91d2b4('0xfd')]+=0x1,_0x56c114[_0x91d2b4('0x86')](createObjHistory(_0x480551,_0x463ec2,_0x91d2b4('0x1b9'),0xd,_0x91d2b4('0x41')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x91d2b4('0x54');}};},Dialer[_0x593c09('0x1fe')]['handleIvr']=function(_0x2d8d5b){const _0x11169d=_0x593c09,_0x5c1cfd=this;let _0x4367d3=_0x2d8d5b['limitCalls']-_0x2d8d5b[_0x11169d('0x1ca')]-_0x2d8d5b['temp'];emitCampaignSummary(_0x2d8d5b),_0x4367d3>0x0&&(_0x4367d3>this[_0x11169d('0x152')]&&(_0x4367d3=this[_0x11169d('0x152')]),_0x2d8d5b[_0x11169d('0x77')]+=_0x4367d3,this['getContactDialerIvr'](_0x2d8d5b['id'],_0x4367d3,_0x2d8d5b['dialOrderByScheduledAt'])[_0x11169d('0xd7')](function(_0x566fa9){const _0x32fe96=_0x11169d;_0x2d8d5b[_0x32fe96('0x77')]-=_0x4367d3,_0x2d8d5b['temp']=_0x2d8d5b[_0x32fe96('0x77')]>0x0?_0x2d8d5b[_0x32fe96('0x77')]:0x0;if(!checkContactEmpty(_0x566fa9))_0x2d8d5b[_0x32fe96('0x16b')]=_0x32fe96('0x70'),logger[_0x32fe96('0x114')](_0x32fe96('0x17')+_0x2d8d5b[_0x32fe96('0x10d')]);else{_0x2d8d5b[_0x32fe96('0x1ca')]+=_0x566fa9[_0x32fe96('0x128')],_0x2d8d5b[_0x32fe96('0x16b')]=_0x32fe96('0x199');for(let _0x539854=0x0;_0x539854<_0x566fa9['length'];_0x539854+=0x1){_0x2d8d5b[_0x32fe96('0xef')]+=0x1,_[_0x32fe96('0xe9')](_0x566fa9[_0x539854])||_[_0x32fe96('0xe9')](_0x566fa9[_0x539854][_0x32fe96('0xc8')])||_[_0x32fe96('0xe9')](_0x566fa9[_0x539854][_0x32fe96('0xc8')]['phone'])?_0x5c1cfd['emptyContact']('[actionOriginate]\x20',_0x2d8d5b,_0x566fa9[_0x539854]):_0x5c1cfd[_0x32fe96('0x195')](_['pick'](_0x566fa9[_0x539854],['CampaignId',_0x32fe96('0x82')]))[_0x32fe96('0xd7')](_0x5c1cfd['checkContactBlack'](_0x2d8d5b,_0x566fa9[_0x539854]))[_0x32fe96('0x1f')](_0x5c1cfd[_0x32fe96('0x17b')](_0x32fe96('0x34'),_0x2d8d5b));}}})[_0x11169d('0x1f')](loggerGetContactDialer(_0x11169d('0xf1'),_0x2d8d5b,_0x4367d3)));},Dialer[_0x593c09('0x1fe')][_0x593c09('0xc5')]=function(_0xd21f4a,_0x23978c){const _0xc8223c=_0x593c09,_0x2ccf16=this,_0x4b7b51=[];let _0x4bfd4a=_0x23978c>=0x1?_0x23978c:0x1;_0xd21f4a[_0xc8223c('0x173')]==='booked'&&(_0x4bfd4a=0x1);let _0x369217=Math[_0xc8223c('0x185')](_0xd21f4a[_0xc8223c('0x6b')]*_0x4bfd4a)-_0xd21f4a[_0xc8223c('0x1ca')]-_0xd21f4a[_0xc8223c('0x77')];emitVoiceQueueSummary(_0xd21f4a);if(_0xd21f4a['dialLimitQueue']>0x0){const _0x165a6b=_0xd21f4a[_0xc8223c('0x1e6')]-_0xd21f4a[_0xc8223c('0x1ca')]-_0xd21f4a[_0xc8223c('0x184')]-_0xd21f4a[_0xc8223c('0x77')]-_0xd21f4a['pTalking'];_0x369217>_0x165a6b&&(_0x369217=_0x165a6b);}if(_0x369217>0x0){_0xd21f4a[_0xc8223c('0x173')]===_0xc8223c('0x106')&&(_0x369217=0x1);_0x369217>this['maxNumberOriginate']&&(_0x369217=this[_0xc8223c('0x152')]);_0xd21f4a['temp']+=_0x369217;for(const _0x31079d in this['agents']){typeof this[_0xc8223c('0x12b')][_0x31079d]!==_0xc8223c('0x19f')&&(this[_0xc8223c('0x12b')][_0x31079d][_0xc8223c('0x1d8')]==='not_inuse'&&this[_0xc8223c('0x12b')][_0x31079d][_0xc8223c('0xcb')]===_0xc8223c('0xad')&&_0x4b7b51[_0xc8223c('0x1df')](this[_0xc8223c('0x12b')][_0x31079d]['id']));}this[_0xc8223c('0x3b')](_0xd21f4a['id'],_0x4b7b51,_0x369217,_0xd21f4a['dialOrderByScheduledAt'])[_0xc8223c('0xd7')](function(_0x2b36a6){const _0x460ab5=_0xc8223c;_0xd21f4a[_0x460ab5('0x77')]-=_0x369217,_0xd21f4a[_0x460ab5('0x77')]=_0xd21f4a[_0x460ab5('0x77')]>0x0?_0xd21f4a['temp']:0x0;if(!checkContactEmpty(_0x2b36a6))_0x2ccf16[_0x460ab5('0x32')](_0xd21f4a)[_0x460ab5('0xd7')](sendMessageReschedule(_0xd21f4a))['catch'](loggerCatch(_0x460ab5('0xc2')));else{_0xd21f4a[_0x460ab5('0x1ca')]+=_0x2b36a6[_0x460ab5('0x128')],_0xd21f4a['message']=_0xd21f4a[_0x460ab5('0x173')]===_0x460ab5('0x106')?_0x460ab5('0x15e'):_0x460ab5('0x199');for(let _0x53be69=0x0;_0x53be69<_0x2b36a6[_0x460ab5('0x128')];_0x53be69+=0x1){_[_0x460ab5('0xe9')](_0x2b36a6[_0x53be69])||_[_0x460ab5('0xe9')](_0x2b36a6[_0x53be69][_0x460ab5('0xc8')])||_[_0x460ab5('0xe9')](_0x2b36a6[_0x53be69][_0x460ab5('0xc8')][_0x460ab5('0x1e2')])?_0x2ccf16[_0x460ab5('0x1e7')](_0x460ab5('0x1f1'),_0xd21f4a,_0x2b36a6[_0x53be69]):_0x2ccf16[_0x460ab5('0x1b3')](_[_0x460ab5('0x205')](_0x2b36a6[_0x53be69],[_0x460ab5('0x71'),_0x460ab5('0x82')]))[_0x460ab5('0xd7')](_0x2ccf16[_0x460ab5('0xec')](_0xd21f4a,_0x2b36a6[_0x53be69]))['catch'](_0x2ccf16[_0x460ab5('0x17b')](_0x460ab5('0x1f1'),_0xd21f4a));}}})[_0xc8223c('0x1f')](loggerGetContactDialer(_0xc8223c('0x1a0'),_0xd21f4a,_0x369217));}},Dialer['prototype']['handlePredictive']=function(_0x9c6118){const _0x41c6c0=_0x593c09;if(_0x9c6118[_0x41c6c0('0x1e6')]>0x0){const _0x418977=_0x9c6118[_0x41c6c0('0x1e6')]-_0x9c6118[_0x41c6c0('0x1ca')]-_0x9c6118['talking'];_0x418977>0x0?this['tryOriginatePredictive'](_0x9c6118):loggerPredictiveCalls[_0x41c6c0('0x114')](_0x41c6c0('0x1dc'));}else this[_0x41c6c0('0x1c8')](_0x9c6118);},Dialer['prototype'][_0x593c09('0x1c8')]=function(_0x436a1a){const _0x4f75b8=_0x593c09,_0x121a00=this,_0x2a56ae=[];_0x436a1a[_0x4f75b8('0x1ca')]+=0x1;for(const _0x3dc3fc in this[_0x4f75b8('0x12b')]){typeof this[_0x4f75b8('0x12b')][_0x3dc3fc]!=='undefined'&&(this['agents'][_0x3dc3fc][_0x4f75b8('0x1d8')]===_0x4f75b8('0x23')&&this['agents'][_0x3dc3fc][_0x4f75b8('0xcb')]===_0x4f75b8('0xad')&&_0x2a56ae['push'](this[_0x4f75b8('0x12b')][_0x3dc3fc]['id']));}this['getContactDialer'](_0x436a1a['id'],_0x2a56ae,0x1,_0x436a1a['dialOrderByScheduledAt'])[_0x4f75b8('0xd7')](function(_0x33c62f){const _0x15775c=_0x4f75b8;!checkContactEmpty(_0x33c62f)?(checkContactLowerLimitOriginate(_0x436a1a,0x1,0x0),_0x121a00[_0x15775c('0x32')](_0x436a1a)[_0x15775c('0xd7')](sendMessageReschedule(_0x436a1a))[_0x15775c('0x1f')](loggerCatch(_0x15775c('0xc2')))):(_0x436a1a[_0x15775c('0x16b')]='RUNNING',_[_0x15775c('0xe9')](_0x33c62f[0x0])||_['isNil'](_0x33c62f[0x0][_0x15775c('0xc8')])||_['isNil'](_0x33c62f[0x0][_0x15775c('0xc8')][_0x15775c('0x1e2')])?_0x121a00[_0x15775c('0x1e7')](_0x15775c('0x1f1'),_0x436a1a,_0x33c62f[0x0]):_0x121a00[_0x15775c('0x1b3')](_['pick'](_0x33c62f[0x0],[_0x15775c('0x71'),'Contact.phone']))[_0x15775c('0xd7')](_0x121a00[_0x15775c('0xec')](_0x436a1a,_0x33c62f[0x0]))[_0x15775c('0x1f')](_0x121a00['loggerHandler'](_0x15775c('0xc0'),_0x436a1a)));})[_0x4f75b8('0x1f')](loggerGetContactDialer(_0x4f75b8('0x30'),_0x436a1a,0x1)),emitVoiceQueueSummary(_0x436a1a);},Dialer[_0x593c09('0x1fe')][_0x593c09('0xb9')]=function(_0x4ca55a,_0x11ad66,_0x49f173,_0x5e74a0,_0x4effa7,_0x257f4b){const _0x82d7f5=_0x593c09;return loggerPredictive[_0x82d7f5('0x114')](_0x82d7f5('0x16d')),loggerPredictive[_0x82d7f5('0x114')](_0x82d7f5('0x37'),_0x4ca55a),loggerPredictive[_0x82d7f5('0x114')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11ad66),loggerPredictive[_0x82d7f5('0x114')](_0x82d7f5('0x1be'),_0x49f173),loggerPredictive[_0x82d7f5('0x114')]('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',_0x5e74a0),loggerPredictive[_0x82d7f5('0x114')](_0x82d7f5('0x1d3'),_0x4effa7),loggerPredictive['info'](_0x82d7f5('0x2a')),new Promise(function(_0x10543a,_0x909c8a){const _0x40f4f0=_0x82d7f5;if(_0x4ca55a<=0x0||isNaN(_0x4ca55a))return _0x909c8a(msgResponse(_0x40f4f0('0x100'),_0x40f4f0('0x1ab'),_0x40f4f0('0x1d7')+_0x4ca55a));if(_0x49f173<=0x0||isNaN(_0x49f173))return _0x909c8a(msgResponse('[abandonmentRate]',_0x40f4f0('0x1ab'),_0x40f4f0('0x10e')+_0x49f173));if(_0x5e74a0<=0x0||isNaN(_0x5e74a0))return _0x909c8a(msgResponse(_0x40f4f0('0x100'),_0x40f4f0('0x1ab'),'p\x20=\x20'+_0x5e74a0));if(_0x11ad66<=0x0||isNaN(_0x11ad66))return _0x909c8a(msgResponse(_0x40f4f0('0x100'),_0x40f4f0('0x1ab'),'interval\x20=\x20'+_0x11ad66));if(_0x4effa7<=0x0||isNaN(_0x4effa7))return _0x909c8a(msgResponse(_0x40f4f0('0x100'),_0x40f4f0('0x1ab'),_0x40f4f0('0xda')+_0x4effa7));_0x257f4b=_0x257f4b||0x0;const _0x565111=0x1/_0x49f173;let _0x4daac9=0x0,_0x1f6545=0x0,_0x4a9c6d=0x0,_0x3d2d24=0x0,_0x1cbc31=0x0;for(_0x1cbc31=0x0;_0x4a9c6d<_0x4effa7;_0x1cbc31+=0x1){_0x1f6545=_0x1cbc31/_0x11ad66,_0x4daac9=(_0x5e74a0*_0x1f6545+_0x257f4b)/_0x565111,_0x4a9c6d=erlangb(_0x4daac9,_0x4ca55a),_0x3d2d24=_0x4daac9/_0x4ca55a*(0x1-erlangb(_0x4daac9,_0x4ca55a));}return _0x10543a({'erlangCalls':_0x1cbc31,'erlangCallToSecond':_0x11ad66/_0x1cbc31,'erlangAbandonmentRate':_0x4a9c6d,'erlangBusyFactor':_0x3d2d24});});},Dialer[_0x593c09('0x1fe')][_0x593c09('0x14c')]=function(_0x247ff6,_0x695a69,_0x3ec2fd,_0xe2bc78,_0x33c5d8,_0x398a4c){const _0x46898d=_0x593c09;return loggerPredictive[_0x46898d('0x114')](_0x46898d('0x1b7')),loggerPredictive[_0x46898d('0x114')](_0x46898d('0x37'),_0x247ff6),loggerPredictive['info'](_0x46898d('0xaa'),_0x695a69),loggerPredictive[_0x46898d('0x114')](_0x46898d('0x1be'),_0x3ec2fd),loggerPredictive[_0x46898d('0x114')](_0x46898d('0x166'),_0xe2bc78),loggerPredictive[_0x46898d('0x114')](_0x46898d('0x207'),_0x33c5d8),loggerPredictive[_0x46898d('0x114')](_0x46898d('0x2a')),new Promise(function(_0x6dd27c,_0x203ee2){const _0x53ce88=_0x46898d;if(_0x247ff6<=0x0||isNaN(_0x247ff6))return _0x203ee2(msgResponse(_0x53ce88('0x40'),_0x53ce88('0x1ab'),'m\x20=\x20'+_0x247ff6));if(_0x3ec2fd<=0x0||isNaN(_0x3ec2fd))return _0x203ee2(msgResponse(_0x53ce88('0x40'),_0x53ce88('0x1ab'),'Ts\x20=\x20'+_0x3ec2fd));if(_0xe2bc78<=0x0||isNaN(_0xe2bc78))return _0x203ee2(msgResponse(_0x53ce88('0x40'),_0x53ce88('0x1ab'),_0x53ce88('0xff')+_0xe2bc78));if(_0x695a69<=0x0||isNaN(_0x695a69))return _0x203ee2(msgResponse(_0x53ce88('0x40'),_0x53ce88('0x1ab'),_0x53ce88('0x191')+_0x695a69));if(_0x33c5d8<=0x0||isNaN(_0x33c5d8))return _0x203ee2(msgResponse('[busyFactor]','Error','Umin\x20=\x20'+_0x33c5d8));_0x398a4c=_0x398a4c||0x0;const _0xacf688=0x1/_0x3ec2fd;let _0x2a9acd=0x0,_0x2cd391=0x0,_0x2729ab=0x0,_0x3faffa=0x0,_0x5d338a=0x0;for(_0x5d338a=0x0;_0x3faffa<_0x33c5d8;_0x5d338a+=0x1){_0x2cd391=_0x5d338a/_0x695a69,_0x2a9acd=(_0xe2bc78*_0x2cd391+_0x398a4c)/_0xacf688,_0x2729ab=erlangb(_0x2a9acd,_0x247ff6),_0x3faffa=_0x2a9acd/_0x247ff6*(0x1-erlangb(_0x2a9acd,_0x247ff6));}return _0x6dd27c({'erlangCalls':_0x5d338a,'erlangCallToSecond':_0x695a69/_0x5d338a,'erlangAbandonmentRate':_0x2729ab,'erlangBusyFactor':_0x3faffa});});},module[_0x593c09('0x180')]=Dialer;