Built motion from commit (unavailable).|2.4.4
[motion2.git] / server / services / ami / dialer / index.js
index aac6dbf..a04fb8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd87a=['[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dropreason','channel','syncQueueMember','actionid','locked','paused','stateinterface','rrmemory','push','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','ContactId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','dialPowerLevel','handlePower','method\x20not\x20recognized','launchHandleIvr','handleIvr','sendMessageOneNotActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialer','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','endtime','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMaxThreshold','round','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','talking','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','queueStatusComplete','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','booked','not_inuse','ACTIVE','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','reachable','[countReScheduled]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','roundrobin','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','queuecallerabandon','syncOriginateResponse','agentcomplete','syncAgentComplete','hangup','syncHangup','syncNewExten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','Error','stringify','milliseconds','diff','emit','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','md5','format','voice:queue:%s','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','startPredictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','starttime','prototype','clearZombieChannels','uniqueId','[uniqueid]','enqueue','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','checkIsBlackList','resolve','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','then','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','emptyContact','saveInDb','pick','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','statedesc','membername','[syncHangupInAMD][createHistory]','MACHINE','outboundAnswerAgiCallsDay','Machine','AMD','[syncMachine][createHistory]','[syncMachine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','amd','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xd87a,0x10e));var _0xad87=function(_0x10d0f0,_0x1eba3d){_0x10d0f0=_0x10d0f0-0x0;var _0x93e308=_0xd87a[_0x10d0f0];return _0x93e308;};'use strict';var util=require(_0xad87('0x0'));var _=require('lodash');var BPromise=require(_0xad87('0x1'));var uuid=require(_0xad87('0x2'));var moment=require(_0xad87('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xad87('0x4'));var config=require(_0xad87('0x5'));var logger=require(_0xad87('0x6'))('dialer');var loggerBooked=require(_0xad87('0x6'))('booked');var loggerPredictive=require(_0xad87('0x6'))(_0xad87('0x7'));var loggerPredictiveCalls=require(_0xad87('0x6'))(_0xad87('0x8'));var loggerSyncQueueSummary=require(_0xad87('0x6'))(_0xad87('0x9'));var ami=require('../ami');config[_0xad87('0xa')]=_[_0xad87('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xad87('0xc'))(new Redis(config[_0xad87('0xa')]));var cmHopper=require(_0xad87('0xd'));var cmHopperFinal=require(_0xad87('0xe'));var cmHopperHistory=require(_0xad87('0xf'));var cmHopperBlack=require(_0xad87('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xad87('0x11'));var History=require(_0xad87('0x12'));var Final=require(_0xad87('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xad87('0x14'));var Hangup=require(_0xad87('0x15'));var ipAgi=process[_0xad87('0x16')][_0xad87('0x17')]||_0xad87('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':_0xad87('0x19')};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x2eba1f){this[_0xad87('0x1a')]=this[_0xad87('0x1a')]?this[_0xad87('0x1a')][_0xad87('0x1b')](_0x2eba1f):_0x2eba1f();};function Dialer(_0x15ce71,_0x284e3e){this[_0xad87('0x1c')]=new Sequence();this[_0xad87('0x1d')]=_0x284e3e;this[_0xad87('0x1e')]=_0x15ce71['voiceQueues'];this[_0xad87('0x1f')]=_0x15ce71[_0xad87('0x1f')];this[_0xad87('0x20')]=_0x15ce71[_0xad87('0x20')];this[_0xad87('0x21')]=_0x15ce71[_0xad87('0x21')];this[_0xad87('0x22')]=config[_0xad87('0x22')]||0x2;this[_0xad87('0x23')]={};this[_0xad87('0x24')]={};this[_0xad87('0x25')]={};this['uniqueId']={};this[_0xad87('0x26')]={};this['startPredictive']={};this['startProgressive']={};this[_0xad87('0x27')]={};this[_0xad87('0x28')]={};this[_0xad87('0x29')]={};ami['on'](_0xad87('0x2a'),this['syncAgentConnect'][_0xad87('0x2b')](this));ami['on'](_0xad87('0x2c'),this['syncQueueCallerAbandon'][_0xad87('0x2b')](this));ami['on']('originateresponse',this[_0xad87('0x2d')][_0xad87('0x2b')](this));ami['on'](_0xad87('0x2e'),this[_0xad87('0x2f')][_0xad87('0x2b')](this));ami['on']('custom:queuesummary',this[_0xad87('0x9')][_0xad87('0x2b')](this));ami['on'](_0xad87('0x30'),this[_0xad87('0x31')][_0xad87('0x2b')](this));ami['on']('newexten',this[_0xad87('0x32')][_0xad87('0x2b')](this));ami['on']('varset',this[_0xad87('0x33')][_0xad87('0x2b')](this));ami['on'](_0xad87('0x34'),this['syncQueueMember'][_0xad87('0x2b')](this));ami['on'](_0xad87('0x35'),this[_0xad87('0x36')][_0xad87('0x2b')](this));this[_0xad87('0x37')]();this[_0xad87('0x38')]();}function isNotNull(_0x5af19f){return _0x5af19f!==null&&!_[_0xad87('0x39')](_0x5af19f);}function checkIsLoggedIn(_0x272d08,_0x296fd3){return function(){if(_0x296fd3<=0x0){_0x272d08[_0xad87('0x3a')]=_0xad87('0x3b');throw _0x272d08[_0xad87('0x3c')]+_0xad87('0x3d');}};}function isActive(_0x511d63){return _0x511d63;}function checkIsActive(_0xefcf8b,_0x2f66df){return function(){if(!isActive(_0x2f66df)){_0xefcf8b[_0xad87('0x3a')]=_0xad87('0x3e');throw _0xefcf8b[_0xad87('0x3c')]+_0xad87('0x3f');}};}function checkInterval(_0xcd741c){return function(){if(!isNotNull(_0xcd741c[_0xad87('0x40')])){_0xcd741c['message']=_0xad87('0x41');throw _0xcd741c[_0xad87('0x3c')]+_0xad87('0x42');}if(!isNotNull(_0xcd741c['Interval'][_0xad87('0x43')])){_0xcd741c[_0xad87('0x3a')]=_0xad87('0x41');throw _0xcd741c[_0xad87('0x3c')]+_0xad87('0x42');}if(!isNotNull(_[_0xad87('0x44')](_0xcd741c['Interval'][_0xad87('0x43')]))){_0xcd741c[_0xad87('0x3a')]=_0xad87('0x41');throw _0xcd741c[_0xad87('0x3c')]+_0xad87('0x42');}};}function msgResponse(_0x3f3dc4,_0x306f1e,_0x349838){return{'action':_0x3f3dc4,'response':_0x306f1e,'message':_0x349838,'stack':_0x349838};}function myreject(_0x1ebc66){return function(_0x1e8d1f){return _0x1ebc66(msgResponse('[ifTime][Action]',_0xad87('0x45'),JSON[_0xad87('0x46')](_0x1e8d1f)));};}function getSeconds(_0x373239,_0xf9e6c5){var _0x248c4b=moment(_0x373239)[_0xad87('0x47')](0x0);var _0x2bfa68=moment(_0xf9e6c5)['milliseconds'](0x0);return _0x248c4b[_0xad87('0x48')](_0x2bfa68,'seconds');}function emit(_0xb29c3b,_0x4adbe5,_0x3cb5d9){io['to'](_0xb29c3b)[_0xad87('0x49')](_0x4adbe5,_0x3cb5d9);}function emitVoiceQueueSummary(_0x2d7681){if(_0x2d7681['type']===_0xad87('0x4a')){var _0x28db94={'id':_0x2d7681['id'],'name':_0x2d7681['name'],'strategy':_0x2d7681[_0xad87('0x4b')],'answered':_0x2d7681[_0xad87('0x4c')],'available':_0x2d7681[_0xad87('0x4d')],'loggedIn':_0x2d7681['loggedIn'],'pTalking':_0x2d7681[_0xad87('0x4e')],'sumBillable':_0x2d7681[_0xad87('0x4f')],'sumDuration':_0x2d7681[_0xad87('0x50')],'sumHoldTime':_0x2d7681[_0xad87('0x51')]||0x0,'talking':_0x2d7681['talking'],'total':_0x2d7681['total'],'type':_0x2d7681[_0xad87('0x52')],'unmanaged':_0x2d7681[_0xad87('0x53')],'abandoned':_0x2d7681[_0xad87('0x54')],'waiting':_0x2d7681[_0xad87('0x55')],'loggedInDb':_0x2d7681[_0xad87('0x56')],'dialActive':_0x2d7681[_0xad87('0x57')],'dialMethod':_0x2d7681[_0xad87('0x58')],'dialOriginateCallerIdName':_0x2d7681['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2d7681[_0xad87('0x59')],'dialOriginateTimeout':_0x2d7681['dialOriginateTimeout'],'dialPrefix':_0x2d7681['dialPrefix'],'outboundAnswerAgiCallsDay':_0x2d7681['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2d7681[_0xad87('0x5a')],'outboundBlacklistCallsDay':_0x2d7681[_0xad87('0x5b')],'outboundBusyCallsDay':_0x2d7681['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x2d7681[_0xad87('0x5c')],'outboundDropCallsDayACS':_0x2d7681[_0xad87('0x5d')],'outboundDropCallsDayCallersExit':_0x2d7681[_0xad87('0x5e')],'outboundDropCallsDayTimeout':_0x2d7681[_0xad87('0x5f')],'outboundNoAnswerCallsDay':_0x2d7681[_0xad87('0x60')],'outboundNoSuchCallsDay':_0x2d7681[_0xad87('0x61')],'outboundOriginateFailureCallsDay':_0x2d7681[_0xad87('0x62')],'outboundReCallsDay':_0x2d7681['outboundReCallsDay'],'outboundRejectCallsDay':_0x2d7681[_0xad87('0x63')],'outboundUnknownCallsDay':_0x2d7681['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x2d7681[_0xad87('0x64')],'predictiveIntervalAvgHoldtime':_0x2d7681['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x2d7681['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x2d7681[_0xad87('0x65')],'predictiveIntervalDroppedCallsTimeout':_0x2d7681[_0xad87('0x66')],'predictiveIntervalErlangCalls':_0x2d7681[_0xad87('0x67')],'predictiveIntervalErlangCallsDroppedCalls':_0x2d7681['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x2d7681[_0xad87('0x68')],'predictiveIntervalMultiplicativeFactor':_0x2d7681['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2d7681[_0xad87('0x69')],'predictiveIntervalAvailable':_0x2d7681[_0xad87('0x6a')],'predictiveIntervalTotalCalls':_0x2d7681[_0xad87('0x6b')],'message':_0x2d7681[_0xad87('0x3a')],'originated':_0x2d7681[_0xad87('0x6c')],'erlangCalls':_0x2d7681[_0xad87('0x6d')],'erlangCallToSecond':_0x2d7681[_0xad87('0x6e')],'erlangAbandonmentRate':_0x2d7681[_0xad87('0x6f')],'erlangBusyFactor':_0x2d7681[_0xad87('0x70')],'startPredictive':_0x2d7681['startPredictive'],'startProgressive':_0x2d7681[_0xad87('0x71')]};if(_0x2d7681[_0xad87('0x72')]){_0x28db94[_0xad87('0x72')]={'id':_0x2d7681[_0xad87('0x72')]['id'],'name':_0x2d7681[_0xad87('0x72')][_0xad87('0x3c')],'active':_0x2d7681[_0xad87('0x72')][_0xad87('0x73')],'callerid':_0x2d7681[_0xad87('0x72')][_0xad87('0x74')]};}if(_0x2d7681[_0xad87('0x40')]){_0x28db94[_0xad87('0x40')]={'id':_0x2d7681['Interval']['id'],'name':_0x2d7681[_0xad87('0x40')][_0xad87('0x3c')]};}var _0xf9842b=md5(JSON['stringify'](_0x28db94));if(_0x2d7681['md5']!==_0xf9842b){_0x2d7681[_0xad87('0x75')]=_0xf9842b;emit(util[_0xad87('0x76')](_0xad87('0x77'),_0x28db94[_0xad87('0x3c')]),'voice_queue:save',_0x28db94);}}}function emitCampaignSummary(_0x125e35){if(_0x125e35[_0xad87('0x52')]===_0xad87('0x78')){emit(util[_0xad87('0x76')](_0xad87('0x79'),_0x125e35['name']),'campaign:save',_0x125e35);}}function checkGetDataPredictive(_0xfffc05){if(isNotNull(_0xfffc05)){if(!_[_0xad87('0x44')](_0xfffc05)){loggerPredictive[_0xad87('0x7a')](_0xad87('0x7b'));loggerPredictive[_0xad87('0x7a')](_0xad87('0x7c'),_0xfffc05[_0xad87('0x6b')]);loggerPredictive[_0xad87('0x7a')](_0xad87('0x7d'),_0xfffc05[_0xad87('0x64')]);loggerPredictive[_0xad87('0x7a')](_0xad87('0x7e'),_0xfffc05['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0xad87('0x7f'),_0xfffc05['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xad87('0x7a')](_0xad87('0x80'),_0xfffc05[_0xad87('0x81')]);loggerPredictive[_0xad87('0x7a')](_0xad87('0x82'),_0xfffc05[_0xad87('0x83')]);loggerPredictive[_0xad87('0x7a')](_0xad87('0x84'));if(_0xfffc05[_0xad87('0x6b')]>0x0){if(!_[_0xad87('0x39')](_0xfffc05[_0xad87('0x83')])&&_0xfffc05[_0xad87('0x83')]>0x0){return!![];}else{loggerPredictive[_0xad87('0x7a')](_0xad87('0x85'));}if(!_[_0xad87('0x39')](_0xfffc05[_0xad87('0x81')])&&_0xfffc05[_0xad87('0x81')]>0x0){return!![];}else{loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xad87('0x7a')](_0xad87('0x86'));}}else{loggerPredictive['info'](_0xad87('0x87'));}}else{loggerPredictive[_0xad87('0x7a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x265970){return function(_0x3399c6){loggerPredictive[_0xad87('0x7a')](_0xad87('0x88'));loggerPredictive['info'](_0xad87('0x89'),_0x3399c6[_0xad87('0x6d')]);loggerPredictive['info'](_0xad87('0x8a'),_0x3399c6[_0xad87('0x6e')]);loggerPredictive[_0xad87('0x7a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3399c6['erlangAbandonmentRate']);loggerPredictive[_0xad87('0x7a')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3399c6[_0xad87('0x70')]);loggerPredictive['info'](_0xad87('0x8b'),_0x3399c6[_0xad87('0x6f')]);loggerPredictive['info']('---------------------------');_[_0xad87('0x8c')](_0x265970,_0x3399c6);};}function getDiff(_0x2fd0ad){var _0x10fe20=moment()[_0xad87('0x47')](0x0);var _0x466c01=moment(_0x2fd0ad)[_0xad87('0x47')](0x0);return _0x10fe20[_0xad87('0x48')](_0x466c01,'seconds');}function ifInterval(_0x243587,_0x3d1f81){if(_[_0xad87('0x39')](_0x3d1f81)){return![];}if(getDiff(_0x3d1f81)<_0x243587*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x34a1be){if(isNotNull(_0x34a1be)){if(!_['isUndefined'](_0x34a1be[_0xad87('0x71')])){_0x34a1be[_0xad87('0x71')]=undefined;loggerPredictive['info'](_0x34a1be['name'],_0xad87('0x8d'));}if(!_[_0xad87('0x39')](_0x34a1be[_0xad87('0x8e')])){_0x34a1be[_0xad87('0x8e')]=undefined;loggerPredictive[_0xad87('0x7a')](_0x34a1be['name'],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x34a1be[_0xad87('0x8f')])){clearInterval(_0x34a1be['handlePredictive']);_0x34a1be[_0xad87('0x8f')]=undefined;loggerPredictive[_0xad87('0x7a')](_0x34a1be['name'],_0xad87('0x90'));}}}function erlangb(_0x20e9cd,_0x3fe711){if(_0x3fe711===0x0){return 0x0;}var _0x34d1fa=0x1;for(var _0x57da44=0x1;_0x57da44<=_0x3fe711;_0x57da44+=0x1){_0x34d1fa=0x1+_0x34d1fa*_0x57da44/_0x20e9cd;}return 0x1/_0x34d1fa;}function isVoiceQueueOutbound(_0x2394f9){return _0x2394f9===_0xad87('0x4a');}function isNotPreview(_0x428efa){return _0x428efa!==_0xad87('0x1d');}function isCampaignIvr(_0x199151){return _0x199151===_0xad87('0x78');}function getCallerId(_0x85f740,_0x34b997,_0x11a23a){if(!_['isUndefined'](_0x11a23a)&&_0xad87('0x91')===typeof _0x11a23a&&!_['isEmpty'](_0x11a23a)){if(!_[_0xad87('0x39')](_0x34b997)&&_0xad87('0x91')===typeof _0x34b997&&!_[_0xad87('0x44')](_0x34b997)){return util[_0xad87('0x76')](_0xad87('0x92'),_0x34b997,_0x11a23a);}return util[_0xad87('0x76')](_0xad87('0x92'),_0x11a23a,_0x11a23a);}if(!_[_0xad87('0x39')](_0x85f740)&&_0xad87('0x91')===typeof _0x85f740&&!_[_0xad87('0x44')](_0x85f740)){return _0x85f740;}return _0xad87('0x93');}function loggerCatchQueueSummary(_0x248dcc,_0x4a1ae2){return function(_0x3dd246){freeVariablesPredictive(_0x4a1ae2);emitVoiceQueueSummary(_0x4a1ae2);emitCampaignSummary(_0x4a1ae2);loggerSyncQueueSummary[_0xad87('0x94')](_0x248dcc,util['inspect'](_0x3dd246,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x72a0aa,_0x18b3cf){return function(_0x3d023f){loggerPredictive[_0xad87('0x94')](_0x18b3cf[_0xad87('0x3c')],_0x72a0aa);loggerPredictive[_0xad87('0x94')](_0x3d023f[_0xad87('0x95')]);freeVariablesPredictive(_0x18b3cf);};}function loggerCatch(_0x1009f2){return function(_0x2f4fa3){logger[_0xad87('0x94')](_0x1009f2,util[_0xad87('0x96')](_0x2f4fa3,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x281b71){return _0x281b71&&!_[_0xad87('0x39')](_0x281b71)&&_0x281b71[_0xad87('0x97')]>0x0;}function decremetOriginate(_0x27def1){if(!_[_0xad87('0x39')](_0x27def1)&&_0x27def1!==null){if(_0x27def1[_0xad87('0x98')](_0xad87('0x6c'))){if(_0x27def1[_0xad87('0x6c')]>0x0){_0x27def1['originated']-=0x1;}else{logger[_0xad87('0x94')](_0xad87('0x99'));}}}else{logger[_0xad87('0x94')](_0xad87('0x9a'));}}function checkContactLowerLimitOriginate(_0x34c593,_0x19b6a8,_0x4f8bf4){if(_0x19b6a8>_0x4f8bf4){for(var _0x1498b8=0x0;_0x1498b8<_0x19b6a8-_0x4f8bf4;_0x1498b8+=0x1){decremetOriginate(_0x34c593);}}}function loggerGetContactDialer(_0x1f6ce2,_0x39ed81,_0x234d6f){return function(_0x5795bc){checkContactLowerLimitOriginate(_0x39ed81,_0x234d6f,0x0);logger['error'](_0x1f6ce2,util[_0xad87('0x96')](_0x5795bc,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x16e47e){return function(_0x23951d){if(isNotNull(_0x23951d)&&isNotNull(_0x23951d[0x0])){if(_0x23951d[0x0][_0xad87('0x9b')]>0x0){_0x16e47e[_0xad87('0x3a')]='RESCHEDULED_CONTACTS';logger['info'](_0xad87('0x9c')+_0x16e47e[_0xad87('0x3c')],_0x23951d[0x0][_0xad87('0x9b')],_0xad87('0x9d'));}else{_0x16e47e[_0xad87('0x3a')]=_0xad87('0x9e');logger[_0xad87('0x7a')](_0xad87('0x9f')+_0x16e47e[_0xad87('0x3c')]);}}};}function notSendMessagesQueue(_0x2aa05f){if(_0x2aa05f['sendMessageOneNotActive']){freeVariablesPredictive(_0x2aa05f);if(_0x2aa05f['originated']===0x0&&_0x2aa05f['talking']===0x0&&_0x2aa05f['waiting']===0x0&&(_0x2aa05f[_0xad87('0x4e')]||0x0)===0x0){_0x2aa05f['sendMessageOneNotActive']=![];_0x2aa05f[_0xad87('0x4d')]=0x0;_0x2aa05f[_0xad87('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2aa05f[_0xad87('0x3c')],'is\x20not\x20active');}else{_0x2aa05f[_0xad87('0x3a')]=_0xad87('0xa0');loggerSyncQueueSummary[_0xad87('0x94')](_0xad87('0xa1'),_0x2aa05f[_0xad87('0x3c')],_0xad87('0xa2'));}emitVoiceQueueSummary(_0x2aa05f);}}function notSendMessagesCampaign(_0x39e1c8){if(_0x39e1c8['sendMessageOneNotActive']){if(_0x39e1c8[_0xad87('0x6c')]===0x0){_0x39e1c8['sendMessageOneNotActive']=![];_0x39e1c8[_0xad87('0x3a')]=_0xad87('0x3e');loggerSyncQueueSummary[_0xad87('0x94')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x39e1c8[_0xad87('0x3c')],'is\x20not\x20active');}else{_0x39e1c8['message']=_0xad87('0xa0');loggerSyncQueueSummary['error'](_0xad87('0xa3'),_0x39e1c8[_0xad87('0x3c')],_0xad87('0xa2'));}emitCampaignSummary(_0x39e1c8);}}function createObjHistory(_0x523408,_0xf47040,_0x320a4a,_0x166860,_0x39757c){_0x523408[_0xad87('0x3a')]=_0x320a4a;var _0x28b2e0=new Action(_0x523408,_0xf47040);var _0x2b4347=new History(_0x28b2e0);_0x2b4347[_0xad87('0xa4')]=_0x166860;_0x2b4347['statedesc']=_0x39757c;_0x2b4347['endtime']=_0x28b2e0[_0xad87('0xa5')];return _0x2b4347;}Dialer[_0xad87('0xa6')][_0xad87('0x38')]=function(){var _0x140a9f=this;setInterval(function(){_0x140a9f[_0xad87('0xa7')](_0x140a9f[_0xad87('0xa8')],_0xad87('0xa9'));_0x140a9f['clearZombieChannels'](_0x140a9f['actions'],'[actions]');},0x32c8);};Dialer[_0xad87('0xa6')][_0xad87('0xa7')]=function(_0x10a7f4,_0x2e0db9){var _0x4d6882=this;for(var _0x187fcc in _0x10a7f4){if(_0x10a7f4[_0xad87('0x98')](_0x187fcc)){this['sequence'][_0xad87('0xaa')](function(){if(!_[_0xad87('0xab')](_0x10a7f4[_0x187fcc])){return ami[_0xad87('0xac')]({'action':_0xad87('0xad'),'channel':_0x10a7f4[_0x187fcc]['channel']})[_0xad87('0xae')](function(_0x2e47e1){if(_0x2e47e1['message']===_0xad87('0xaf')){setTimeout(function(){if(_0x10a7f4[_0x187fcc]&&_0x10a7f4[_0x187fcc][_0xad87('0x52')]!==_0xad87('0x78')){_0x4d6882[_0xad87('0xb0')](_0x4d6882[_0xad87('0x1e')][_0x10a7f4[_0x187fcc][_0xad87('0xb1')]]);logger['error'](_0xad87('0xb2'),_0x2e0db9,_0x187fcc,_0x10a7f4[_0x187fcc][_0xad87('0xb1')]);delete _0x10a7f4[_0x187fcc];}if(_0x10a7f4[_0x187fcc]&&_0x10a7f4[_0x187fcc][_0xad87('0x52')]===_0xad87('0x78')){_0x4d6882[_0xad87('0xb0')](_0x4d6882[_0xad87('0x1f')][_0x10a7f4[_0x187fcc][_0xad87('0xb1')]]);logger[_0xad87('0x94')](_0xad87('0xb3'),_0x2e0db9,_0x187fcc,_0x10a7f4[_0x187fcc][_0xad87('0xb1')]);delete _0x10a7f4[_0x187fcc];}},0x2328);}});}});}}};Dialer[_0xad87('0xa6')][_0xad87('0xb4')]=function(_0x431794){return BPromise['resolve']()['then'](cmHopper[_0xad87('0xb4')](_0x431794))[_0xad87('0xae')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0xad87('0xb5')]=function(_0x4de74b){return BPromise[_0xad87('0xb6')]()['then'](cmHopperBlack[_0xad87('0xb5')](_0x4de74b))[_0xad87('0xae')](loggerCatch(_0xad87('0xb7')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x3ba4c0){return BPromise[_0xad87('0xb6')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x3ba4c0))[_0xad87('0xae')](loggerCatch(_0xad87('0xb8')));};Dialer['prototype'][_0xad87('0xb9')]=function(_0x301799){return BPromise[_0xad87('0xb6')]()[_0xad87('0xba')](cmHopperHistory[_0xad87('0xbb')](_0x301799))['catch'](loggerCatch(_0xad87('0xbc')));};Dialer[_0xad87('0xa6')][_0xad87('0xbd')]=function(_0x569258){return BPromise[_0xad87('0xb6')]()[_0xad87('0xba')](cmHopper[_0xad87('0xbd')](_0x569258))[_0xad87('0xae')](loggerCatch(_0xad87('0xbe')));};Dialer[_0xad87('0xa6')][_0xad87('0xbf')]=function(_0x32bb0b,_0x54b12e,_0x12291d,_0x505901){return BPromise[_0xad87('0xb6')]()[_0xad87('0xba')](cmHopper[_0xad87('0xbf')](_0x32bb0b,_0x54b12e,_0x12291d,_0x505901))[_0xad87('0xae')](loggerCatch(_0xad87('0xc0')));};Dialer[_0xad87('0xa6')][_0xad87('0xc1')]=function(_0x121e0d,_0x2f2043,_0x338af4){return BPromise[_0xad87('0xb6')]()[_0xad87('0xba')](cmHopper[_0xad87('0xc1')](_0x121e0d,_0x2f2043,_0x338af4))[_0xad87('0xae')](loggerCatch(_0xad87('0xc0')));};Dialer['prototype'][_0xad87('0xc2')]=function(_0x56f7b3){return BPromise[_0xad87('0xb6')]()[_0xad87('0xba')](voiceQueueRt[_0xad87('0xc2')](_0x56f7b3))[_0xad87('0xae')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xad87('0xa6')][_0xad87('0xc3')]=function(_0x3def30){return BPromise['resolve']()[_0xad87('0xba')](cmHopper[_0xad87('0xc3')](_0x3def30))['catch'](loggerCatch(_0xad87('0xc4')));};Dialer[_0xad87('0xa6')][_0xad87('0xc5')]=function(_0x13346a){return BPromise[_0xad87('0xb6')]()[_0xad87('0xba')](cmHopperHistory[_0xad87('0xc5')](_0x13346a))[_0xad87('0xae')](loggerCatch(_0xad87('0xc6')));};Dialer[_0xad87('0xa6')]['updateOriginated']=function(_0x12aafa){if(!_[_0xad87('0x39')](_0x12aafa)&&_0x12aafa!==null){if(_0x12aafa[_0xad87('0x98')]('originated')){if(_0x12aafa[_0xad87('0x6c')]>0x0){_0x12aafa[_0xad87('0x6c')]-=0x1;}else{logger[_0xad87('0x94')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xad87('0x94')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xad87('0xa6')]['loggerHandler']=function(_0x5152b4,_0xea5b8d){var _0x41b3f4=this;return function(_0x24775c){_0x41b3f4[_0xad87('0xb0')](_0xea5b8d);logger[_0xad87('0x94')](_0x5152b4,util[_0xad87('0x96')](_0x24775c,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xad87('0xc7')]=function(_0x35be44,_0x15a1cf,_0x3e111e){var _0x38b75f={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x15a1cf);this[_0xad87('0xc8')](_['merge'](_0x38b75f,_[_0xad87('0xc9')](_0x3e111e,['ContactId',_0xad87('0xca'),'UserId',_0xad87('0xcb'),_0xad87('0xcc')])),_0xad87('0xcd'),'[emptyContact]');logger[_0xad87('0x94')](_0x35be44);};Dialer[_0xad87('0xa6')][_0xad87('0xce')]=function(_0x11b127){return _0x11b127===_0xad87('0xcf');};Dialer[_0xad87('0xa6')][_0xad87('0xd0')]=function(_0xae2cf){return!_['isUndefined'](_0xae2cf)&&_0xae2cf&&!_[_0xad87('0x39')](_0xae2cf[_0xad87('0x3c')])&&!_[_0xad87('0x39')](_0xae2cf[_0xad87('0x73')])&&_0xae2cf[_0xad87('0x73')]&&(this['trunks'][util[_0xad87('0x76')]('SIP/%s',_0xae2cf['name'])][_0xad87('0xad')]==='reachable'||this[_0xad87('0x21')][util[_0xad87('0x76')](_0xad87('0xd1'),_0xae2cf[_0xad87('0x3c')])][_0xad87('0xad')]===_0xad87('0xd2'));};Dialer[_0xad87('0xa6')]['saveInDb']=function(_0x15126c,_0x15dbda,_0x30eab4){this[_0xad87('0xc5')](_0x15126c)['catch'](loggerCatch(_0x15dbda));this[_0xad87('0xc3')](_0x15126c)[_0xad87('0xae')](loggerCatch(_0x30eab4));};Dialer['prototype'][_0xad87('0x33')]=function(_0x5553b3){var _0x3fc970=this[_0xad87('0xa8')][_0x5553b3[_0xad87('0xd3')]];var _0x2dff93;if(!_['isNil'](_0x5553b3)&&!_[_0xad87('0xab')](_0x5553b3[_0xad87('0xd4')])&&!_[_0xad87('0xab')](_0x5553b3[_0xad87('0xd4')][_0xad87('0xd5')])&&_0x5553b3[_0xad87('0xd6')]===_0xad87('0xd7')&&_0x3fc970){if(_0x3fc970[_0xad87('0x52')]!=='ivr'&&this[_0xad87('0x1e')][_0x3fc970[_0xad87('0xb1')]][_0xad87('0xd8')]&&_0x5553b3[_0xad87('0xd9')]===_0xad87('0xda')){delete this[_0xad87('0xa8')][_0x5553b3[_0xad87('0xd3')]];this[_0xad87('0xb0')](this['voiceQueues'][_0x3fc970[_0xad87('0xb1')]]);this[_0xad87('0x1e')][_0x3fc970['queue']][_0xad87('0x5a')]+=0x1;this['voiceQueues'][_0x3fc970[_0xad87('0xb1')]]['outboundAnswerAgiCallsDay']+=0x1;_0x2dff93=new Hangup(_0x3fc970,_0x5553b3);_0x2dff93[_0xad87('0xa4')]=0x12;_0x2dff93[_0xad87('0xdb')]='HangupInAMD';_0x2dff93[_0xad87('0xdc')]='AMD';this['saveInDb'](_0x2dff93,_0xad87('0xdd'),'[syncHangupInAMD]');}if(_0x3fc970[_0xad87('0x52')]!==_0xad87('0x78')&&this[_0xad87('0x1e')][_0x3fc970[_0xad87('0xb1')]]['dialAMDActive']&&_0x5553b3['value']===_0xad87('0xde')){delete this[_0xad87('0xa8')][_0x5553b3[_0xad87('0xd3')]];this[_0xad87('0xb0')](this['voiceQueues'][_0x3fc970[_0xad87('0xb1')]]);this[_0xad87('0x1e')][_0x3fc970[_0xad87('0xb1')]][_0xad87('0x5a')]+=0x1;this[_0xad87('0x1e')][_0x3fc970[_0xad87('0xb1')]][_0xad87('0xdf')]+=0x1;_0x2dff93=new Hangup(_0x3fc970,_0x5553b3);_0x2dff93[_0xad87('0xa4')]=0x13;_0x2dff93[_0xad87('0xdb')]=_0xad87('0xe0');_0x2dff93[_0xad87('0xdc')]=_0xad87('0xe1');_0x2dff93['amd']=!![];this['saveInDb'](_0x2dff93,_0xad87('0xe2'),_0xad87('0xe3'));}if(_0x3fc970[_0xad87('0x52')]===_0xad87('0x78')&&this[_0xad87('0x1f')][_0x3fc970['queue']]['dialAMDActive']&&_0x5553b3[_0xad87('0xd9')]==='HANGUP'){delete this['uniqueId'][_0x5553b3[_0xad87('0xd3')]];this['updateOriginated'](this[_0xad87('0x1f')][_0x3fc970[_0xad87('0xb1')]]);_0x2dff93=new Hangup(_0x3fc970,_0x5553b3);_0x2dff93['state']=0x12;_0x2dff93[_0xad87('0xdb')]=_0xad87('0xe4');_0x2dff93[_0xad87('0xdc')]=_0xad87('0xe1');this[_0xad87('0xc8')](_0x2dff93,_0xad87('0xe5'),_0xad87('0xe6'));}if(_0x3fc970[_0xad87('0x52')]==='ivr'&&this[_0xad87('0x1f')][_0x3fc970[_0xad87('0xb1')]]['dialAMDActive']&&_0x5553b3[_0xad87('0xd9')]===_0xad87('0xde')){delete this[_0xad87('0xa8')][_0x5553b3['uniqueid']];this[_0xad87('0xb0')](this[_0xad87('0x1f')][_0x3fc970['queue']]);_0x2dff93=new Hangup(_0x3fc970,_0x5553b3);_0x2dff93['state']=0x13;_0x2dff93[_0xad87('0xdb')]=_0xad87('0xe0');_0x2dff93[_0xad87('0xdc')]='AMD';_0x2dff93[_0xad87('0xe7')]=!![];this['saveInDb'](_0x2dff93,_0xad87('0xe8'),_0xad87('0xe9'));}}};Dialer[_0xad87('0xa6')][_0xad87('0x31')]=function(_0x58f863){var _0x253abd=this['uniqueId'][_0x58f863[_0xad87('0xd3')]];var _0x3ff91a=this;var _0xeb3cee;if(_0x253abd&&_0x253abd[_0xad87('0x52')]==='ivr'){delete this[_0xad87('0xa8')][_0x58f863[_0xad87('0xd3')]];this[_0xad87('0xb0')](this[_0xad87('0x1f')][_0x253abd[_0xad87('0xb1')]]);this[_0xad87('0x1f')][_0x253abd[_0xad87('0xb1')]][_0xad87('0xea')]+=0x1;_0xeb3cee=new Hangup(_0x253abd,_0x58f863);this[_0xad87('0xc5')](_0xeb3cee)[_0xad87('0xae')](loggerCatch(_0xad87('0xeb')));this[_0xad87('0xc3')](_0xeb3cee)['catch'](loggerCatch(_0xad87('0xec')));}if(_0x253abd&&_0x253abd['type']!==_0xad87('0x78')&&isNotNull(this['voiceQueues'][_0x253abd[_0xad87('0xb1')]][_0xad87('0xed')])){delete this[_0xad87('0xa8')][_0x58f863[_0xad87('0xd3')]];this[_0xad87('0xb0')](this[_0xad87('0x1e')][_0x253abd['queue']]);this[_0xad87('0x1e')][_0x253abd['queue']][_0xad87('0x5a')]+=0x1;this['voiceQueues'][_0x253abd[_0xad87('0xb1')]][_0xad87('0xdf')]+=0x1;_0xeb3cee=new Hangup(_0x253abd,_0x58f863);_0xeb3cee[_0xad87('0xa4')]=0x10;_0xeb3cee[_0xad87('0xdb')]=_0xad87('0xee');_0xeb3cee['membername']=_0xad87('0xef');this[_0xad87('0xc5')](_0xeb3cee)[_0xad87('0xae')](loggerCatch(_0xad87('0xeb')));this['moveContactManagedDialer'](_0xeb3cee)[_0xad87('0xae')](loggerCatch(_0xad87('0xec')));}if(_0x253abd&&_0x253abd[_0xad87('0x52')]!==_0xad87('0x78')&&!isNotNull(this[_0xad87('0x1e')][_0x253abd['queue']][_0xad87('0xed')])){delete this[_0xad87('0xa8')][_0x58f863['uniqueid']];this[_0xad87('0xb0')](this['voiceQueues'][_0x253abd['queue']]);this[_0xad87('0x1e')][_0x253abd['queue']][_0xad87('0xf0')]+=0x1;_0xeb3cee=new Hangup(_0x253abd,_0x58f863);_0xeb3cee[_0xad87('0xa4')]=0xc;_0xeb3cee[_0xad87('0xdb')]=_0x58f863[_0xad87('0xf1')];_0xeb3cee[_0xad87('0xdc')]='Unknow';this[_0xad87('0xc5')](_0xeb3cee)[_0xad87('0xae')](loggerCatch(_0xad87('0xeb')));this[_0xad87('0xc3')](_0xeb3cee)[_0xad87('0xae')](loggerCatch(_0xad87('0xec')));}};Dialer[_0xad87('0xa6')][_0xad87('0x2f')]=function(_0x1afcde){var _0x3a83d3=this['uniqueId'][_0x1afcde[_0xad87('0xd3')]];var _0x1a0519=this;if(this['voiceQueues'][_0x1afcde['queue']]){if(_0x3a83d3&&_0x3a83d3[_0xad87('0x52')]!==_0xad87('0x78')){delete this[_0xad87('0xa8')][_0x1afcde[_0xad87('0xd3')]];this[_0xad87('0x1e')][_0x1afcde[_0xad87('0xb1')]][_0xad87('0x5a')]+=0x1;var _0x4d4213=new AgentComplete(_0x3a83d3,_0x1afcde);if(_0x1afcde[_0xad87('0xf2')]==='agent'){_0x4d4213[_0xad87('0xf3')]=this['voiceQueues'][_0x1afcde[_0xad87('0xb1')]][_0xad87('0xf4')]&&this[_0xad87('0x1e')][_0x1afcde['queue']][_0xad87('0xf5')]?moment()[_0xad87('0x76')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xad87('0xc5')](_0x4d4213)[_0xad87('0xae')](loggerCatch(_0xad87('0xf6')));this[_0xad87('0xc3')](_0x4d4213)[_0xad87('0xae')](loggerCatch(_0xad87('0xf7')));}}};Dialer[_0xad87('0xa6')]['syncAgentConnect']=function(_0x1f738c){if(this['voiceQueues'][_0x1f738c[_0xad87('0xb1')]]){if(this[_0xad87('0xa8')][_0x1f738c[_0xad87('0xd3')]]&&this[_0xad87('0xa8')][_0x1f738c[_0xad87('0xd3')]][_0xad87('0x52')]!==_0xad87('0x78')){this['updateOriginated'](this[_0xad87('0x1e')][_0x1f738c[_0xad87('0xb1')]]);this[_0xad87('0xa8')][_0x1f738c[_0xad87('0xd3')]][_0xad87('0xf8')]=moment()[_0xad87('0x76')](_0xad87('0xf9'));}}};Dialer['prototype'][_0xad87('0xfa')]=function(_0x52c300){this['createHistory'](_0x52c300)[_0xad87('0xae')](loggerCatch(_0xad87('0xf6')));this[_0xad87('0xc3')](_0x52c300)[_0xad87('0xae')](loggerCatch(_0xad87('0xfb')));};Dialer[_0xad87('0xa6')][_0xad87('0xfc')]=function(_0x18d4b1){var _0x59b534=this['uniqueId'][_0x18d4b1[_0xad87('0xd3')]];var _0x2f2a5d=this;if(this[_0xad87('0x1e')][_0x18d4b1[_0xad87('0xb1')]]){if(_0x59b534&&_0x59b534[_0xad87('0x52')]!=='ivr'){delete this[_0xad87('0xa8')][_0x18d4b1[_0xad87('0xd3')]];this[_0xad87('0xb0')](this[_0xad87('0x1e')][_0x18d4b1[_0xad87('0xb1')]]);_0x59b534[_0xad87('0xfd')]=moment()[_0xad87('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x38f58f=new QueueCallerAbandon(_0x59b534,_0x18d4b1);if(getSeconds(_0x59b534['droptime'],_0x59b534[_0xad87('0xfe')])>=_0x59b534[_0xad87('0xff')]){this['voiceQueues'][_0x18d4b1['queue']][_0xad87('0x66')]+=0x1;this[_0xad87('0x1e')][_0x18d4b1[_0xad87('0xb1')]][_0xad87('0x5f')]+=0x1;this[_0xad87('0x1e')][_0x18d4b1['queue']][_0xad87('0x100')]+=0x1;_0x38f58f['state']=0xa;_0x38f58f[_0xad87('0xdb')]=_0xad87('0x101');_0x38f58f['dropreason']=_0xad87('0x102');_0x38f58f[_0xad87('0xf3')]=this['voiceQueues'][_0x18d4b1[_0xad87('0xb1')]][_0xad87('0xf4')]?moment()['format'](_0xad87('0xf9')):undefined;this[_0xad87('0xfa')](_0x38f58f);}else{this[_0xad87('0x1e')][_0x18d4b1['queue']][_0xad87('0x65')]+=0x1;this['voiceQueues'][_0x18d4b1['queue']]['outboundDropCallsDayCallersExit']+=0x1;_0x38f58f[_0xad87('0xa4')]=0xb;_0x38f58f['statedesc']='Abandoned';_0x38f58f[_0xad87('0x103')]='CALLEREXIT';this[_0xad87('0xfa')](_0x38f58f);}}}};Dialer[_0xad87('0xa6')]['syncNewExten']=function(_0x168e72){if(this[_0xad87('0x24')][_0x168e72[_0xad87('0xd3')]]){this['actions'][_0x168e72[_0xad87('0xd3')]]['channel']=_0x168e72[_0xad87('0x104')];}if(this['uniqueId'][_0x168e72[_0xad87('0xd3')]]){this[_0xad87('0xa8')][_0x168e72[_0xad87('0xd3')]][_0xad87('0x104')]=_0x168e72[_0xad87('0x104')];}};Dialer['prototype'][_0xad87('0x105')]=function(_0x2d7586){if(strategy[this[_0xad87('0x1e')][this[_0xad87('0x24')][_0x2d7586[_0xad87('0x106')]][_0xad87('0xb1')]][_0xad87('0x4b')]]===_0xad87('0x19')){if(this[_0xad87('0x24')][_0x2d7586['actionid']]&&_[_0xad87('0xab')](this[_0xad87('0x24')][_0x2d7586[_0xad87('0x106')]][_0xad87('0x107')])&&_0x2d7586[_0xad87('0xad')]==='1'&&_0x2d7586[_0xad87('0x108')]==='0'){if(this[_0xad87('0x20')][_0x2d7586[_0xad87('0x109')]]){if(!this['agents'][_0x2d7586[_0xad87('0x109')]]['locked']){this[_0xad87('0x20')][_0x2d7586[_0xad87('0x109')]][_0xad87('0x107')]=!![];this['actions'][_0x2d7586[_0xad87('0x106')]][_0xad87('0x107')]=!![];this[_0xad87('0x24')][_0x2d7586[_0xad87('0x106')]]['stateinterface']=_0x2d7586['stateinterface'];}}}}else if((strategy[this[_0xad87('0x1e')][this[_0xad87('0x24')][_0x2d7586[_0xad87('0x106')]][_0xad87('0xb1')]][_0xad87('0x4b')]]||'rrmemory')===_0xad87('0x10a')){if(this[_0xad87('0x24')][_0x2d7586[_0xad87('0x106')]]){if(this[_0xad87('0x20')][_0x2d7586['stateinterface']]){this[_0xad87('0x24')][_0x2d7586['actionid']][_0xad87('0x109')]=_0x2d7586[_0xad87('0x109')];if(_['isNil'](this[_0xad87('0x28')][this[_0xad87('0x24')][_0x2d7586[_0xad87('0x106')]]['queue']])){this['queueBooked'][this[_0xad87('0x24')][_0x2d7586[_0xad87('0x106')]][_0xad87('0xb1')]]=[];}this[_0xad87('0x28')][this['actions'][_0x2d7586[_0xad87('0x106')]][_0xad87('0xb1')]][_0xad87('0x10b')](_['merge'](_[_0xad87('0xc9')](this[_0xad87('0x24')][_0x2d7586[_0xad87('0x106')]],['idHopper',_0xad87('0x109')]),{'status':_0x2d7586[_0xad87('0xad')],'paused':_0x2d7586[_0xad87('0x108')]}));}}}};function unlockQueueStatus(_0x4a7c8f,_0x51a4ef){setTimeout(function(){if(_[_0xad87('0x39')](_0x4a7c8f['queueStatusComplete'])){loggerBooked[_0xad87('0x94')]('[unlockQueueStatus][undefined]',_0x51a4ef);}_0x4a7c8f['queueStatusComplete']=!![];loggerBooked[_0xad87('0x7a')](_0xad87('0x10c'),_0x51a4ef,JSON[_0xad87('0x46')](_[_0xad87('0xc9')](_0x4a7c8f,[_0xad87('0x3c'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xad87('0xa6')][_0xad87('0x36')]=function(_0x3f838a){var _0x202353=this;var _0x2486d9=_0x202353[_0xad87('0x1e')][_0x202353[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]];if(strategy[this[_0xad87('0x1e')][this[_0xad87('0x24')][_0x3f838a['actionid']][_0xad87('0xb1')]][_0xad87('0x4b')]]==='roundrobin'){if(this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]]&&this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0x109')]){this['preview'][_0xad87('0x10d')](this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0x10e')],this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]]['stateinterface'])['catch'](function(_0x3c0591){logger[_0xad87('0x94')](_0xad87('0x10f'),util['inspect'](_0x3c0591,{'showHidden':![],'depth':null}));})['finally'](function(){_0x202353[_0xad87('0xb0')](_0x202353[_0xad87('0x1e')][_0x202353[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]]);_0x202353['agents'][_0x202353['actions'][_0x3f838a[_0xad87('0x106')]][_0xad87('0x109')]][_0xad87('0x107')]=![];delete _0x202353['actions'][_0x3f838a['actionid']];unlockQueueStatus(_0x2486d9);});}else{this[_0xad87('0xb0')](this[_0xad87('0x1e')][this['actions'][_0x3f838a[_0xad87('0x106')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x3f838a[_0xad87('0x106')]][_0xad87('0x110')],'ListId':this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xca')],'VoiceQueueId':this['actions'][_0x3f838a[_0xad87('0x106')]][_0xad87('0xcb')]||undefined,'CampaignId':this['actions'][_0x3f838a[_0xad87('0x106')]]['CampaignId']||undefined})[_0xad87('0xae')](loggerCatch(_0xad87('0x111')));delete this['actions'][_0x3f838a[_0xad87('0x106')]];unlockQueueStatus(_0x2486d9);}}else if((strategy[this[_0xad87('0x1e')][this[_0xad87('0x24')][_0x3f838a['actionid']]['queue']][_0xad87('0x4b')]]||_0xad87('0x10a'))===_0xad87('0x10a')){var _0xec8222;if(this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]]&&!_['isEmpty'](this[_0xad87('0x28')][this['actions'][_0x3f838a[_0xad87('0x106')]]['queue']])){if(this[_0xad87('0x29')][_0x202353[_0xad87('0x24')][_0x3f838a['actionid']][_0xad87('0xb1')]]){this[_0xad87('0x29')][_0x202353['actions'][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]]=this['queueBookedRR'][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]]?this['queueBookedRR'][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]]['queue']]:this[_0xad87('0x28')][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]]['queue']]?this[_0xad87('0x28')][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]]['_rr']||0x0:0x0;}this[_0xad87('0x28')][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]][_0xad87('0x112')]=this[_0xad87('0x29')][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]]['queue']];for(var _0x460380=0x0;_0x460380<this[_0xad87('0x28')][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]][_0xad87('0x97')];_0x460380+=0x1){_0xec8222=rr(this[_0xad87('0x28')][this[_0xad87('0x24')][_0x3f838a['actionid']][_0xad87('0xb1')]]);this['queueBookedRR'][_0x202353[_0xad87('0x24')][_0x3f838a['actionid']][_0xad87('0xb1')]]=this[_0xad87('0x28')][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]]['queue']]['_rr'];if(_0xec8222[_0xad87('0xad')]==='1'&&_0xec8222[_0xad87('0x108')]==='0'){break;}}if(!_[_0xad87('0xab')](_0xec8222)){this[_0xad87('0x20')][_0xec8222[_0xad87('0x109')]][_0xad87('0x113')]=_['isUndefined'](this[_0xad87('0x20')][_0xec8222[_0xad87('0x109')]]['unlockRR'])?!![]:this[_0xad87('0x20')][_0xec8222[_0xad87('0x109')]][_0xad87('0x113')];}loggerBooked[_0xad87('0x7a')](_0xad87('0x114'),_0x3f838a[_0xad87('0x106')],_0xad87('0x115'),JSON[_0xad87('0x46')](_['pick'](this[_0xad87('0x20')][_0xec8222[_0xad87('0x109')]],[_0xad87('0x3c'),'unlockRR'])),_0xad87('0x116'),JSON[_0xad87('0x46')](_0xec8222['idHopper']));if(!_['isNil'](_0xec8222)&&_0xec8222[_0xad87('0xad')]==='1'&&_0xec8222[_0xad87('0x108')]==='0'&&this[_0xad87('0x20')][_0xec8222['stateinterface']][_0xad87('0x113')]){this[_0xad87('0x20')][_0xec8222[_0xad87('0x109')]]['unlockRR']=![];this['queueBooked'][_0x202353[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]]=[];this['preview'][_0xad87('0x10d')](_0xec8222[_0xad87('0x10e')],_0xec8222[_0xad87('0x109')])[_0xad87('0xae')](function(_0x14e9cf){logger[_0xad87('0x94')](_0xad87('0x10f'),util[_0xad87('0x96')](_0x14e9cf,{'showHidden':![],'depth':null}));})['finally'](function(){_0x202353['updateOriginated'](_0x202353[_0xad87('0x1e')][_0x202353['actions'][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]]);setTimeout(function(){_0x202353[_0xad87('0x20')][_0xec8222[_0xad87('0x109')]][_0xad87('0x113')]=!![];loggerBooked[_0xad87('0x7a')](_0xad87('0x117'),_0x3f838a[_0xad87('0x106')],_0xad87('0x115'),JSON[_0xad87('0x46')](_[_0xad87('0xc9')](_0x202353[_0xad87('0x20')][_0xec8222['stateinterface']],['name','unlockRR'])),_0xad87('0x116'),JSON[_0xad87('0x46')](_0xec8222[_0xad87('0x10e')]));},0xc7);delete _0x202353['actions'][_0x3f838a[_0xad87('0x106')]];unlockQueueStatus(_0x2486d9,_0x3f838a['actionid']);});}else{loggerBooked['info'](_0xad87('0x118'));this[_0xad87('0xb0')](this['voiceQueues'][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]]);this[_0xad87('0xbd')]({'active':![],'ContactId':this[_0xad87('0x24')][_0x3f838a['actionid']][_0xad87('0x110')],'ListId':this[_0xad87('0x24')][_0x3f838a['actionid']][_0xad87('0xca')],'VoiceQueueId':this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xcb')]||undefined,'CampaignId':this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xcc')]||undefined})[_0xad87('0xae')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]];unlockQueueStatus(_0x2486d9);}}else{loggerBooked['info'](_0xad87('0x119'));this[_0xad87('0xb0')](this[_0xad87('0x1e')][this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]]);this[_0xad87('0xbd')]({'active':![],'ContactId':this[_0xad87('0x24')][_0x3f838a['actionid']][_0xad87('0x110')],'ListId':this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]]['ListId'],'VoiceQueueId':this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xcb')]||undefined,'CampaignId':this[_0xad87('0x24')][_0x3f838a['actionid']]['CampaignId']||undefined})['catch'](loggerCatch(_0xad87('0x11a')));delete this[_0xad87('0x24')][_0x3f838a['actionid']];unlockQueueStatus(_0x2486d9);}}else{loggerBooked[_0xad87('0x7a')]('[booked][unlock3]');this[_0xad87('0xb0')](this[_0xad87('0x1e')][this['actions'][_0x3f838a[_0xad87('0x106')]][_0xad87('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x3f838a[_0xad87('0x106')]][_0xad87('0x110')],'ListId':this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xca')],'VoiceQueueId':this['actions'][_0x3f838a['actionid']][_0xad87('0xcb')]||undefined,'CampaignId':this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]][_0xad87('0xcc')]||undefined})[_0xad87('0xae')](loggerCatch(_0xad87('0x11b')));delete this[_0xad87('0x24')][_0x3f838a[_0xad87('0x106')]];unlockQueueStatus(_0x2486d9);}};Dialer[_0xad87('0xa6')][_0xad87('0x37')]=function(){var _0x92dc02=this;setInterval(function(){_0x92dc02[_0xad87('0x11c')]();},0x3e8);};Dialer[_0xad87('0xa6')][_0xad87('0x11d')]=function(_0x501f91){var _0x36dcd2=this;return function(){if(!_0x36dcd2['isTrunkReachable'](_0x501f91[_0xad87('0x72')])){if(!_0x36dcd2[_0xad87('0xd0')](_0x501f91[_0xad87('0x11e')])){_0x501f91[_0xad87('0x3a')]=_0xad87('0x11f');throw _0x501f91[_0xad87('0x3c')]+_0xad87('0x120');}}};};Dialer['prototype'][_0xad87('0x121')]=function(_0x195eb1,_0x2d846e,_0x2d7f0e,_0x315f13){var _0x5c9b91=this;return function(){var _0xfd469=!![];return _0x5c9b91[_0xad87('0x122')](_0x195eb1,_0x2d846e,_0x2d7f0e,_0x315f13,_0xfd469);};};Dialer[_0xad87('0xa6')][_0xad87('0x123')]=function(_0x2d5b52,_0x2fdb51,_0x23ca7c,_0x534cf0){var _0x29ffe8=this;return function(){var _0x27174f=![];return _0x29ffe8[_0xad87('0x122')](_0x2d5b52[_0xad87('0x43')],_0x2fdb51,_0x23ca7c,_0x534cf0,_0x27174f);};};Dialer[_0xad87('0xa6')][_0xad87('0x122')]=function(_0x51cf9d,_0x1aaae7,_0x334bb5,_0x5e2ff7,_0x35dd82){var _0x73e885=[];return new BPromise(function(_0x4e904a,_0x128ef0){if(!isNotNull(_0x51cf9d)){_0x5e2ff7[_0xad87('0x3a')]='INTERVAL_IS_NULL';return _0x128ef0(msgResponse(_0xad87('0x122'),_0xad87('0x124'),_0x334bb5+'\x20Intervals\x20is\x20null\x20'));}if(_[_0xad87('0x44')](_0x51cf9d)){_0x5e2ff7[_0xad87('0x3a')]=_0xad87('0x125');return _0x128ef0(msgResponse('ifTime','Failure',_0x334bb5+'\x20Intervals\x20is\x20empty\x20'));}if(_0x1aaae7&&_['isUndefined'](config[_0xad87('0x126')][_0x1aaae7])){_0x5e2ff7['message']=_0xad87('0x127');return _0x128ef0(msgResponse(_0xad87('0x122'),_0xad87('0x124'),_0x334bb5+_0xad87('0x128')+_0x1aaae7));}if(_[_0xad87('0x129')](_0x51cf9d)){for(var _0x43a704=0x0;_0x43a704<_0x51cf9d[_0xad87('0x97')];_0x43a704+=0x1){_0x73e885[_0xad87('0x10b')](ami[_0xad87('0xac')]({'action':_0xad87('0x12a'),'command':util['format'](_0xad87('0x12b'),_0x51cf9d[_0x43a704][_0xad87('0x12c')],!_[_0xad87('0x39')](config['timezones'][_0x1aaae7])?_0x1aaae7:'')})[_0xad87('0xba')](function(_0x2b2fa7){return _0x2b2fa7[_0xad87('0x12d')][_0xad87('0x12e')](_0xad87('0x12f'))>=0x0?!![]:![];})[_0xad87('0xae')](myreject(_0x128ef0)));}}else{_0x73e885['push'](ami['Action']({'action':'command','command':util[_0xad87('0x76')](_0xad87('0x12b'),_0x51cf9d,!_['isUndefined'](config[_0xad87('0x126')][_0x1aaae7])?_0x1aaae7:'')})[_0xad87('0xba')](function(_0x4ce0b5){return _0x4ce0b5[_0xad87('0x12d')]['indexOf'](_0xad87('0x12f'))>=0x0?!![]:![];})['catch'](myreject(_0x128ef0)));}BPromise[_0xad87('0x130')](_0x73e885)['then'](function(_0x38752a){var _0x2f5c95=_['some'](_0x38752a);if(_0x2f5c95){return _0x4e904a(_0x2f5c95);}else{_0x5e2ff7[_0xad87('0x3a')]=_0x35dd82?_0xad87('0x131'):_0xad87('0x132');return _0x128ef0(msgResponse(_0xad87('0x133'),_0xad87('0x124'),_0xad87('0x134')+_0x35dd82+'\x20'+_0x334bb5+'\x20Interval\x20is\x20overtime:\x20'+util[_0xad87('0x96')](_0x51cf9d,{'showHidden':![],'depth':null})+_0xad87('0x135')+_0x1aaae7));}})['catch'](function(_0x21ec1c){return _0x128ef0(msgResponse(_0xad87('0x122'),_0xad87('0x124'),JSON[_0xad87('0x46')](_0x21ec1c)));});});};Dialer[_0xad87('0xa6')][_0xad87('0x136')]=function(_0x178c95){var _0x10d2ab=this;return function(){switch(_0x178c95[_0xad87('0x58')]){case _0xad87('0x137'):freeVariablesPredictive(_0x178c95);_0x10d2ab['handlePower'](_0x178c95,0x1);break;case'power':freeVariablesPredictive(_0x178c95);_0x10d2ab['handlePower'](_0x178c95,_0x178c95[_0xad87('0x138')]);break;case _0xad87('0x7'):_0x10d2ab['predictive'](_0x178c95);break;case'booked':freeVariablesPredictive(_0x178c95);_0x10d2ab[_0xad87('0x139')](_0x178c95,0x1);break;default:freeVariablesPredictive(_0x178c95);logger[_0xad87('0x94')]('Queue',_0x178c95['name'],_0xad87('0x13a'));}};};Dialer['prototype'][_0xad87('0x13b')]=function(_0xa999f2){var _0xf09f15=this;return function(){_0xf09f15[_0xad87('0x13c')](_0xa999f2);};};Dialer['prototype']['syncQueueSummary']=function(_0x1b6580){var _0x5ba474=this;if(isNotPreview(_0x1b6580['dialMethod'])){if(isVoiceQueueOutbound(_0x1b6580['type'])&&isActive(_0x1b6580[_0xad87('0x57')])){_0x1b6580[_0xad87('0x13d')]=!![];BPromise[_0xad87('0xb6')]()['then'](checkIsLoggedIn(_0x1b6580,_0x1b6580['loggedIn']))[_0xad87('0xba')](checkIsActive(_0x1b6580,_0x1b6580[_0xad87('0x57')]))['then'](checkInterval(_0x1b6580))[_0xad87('0xba')](_0x5ba474[_0xad87('0x11d')](_0x1b6580))[_0xad87('0xba')](_0x5ba474[_0xad87('0x121')](_0x1b6580[_0xad87('0x13e')],_0x1b6580[_0xad87('0x13f')],_0x1b6580[_0xad87('0x3c')],_0x1b6580))[_0xad87('0xba')](_0x5ba474[_0xad87('0x123')](_0x1b6580[_0xad87('0x40')],_0x1b6580[_0xad87('0x13f')],_0x1b6580[_0xad87('0x3c')],_0x1b6580))['then'](_0x5ba474['checkDialMethod'](_0x1b6580))[_0xad87('0xae')](loggerCatchQueueSummary(_0xad87('0x140'),_0x1b6580));}else{notSendMessagesQueue(_0x1b6580);}}else{freeVariablesPredictive(_0x1b6580);}};Dialer[_0xad87('0xa6')][_0xad87('0x11c')]=function(){var _0xf4f26a=this;var _0xae21fb;for(var _0x48e9cb in this[_0xad87('0x1f')]){if(this[_0xad87('0x1f')]['hasOwnProperty'](_0x48e9cb)){_0xae21fb=this[_0xad87('0x1f')][_0x48e9cb];if(isCampaignIvr(_0xae21fb['type'])&&isActive(_0xae21fb[_0xad87('0x73')])){_0xae21fb[_0xad87('0x13d')]=!![];BPromise['resolve']()[_0xad87('0xba')](checkIsActive(_0xae21fb,_0xae21fb[_0xad87('0x73')]))[_0xad87('0xba')](checkInterval(_0xae21fb))[_0xad87('0xba')](_0xf4f26a[_0xad87('0x11d')](_0xae21fb))[_0xad87('0xba')](_0xf4f26a[_0xad87('0x121')](_0xae21fb[_0xad87('0x13e')],_0xae21fb[_0xad87('0x13f')],_0xae21fb[_0xad87('0x3c')],_0xae21fb))[_0xad87('0xba')](_0xf4f26a['checkIfTimeIntervals'](_0xae21fb[_0xad87('0x40')],_0xae21fb['dialTimezone'],_0xae21fb['name'],_0xae21fb))[_0xad87('0xba')](_0xf4f26a[_0xad87('0x13b')](_0xae21fb))[_0xad87('0xae')](loggerCatchQueueSummary(_0xad87('0x141'),_0xae21fb));}else{notSendMessagesCampaign(_0xae21fb);}}}};function getCallerIdRandom(_0x511956,_0x3e3425){var _0x3835ab,_0x1d688b,_0x431b84;if(_0x3e3425<=0x0){_0x3e3425=0x1;}_0x3835ab=new RegExp(_0xad87('0x142')+_0x3e3425+'}$');_0x1d688b=Math[_0xad87('0x143')](0xa,_0x3e3425-0x1);_0x431b84=Math[_0xad87('0x143')](0xa,_0x3e3425)-0x1;return util['format']('%s',_['replace'](_0x511956,_0x3835ab,_['random'](_0x1d688b,_0x431b84)));}function extractCalleridName(_0xd3879a){var _0x2cb12e=_0xd3879a['match'](/"(.*?)"/);return _0x2cb12e?_0x2cb12e[0x1]:_0xd3879a;}function extractCalleridNumber(_0x2c88f1){var _0x1073c0=_0x2c88f1[_0xad87('0x144')](/<(.*?)>/);return _0x1073c0?_0x1073c0[0x1]:_0x2c88f1;}Dialer[_0xad87('0xa6')][_0xad87('0x145')]=function(_0x50d8f9,_0x2233b7){var _0x1a3278=this;var _0x30286d=uuid['v4']();this[_0xad87('0x24')][_0x30286d]=new Action(_0x50d8f9,_0x2233b7,_0x30286d);return new BPromise(function(_0x41a6ba,_0x3388fe){if(_[_0xad87('0x39')](_0x50d8f9)&&_0xad87('0x146')!==typeof _0x50d8f9){return _0x3388fe(msgResponse(_0xad87('0x147'),'Failure',_0xad87('0x148')));}if(_[_0xad87('0x39')](_0x2233b7[_0xad87('0x149')]['phone'])||_0x2233b7[_0xad87('0x149')][_0xad87('0x14a')]===null){return _0x3388fe(msgResponse(_0xad87('0x147'),'Failure',_0xad87('0x14b')));}var _0x7b27df={'XMD-CALLERID':_0x1a3278[_0xad87('0x24')][_0x30286d][_0xad87('0x14c')](),'XMD-AGI':_0x50d8f9[_0xad87('0xed')]?util[_0xad87('0x76')](_0xad87('0x14d'),ipAgi,_0x50d8f9[_0xad87('0xed')]):'NONE','XMD-AGIAFTER':_0x50d8f9['dialQueueProject2']?util[_0xad87('0x76')](_0xad87('0x14d'),ipAgi,_0x50d8f9['dialQueueProject2']):_0xad87('0x14e'),'XMD-QUEUE':_0x50d8f9['type']===_0xad87('0x4a')?util[_0xad87('0x76')](_0xad87('0x14f'),_0x50d8f9[_0xad87('0x3c')],_0x50d8f9['dialQueueOptions']||'',_0x50d8f9[_0xad87('0xf5')]?'c':'',_0x50d8f9[_0xad87('0xff')]||0x3):'NONE','XMD-CONTACTID':_0x2233b7['ContactId'],'XMD-CDRTYPE':_0xad87('0x150'),'CALLERID(all)':_0x1a3278['actions'][_0x30286d][_0xad87('0x14c')](),'XMD-AMD':_0x50d8f9['dialAMDActive']?'ACTIVE':_0xad87('0x14e'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x50d8f9[_0xad87('0xd8')]){_0x7b27df['XMD-AMDINITIALSILENCE']=_0x50d8f9[_0xad87('0x151')]||0x9c4;_0x7b27df[_0xad87('0x152')]=_0x50d8f9[_0xad87('0x153')]||0x5dc;_0x7b27df[_0xad87('0x154')]=_0x50d8f9[_0xad87('0x155')]||0x320;_0x7b27df['XMD-AMDTOTALANALYSISTIME']=_0x50d8f9['dialAMDTotalAnalysisTime']||0x1388;_0x7b27df[_0xad87('0x156')]=_0x50d8f9[_0xad87('0x157')]||0x64;_0x7b27df[_0xad87('0x158')]=_0x50d8f9[_0xad87('0x159')]||0x32;_0x7b27df['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x50d8f9[_0xad87('0x15a')]||0x3;_0x7b27df[_0xad87('0x15b')]=_0x50d8f9[_0xad87('0x15c')]||0x100;_0x7b27df[_0xad87('0x15d')]=_0x50d8f9[_0xad87('0x15e')]||0x1388;}if(_0x50d8f9[_0xad87('0x52')]==='outbound'){_0x7b27df[_0xad87('0x15f')]=_0x2233b7[_0xad87('0xcb')];}else{_0x7b27df[_0xad87('0x160')]=_0x2233b7[_0xad87('0xcc')];}for(var _0x20e675 in _0x2233b7['Contact']){if(_0x2233b7['Contact'][_0xad87('0x98')](_0x20e675)){if(isNotNull(_0x2233b7[_0xad87('0x149')][_0x20e675])&&_0x20e675!=='id'&&_0x20e675!==_0xad87('0x161')&&_0x20e675!==_0xad87('0x162')&&_0x20e675!==_0xad87('0x163')){_0x7b27df[util['format'](_0xad87('0x164'),_0xad87('0x165'),_['toUpper'](_0x20e675))]=_0x2233b7[_0xad87('0x149')][_0x20e675];}}}var _0x5550e2=_0x1a3278[_0xad87('0xd0')](_0x50d8f9[_0xad87('0x72')])?getCallerId(_0x50d8f9['Trunk']['callerid'],_0x50d8f9['dialOriginateCallerIdName'],_0x50d8f9['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x50d8f9[_0xad87('0x59')],_0x50d8f9[_0xad87('0x166')]):_0x50d8f9[_0xad87('0x59')]):getCallerId(_[_0xad87('0xab')](_0x50d8f9[_0xad87('0x11e')])?_0x50d8f9[_0xad87('0x72')]['callerid']:_0x50d8f9[_0xad87('0x11e')][_0xad87('0x74')],_0x50d8f9[_0xad87('0x167')],_0x50d8f9[_0xad87('0x166')]>0x0?getCallerIdRandom(_0x50d8f9[_0xad87('0x59')],_0x50d8f9[_0xad87('0x166')]):_0x50d8f9[_0xad87('0x59')]);if(_0x5550e2){_0x7b27df[_0xad87('0x168')]=_0x1a3278['actions'][_0x30286d][_0xad87('0x169')]=extractCalleridName(_0x5550e2);_0x7b27df['XMD-ORIGINATECALLERIDNUM']=_0x1a3278[_0xad87('0x24')][_0x30286d][_0xad87('0x16a')]=extractCalleridNumber(_0x5550e2);}return ami[_0xad87('0xac')]({'actionid':_0x30286d,'action':_0xad87('0x147'),'channel':_0x1a3278['isTrunkReachable'](_0x50d8f9[_0xad87('0x72')])?util[_0xad87('0x76')](_0xad87('0x16b'),_0x50d8f9[_0xad87('0x72')][_0xad87('0x3c')],isNotNull(_0x50d8f9[_0xad87('0x16c')])?_0x50d8f9[_0xad87('0x16c')][_0xad87('0x16d')]()||'':'',_0x50d8f9[_0xad87('0x16e')]>0x0?_0x2233b7[_0xad87('0x149')][_0xad87('0x14a')][_0xad87('0x16f')](_0x50d8f9[_0xad87('0x16e')]):_0x2233b7[_0xad87('0x149')]['phone']):util[_0xad87('0x76')](_0xad87('0x16b'),_[_0xad87('0xab')](_0x50d8f9[_0xad87('0x11e')])?_0x50d8f9['Trunk'][_0xad87('0x3c')]:_0x50d8f9[_0xad87('0x11e')][_0xad87('0x3c')],isNotNull(_0x50d8f9[_0xad87('0x16c')])?_0x50d8f9['dialPrefix'][_0xad87('0x16d')]()||'':'',_0x50d8f9[_0xad87('0x16e')]>0x0?_0x2233b7['Contact'][_0xad87('0x14a')][_0xad87('0x16f')](_0x50d8f9[_0xad87('0x16e')]):_0x2233b7[_0xad87('0x149')][_0xad87('0x14a')]),'callerid':_0x5550e2,'Exten':_0xad87('0xd7'),'Context':_0xad87('0x170'),'Priority':'1','variable':_0x7b27df,'timeout':(_0x50d8f9['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x30286d})[_0xad87('0xba')](function(_0x4571a6){return _0x41a6ba(_0x4571a6);})['catch'](function(_0x49e821){_0x50d8f9[_0xad87('0x62')]+=0x1;var _0x3027bf=new History(_0x1a3278[_0xad87('0x24')][_0x30286d]);logger[_0xad87('0x94')](util['format'](_0xad87('0x171'),JSON['stringify'](_0x49e821)));_0x3027bf[_0xad87('0xa4')]=0xe;_0x3027bf[_0xad87('0xdb')]=_0xad87('0x172');_0x3027bf[_0xad87('0xa5')]=moment()[_0xad87('0x76')](_0xad87('0xf9'));_0x3027bf[_0xad87('0x173')]=_0x3027bf[_0xad87('0xa5')];_0x1a3278[_0xad87('0xc5')](_0x3027bf)['catch'](loggerCatch(_0xad87('0x174')));_0x1a3278[_0xad87('0xc3')](_0x3027bf)[_0xad87('0xae')](loggerCatch('[originate][error]'))[_0xad87('0x1b')](function(){delete _0x1a3278[_0xad87('0x24')][_0x30286d];return _0x3388fe(msgResponse(_0xad87('0x147'),_0xad87('0x45'),'originate\x20action\x20Error'));});});});};Dialer[_0xad87('0xa6')]['syncOriginateResponse']=function(_0x19768a){var _0x52dc52=this[_0xad87('0x24')][_0x19768a[_0xad87('0x106')]];var _0x2c9074=this;if(_0x52dc52){delete this[_0xad87('0x24')][_0x19768a[_0xad87('0x106')]];_0x52dc52['responsetime']=moment()[_0xad87('0x76')](_0xad87('0xf9'));var _0x5bdb93=_0x52dc52[_0xad87('0x52')]===_0xad87('0x78')?this[_0xad87('0x1f')][_0x52dc52['queue']]:this[_0xad87('0x1e')][_0x52dc52[_0xad87('0x175')]()];if(!this[_0xad87('0xce')](_0x19768a[_0xad87('0x176')])){this['updateOriginated'](_0x5bdb93);return this[_0xad87('0x177')](_0x52dc52,_0x5bdb93,_0x19768a)[_0xad87('0xba')](function(_0x14af9e){})['catch'](loggerCatch(_0xad87('0x178')));}else{this['uniqueId'][_0x19768a[_0xad87('0xd3')]]=_0x52dc52;}}};Dialer[_0xad87('0xa6')][_0xad87('0x179')]=function(_0x19e728,_0x4f96f4,_0x3cc33d){var _0x25b519=new History(_0x4f96f4);if(_0x25b519[_0xad87('0x17a')]+_0x25b519[_0xad87('0x17b')]+_0x25b519[_0xad87('0x17c')]>=_0x3cc33d[_0xad87('0x17d')]-0x1){return!![];}switch(_0x19e728){case 0x3:if(_0x25b519[_0xad87('0x17c')]>=_0x3cc33d['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0xad87('0xbd')]({'active':![],'countnoanswerretry':_0x25b519[_0xad87('0x17c')]+=0x1,'scheduledat':moment()[_0xad87('0x17e')](_0x3cc33d[_0xad87('0x17f')],_0xad87('0x180'))[_0xad87('0x76')](_0xad87('0xf9')),'ContactId':_0x25b519['ContactId'],'ListId':_0x25b519[_0xad87('0xca')],'VoiceQueueId':_0x25b519[_0xad87('0xcb')]||undefined,'CampaignId':_0x25b519[_0xad87('0xcc')]||undefined})[_0xad87('0xae')](loggerCatch(_0xad87('0x181')));}break;case 0x5:if(_0x25b519['countbusyretry']>=_0x3cc33d[_0xad87('0x182')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x25b519['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x3cc33d[_0xad87('0x183')],_0xad87('0x180'))[_0xad87('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x25b519[_0xad87('0x110')],'ListId':_0x25b519[_0xad87('0xca')],'VoiceQueueId':_0x25b519[_0xad87('0xcb')]||undefined,'CampaignId':_0x25b519[_0xad87('0xcc')]||undefined})[_0xad87('0xae')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x25b519[_0xad87('0x17b')]>=_0x3cc33d['dialCongestionMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x25b519[_0xad87('0x17b')]+=0x1,'scheduledat':moment()['add'](_0x3cc33d['dialCongestionRetryFrequency'],_0xad87('0x180'))[_0xad87('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x25b519['ContactId'],'ListId':_0x25b519['ListId'],'VoiceQueueId':_0x25b519[_0xad87('0xcb')]||undefined,'CampaignId':_0x25b519['CampaignId']||undefined})[_0xad87('0xae')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0xad87('0xa6')][_0xad87('0x177')]=function(_0x34d159,_0x542b0f,_0x52e309){var _0x102b7c=this;var _0x2cc70e=new History(_0x34d159);return new BPromise(function(_0x2caed5,_0x1da9a3){if(_[_0xad87('0x39')](_0x542b0f)&&_0xad87('0x146')!==typeof _0x542b0f){return _0x1da9a3(msgResponse(_0xad87('0x184'),'Failure',_0xad87('0x185')));}if(_['isUndefined'](_0x52e309)&&_0xad87('0x146')!==typeof _0x52e309){return _0x1da9a3(msgResponse(_0xad87('0x184'),_0xad87('0x124'),'evt\x20is\x20undefine'));}switch(_0x52e309[_0xad87('0xf2')]){case'0':_0x542b0f['outboundNoSuchCallsDay']+=0x1;_0x2cc70e['state']=0x0;_0x2cc70e[_0xad87('0xdb')]=_0xad87('0x186');_0x102b7c['createHistory'](_0x2cc70e)[_0xad87('0xae')](loggerCatch(_0xad87('0x187')));if(_0x102b7c[_0xad87('0x179')](0x0,_0x34d159,_0x542b0f)){if(_0x2cc70e['countbusyretry']+_0x2cc70e[_0xad87('0x17b')]+_0x2cc70e['countnoanswerretry']>=_0x542b0f[_0xad87('0x17d')]){_0x102b7c[_0xad87('0x188')](_0x2cc70e,_0x2caed5,_0x1da9a3,_0xad87('0x189'));}else{_0x102b7c[_0xad87('0x18a')](_0x2cc70e,_0x2caed5,_0x1da9a3,_0xad87('0x189'));}}break;case'3':_0x542b0f['outboundNoAnswerCallsDay']+=0x1;_0x2cc70e[_0xad87('0xa4')]=0x3;_0x2cc70e[_0xad87('0xdb')]=_0xad87('0x18b');_0x2cc70e[_0xad87('0x17c')]+=0x1;_0x2cc70e[_0xad87('0x18c')]+=0x1;_0x102b7c['createHistory'](_0x2cc70e)[_0xad87('0xae')](loggerCatch(_0xad87('0x18d')));if(_0x102b7c[_0xad87('0x179')](0x3,_0x34d159,_0x542b0f)){if(_0x2cc70e[_0xad87('0x17c')]>=_0x542b0f[_0xad87('0x18e')]){_0x102b7c['createStateFinal'](_0x2cc70e,_0x2caed5,_0x1da9a3,'reason\x203\x20ringing\x20no\x20answer');}else{_0x102b7c[_0xad87('0x188')](_0x2cc70e,_0x2caed5,_0x1da9a3,_0xad87('0x18f'));}}break;case'5':_0x542b0f[_0xad87('0x190')]+=0x1;_0x2cc70e[_0xad87('0xa4')]=0x5;_0x2cc70e['statedesc']=_0xad87('0x191');_0x2cc70e[_0xad87('0x17a')]+=0x1;_0x2cc70e[_0xad87('0x18c')]+=0x1;_0x102b7c[_0xad87('0xc5')](_0x2cc70e)[_0xad87('0xae')](loggerCatch(_0xad87('0x192')));if(_0x102b7c['checkRetriveMax'](0x5,_0x34d159,_0x542b0f)){if(_0x2cc70e[_0xad87('0x17a')]>=_0x542b0f[_0xad87('0x182')]){_0x102b7c[_0xad87('0x18a')](_0x2cc70e,_0x2caed5,_0x1da9a3,'reason\x205\x20busy');}else{_0x102b7c[_0xad87('0x188')](_0x2cc70e,_0x2caed5,_0x1da9a3,_0xad87('0x193'));}}break;case'8':_0x542b0f[_0xad87('0x5c')]+=0x1;_0x2cc70e[_0xad87('0xa4')]=0x8;_0x2cc70e[_0xad87('0xdb')]=_0xad87('0x194');_0x2cc70e['countcongestionretry']+=0x1;_0x2cc70e['countglobal']+=0x1;_0x102b7c[_0xad87('0xc5')](_0x2cc70e)[_0xad87('0xae')](loggerCatch(_0xad87('0x195')));if(_0x102b7c['checkRetriveMax'](0x8,_0x34d159,_0x542b0f)){if(_0x2cc70e[_0xad87('0x17b')]>=_0x542b0f[_0xad87('0x196')]){_0x102b7c[_0xad87('0x18a')](_0x2cc70e,_0x2caed5,_0x1da9a3,_0xad87('0x197'));}else{_0x102b7c[_0xad87('0x188')](_0x2cc70e,_0x2caed5,_0x1da9a3,_0xad87('0x197'));}}break;default:_0x542b0f[_0xad87('0xf0')]+=0x1;_0x2cc70e['state']=0xc;_0x2cc70e['statedesc']=_0x52e309['reason'];_0x102b7c[_0xad87('0xc5')](_0x2cc70e)['catch'](loggerCatch(_0xad87('0x198')));if(_0x102b7c[_0xad87('0x179')](_0x52e309['reason'],_0x34d159,_0x542b0f)){if(_0x2cc70e[_0xad87('0x17a')]+_0x2cc70e['countcongestionretry']+_0x2cc70e[_0xad87('0x17c')]>=_0x542b0f[_0xad87('0x17d')]){_0x102b7c['stateGlobal'](_0x2cc70e,_0x2caed5,_0x1da9a3,_0x52e309[_0xad87('0xf2')]);}else{_0x102b7c['createStateFinal'](_0x2cc70e,_0x2caed5,_0x1da9a3,_0x52e309[_0xad87('0xf2')]);}}}});};Dialer[_0xad87('0xa6')][_0xad87('0x188')]=function(_0x5010c7,_0x3ca6bb,_0xf33afc,_0x250783){var _0x48a2db=new Final(_0x5010c7);_0x48a2db[_0xad87('0xa4')]=0xf;_0x48a2db[_0xad87('0xdb')]=_0xad87('0x199');this[_0xad87('0x18a')](_0x48a2db,_0x3ca6bb,_0xf33afc,_0x250783);};Dialer[_0xad87('0xa6')][_0xad87('0x18a')]=function(_0x2569b9,_0x3a9236,_0x626013,_0x5c0ebb){this['moveContactManagedDialer'](_0x2569b9)[_0xad87('0xba')](function(_0x4b26b5){return _0x3a9236(msgResponse(_0xad87('0x184'),'Success',_0x5c0ebb));})['catch'](function(_0x5b72e0){return _0x626013(msgResponse(_0xad87('0x19a'),'Failure',_0xad87('0x19b')));});};Dialer['prototype'][_0xad87('0x7')]=function(_0x1ae582){var _0xea3ea1=this;var _0xdc18f1=_0x1ae582[_0xad87('0x19c')]/0x64;var _0x4c07c5=_0x1ae582[_0xad87('0x5f')]/(_0x1ae582[_0xad87('0x5f')]+_0x1ae582['outboundAnswerCallsDay']);var _0x3ce42a=Math['round'](_0x1ae582['predictiveIntervalAvailable']*(_0x1ae582[_0xad87('0x19d')]/0x64));var _0x42b5ea=Math[_0xad87('0x19e')](_0x1ae582['predictiveIntervalAvailable']*(_0x1ae582[_0xad87('0x19f')]/0x64));var _0x48756d=_0x1ae582[_0xad87('0x4d')]+_0x1ae582['talking'];var _0x36d58e=Math[_0xad87('0x1a0')](_0x1ae582[_0xad87('0x6d')]*_0x1ae582['erlangAbandonmentRate']*_0x1ae582['predictiveIntervalHitRate']*_0x1ae582[_0xad87('0x1a1')]);if(_[_0xad87('0x39')](_0x1ae582[_0xad87('0x71')])){if(!_[_0xad87('0x39')](_0x1ae582[_0xad87('0x8e')])){_0x1ae582['startPredictive']=undefined;loggerPredictive['error'](_0xad87('0x1a2'),_0xad87('0x1a3'));}if(!_[_0xad87('0x39')](_0x1ae582[_0xad87('0x8f')])){loggerPredictive[_0xad87('0x94')](_0xad87('0x1a2'),_0xad87('0x1a4'));clearInterval(_0x1ae582[_0xad87('0x8f')]);_0x1ae582[_0xad87('0x8f')]=undefined;}_0x1ae582[_0xad87('0x71')]=moment()[_0xad87('0x76')](_0xad87('0xf9'));loggerPredictive[_0xad87('0x7a')](_0x1ae582[_0xad87('0x3c')],'collection\x20data\x20in\x20progressive\x20at',_0x1ae582[_0xad87('0x71')]);this[_0xad87('0x139')](_0x1ae582,0x1);}else if(ifInterval(_0x1ae582[_0xad87('0x1a5')],_0x1ae582[_0xad87('0x71')])){this[_0xad87('0x139')](_0x1ae582,0x1);loggerPredictiveCalls[_0xad87('0x7a')](_0xad87('0x1a6'),_0x1ae582[_0xad87('0x71')],_0x1ae582['name']);_0x1ae582[_0xad87('0x6d')]=0x0;_0x1ae582[_0xad87('0x100')]=0x0;}else if(_0xdc18f1<_0x4c07c5&&_0x1ae582[_0xad87('0x1a7')]==='dropRate'){freeVariablesPredictive(_0x1ae582);loggerPredictive['info'](_0xad87('0x1a8'),_0xad87('0x1a9'),_0x4c07c5,_0xad87('0x71'),_0x1ae582[_0xad87('0x3c')]);}else if(_0x36d58e<_0x1ae582['predictiveIntervalErlangCallsDroppedCalls']&&_0x1ae582[_0xad87('0x1a7')]===_0xad87('0x1aa')){freeVariablesPredictive(_0x1ae582);loggerPredictive[_0xad87('0x7a')](_0xad87('0x1ab'),'Max\x20Drop\x20',_0x36d58e,_0xad87('0x1ac'),_0x1ae582['predictiveIntervalErlangCallsDroppedCalls'],_0xad87('0x71'),_0x1ae582['name']);}else if(!ifInterval(_0x1ae582['dialPredictiveInterval'],_0x1ae582[_0xad87('0x71')])&&_['isUndefined'](_0x1ae582[_0xad87('0x8e')])&&!_['isUndefined'](_0x1ae582[_0xad87('0x71')])){_0x1ae582['startPredictive']=moment()[_0xad87('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xad87('0x7a')](_0x1ae582['name'],_0xad87('0x1ad'),_0x1ae582[_0xad87('0x8e')]);this[_0xad87('0xb9')](_0x1ae582[_0xad87('0x1a5')])[_0xad87('0xba')](this[_0xad87('0x1ae')](_0x1ae582))[_0xad87('0xba')](mergeDataErlangB(_0x1ae582))['then'](this[_0xad87('0x1af')](_0x1ae582))[_0xad87('0xae')](loggerCatchPredictive(_0xad87('0x1b0'),_0x1ae582));}else if(!ifInterval(_0x1ae582['dialPredictiveInterval'],_0x1ae582[_0xad87('0x8e')])){_0x1ae582[_0xad87('0x100')]=0x0;_0x1ae582[_0xad87('0x8e')]=moment()[_0xad87('0x76')](_0xad87('0xf9'));loggerPredictive['info'](_0x1ae582[_0xad87('0x3c')],_0xad87('0x1b1'),_0x1ae582[_0xad87('0x8e')]);clearInterval(_0x1ae582['handlePredictive']);_0x1ae582['handlePredictive']=undefined;this[_0xad87('0xb9')](_0x1ae582[_0xad87('0x1a5')])[_0xad87('0xba')](this['getDataPredictive'](_0x1ae582))[_0xad87('0xba')](mergeDataErlangB(_0x1ae582))[_0xad87('0xba')](this['startMethodPredictive'](_0x1ae582))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x1ae582));}else if(_0x1ae582[_0xad87('0x6a')]&&_0x48756d<_0x1ae582[_0xad87('0x6a')]-_0x42b5ea){freeVariablesPredictive(_0x1ae582);loggerPredictive[_0xad87('0x7a')](_0x1ae582[_0xad87('0x3c')],_0xad87('0x1b2'),_0x48756d,_0xad87('0x1b3'),_0x1ae582[_0xad87('0x6a')],'-',_0x42b5ea,'=',_0x1ae582[_0xad87('0x6a')]-_0x42b5ea,')');}else if(_0x1ae582[_0xad87('0x6a')]&&_0x48756d>_0x1ae582[_0xad87('0x6a')]+_0x3ce42a){freeVariablesPredictive(_0x1ae582);loggerPredictive[_0xad87('0x7a')](_0x1ae582[_0xad87('0x3c')],_0xad87('0x1b2'),_0x48756d,_0xad87('0x1b4'),_0x1ae582[_0xad87('0x6a')],'+',_0x3ce42a,'=',_0x1ae582['predictiveIntervalAvailable']+_0x3ce42a,')');}};Dialer['prototype'][_0xad87('0x1ae')]=function(_0x120e28){var _0x1877d7=this;return function(_0x16c198){return new BPromise(function(_0x52a4fb,_0x19ea73){_[_0xad87('0x8c')](_0x120e28,_0x16c198[0x0]);if(checkGetDataPredictive(_0x16c198[0x0])){var _0x48b689=_0x120e28[_0xad87('0x6a')]=_0x120e28[_0xad87('0x1b5')]+_0x120e28[_0xad87('0x4d')];var _0x2b839e=_0x120e28['dialPredictiveInterval']*0x3c;var _0x215ad2=_0x16c198[0x0][_0xad87('0x83')]+_0x16c198[0x0][_0xad87('0x81')];var _0x36c067=(_0x16c198[0x0][_0xad87('0x64')]+_0x16c198[0x0][_0xad87('0x66')]+_0x16c198[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x16c198[0x0][_0xad87('0x6b')];_0x120e28[_0xad87('0x68')]=_0x36c067>0x0?_0x36c067:0x1;switch(_0x120e28['dialPredictiveOptimization']){case _0xad87('0x1aa'):var _0x2bcc5e=_0x120e28[_0xad87('0x19c')]/0x64;return _0x1877d7[_0xad87('0x1b6')](_0x48b689,_0x2b839e,_0x215ad2,_0x36c067,_0x2bcc5e)[_0xad87('0xba')](function(_0x11b469){return _0x52a4fb(_0x11b469);});case _0xad87('0x1b7'):var _0x29ea03=_0x120e28['dialPredictiveOptimizationPercentage']/0x64;return _0x1877d7[_0xad87('0x1b8')](_0x48b689,_0x2b839e,_0x215ad2,_0x36c067,_0x29ea03)['then'](function(_0x3fcfc5){return _0x52a4fb(_0x3fcfc5);});default:return _0x19ea73(msgResponse(_0xad87('0x1b9'),_0xad87('0x124'),'Unknown\x20Predictive'));}}else{return _0x19ea73(msgResponse(_0xad87('0x1b9'),'Failure',_0xad87('0x1ba')));}});};};Dialer[_0xad87('0xa6')][_0xad87('0x1bb')]=function(_0x55f718){var _0x4b6e01=this;return function(_0x154759){return new BPromise(function(_0xeeb349,_0x33e0e4){_[_0xad87('0x8c')](_0x55f718,_0x154759[0x0]);if(checkGetDataPredictive(_0x154759[0x0])){loggerPredictive[_0xad87('0x7a')](JSON[_0xad87('0x46')](_0x154759[0x0]));if(_0x55f718[_0xad87('0x1a7')]==='dropRate'){return _0x4b6e01[_0xad87('0xc2')](_0x55f718['id'])[_0xad87('0xba')](function(_0x3fc64c){var _0x36cea6=_0x55f718[_0xad87('0x1bc')]-_0x3fc64c[0x0][_0xad87('0x1bd')];var _0x48fedb=_0x55f718[_0xad87('0x1a5')]*0x3c;var _0x2abe45=_0x154759[0x0][_0xad87('0x83')]+_0x154759[0x0][_0xad87('0x81')];var _0x5db7fc=(_0x154759[0x0][_0xad87('0x64')]+_0x154759[0x0][_0xad87('0x66')]+_0x154759[0x0][_0xad87('0x65')])/_0x154759[0x0][_0xad87('0x6b')];var _0x4f1213=_0x55f718[_0xad87('0x19c')]/0x64;_0x55f718['predictiveIntervalPauses']=_0x3fc64c[0x0][_0xad87('0x1bd')]||0x0;_0x55f718[_0xad87('0x68')]=_0x5db7fc>0x0?_0x5db7fc:0x1;return _0x4b6e01['abandonmentRate'](_0x36cea6,_0x48fedb,_0x2abe45,_0x5db7fc,_0x4f1213);})[_0xad87('0xba')](function(_0x4f17ad){return _0xeeb349(_0x4f17ad);})[_0xad87('0xae')](function(_0x34b21d){return _0x33e0e4(msgResponse(_0xad87('0x1be'),_0xad87('0x124'),JSON['stringify'](_0x34b21d)));});}if(_0x55f718[_0xad87('0x1a7')]===_0xad87('0x1b7')){return _0x4b6e01[_0xad87('0xc2')](_0x55f718['id'])[_0xad87('0xba')](function(_0x2024c9){var _0x499204=_0x55f718[_0xad87('0x1bc')]-_0x2024c9[0x0][_0xad87('0x1bd')];var _0x1cf9c7=_0x55f718[_0xad87('0x1a5')]*0x3c;var _0x1f06ec=_0x154759[0x0]['predictiveIntervalAvgTalktime']+_0x154759[0x0][_0xad87('0x81')];var _0x5c65f4=(_0x154759[0x0]['predictiveIntervalAnsweredCalls']+_0x154759[0x0][_0xad87('0x66')]+_0x154759[0x0][_0xad87('0x65')])/_0x154759[0x0][_0xad87('0x6b')];var _0x55a1ee=_0x55f718[_0xad87('0x19c')]/0x64;_0x55f718[_0xad87('0x69')]=_0x2024c9[0x0][_0xad87('0x1bd')]||0x0;_0x55f718['predictiveIntervalHitRate']=_0x5c65f4>0x0?_0x5c65f4:0x1;return _0x4b6e01[_0xad87('0x1b8')](_0x499204,_0x1cf9c7,_0x1f06ec,_0x5c65f4,_0x55a1ee);})[_0xad87('0xba')](function(_0x414c91){return _0xeeb349(_0x414c91);})[_0xad87('0xae')](function(_0x1c32c3){return _0x33e0e4(msgResponse('[CatchErlangB]',_0xad87('0x124'),JSON[_0xad87('0x46')](_0x1c32c3)));});}}else{return _0x33e0e4(msgResponse('[getDataPredictive]',_0xad87('0x124'),_0xad87('0x1ba')));}});};};Dialer[_0xad87('0xa6')][_0xad87('0x1af')]=function(_0x1ad4cc){var _0x412fb7=this;return function(){var _0x4cd425=0x0;var _0x4ab67a=Math['floor'](_0x1ad4cc[_0xad87('0x6e')]*0x3e8);if(_0x4ab67a>0x0){_0x4ab67a=_0x4ab67a<0x64?0x64:_0x4ab67a;loggerPredictive[_0xad87('0x7a')](_0x1ad4cc['name'],_0xad87('0x1bf'),_0x4ab67a,_0xad87('0x47'));_0x1ad4cc[_0xad87('0x8f')]=setInterval(function(){_0x412fb7[_0xad87('0x8f')](_0x1ad4cc);loggerPredictiveCalls[_0xad87('0x7a')](_0xad87('0x1c0'),_0x4cd425+=0x1);},_0x4ab67a);}else{loggerPredictive[_0xad87('0x7a')](_0x1ad4cc[_0xad87('0x3c')],_0xad87('0x1c1'));}};};Dialer['prototype'][_0xad87('0x1c2')]=function(_0x4fda92,_0x540530){var _0x3c87a9=this;return function(_0x4689bf){if(_[_0xad87('0x44')](_0x4689bf)){if(_[_0xad87('0xab')](_0x540530[_0xad87('0x1c3')])||!_0x540530[_0xad87('0x1c4')]){if(_0x4fda92[_0xad87('0x58')]==='booked'){_0x4fda92[_0xad87('0x1c5')]=_[_0xad87('0x39')](_0x4fda92[_0xad87('0x1c5')])?!![]:_0x4fda92[_0xad87('0x1c5')];var _0x546398=uuid['v4']();_0x3c87a9[_0xad87('0x24')][_0x546398]=new Action(_0x4fda92,_0x540530,_0x546398);loggerBooked[_0xad87('0x7a')](_0xad87('0x1c6'),_0x546398,_0xad87('0x1c7'),JSON[_0xad87('0x46')](_0x4fda92[_0xad87('0x1c5')]),'Queue:\x20',_0x4fda92[_0xad87('0x3c')]);if(_0x4fda92[_0xad87('0x1c5')]){_0x4fda92[_0xad87('0x1c5')]=![];_0x3c87a9[_0xad87('0x28')][_0x3c87a9[_0xad87('0x24')][_0x546398]['queue']]=[];ami['Action']({'actionid':_0x546398,'action':'queuestatus','queue':_0x4fda92[_0xad87('0x3c')]})[_0xad87('0xae')](function(_0xf8eab4){_0x3c87a9[_0xad87('0xb0')](_0x4fda92);_0x3c87a9[_0xad87('0xbd')]({'active':![],'ContactId':_0x3c87a9[_0xad87('0x24')][_0x546398][_0xad87('0x110')],'ListId':_0x3c87a9[_0xad87('0x24')][_0x546398]['ListId'],'VoiceQueueId':_0x3c87a9[_0xad87('0x24')][_0x546398][_0xad87('0xcb')]||undefined,'CampaignId':_0x3c87a9[_0xad87('0x24')][_0x546398]['CampaignId']||undefined})[_0xad87('0xae')](loggerCatch(_0xad87('0x1c8')));delete _0x3c87a9[_0xad87('0x24')][_0x546398];});}else{loggerBooked[_0xad87('0x7a')](_0xad87('0x1c9'),JSON[_0xad87('0x46')](_0x4fda92[_0xad87('0x1c5')]),'Queue:\x20',_0x4fda92[_0xad87('0x3c')]);_0x3c87a9['updateOriginated'](_0x4fda92);_0x3c87a9[_0xad87('0xbd')]({'active':![],'ContactId':_0x3c87a9['actions'][_0x546398]['ContactId'],'ListId':_0x3c87a9[_0xad87('0x24')][_0x546398][_0xad87('0xca')],'VoiceQueueId':_0x3c87a9['actions'][_0x546398][_0xad87('0xcb')]||undefined,'CampaignId':_0x3c87a9['actions'][_0x546398][_0xad87('0xcc')]||undefined})[_0xad87('0xae')](loggerCatch(_0xad87('0x1c8')));delete _0x3c87a9['actions'][_0x546398];}}else{return _0x3c87a9[_0xad87('0x145')](_0x4fda92,_0x540530);}}else{if(getDiff(_0x540530[_0xad87('0x1ca')])<_0x4fda92[_0xad87('0x1cb')]*0x3c){_0x3c87a9['preview'][_0xad87('0x10d')](_0x540530['id'])[_0xad87('0x1b')](function(){_0x3c87a9['updateOriginated'](_0x4fda92);});}else{_0x4fda92['outboundReCallsDay']+=0x1;_0x3c87a9['updateOriginated'](_0x4fda92);if(_0x4fda92['dialRecallInQueue']){_0x3c87a9[_0xad87('0xbd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x540530[_0xad87('0x110')],'ListId':_0x540530['ListId'],'VoiceQueueId':_0x540530['VoiceQueueId']||undefined,'CampaignId':_0x540530[_0xad87('0xcc')]||undefined})[_0xad87('0xae')](loggerCatch(_0xad87('0x1cc')));_0x3c87a9['createHistory'](createObjHistory(_0x4fda92,_0x540530,'RECALLINQUEUE',0x17,_0xad87('0x1cd')))[_0xad87('0xae')](loggerCatch(_0xad87('0x1ce')));}else{_0x3c87a9[_0xad87('0xc8')](createObjHistory(_0x4fda92,_0x540530,_0xad87('0x1cf'),0x16,'RecallFailedTimeout'),_0xad87('0x1d0'),'[Originate][HistoryRecallClose]');}}}}else{_0x4fda92[_0xad87('0x5b')]+=0x1;_0x3c87a9[_0xad87('0xc8')](createObjHistory(_0x4fda92,_0x540530,'BLACKLIST',0xd,_0xad87('0x1d1')),_0xad87('0x1d2'),_0xad87('0x1d3'));throw _0xad87('0x1d4');}};};Dialer[_0xad87('0xa6')][_0xad87('0x13c')]=function(_0x453062){var _0x34b4f3=this;var _0x2b277c=[];var _0x4cea46=_0x453062['limitCalls']-_0x453062['originated']-_0x453062[_0xad87('0x1d5')];emitCampaignSummary(_0x453062);if(_0x4cea46>0x0){if(_0x4cea46>this['maxNumberOriginate']){_0x4cea46=this[_0xad87('0x22')];}_0x453062[_0xad87('0x1d5')]+=_0x4cea46;this[_0xad87('0xc1')](_0x453062['id'],_0x4cea46,_0x453062[_0xad87('0x1d6')])[_0xad87('0xba')](function(_0x48fe3f){_0x453062[_0xad87('0x1d5')]-=_0x4cea46;_0x453062[_0xad87('0x1d5')]=_0x453062[_0xad87('0x1d5')]>0x0?_0x453062[_0xad87('0x1d5')]:0x0;if(!checkContactEmpty(_0x48fe3f)){_0x453062[_0xad87('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0xad87('0x7a')](_0xad87('0x1d7')+_0x453062[_0xad87('0x3c')]);}else{_0x453062['originated']+=_0x48fe3f[_0xad87('0x97')];_0x453062['message']=_0xad87('0x1d8');for(var _0x29bda5=0x0;_0x29bda5<_0x48fe3f[_0xad87('0x97')];_0x29bda5+=0x1){_0x453062[_0xad87('0x1d9')]+=0x1;if(_[_0xad87('0xab')](_0x48fe3f[_0x29bda5])||_[_0xad87('0xab')](_0x48fe3f[_0x29bda5]['Contact'])||_[_0xad87('0xab')](_0x48fe3f[_0x29bda5][_0xad87('0x149')]['phone'])){_0x34b4f3[_0xad87('0xc7')](_0xad87('0x1da'),_0x453062,_0x48fe3f[_0x29bda5]);}else{_0x34b4f3[_0xad87('0x1db')](_['pick'](_0x48fe3f[_0x29bda5],[_0xad87('0xcc'),_0xad87('0x1dc')]))[_0xad87('0xba')](_0x34b4f3[_0xad87('0x1c2')](_0x453062,_0x48fe3f[_0x29bda5]))[_0xad87('0xae')](_0x34b4f3[_0xad87('0x1dd')](_0xad87('0x1de'),_0x453062));}}}})[_0xad87('0xae')](loggerGetContactDialer(_0xad87('0x1df'),_0x453062,_0x4cea46));}};Dialer['prototype'][_0xad87('0x139')]=function(_0x215e00,_0x5f05df){var _0xd58e2d=this;var _0x29a576=[];var _0x4452af=_0x5f05df>=0x1?_0x5f05df:0x1;var _0x1e7616=[];if(_0x215e00[_0xad87('0x58')]==='booked'){_0x4452af=0x1;}var _0x4dabc1=Math[_0xad87('0x1a0')](_0x215e00[_0xad87('0x4d')]*_0x4452af)-_0x215e00[_0xad87('0x6c')]-_0x215e00['temp'];emitVoiceQueueSummary(_0x215e00);if(_0x215e00[_0xad87('0x1e0')]>0x0){var _0x49eac9=_0x215e00[_0xad87('0x1e0')]-_0x215e00['originated']-_0x215e00[_0xad87('0x1b5')]-_0x215e00['temp']-_0x215e00[_0xad87('0x4e')];if(_0x4dabc1>_0x49eac9){_0x4dabc1=_0x49eac9;}}if(_0x4dabc1>0x0){if(_0x215e00[_0xad87('0x58')]===_0xad87('0x1e1')){_0x4dabc1=0x1;}if(_0x4dabc1>this[_0xad87('0x22')]){_0x4dabc1=this['maxNumberOriginate'];}_0x215e00[_0xad87('0x1d5')]+=_0x4dabc1;for(var _0x34aa25 in this[_0xad87('0x20')]){if(this[_0xad87('0x20')]['hasOwnProperty'](_0x34aa25)){if(this['agents'][_0x34aa25]['state']===_0xad87('0x1e2')&&this['agents'][_0x34aa25]['status']==='reachable'){_0x29a576[_0xad87('0x10b')](this[_0xad87('0x20')][_0x34aa25]['id']);}}}this[_0xad87('0xbf')](_0x215e00['id'],_0x29a576,_0x4dabc1,_0x215e00[_0xad87('0x1d6')])[_0xad87('0xba')](function(_0x3d485e){_0x215e00[_0xad87('0x1d5')]-=_0x4dabc1;_0x215e00[_0xad87('0x1d5')]=_0x215e00[_0xad87('0x1d5')]>0x0?_0x215e00[_0xad87('0x1d5')]:0x0;if(!checkContactEmpty(_0x3d485e)){_0xd58e2d[_0xad87('0xb4')](_0x215e00)[_0xad87('0xba')](sendMessageReschedule(_0x215e00))[_0xad87('0xae')](loggerCatch('[countReScheduled]\x20'));}else{_0x215e00[_0xad87('0x6c')]+=_0x3d485e['length'];_0x215e00[_0xad87('0x3a')]=_0x215e00['dialMethod']===_0xad87('0x1e1')?_0xad87('0x1e3'):_0xad87('0x1d8');for(var _0x1f3159=0x0;_0x1f3159<_0x3d485e[_0xad87('0x97')];_0x1f3159+=0x1){if(_[_0xad87('0xab')](_0x3d485e[_0x1f3159])||_[_0xad87('0xab')](_0x3d485e[_0x1f3159][_0xad87('0x149')])||_[_0xad87('0xab')](_0x3d485e[_0x1f3159][_0xad87('0x149')][_0xad87('0x14a')])){_0xd58e2d[_0xad87('0xc7')](_0xad87('0x1da'),_0x215e00,_0x3d485e[_0x1f3159]);}else{_0xd58e2d[_0xad87('0xb5')](_[_0xad87('0xc9')](_0x3d485e[_0x1f3159],[_0xad87('0xcb'),_0xad87('0x1dc')]))['then'](_0xd58e2d[_0xad87('0x1c2')](_0x215e00,_0x3d485e[_0x1f3159]))[_0xad87('0xae')](_0xd58e2d[_0xad87('0x1dd')](_0xad87('0x1da'),_0x215e00));}}}})[_0xad87('0xae')](loggerGetContactDialer(_0xad87('0x1e4'),_0x215e00,_0x4dabc1));}};Dialer[_0xad87('0xa6')][_0xad87('0x8f')]=function(_0x6f298d){var _0x5e29a7=this;if(_0x6f298d[_0xad87('0x1e0')]>0x0){var _0x2cf40b=_0x6f298d[_0xad87('0x1e0')]-_0x6f298d[_0xad87('0x6c')]-_0x6f298d[_0xad87('0x1b5')];if(_0x2cf40b>0x0){this[_0xad87('0x1e5')](_0x6f298d);}else{loggerPredictiveCalls[_0xad87('0x7a')](_0xad87('0x1e6'));}}else{this[_0xad87('0x1e5')](_0x6f298d);}};Dialer[_0xad87('0xa6')]['tryOriginatePredictive']=function(_0x321dab){var _0x15c819=this;var _0x1d32ba=[];_0x321dab[_0xad87('0x6c')]+=0x1;for(var _0x1f4155 in this[_0xad87('0x20')]){if(this[_0xad87('0x20')][_0xad87('0x98')](_0x1f4155)){if(this[_0xad87('0x20')][_0x1f4155][_0xad87('0xa4')]===_0xad87('0x1e2')&&this[_0xad87('0x20')][_0x1f4155][_0xad87('0xad')]===_0xad87('0x1e7')){_0x1d32ba[_0xad87('0x10b')](this[_0xad87('0x20')][_0x1f4155]['id']);}}}this[_0xad87('0xbf')](_0x321dab['id'],_0x1d32ba,0x1,_0x321dab[_0xad87('0x1d6')])[_0xad87('0xba')](function(_0x3543cb){if(!checkContactEmpty(_0x3543cb)){checkContactLowerLimitOriginate(_0x321dab,0x1,0x0);_0x15c819['countReScheduled'](_0x321dab)[_0xad87('0xba')](sendMessageReschedule(_0x321dab))[_0xad87('0xae')](loggerCatch(_0xad87('0x1e8')));}else{_0x321dab['message']=_0xad87('0x1d8');if(_['isNil'](_0x3543cb[0x0])||_[_0xad87('0xab')](_0x3543cb[0x0][_0xad87('0x149')])||_[_0xad87('0xab')](_0x3543cb[0x0]['Contact']['phone'])){_0x15c819[_0xad87('0xc7')](_0xad87('0x1da'),_0x321dab,_0x3543cb[0x0]);}else{_0x15c819[_0xad87('0xb5')](_[_0xad87('0xc9')](_0x3543cb[0x0],[_0xad87('0xcb'),_0xad87('0x1dc')]))[_0xad87('0xba')](_0x15c819['checkContactBlack'](_0x321dab,_0x3543cb[0x0]))[_0xad87('0xae')](_0x15c819[_0xad87('0x1dd')]('[actionOriginatePredictive]\x20',_0x321dab));}}})[_0xad87('0xae')](loggerGetContactDialer(_0xad87('0x1e9'),_0x321dab,0x1));emitVoiceQueueSummary(_0x321dab);};Dialer['prototype'][_0xad87('0x1b6')]=function(_0xf10d8,_0x52b210,_0x3d621d,_0x58f7ff,_0x3ec7b7,_0x30dedd){loggerPredictive[_0xad87('0x7a')](_0xad87('0x1ea'));loggerPredictive['info'](_0xad87('0x1eb'),_0xf10d8);loggerPredictive[_0xad87('0x7a')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x52b210);loggerPredictive[_0xad87('0x7a')](_0xad87('0x1ec'),_0x3d621d);loggerPredictive['info']('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',_0x58f7ff);loggerPredictive[_0xad87('0x7a')](_0xad87('0x1ed'),_0x3ec7b7);loggerPredictive['info'](_0xad87('0x84'));return new BPromise(function(_0x29b036,_0x34d743){if(_0xf10d8<=0x0||isNaN(_0xf10d8)){return _0x34d743(msgResponse(_0xad87('0x1ee'),_0xad87('0x45'),_0xad87('0x1ef')+_0xf10d8));}if(_0x3d621d<=0x0||isNaN(_0x3d621d)){return _0x34d743(msgResponse(_0xad87('0x1ee'),_0xad87('0x45'),_0xad87('0x1f0')+_0x3d621d));}if(_0x58f7ff<=0x0||isNaN(_0x58f7ff)){return _0x34d743(msgResponse(_0xad87('0x1ee'),_0xad87('0x45'),'p\x20=\x20'+_0x58f7ff));}if(_0x52b210<=0x0||isNaN(_0x52b210)){return _0x34d743(msgResponse(_0xad87('0x1ee'),'Error',_0xad87('0x1f1')+_0x52b210));}if(_0x3ec7b7<=0x0||isNaN(_0x3ec7b7)){return _0x34d743(msgResponse(_0xad87('0x1ee'),_0xad87('0x45'),_0xad87('0x1f2')+_0x3ec7b7));}_0x30dedd=_0x30dedd||0x0;var _0x1fec45=0x1/_0x3d621d;var _0x31e7eb=0x0;var _0x1e6b84=0x0;var _0x1fb959=0x0;var _0xf8b119=0x0;for(var _0x5ef046=0x0;_0x1fb959<_0x3ec7b7;_0x5ef046+=0x1){_0x1e6b84=_0x5ef046/_0x52b210;_0x31e7eb=(_0x58f7ff*_0x1e6b84+_0x30dedd)/_0x1fec45;_0x1fb959=erlangb(_0x31e7eb,_0xf10d8);_0xf8b119=_0x31e7eb/_0xf10d8*(0x1-erlangb(_0x31e7eb,_0xf10d8));}return _0x29b036({'erlangCalls':_0x5ef046,'erlangCallToSecond':_0x52b210/_0x5ef046,'erlangAbandonmentRate':_0x1fb959,'erlangBusyFactor':_0xf8b119});});};Dialer[_0xad87('0xa6')][_0xad87('0x1b8')]=function(_0x11e84c,_0x316c83,_0x930f0b,_0x2c4e55,_0x4027bb,_0xdc6604){loggerPredictive[_0xad87('0x7a')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0xad87('0x1eb'),_0x11e84c);loggerPredictive['info'](_0xad87('0x1f3'),_0x316c83);loggerPredictive[_0xad87('0x7a')](_0xad87('0x1ec'),_0x930f0b);loggerPredictive[_0xad87('0x7a')]('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',_0x2c4e55);loggerPredictive['info'](_0xad87('0x1f4'),_0x4027bb);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x2cc37e,_0x6f6d5b){if(_0x11e84c<=0x0||isNaN(_0x11e84c)){return _0x6f6d5b(msgResponse(_0xad87('0x1f5'),'Error',_0xad87('0x1ef')+_0x11e84c));}if(_0x930f0b<=0x0||isNaN(_0x930f0b)){return _0x6f6d5b(msgResponse('[busyFactor]',_0xad87('0x45'),_0xad87('0x1f0')+_0x930f0b));}if(_0x2c4e55<=0x0||isNaN(_0x2c4e55)){return _0x6f6d5b(msgResponse(_0xad87('0x1f5'),'Error',_0xad87('0x1f6')+_0x2c4e55));}if(_0x316c83<=0x0||isNaN(_0x316c83)){return _0x6f6d5b(msgResponse(_0xad87('0x1f5'),_0xad87('0x45'),_0xad87('0x1f1')+_0x316c83));}if(_0x4027bb<=0x0||isNaN(_0x4027bb)){return _0x6f6d5b(msgResponse(_0xad87('0x1f5'),_0xad87('0x45'),_0xad87('0x1f7')+_0x4027bb));}_0xdc6604=_0xdc6604||0x0;var _0x3f6cbb=0x1/_0x930f0b;var _0x3fcf60=0x0;var _0x7e6f94=0x0;var _0x20170e=0x0;var _0x1d014f=0x0;for(var _0x54f7a3=0x0;_0x1d014f<_0x4027bb;_0x54f7a3+=0x1){_0x7e6f94=_0x54f7a3/_0x316c83;_0x3fcf60=(_0x2c4e55*_0x7e6f94+_0xdc6604)/_0x3f6cbb;_0x20170e=erlangb(_0x3fcf60,_0x11e84c);_0x1d014f=_0x3fcf60/_0x11e84c*(0x1-erlangb(_0x3fcf60,_0x11e84c));}return _0x2cc37e({'erlangCalls':_0x54f7a3,'erlangCallToSecond':_0x316c83/_0x54f7a3,'erlangAbandonmentRate':_0x20170e,'erlangBusyFactor':_0x1d014f});});};module[_0xad87('0x1f8')]=Dialer;
\ No newline at end of file
+var _0x434c=['method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','checkIfTimeIntervals','[syncCampaigns]','\x5cw{0,','pow','match','actionOriginate','object','originate','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','SIP/%s/%s%s','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','responsetime','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','add','dialBusyRetryFrequency','minutes','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','dialGlobalMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','countglobal','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','agentBusyFactor','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','ACTIVE','RUNNING','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','lodash','bluebird','uuid','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./history','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','queuecallerabandon','bind','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','syncNewExten','queuemember','syncQueueMember','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','diff','seconds','type','outbound','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','milliseconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','uniqueId','[uniqueid]','[actions]','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','pick','ListId','UserId','VoiceQueueId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','active','SIP/%s','reachable','unmonitored','syncVarSet','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','uniqueid','HangupInAMD','membername','AMD','[syncHangupInAMD]','Machine','[syncMachine][createHistory]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','amd','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AGI','[syncHangupIvr]','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','YYYY-MM-DD\x20HH:mm:ss','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','dialQueueProject2','Abandoned','CALLEREXIT','actionid','roundrobin','locked','paused','stateinterface','queueBooked','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','ContactId','CampaignId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','Action','iftime\x20%s,%s','content','true','command','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','power','dialPowerLevel','Queue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x434c,0xb7));var _0xc434=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x434c[_0x432682];return _0x463d05;};'use strict';var util=require('util');var _=require(_0xc434('0x0'));var BPromise=require(_0xc434('0x1'));var uuid=require(_0xc434('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0xc434('0x3'));var Redis=require(_0xc434('0x4'));var config=require(_0xc434('0x5'));var logger=require(_0xc434('0x6'))(_0xc434('0x7'));var loggerBooked=require(_0xc434('0x6'))(_0xc434('0x8'));var loggerPredictive=require(_0xc434('0x6'))(_0xc434('0x9'));var loggerPredictiveCalls=require(_0xc434('0x6'))(_0xc434('0xa'));var loggerSyncQueueSummary=require(_0xc434('0x6'))('syncQueueSummary');var ami=require('../ami');config[_0xc434('0xb')]=_[_0xc434('0xc')](config[_0xc434('0xb')],{'host':_0xc434('0xd'),'port':0x18eb});var io=require(_0xc434('0xe'))(new Redis(config[_0xc434('0xb')]));var cmHopper=require(_0xc434('0xf'));var cmHopperFinal=require(_0xc434('0x10'));var cmHopperHistory=require(_0xc434('0x11'));var cmHopperBlack=require(_0xc434('0x12'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0xc434('0x13'));var Final=require(_0xc434('0x14'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xc434('0x15'));var Hangup=require(_0xc434('0x16'));var ipAgi=process[_0xc434('0x17')][_0xc434('0x18')]||_0xc434('0x19');var strategy={'rrmemory':_0xc434('0x1a'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0xc434('0x1b')][_0xc434('0x1c')]=function(_0x4eb7b2){this[_0xc434('0x1d')]=this[_0xc434('0x1d')]?this[_0xc434('0x1d')][_0xc434('0x1e')](_0x4eb7b2):_0x4eb7b2();};function Dialer(_0xb5608e,_0x2dedab){this[_0xc434('0x1f')]=new Sequence();this['preview']=_0x2dedab;this[_0xc434('0x20')]=_0xb5608e[_0xc434('0x20')];this[_0xc434('0x21')]=_0xb5608e[_0xc434('0x21')];this[_0xc434('0x22')]=_0xb5608e[_0xc434('0x22')];this[_0xc434('0x23')]=_0xb5608e[_0xc434('0x23')];this['maxNumberOriginate']=config[_0xc434('0x24')]||0x2;this[_0xc434('0x25')]={};this[_0xc434('0x26')]={};this[_0xc434('0x27')]={};this['uniqueId']={};this[_0xc434('0x28')]={};this[_0xc434('0x29')]={};this[_0xc434('0x2a')]={};this[_0xc434('0x2b')]={};this['queueBooked']={};this[_0xc434('0x2c')]={};ami['on'](_0xc434('0x2d'),this['syncAgentConnect']['bind'](this));ami['on'](_0xc434('0x2e'),this['syncQueueCallerAbandon'][_0xc434('0x2f')](this));ami['on']('originateresponse',this[_0xc434('0x30')][_0xc434('0x2f')](this));ami['on'](_0xc434('0x31'),this[_0xc434('0x32')][_0xc434('0x2f')](this));ami['on'](_0xc434('0x33'),this[_0xc434('0x34')][_0xc434('0x2f')](this));ami['on'](_0xc434('0x35'),this[_0xc434('0x36')][_0xc434('0x2f')](this));ami['on']('newexten',this[_0xc434('0x37')][_0xc434('0x2f')](this));ami['on']('varset',this['syncVarSet'][_0xc434('0x2f')](this));ami['on'](_0xc434('0x38'),this[_0xc434('0x39')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xc434('0x2f')](this));this['loopCampaigns']();this[_0xc434('0x3a')]();}function isNotNull(_0x3e4402){return _0x3e4402!==null&&!_[_0xc434('0x3b')](_0x3e4402);}function checkIsLoggedIn(_0x5b0e18,_0x4040fc){return function(){if(_0x4040fc<=0x0){_0x5b0e18[_0xc434('0x3c')]=_0xc434('0x3d');throw _0x5b0e18[_0xc434('0x3e')]+_0xc434('0x3f');}};}function isActive(_0x4c9023){return _0x4c9023;}function checkIsActive(_0x97d817,_0x23e95b){return function(){if(!isActive(_0x23e95b)){_0x97d817[_0xc434('0x3c')]=_0xc434('0x40');throw _0x97d817['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x572c58){return function(){if(!isNotNull(_0x572c58[_0xc434('0x41')])){_0x572c58['message']='INTERVAL_IS_NULL';throw _0x572c58['name']+_0xc434('0x42');}if(!isNotNull(_0x572c58[_0xc434('0x41')][_0xc434('0x43')])){_0x572c58['message']=_0xc434('0x44');throw _0x572c58['name']+_0xc434('0x42');}if(!isNotNull(_[_0xc434('0x45')](_0x572c58[_0xc434('0x41')][_0xc434('0x43')]))){_0x572c58[_0xc434('0x3c')]=_0xc434('0x44');throw _0x572c58['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x47186e,_0x429c56,_0x4ab40f){return{'action':_0x47186e,'response':_0x429c56,'message':_0x4ab40f,'stack':_0x4ab40f};}function myreject(_0x15e08a){return function(_0x3116a7){return _0x15e08a(msgResponse(_0xc434('0x46'),_0xc434('0x47'),JSON[_0xc434('0x48')](_0x3116a7)));};}function getSeconds(_0x430936,_0x5df55a){var _0x3fba84=moment(_0x430936)['milliseconds'](0x0);var _0x12964c=moment(_0x5df55a)['milliseconds'](0x0);return _0x3fba84[_0xc434('0x49')](_0x12964c,_0xc434('0x4a'));}function emit(_0x44e218,_0x56305a,_0x41318c){io['to'](_0x44e218)['emit'](_0x56305a,_0x41318c);}function emitVoiceQueueSummary(_0x3b1e70){if(_0x3b1e70[_0xc434('0x4b')]===_0xc434('0x4c')){var _0x3278c2={'id':_0x3b1e70['id'],'name':_0x3b1e70[_0xc434('0x3e')],'strategy':_0x3b1e70[_0xc434('0x4d')],'answered':_0x3b1e70[_0xc434('0x4e')],'available':_0x3b1e70[_0xc434('0x4f')],'loggedIn':_0x3b1e70[_0xc434('0x50')],'pTalking':_0x3b1e70['pTalking'],'sumBillable':_0x3b1e70['sumBillable'],'sumDuration':_0x3b1e70[_0xc434('0x51')],'sumHoldTime':_0x3b1e70[_0xc434('0x52')]||0x0,'talking':_0x3b1e70[_0xc434('0x53')],'total':_0x3b1e70[_0xc434('0x54')],'type':_0x3b1e70[_0xc434('0x4b')],'unmanaged':_0x3b1e70[_0xc434('0x55')],'abandoned':_0x3b1e70[_0xc434('0x56')],'waiting':_0x3b1e70[_0xc434('0x57')],'loggedInDb':_0x3b1e70[_0xc434('0x58')],'dialActive':_0x3b1e70[_0xc434('0x59')],'dialMethod':_0x3b1e70[_0xc434('0x5a')],'dialOriginateCallerIdName':_0x3b1e70['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x3b1e70[_0xc434('0x5b')],'dialOriginateTimeout':_0x3b1e70[_0xc434('0x5c')],'dialPrefix':_0x3b1e70[_0xc434('0x5d')],'outboundAnswerAgiCallsDay':_0x3b1e70[_0xc434('0x5e')],'outboundAnswerCallsDay':_0x3b1e70[_0xc434('0x5f')],'outboundBlacklistCallsDay':_0x3b1e70['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3b1e70[_0xc434('0x60')],'outboundCongestionCallsDay':_0x3b1e70[_0xc434('0x61')],'outboundDropCallsDayACS':_0x3b1e70[_0xc434('0x62')],'outboundDropCallsDayCallersExit':_0x3b1e70[_0xc434('0x63')],'outboundDropCallsDayTimeout':_0x3b1e70[_0xc434('0x64')],'outboundNoAnswerCallsDay':_0x3b1e70[_0xc434('0x65')],'outboundNoSuchCallsDay':_0x3b1e70[_0xc434('0x66')],'outboundOriginateFailureCallsDay':_0x3b1e70[_0xc434('0x67')],'outboundReCallsDay':_0x3b1e70['outboundReCallsDay'],'outboundRejectCallsDay':_0x3b1e70[_0xc434('0x68')],'outboundUnknownCallsDay':_0x3b1e70[_0xc434('0x69')],'predictiveIntervalAnsweredCalls':_0x3b1e70[_0xc434('0x6a')],'predictiveIntervalAvgHoldtime':_0x3b1e70['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3b1e70[_0xc434('0x6b')],'predictiveIntervalDroppedCallsCallersExit':_0x3b1e70['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3b1e70['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x3b1e70[_0xc434('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x3b1e70['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x3b1e70[_0xc434('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x3b1e70['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3b1e70['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x3b1e70[_0xc434('0x6e')],'predictiveIntervalTotalCalls':_0x3b1e70[_0xc434('0x6f')],'message':_0x3b1e70['message'],'originated':_0x3b1e70[_0xc434('0x70')],'erlangCalls':_0x3b1e70[_0xc434('0x71')],'erlangCallToSecond':_0x3b1e70[_0xc434('0x72')],'erlangAbandonmentRate':_0x3b1e70[_0xc434('0x73')],'erlangBusyFactor':_0x3b1e70[_0xc434('0x74')],'startPredictive':_0x3b1e70[_0xc434('0x29')],'startProgressive':_0x3b1e70[_0xc434('0x2a')]};if(_0x3b1e70['Trunk']){_0x3278c2['Trunk']={'id':_0x3b1e70['Trunk']['id'],'name':_0x3b1e70['Trunk']['name'],'active':_0x3b1e70[_0xc434('0x75')]['active'],'callerid':_0x3b1e70[_0xc434('0x75')][_0xc434('0x76')]};}if(_0x3b1e70['Interval']){_0x3278c2[_0xc434('0x41')]={'id':_0x3b1e70[_0xc434('0x41')]['id'],'name':_0x3b1e70[_0xc434('0x41')]['name']};}var _0x18cb65=md5(JSON[_0xc434('0x48')](_0x3278c2));if(_0x3b1e70[_0xc434('0x3')]!==_0x18cb65){_0x3b1e70['md5']=_0x18cb65;emit(util['format'](_0xc434('0x77'),_0x3278c2[_0xc434('0x3e')]),'voice_queue:save',_0x3278c2);}}}function emitCampaignSummary(_0x2bda9f){if(_0x2bda9f[_0xc434('0x4b')]===_0xc434('0x78')){emit(util['format'](_0xc434('0x79'),_0x2bda9f[_0xc434('0x3e')]),_0xc434('0x7a'),_0x2bda9f);}}function checkGetDataPredictive(_0x5b7239){if(isNotNull(_0x5b7239)){if(!_['isEmpty'](_0x5b7239)){loggerPredictive[_0xc434('0x7b')](_0xc434('0x7c'));loggerPredictive['info']('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b7239[_0xc434('0x6f')]);loggerPredictive[_0xc434('0x7b')](_0xc434('0x7d'),_0x5b7239[_0xc434('0x6a')]);loggerPredictive[_0xc434('0x7b')](_0xc434('0x7e'),_0x5b7239[_0xc434('0x7f')]);loggerPredictive[_0xc434('0x7b')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b7239[_0xc434('0x80')]);loggerPredictive[_0xc434('0x7b')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5b7239['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xc434('0x7b')](_0xc434('0x81'),_0x5b7239[_0xc434('0x6b')]);loggerPredictive[_0xc434('0x7b')](_0xc434('0x82'));if(_0x5b7239['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x5b7239[_0xc434('0x6b')])&&_0x5b7239['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0xc434('0x7b')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0xc434('0x3b')](_0x5b7239[_0xc434('0x83')])&&_0x5b7239[_0xc434('0x83')]>0x0){return!![];}else{loggerPredictive['info'](_0xc434('0x84'));}}else{loggerPredictive[_0xc434('0x7b')](_0xc434('0x85'));}}else{loggerPredictive[_0xc434('0x7b')](_0xc434('0x86'));}}else{loggerPredictive[_0xc434('0x7b')](_0xc434('0x86'));}return![];}function mergeDataErlangB(_0x25c190){return function(_0x49cf3a){loggerPredictive[_0xc434('0x7b')](_0xc434('0x87'));loggerPredictive[_0xc434('0x7b')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49cf3a[_0xc434('0x71')]);loggerPredictive[_0xc434('0x7b')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49cf3a[_0xc434('0x72')]);loggerPredictive[_0xc434('0x7b')](_0xc434('0x88'),_0x49cf3a[_0xc434('0x73')]);loggerPredictive[_0xc434('0x7b')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49cf3a['erlangBusyFactor']);loggerPredictive[_0xc434('0x7b')](_0xc434('0x88'),_0x49cf3a['erlangAbandonmentRate']);loggerPredictive[_0xc434('0x7b')](_0xc434('0x82'));_[_0xc434('0x89')](_0x25c190,_0x49cf3a);};}function getDiff(_0x4fe022){var _0x6777ce=moment()[_0xc434('0x8a')](0x0);var _0x589683=moment(_0x4fe022)[_0xc434('0x8a')](0x0);return _0x6777ce[_0xc434('0x49')](_0x589683,_0xc434('0x4a'));}function ifInterval(_0x5a483a,_0x1c78c7){if(_[_0xc434('0x3b')](_0x1c78c7)){return![];}if(getDiff(_0x1c78c7)<_0x5a483a*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xd59de8){if(isNotNull(_0xd59de8)){if(!_[_0xc434('0x3b')](_0xd59de8[_0xc434('0x2a')])){_0xd59de8[_0xc434('0x2a')]=undefined;loggerPredictive[_0xc434('0x7b')](_0xd59de8[_0xc434('0x3e')],_0xc434('0x8b'));}if(!_[_0xc434('0x3b')](_0xd59de8[_0xc434('0x29')])){_0xd59de8[_0xc434('0x29')]=undefined;loggerPredictive[_0xc434('0x7b')](_0xd59de8[_0xc434('0x3e')],_0xc434('0x8c'));}if(!_[_0xc434('0x3b')](_0xd59de8[_0xc434('0x8d')])){clearInterval(_0xd59de8[_0xc434('0x8d')]);_0xd59de8[_0xc434('0x8d')]=undefined;loggerPredictive[_0xc434('0x7b')](_0xd59de8[_0xc434('0x3e')],_0xc434('0x8e'));}}}function erlangb(_0x360fc1,_0x18071f){if(_0x18071f===0x0){return 0x0;}var _0x2d82a5=0x1;for(var _0x2e2c89=0x1;_0x2e2c89<=_0x18071f;_0x2e2c89+=0x1){_0x2d82a5=0x1+_0x2d82a5*_0x2e2c89/_0x360fc1;}return 0x1/_0x2d82a5;}function isVoiceQueueOutbound(_0x31c8b2){return _0x31c8b2===_0xc434('0x4c');}function isNotPreview(_0x15d7b2){return _0x15d7b2!==_0xc434('0x8f');}function isCampaignIvr(_0x1d9d59){return _0x1d9d59==='ivr';}function getCallerId(_0x27221c,_0x19a2fd,_0x523c8b){if(!_[_0xc434('0x3b')](_0x523c8b)&&'string'===typeof _0x523c8b&&!_[_0xc434('0x45')](_0x523c8b)){if(!_[_0xc434('0x3b')](_0x19a2fd)&&_0xc434('0x90')===typeof _0x19a2fd&&!_['isEmpty'](_0x19a2fd)){return util[_0xc434('0x91')](_0xc434('0x92'),_0x19a2fd,_0x523c8b);}return util[_0xc434('0x91')](_0xc434('0x92'),_0x523c8b,_0x523c8b);}if(!_['isUndefined'](_0x27221c)&&_0xc434('0x90')===typeof _0x27221c&&!_[_0xc434('0x45')](_0x27221c)){return _0x27221c;}return _0xc434('0x93');}function loggerCatchQueueSummary(_0x877f88,_0x2aaa49){return function(_0x379cc5){freeVariablesPredictive(_0x2aaa49);emitVoiceQueueSummary(_0x2aaa49);emitCampaignSummary(_0x2aaa49);loggerSyncQueueSummary[_0xc434('0x94')](_0x877f88,util[_0xc434('0x95')](_0x379cc5,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x429641,_0xa5fc78){return function(_0x4c8c18){loggerPredictive[_0xc434('0x94')](_0xa5fc78[_0xc434('0x3e')],_0x429641);loggerPredictive['error'](_0x4c8c18[_0xc434('0x96')]);freeVariablesPredictive(_0xa5fc78);};}function loggerCatch(_0x294132){return function(_0x14efa4){logger[_0xc434('0x94')](_0x294132,util[_0xc434('0x95')](_0x14efa4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x537a7f){return _0x537a7f&&!_[_0xc434('0x3b')](_0x537a7f)&&_0x537a7f[_0xc434('0x97')]>0x0;}function decremetOriginate(_0x4d815f){if(!_[_0xc434('0x3b')](_0x4d815f)&&_0x4d815f!==null){if(_0x4d815f[_0xc434('0x98')](_0xc434('0x70'))){if(_0x4d815f[_0xc434('0x70')]>0x0){_0x4d815f[_0xc434('0x70')]-=0x1;}else{logger[_0xc434('0x94')](_0xc434('0x99'));}}}else{logger[_0xc434('0x94')](_0xc434('0x9a'));}}function checkContactLowerLimitOriginate(_0x4fbadd,_0x1197f0,_0x564ad4){if(_0x1197f0>_0x564ad4){for(var _0x28b633=0x0;_0x28b633<_0x1197f0-_0x564ad4;_0x28b633+=0x1){decremetOriginate(_0x4fbadd);}}}function loggerGetContactDialer(_0x585431,_0x34b22f,_0x4a0b2a){return function(_0x3b9ed6){checkContactLowerLimitOriginate(_0x34b22f,_0x4a0b2a,0x0);logger[_0xc434('0x94')](_0x585431,util['inspect'](_0x3b9ed6,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x26ab24){return function(_0x2c943d){if(isNotNull(_0x2c943d)&&isNotNull(_0x2c943d[0x0])){if(_0x2c943d[0x0]['contactsRescheduled']>0x0){_0x26ab24['message']='RESCHEDULED_CONTACTS';logger[_0xc434('0x7b')](_0xc434('0x9b')+_0x26ab24['name'],_0x2c943d[0x0][_0xc434('0x9c')],_0xc434('0x9d'));}else{_0x26ab24['message']=_0xc434('0x9e');logger['info'](_0xc434('0x9f')+_0x26ab24[_0xc434('0x3e')]);}}};}function notSendMessagesQueue(_0x297289){if(_0x297289[_0xc434('0xa0')]){freeVariablesPredictive(_0x297289);if(_0x297289['originated']===0x0&&_0x297289['talking']===0x0&&_0x297289['waiting']===0x0&&(_0x297289[_0xc434('0xa1')]||0x0)===0x0){_0x297289['sendMessageOneNotActive']=![];_0x297289['available']=0x0;_0x297289[_0xc434('0x3c')]=_0xc434('0x40');loggerSyncQueueSummary[_0xc434('0x94')](_0xc434('0xa2'),_0x297289[_0xc434('0x3e')],_0xc434('0xa3'));}else{_0x297289[_0xc434('0x3c')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc434('0x94')](_0xc434('0xa2'),_0x297289['name'],_0xc434('0xa4'));}emitVoiceQueueSummary(_0x297289);}}function notSendMessagesCampaign(_0x3b9ef8){if(_0x3b9ef8[_0xc434('0xa0')]){if(_0x3b9ef8[_0xc434('0x70')]===0x0){_0x3b9ef8[_0xc434('0xa0')]=![];_0x3b9ef8[_0xc434('0x3c')]=_0xc434('0x40');loggerSyncQueueSummary[_0xc434('0x94')](_0xc434('0xa5'),_0x3b9ef8[_0xc434('0x3e')],_0xc434('0xa3'));}else{_0x3b9ef8[_0xc434('0x3c')]=_0xc434('0xa6');loggerSyncQueueSummary['error'](_0xc434('0xa5'),_0x3b9ef8[_0xc434('0x3e')],'is\x20disactive');}emitCampaignSummary(_0x3b9ef8);}}function createObjHistory(_0x20619d,_0x5b52a4,_0x1dbf84,_0x12ddf8,_0x2531b2){_0x20619d[_0xc434('0x3c')]=_0x1dbf84;var _0x390775=new Action(_0x20619d,_0x5b52a4);var _0x5ae966=new History(_0x390775);_0x5ae966[_0xc434('0xa7')]=_0x12ddf8;_0x5ae966[_0xc434('0xa8')]=_0x2531b2;_0x5ae966[_0xc434('0xa9')]=_0x390775[_0xc434('0xaa')];return _0x5ae966;}Dialer[_0xc434('0x1b')][_0xc434('0x3a')]=function(){var _0x217db2=this;setInterval(function(){_0x217db2[_0xc434('0xab')](_0x217db2[_0xc434('0xac')],_0xc434('0xad'));_0x217db2[_0xc434('0xab')](_0x217db2[_0xc434('0x26')],_0xc434('0xae'));},0x32c8);};Dialer['prototype'][_0xc434('0xab')]=function(_0xa6f858,_0x1d6374){var _0x39e562=this;for(var _0x4a60b3 in _0xa6f858){if(_0xa6f858[_0xc434('0x98')](_0x4a60b3)){this[_0xc434('0x1f')][_0xc434('0x1c')](function(){if(!_[_0xc434('0xaf')](_0xa6f858[_0x4a60b3])){return ami['Action']({'action':_0xc434('0xb0'),'channel':_0xa6f858[_0x4a60b3][_0xc434('0xb1')]})[_0xc434('0xb2')](function(_0x44288b){if(_0x44288b[_0xc434('0x3c')]===_0xc434('0xb3')){setTimeout(function(){if(_0xa6f858[_0x4a60b3]&&_0xa6f858[_0x4a60b3][_0xc434('0x4b')]!==_0xc434('0x78')){_0x39e562[_0xc434('0xb4')](_0x39e562['voiceQueues'][_0xa6f858[_0x4a60b3][_0xc434('0xb5')]]);logger[_0xc434('0x94')](_0xc434('0xb6'),_0x1d6374,_0x4a60b3,_0xa6f858[_0x4a60b3][_0xc434('0xb5')]);delete _0xa6f858[_0x4a60b3];}if(_0xa6f858[_0x4a60b3]&&_0xa6f858[_0x4a60b3][_0xc434('0x4b')]===_0xc434('0x78')){_0x39e562[_0xc434('0xb4')](_0x39e562[_0xc434('0x21')][_0xa6f858[_0x4a60b3][_0xc434('0xb5')]]);logger[_0xc434('0x94')](_0xc434('0xb7'),_0x1d6374,_0x4a60b3,_0xa6f858[_0x4a60b3][_0xc434('0xb5')]);delete _0xa6f858[_0x4a60b3];}},0x2328);}});}});}}};Dialer[_0xc434('0x1b')]['countReScheduled']=function(_0x3cfa5a){return BPromise[_0xc434('0xb8')]()[_0xc434('0xb9')](cmHopper['countReScheduled'](_0x3cfa5a))['catch'](loggerCatch(_0xc434('0xba')));};Dialer[_0xc434('0x1b')][_0xc434('0xbb')]=function(_0x2d1d69){return BPromise[_0xc434('0xb8')]()['then'](cmHopperBlack['checkIsBlackList'](_0x2d1d69))[_0xc434('0xb2')](loggerCatch(_0xc434('0xbc')));};Dialer[_0xc434('0x1b')][_0xc434('0xbd')]=function(_0x161022){return BPromise[_0xc434('0xb8')]()[_0xc434('0xb9')](cmHopperBlack[_0xc434('0xbd')](_0x161022))[_0xc434('0xb2')](loggerCatch(_0xc434('0xbe')));};Dialer[_0xc434('0x1b')][_0xc434('0xbf')]=function(_0x2eace7){return BPromise[_0xc434('0xb8')]()[_0xc434('0xb9')](cmHopperHistory[_0xc434('0xc0')](_0x2eace7))[_0xc434('0xb2')](loggerCatch(_0xc434('0xc1')));};Dialer['prototype'][_0xc434('0xc2')]=function(_0x31ff3a){return BPromise[_0xc434('0xb8')]()[_0xc434('0xb9')](cmHopper[_0xc434('0xc2')](_0x31ff3a))[_0xc434('0xb2')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['getContactDialer']=function(_0x130b5f,_0x2a6ae1,_0x40820c,_0x15f58d){return BPromise['resolve']()[_0xc434('0xb9')](cmHopper[_0xc434('0xc3')](_0x130b5f,_0x2a6ae1,_0x40820c,_0x15f58d))[_0xc434('0xb2')](loggerCatch(_0xc434('0xc4')));};Dialer[_0xc434('0x1b')][_0xc434('0xc5')]=function(_0x706798,_0x57613f,_0xbb8b1d){return BPromise['resolve']()['then'](cmHopper['getContactDialerIvr'](_0x706798,_0x57613f,_0xbb8b1d))[_0xc434('0xb2')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xc434('0x1b')][_0xc434('0xc6')]=function(_0x272ed7){return BPromise[_0xc434('0xb8')]()[_0xc434('0xb9')](voiceQueueRt['getVoiceQueueRtPauses'](_0x272ed7))[_0xc434('0xb2')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0xc434('0x1b')][_0xc434('0xc7')]=function(_0x5643e5){return BPromise[_0xc434('0xb8')]()[_0xc434('0xb9')](cmHopper['moveContactManagedDialer'](_0x5643e5))[_0xc434('0xb2')](loggerCatch(_0xc434('0xc8')));};Dialer[_0xc434('0x1b')][_0xc434('0xc9')]=function(_0x5a4ae3){return BPromise[_0xc434('0xb8')]()[_0xc434('0xb9')](cmHopperHistory[_0xc434('0xc9')](_0x5a4ae3))[_0xc434('0xb2')](loggerCatch('[createHistory]\x20'));};Dialer[_0xc434('0x1b')]['updateOriginated']=function(_0x2741e6){if(!_['isUndefined'](_0x2741e6)&&_0x2741e6!==null){if(_0x2741e6[_0xc434('0x98')](_0xc434('0x70'))){if(_0x2741e6[_0xc434('0x70')]>0x0){_0x2741e6[_0xc434('0x70')]-=0x1;}else{logger[_0xc434('0x94')](_0xc434('0xca'));}}}else{logger['error'](_0xc434('0xcb'));}};Dialer['prototype']['loggerHandler']=function(_0x597c5a,_0x5762c5){var _0x1a9984=this;return function(_0x4ddb72){_0x1a9984[_0xc434('0xb4')](_0x5762c5);logger[_0xc434('0x94')](_0x597c5a,util[_0xc434('0x95')](_0x4ddb72,{'showHidden':![],'depth':null}));};};Dialer[_0xc434('0x1b')][_0xc434('0xcc')]=function(_0x4bccc1,_0x4c9538,_0xb6564c){var _0xe949b7={'state':0x19,'statedesc':_0xc434('0xcd')};this[_0xc434('0xb4')](_0x4c9538);this[_0xc434('0xce')](_[_0xc434('0x89')](_0xe949b7,_[_0xc434('0xcf')](_0xb6564c,['ContactId',_0xc434('0xd0'),_0xc434('0xd1'),_0xc434('0xd2'),'CampaignId'])),_0xc434('0xd3'),'[emptyContact]');logger['error'](_0x4bccc1);};Dialer['prototype'][_0xc434('0xd4')]=function(_0x2b6d59){return _0x2b6d59==='Success';};Dialer[_0xc434('0x1b')][_0xc434('0xd5')]=function(_0x5a096e){return!_[_0xc434('0x3b')](_0x5a096e)&&_0x5a096e&&!_[_0xc434('0x3b')](_0x5a096e[_0xc434('0x3e')])&&!_[_0xc434('0x3b')](_0x5a096e['active'])&&_0x5a096e[_0xc434('0xd6')]&&(this[_0xc434('0x23')][util[_0xc434('0x91')](_0xc434('0xd7'),_0x5a096e[_0xc434('0x3e')])][_0xc434('0xb0')]===_0xc434('0xd8')||this['trunks'][util['format'](_0xc434('0xd7'),_0x5a096e[_0xc434('0x3e')])][_0xc434('0xb0')]===_0xc434('0xd9'));};Dialer[_0xc434('0x1b')][_0xc434('0xce')]=function(_0x3dbe56,_0x5551c0,_0x52191d){this['createHistory'](_0x3dbe56)[_0xc434('0xb2')](loggerCatch(_0x5551c0));this[_0xc434('0xc7')](_0x3dbe56)[_0xc434('0xb2')](loggerCatch(_0x52191d));};Dialer[_0xc434('0x1b')][_0xc434('0xda')]=function(_0x474fb3){var _0x2d8d37=this[_0xc434('0xac')][_0x474fb3['uniqueid']];var _0x16891f;if(!_[_0xc434('0xaf')](_0x474fb3)&&!_[_0xc434('0xaf')](_0x474fb3[_0xc434('0xdb')])&&!_[_0xc434('0xaf')](_0x474fb3['variable'][_0xc434('0xdc')])&&_0x474fb3[_0xc434('0xdd')]===_0xc434('0xde')&&_0x2d8d37){if(_0x2d8d37[_0xc434('0x4b')]!==_0xc434('0x78')&&this['voiceQueues'][_0x2d8d37[_0xc434('0xb5')]][_0xc434('0xdf')]&&_0x474fb3[_0xc434('0xe0')]==='HANGUP'){delete this['uniqueId'][_0x474fb3[_0xc434('0xe1')]];this[_0xc434('0xb4')](this[_0xc434('0x20')][_0x2d8d37[_0xc434('0xb5')]]);this[_0xc434('0x20')][_0x2d8d37[_0xc434('0xb5')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x2d8d37['queue']][_0xc434('0x5e')]+=0x1;_0x16891f=new Hangup(_0x2d8d37,_0x474fb3);_0x16891f[_0xc434('0xa7')]=0x12;_0x16891f[_0xc434('0xa8')]=_0xc434('0xe2');_0x16891f[_0xc434('0xe3')]=_0xc434('0xe4');this['saveInDb'](_0x16891f,'[syncHangupInAMD][createHistory]',_0xc434('0xe5'));}if(_0x2d8d37[_0xc434('0x4b')]!==_0xc434('0x78')&&this[_0xc434('0x20')][_0x2d8d37[_0xc434('0xb5')]]['dialAMDActive']&&_0x474fb3[_0xc434('0xe0')]==='MACHINE'){delete this[_0xc434('0xac')][_0x474fb3[_0xc434('0xe1')]];this[_0xc434('0xb4')](this[_0xc434('0x20')][_0x2d8d37[_0xc434('0xb5')]]);this[_0xc434('0x20')][_0x2d8d37['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xc434('0x20')][_0x2d8d37[_0xc434('0xb5')]]['outboundAnswerAgiCallsDay']+=0x1;_0x16891f=new Hangup(_0x2d8d37,_0x474fb3);_0x16891f[_0xc434('0xa7')]=0x13;_0x16891f[_0xc434('0xa8')]=_0xc434('0xe6');_0x16891f[_0xc434('0xe3')]=_0xc434('0xe4');_0x16891f['amd']=!![];this[_0xc434('0xce')](_0x16891f,_0xc434('0xe7'),'[syncMachine]');}if(_0x2d8d37['type']==='ivr'&&this[_0xc434('0x21')][_0x2d8d37[_0xc434('0xb5')]][_0xc434('0xdf')]&&_0x474fb3[_0xc434('0xe0')]===_0xc434('0xe8')){delete this[_0xc434('0xac')][_0x474fb3[_0xc434('0xe1')]];this[_0xc434('0xb4')](this['campaigns'][_0x2d8d37[_0xc434('0xb5')]]);_0x16891f=new Hangup(_0x2d8d37,_0x474fb3);_0x16891f[_0xc434('0xa7')]=0x12;_0x16891f[_0xc434('0xa8')]=_0xc434('0xe2');_0x16891f[_0xc434('0xe3')]=_0xc434('0xe4');this['saveInDb'](_0x16891f,_0xc434('0xe9'),_0xc434('0xea'));}if(_0x2d8d37[_0xc434('0x4b')]===_0xc434('0x78')&&this['campaigns'][_0x2d8d37[_0xc434('0xb5')]][_0xc434('0xdf')]&&_0x474fb3['value']===_0xc434('0xeb')){delete this[_0xc434('0xac')][_0x474fb3[_0xc434('0xe1')]];this[_0xc434('0xb4')](this[_0xc434('0x21')][_0x2d8d37[_0xc434('0xb5')]]);_0x16891f=new Hangup(_0x2d8d37,_0x474fb3);_0x16891f[_0xc434('0xa7')]=0x13;_0x16891f[_0xc434('0xa8')]=_0xc434('0xe6');_0x16891f[_0xc434('0xe3')]=_0xc434('0xe4');_0x16891f[_0xc434('0xec')]=!![];this['saveInDb'](_0x16891f,_0xc434('0xed'),_0xc434('0xee'));}}};Dialer[_0xc434('0x1b')][_0xc434('0x36')]=function(_0x5264dd){var _0x2889a2=this['uniqueId'][_0x5264dd[_0xc434('0xe1')]];var _0x321810=this;var _0x5eacdd;if(_0x2889a2&&_0x2889a2['type']===_0xc434('0x78')){delete this[_0xc434('0xac')][_0x5264dd[_0xc434('0xe1')]];this[_0xc434('0xb4')](this[_0xc434('0x21')][_0x2889a2[_0xc434('0xb5')]]);this[_0xc434('0x21')][_0x2889a2[_0xc434('0xb5')]][_0xc434('0xef')]+=0x1;_0x5eacdd=new Hangup(_0x2889a2,_0x5264dd);this['createHistory'](_0x5eacdd)[_0xc434('0xb2')](loggerCatch(_0xc434('0xf0')));this[_0xc434('0xc7')](_0x5eacdd)[_0xc434('0xb2')](loggerCatch('[syncHangupIvr]'));}if(_0x2889a2&&_0x2889a2['type']!==_0xc434('0x78')&&isNotNull(this[_0xc434('0x20')][_0x2889a2[_0xc434('0xb5')]][_0xc434('0xf1')])){delete this[_0xc434('0xac')][_0x5264dd[_0xc434('0xe1')]];this[_0xc434('0xb4')](this[_0xc434('0x20')][_0x2889a2[_0xc434('0xb5')]]);this[_0xc434('0x20')][_0x2889a2[_0xc434('0xb5')]]['outboundAnswerCallsDay']+=0x1;this[_0xc434('0x20')][_0x2889a2[_0xc434('0xb5')]][_0xc434('0x5e')]+=0x1;_0x5eacdd=new Hangup(_0x2889a2,_0x5264dd);_0x5eacdd[_0xc434('0xa7')]=0x10;_0x5eacdd[_0xc434('0xa8')]='AnswerAGI';_0x5eacdd['membername']=_0xc434('0xf2');this['createHistory'](_0x5eacdd)[_0xc434('0xb2')](loggerCatch(_0xc434('0xf0')));this[_0xc434('0xc7')](_0x5eacdd)[_0xc434('0xb2')](loggerCatch(_0xc434('0xf3')));}if(_0x2889a2&&_0x2889a2[_0xc434('0x4b')]!=='ivr'&&!isNotNull(this[_0xc434('0x20')][_0x2889a2['queue']][_0xc434('0xf1')])){delete this[_0xc434('0xac')][_0x5264dd[_0xc434('0xe1')]];this[_0xc434('0xb4')](this[_0xc434('0x20')][_0x2889a2[_0xc434('0xb5')]]);this[_0xc434('0x20')][_0x2889a2[_0xc434('0xb5')]][_0xc434('0x69')]+=0x1;_0x5eacdd=new Hangup(_0x2889a2,_0x5264dd);_0x5eacdd['state']=0xc;_0x5eacdd['statedesc']=_0x5264dd['cause-txt'];_0x5eacdd['membername']=_0xc434('0xf4');this[_0xc434('0xc9')](_0x5eacdd)[_0xc434('0xb2')](loggerCatch(_0xc434('0xf0')));this[_0xc434('0xc7')](_0x5eacdd)[_0xc434('0xb2')](loggerCatch(_0xc434('0xf3')));}};Dialer[_0xc434('0x1b')]['syncAgentComplete']=function(_0x10e37e){var _0xab3254=this[_0xc434('0xac')][_0x10e37e[_0xc434('0xe1')]];var _0xf868ae=this;if(this['voiceQueues'][_0x10e37e[_0xc434('0xb5')]]){if(_0xab3254&&_0xab3254[_0xc434('0x4b')]!==_0xc434('0x78')){delete this[_0xc434('0xac')][_0x10e37e[_0xc434('0xe1')]];this[_0xc434('0x20')][_0x10e37e[_0xc434('0xb5')]][_0xc434('0x5f')]+=0x1;var _0x154d22=new AgentComplete(_0xab3254,_0x10e37e);if(_0x10e37e[_0xc434('0xf5')]===_0xc434('0xf6')){_0x154d22[_0xc434('0xf7')]=this[_0xc434('0x20')][_0x10e37e[_0xc434('0xb5')]]['dialQueueProject2']&&this[_0xc434('0x20')][_0x10e37e['queue']][_0xc434('0xf8')]?moment()[_0xc434('0x91')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this['createHistory'](_0x154d22)[_0xc434('0xb2')](loggerCatch(_0xc434('0xf9')));this[_0xc434('0xc7')](_0x154d22)[_0xc434('0xb2')](loggerCatch(_0xc434('0xfa')));}}};Dialer[_0xc434('0x1b')][_0xc434('0xfb')]=function(_0xa8a62a){if(this[_0xc434('0x20')][_0xa8a62a[_0xc434('0xb5')]]){if(this[_0xc434('0xac')][_0xa8a62a[_0xc434('0xe1')]]&&this[_0xc434('0xac')][_0xa8a62a['uniqueid']][_0xc434('0x4b')]!==_0xc434('0x78')){this[_0xc434('0xb4')](this[_0xc434('0x20')][_0xa8a62a[_0xc434('0xb5')]]);this[_0xc434('0xac')][_0xa8a62a[_0xc434('0xe1')]]['answertime']=moment()[_0xc434('0x91')](_0xc434('0xfc'));}}};Dialer['prototype'][_0xc434('0xfd')]=function(_0x2d674f){this[_0xc434('0xc9')](_0x2d674f)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x2d674f)[_0xc434('0xb2')](loggerCatch(_0xc434('0xfe')));};Dialer['prototype'][_0xc434('0xff')]=function(_0x5e9675){var _0x564814=this['uniqueId'][_0x5e9675[_0xc434('0xe1')]];var _0xf30133=this;if(this[_0xc434('0x20')][_0x5e9675['queue']]){if(_0x564814&&_0x564814['type']!=='ivr'){delete this[_0xc434('0xac')][_0x5e9675[_0xc434('0xe1')]];this['updateOriginated'](this[_0xc434('0x20')][_0x5e9675[_0xc434('0xb5')]]);_0x564814[_0xc434('0x100')]=moment()['format'](_0xc434('0xfc'));var _0x8ce895=new QueueCallerAbandon(_0x564814,_0x5e9675);if(getSeconds(_0x564814[_0xc434('0x100')],_0x564814['responsetime'])>=_0x564814[_0xc434('0x101')]){this[_0xc434('0x20')][_0x5e9675[_0xc434('0xb5')]][_0xc434('0x7f')]+=0x1;this[_0xc434('0x20')][_0x5e9675[_0xc434('0xb5')]][_0xc434('0x64')]+=0x1;this[_0xc434('0x20')][_0x5e9675[_0xc434('0xb5')]][_0xc434('0x102')]+=0x1;_0x8ce895[_0xc434('0xa7')]=0xa;_0x8ce895['statedesc']=_0xc434('0x103');_0x8ce895[_0xc434('0x104')]=_0xc434('0x105');_0x8ce895[_0xc434('0xf7')]=this['voiceQueues'][_0x5e9675['queue']][_0xc434('0x106')]?moment()[_0xc434('0x91')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0xc434('0xfd')](_0x8ce895);}else{this['voiceQueues'][_0x5e9675[_0xc434('0xb5')]][_0xc434('0x80')]+=0x1;this[_0xc434('0x20')][_0x5e9675[_0xc434('0xb5')]][_0xc434('0x63')]+=0x1;_0x8ce895[_0xc434('0xa7')]=0xb;_0x8ce895[_0xc434('0xa8')]=_0xc434('0x107');_0x8ce895[_0xc434('0x104')]=_0xc434('0x108');this['queueCallerAbandonCreateState'](_0x8ce895);}}}};Dialer[_0xc434('0x1b')][_0xc434('0x37')]=function(_0x400a1c){if(this[_0xc434('0x26')][_0x400a1c['uniqueid']]){this['actions'][_0x400a1c[_0xc434('0xe1')]]['channel']=_0x400a1c[_0xc434('0xb1')];}if(this['uniqueId'][_0x400a1c['uniqueid']]){this['uniqueId'][_0x400a1c[_0xc434('0xe1')]][_0xc434('0xb1')]=_0x400a1c['channel'];}};Dialer['prototype'][_0xc434('0x39')]=function(_0x12646b){if(strategy[this[_0xc434('0x20')][this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]][_0xc434('0xb5')]][_0xc434('0x4d')]]===_0xc434('0x10a')){if(this[_0xc434('0x26')][_0x12646b['actionid']]&&_[_0xc434('0xaf')](this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]][_0xc434('0x10b')])&&_0x12646b[_0xc434('0xb0')]==='1'&&_0x12646b[_0xc434('0x10c')]==='0'){if(this[_0xc434('0x22')][_0x12646b[_0xc434('0x10d')]]){if(!this['agents'][_0x12646b[_0xc434('0x10d')]][_0xc434('0x10b')]){this[_0xc434('0x22')][_0x12646b['stateinterface']][_0xc434('0x10b')]=!![];this['actions'][_0x12646b['actionid']][_0xc434('0x10b')]=!![];this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]][_0xc434('0x10d')]=_0x12646b['stateinterface'];}}}}else if((strategy[this[_0xc434('0x20')][this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]][_0xc434('0xb5')]][_0xc434('0x4d')]]||_0xc434('0x1a'))===_0xc434('0x1a')){if(this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]]){if(this[_0xc434('0x22')][_0x12646b[_0xc434('0x10d')]]){this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]][_0xc434('0x10d')]=_0x12646b[_0xc434('0x10d')];if(_[_0xc434('0xaf')](this['queueBooked'][this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]][_0xc434('0xb5')]])){this['queueBooked'][this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]][_0xc434('0xb5')]]=[];}this[_0xc434('0x10e')][this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]][_0xc434('0xb5')]][_0xc434('0x10f')](_[_0xc434('0x89')](_[_0xc434('0xcf')](this[_0xc434('0x26')][_0x12646b[_0xc434('0x109')]],[_0xc434('0x110'),_0xc434('0x10d')]),{'status':_0x12646b[_0xc434('0xb0')],'paused':_0x12646b['paused']}));}}}};function unlockQueueStatus(_0x42a3a1,_0x241149){setTimeout(function(){if(_['isUndefined'](_0x42a3a1['queueStatusComplete'])){loggerBooked[_0xc434('0x94')](_0xc434('0x111'),_0x241149);}_0x42a3a1[_0xc434('0x112')]=!![];loggerBooked[_0xc434('0x7b')](_0xc434('0x113'),_0x241149,JSON['stringify'](_['pick'](_0x42a3a1,[_0xc434('0x3e'),_0xc434('0x112')])));},0x1f3);}Dialer[_0xc434('0x1b')]['syncQueueStatusComplete']=function(_0x388650){var _0x22818d=this;var _0x4b9c5a=_0x22818d['voiceQueues'][_0x22818d['actions'][_0x388650[_0xc434('0x109')]]['queue']];if(strategy[this[_0xc434('0x20')][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['queue']][_0xc434('0x4d')]]===_0xc434('0x10a')){if(this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]&&this[_0xc434('0x26')][_0x388650['actionid']][_0xc434('0x10d')]){this[_0xc434('0x8f')][_0xc434('0x114')](this[_0xc434('0x26')][_0x388650['actionid']]['idHopper'],this[_0xc434('0x26')][_0x388650['actionid']][_0xc434('0x10d')])[_0xc434('0xb2')](function(_0x1fc358){logger['error'](_0xc434('0x115'),util[_0xc434('0x95')](_0x1fc358,{'showHidden':![],'depth':null}));})['finally'](function(){_0x22818d[_0xc434('0xb4')](_0x22818d[_0xc434('0x20')][_0x22818d[_0xc434('0x26')][_0x388650['actionid']]['queue']]);_0x22818d['agents'][_0x22818d[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['stateinterface']][_0xc434('0x10b')]=![];delete _0x22818d[_0xc434('0x26')][_0x388650[_0xc434('0x109')]];unlockQueueStatus(_0x4b9c5a);});}else{this[_0xc434('0xb4')](this[_0xc434('0x20')][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['queue']]);this[_0xc434('0xc2')]({'active':![],'ContactId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0x116')],'ListId':this[_0xc434('0x26')][_0x388650['actionid']][_0xc434('0xd0')],'VoiceQueueId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xd2')]||undefined,'CampaignId':this[_0xc434('0x26')][_0x388650['actionid']][_0xc434('0x117')]||undefined})[_0xc434('0xb2')](loggerCatch(_0xc434('0x118')));delete this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]];unlockQueueStatus(_0x4b9c5a);}}else if((strategy[this['voiceQueues'][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]][_0xc434('0x4d')]]||_0xc434('0x1a'))==='rrmemory'){var _0x427558;if(this[_0xc434('0x26')][_0x388650['actionid']]&&!_['isEmpty'](this[_0xc434('0x10e')][this[_0xc434('0x26')][_0x388650['actionid']][_0xc434('0xb5')]])){if(this[_0xc434('0x2c')][_0x22818d['actions'][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]]){this[_0xc434('0x2c')][_0x22818d[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]]=this['queueBookedRR'][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]]?this[_0xc434('0x2c')][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]]:this[_0xc434('0x10e')][this[_0xc434('0x26')][_0x388650['actionid']][_0xc434('0xb5')]]?this[_0xc434('0x10e')][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]][_0xc434('0x119')]||0x0:0x0;}this[_0xc434('0x10e')][this[_0xc434('0x26')][_0x388650['actionid']]['queue']][_0xc434('0x119')]=this[_0xc434('0x2c')][this[_0xc434('0x26')][_0x388650['actionid']][_0xc434('0xb5')]];for(var _0x3b9020=0x0;_0x3b9020<this[_0xc434('0x10e')][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]]['length'];_0x3b9020+=0x1){_0x427558=rr(this[_0xc434('0x10e')][this[_0xc434('0x26')][_0x388650['actionid']][_0xc434('0xb5')]]);this[_0xc434('0x2c')][_0x22818d['actions'][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]]=this['queueBooked'][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['queue']][_0xc434('0x119')];if(_0x427558[_0xc434('0xb0')]==='1'&&_0x427558[_0xc434('0x10c')]==='0'){break;}}if(!_[_0xc434('0xaf')](_0x427558)){this[_0xc434('0x22')][_0x427558[_0xc434('0x10d')]][_0xc434('0x11a')]=_['isUndefined'](this['agents'][_0x427558[_0xc434('0x10d')]][_0xc434('0x11a')])?!![]:this[_0xc434('0x22')][_0x427558[_0xc434('0x10d')]][_0xc434('0x11a')];}loggerBooked[_0xc434('0x7b')](_0xc434('0x11b'),_0x388650[_0xc434('0x109')],_0xc434('0x11c'),JSON[_0xc434('0x48')](_[_0xc434('0xcf')](this[_0xc434('0x22')][_0x427558[_0xc434('0x10d')]],['name',_0xc434('0x11a')])),_0xc434('0x11d'),JSON[_0xc434('0x48')](_0x427558[_0xc434('0x110')]));if(!_[_0xc434('0xaf')](_0x427558)&&_0x427558[_0xc434('0xb0')]==='1'&&_0x427558[_0xc434('0x10c')]==='0'&&this[_0xc434('0x22')][_0x427558[_0xc434('0x10d')]][_0xc434('0x11a')]){this[_0xc434('0x22')][_0x427558['stateinterface']]['unlockRR']=![];this[_0xc434('0x10e')][_0x22818d[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['queue']]=[];this[_0xc434('0x8f')][_0xc434('0x114')](_0x427558[_0xc434('0x110')],_0x427558[_0xc434('0x10d')])[_0xc434('0xb2')](function(_0x26fe75){logger[_0xc434('0x94')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x26fe75,{'showHidden':![],'depth':null}));})[_0xc434('0x1e')](function(){_0x22818d[_0xc434('0xb4')](_0x22818d[_0xc434('0x20')][_0x22818d[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['queue']]);setTimeout(function(){_0x22818d[_0xc434('0x22')][_0x427558[_0xc434('0x10d')]]['unlockRR']=!![];loggerBooked[_0xc434('0x7b')]('[booked][RR][finaly]',_0x388650[_0xc434('0x109')],_0xc434('0x11c'),JSON[_0xc434('0x48')](_['pick'](_0x22818d['agents'][_0x427558['stateinterface']],['name',_0xc434('0x11a')])),_0xc434('0x11d'),JSON['stringify'](_0x427558[_0xc434('0x110')]));},0xc7);delete _0x22818d[_0xc434('0x26')][_0x388650['actionid']];unlockQueueStatus(_0x4b9c5a,_0x388650['actionid']);});}else{loggerBooked[_0xc434('0x7b')](_0xc434('0x11e'));this[_0xc434('0xb4')](this['voiceQueues'][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]]);this[_0xc434('0xc2')]({'active':![],'ContactId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['ContactId'],'ListId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xd0')],'VoiceQueueId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['CampaignId']||undefined})[_0xc434('0xb2')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]];unlockQueueStatus(_0x4b9c5a);}}else{loggerBooked[_0xc434('0x7b')](_0xc434('0x11f'));this['updateOriginated'](this[_0xc434('0x20')][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]]);this[_0xc434('0xc2')]({'active':![],'ContactId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0x116')],'ListId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['ListId'],'VoiceQueueId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xd2')]||undefined,'CampaignId':this[_0xc434('0x26')][_0x388650['actionid']][_0xc434('0x117')]||undefined})[_0xc434('0xb2')](loggerCatch(_0xc434('0x120')));delete this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]];unlockQueueStatus(_0x4b9c5a);}}else{loggerBooked[_0xc434('0x7b')](_0xc434('0x121'));this[_0xc434('0xb4')](this[_0xc434('0x20')][this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0xb5')]]);this[_0xc434('0xc2')]({'active':![],'ContactId':this['actions'][_0x388650[_0xc434('0x109')]][_0xc434('0x116')],'ListId':this['actions'][_0x388650[_0xc434('0x109')]]['ListId'],'VoiceQueueId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xc434('0x26')][_0x388650[_0xc434('0x109')]][_0xc434('0x117')]||undefined})[_0xc434('0xb2')](loggerCatch(_0xc434('0x122')));delete this[_0xc434('0x26')][_0x388650['actionid']];unlockQueueStatus(_0x4b9c5a);}};Dialer[_0xc434('0x1b')][_0xc434('0x123')]=function(){var _0x5b0028=this;setInterval(function(){_0x5b0028['syncCampaigns']();},0x3e8);};Dialer['prototype'][_0xc434('0x124')]=function(_0x5969a0){var _0x2804e9=this;return function(){if(!_0x2804e9[_0xc434('0xd5')](_0x5969a0[_0xc434('0x75')])){if(!_0x2804e9[_0xc434('0xd5')](_0x5969a0[_0xc434('0x125')])){_0x5969a0['message']='TRUNK_IS_NOT_REACHABLE';throw _0x5969a0[_0xc434('0x3e')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0xc434('0x126')]=function(_0xf5a479,_0x1f8347,_0x179257,_0x3ed84d){var _0x202cc6=this;return function(){var _0x3e8c4d=!![];return _0x202cc6[_0xc434('0x127')](_0xf5a479,_0x1f8347,_0x179257,_0x3ed84d,_0x3e8c4d);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x2ec512,_0x25bddb,_0x24353b,_0x61b0d5){var _0x43d92d=this;return function(){var _0x532104=![];return _0x43d92d[_0xc434('0x127')](_0x2ec512[_0xc434('0x43')],_0x25bddb,_0x24353b,_0x61b0d5,_0x532104);};};Dialer['prototype'][_0xc434('0x127')]=function(_0x2d8470,_0x483f1f,_0xda3e5,_0x5087f7,_0x4eef30){var _0x27c606=[];return new BPromise(function(_0x1d493e,_0xb01f94){if(!isNotNull(_0x2d8470)){_0x5087f7[_0xc434('0x3c')]=_0xc434('0x44');return _0xb01f94(msgResponse('ifTime',_0xc434('0x128'),_0xda3e5+_0xc434('0x129')));}if(_[_0xc434('0x45')](_0x2d8470)){_0x5087f7[_0xc434('0x3c')]=_0xc434('0x12a');return _0xb01f94(msgResponse(_0xc434('0x127'),'Failure',_0xda3e5+_0xc434('0x12b')));}if(_0x483f1f&&_[_0xc434('0x3b')](config[_0xc434('0x12c')][_0x483f1f])){_0x5087f7[_0xc434('0x3c')]=_0xc434('0x12d');return _0xb01f94(msgResponse(_0xc434('0x127'),_0xc434('0x128'),_0xda3e5+'\x20Timezone\x20unknow\x20'+_0x483f1f));}if(_[_0xc434('0x12e')](_0x2d8470)){for(var _0x5d166b=0x0;_0x5d166b<_0x2d8470[_0xc434('0x97')];_0x5d166b+=0x1){_0x27c606['push'](ami[_0xc434('0x12f')]({'action':'command','command':util['format'](_0xc434('0x130'),_0x2d8470[_0x5d166b]['interval'],!_[_0xc434('0x3b')](config['timezones'][_0x483f1f])?_0x483f1f:'')})[_0xc434('0xb9')](function(_0x4e86a4){return _0x4e86a4[_0xc434('0x131')]['indexOf'](_0xc434('0x132'))>=0x0?!![]:![];})[_0xc434('0xb2')](myreject(_0xb01f94)));}}else{_0x27c606['push'](ami[_0xc434('0x12f')]({'action':_0xc434('0x133'),'command':util[_0xc434('0x91')](_0xc434('0x130'),_0x2d8470,!_[_0xc434('0x3b')](config[_0xc434('0x12c')][_0x483f1f])?_0x483f1f:'')})['then'](function(_0x1c608f){return _0x1c608f[_0xc434('0x131')][_0xc434('0x134')](_0xc434('0x132'))>=0x0?!![]:![];})[_0xc434('0xb2')](myreject(_0xb01f94)));}BPromise[_0xc434('0x135')](_0x27c606)[_0xc434('0xb9')](function(_0x388202){var _0x100473=_[_0xc434('0x136')](_0x388202);if(_0x100473){return _0x1d493e(_0x100473);}else{_0x5087f7['message']=_0x4eef30?_0xc434('0x137'):_0xc434('0x138');return _0xb01f94(msgResponse(_0xc434('0x139'),'Failure',_0xc434('0x13a')+_0x4eef30+'\x20'+_0xda3e5+_0xc434('0x13b')+util['inspect'](_0x2d8470,{'showHidden':![],'depth':null})+_0xc434('0x13c')+_0x483f1f));}})[_0xc434('0xb2')](function(_0x12dd59){return _0xb01f94(msgResponse(_0xc434('0x127'),'Failure',JSON[_0xc434('0x48')](_0x12dd59)));});});};Dialer[_0xc434('0x1b')]['checkDialMethod']=function(_0x54ec95){var _0x5d59b7=this;return function(){switch(_0x54ec95['dialMethod']){case _0xc434('0x13d'):freeVariablesPredictive(_0x54ec95);_0x5d59b7[_0xc434('0x13e')](_0x54ec95,0x1);break;case _0xc434('0x13f'):freeVariablesPredictive(_0x54ec95);_0x5d59b7['handlePower'](_0x54ec95,_0x54ec95[_0xc434('0x140')]);break;case'predictive':_0x5d59b7[_0xc434('0x9')](_0x54ec95);break;case _0xc434('0x8'):freeVariablesPredictive(_0x54ec95);_0x5d59b7[_0xc434('0x13e')](_0x54ec95,0x1);break;default:freeVariablesPredictive(_0x54ec95);logger[_0xc434('0x94')](_0xc434('0x141'),_0x54ec95['name'],_0xc434('0x142'));}};};Dialer[_0xc434('0x1b')][_0xc434('0x143')]=function(_0x38929a){var _0x1e99db=this;return function(){_0x1e99db[_0xc434('0x144')](_0x38929a);};};Dialer['prototype']['syncQueueSummary']=function(_0x37523e){var _0x326db5=this;if(isNotPreview(_0x37523e['dialMethod'])){if(isVoiceQueueOutbound(_0x37523e[_0xc434('0x4b')])&&isActive(_0x37523e[_0xc434('0x59')])){_0x37523e['sendMessageOneNotActive']=!![];BPromise[_0xc434('0xb8')]()[_0xc434('0xb9')](checkIsLoggedIn(_0x37523e,_0x37523e[_0xc434('0x50')]))[_0xc434('0xb9')](checkIsActive(_0x37523e,_0x37523e[_0xc434('0x59')]))[_0xc434('0xb9')](checkInterval(_0x37523e))['then'](_0x326db5[_0xc434('0x124')](_0x37523e))[_0xc434('0xb9')](_0x326db5[_0xc434('0x126')](_0x37523e[_0xc434('0x145')],_0x37523e[_0xc434('0x146')],_0x37523e[_0xc434('0x3e')],_0x37523e))[_0xc434('0xb9')](_0x326db5['checkIfTimeIntervals'](_0x37523e['Interval'],_0x37523e[_0xc434('0x146')],_0x37523e[_0xc434('0x3e')],_0x37523e))['then'](_0x326db5[_0xc434('0x147')](_0x37523e))[_0xc434('0xb2')](loggerCatchQueueSummary(_0xc434('0x148'),_0x37523e));}else{notSendMessagesQueue(_0x37523e);}}else{freeVariablesPredictive(_0x37523e);}};Dialer[_0xc434('0x1b')]['syncCampaigns']=function(){var _0x39771a=this;var _0x2b7ea1;for(var _0x55a928 in this[_0xc434('0x21')]){if(this[_0xc434('0x21')][_0xc434('0x98')](_0x55a928)){_0x2b7ea1=this['campaigns'][_0x55a928];if(isCampaignIvr(_0x2b7ea1[_0xc434('0x4b')])&&isActive(_0x2b7ea1[_0xc434('0xd6')])){_0x2b7ea1['sendMessageOneNotActive']=!![];BPromise[_0xc434('0xb8')]()[_0xc434('0xb9')](checkIsActive(_0x2b7ea1,_0x2b7ea1['active']))[_0xc434('0xb9')](checkInterval(_0x2b7ea1))[_0xc434('0xb9')](_0x39771a[_0xc434('0x124')](_0x2b7ea1))[_0xc434('0xb9')](_0x39771a['checkIfTime'](_0x2b7ea1[_0xc434('0x145')],_0x2b7ea1[_0xc434('0x146')],_0x2b7ea1['name'],_0x2b7ea1))[_0xc434('0xb9')](_0x39771a[_0xc434('0x149')](_0x2b7ea1[_0xc434('0x41')],_0x2b7ea1[_0xc434('0x146')],_0x2b7ea1[_0xc434('0x3e')],_0x2b7ea1))[_0xc434('0xb9')](_0x39771a[_0xc434('0x143')](_0x2b7ea1))['catch'](loggerCatchQueueSummary(_0xc434('0x14a'),_0x2b7ea1));}else{notSendMessagesCampaign(_0x2b7ea1);}}}};function getCallerIdRandom(_0x329a3d,_0x2a56b2){var _0x47ec28,_0x1441d1,_0xf8db22;if(_0x2a56b2<=0x0){_0x2a56b2=0x1;}_0x47ec28=new RegExp(_0xc434('0x14b')+_0x2a56b2+'}$');_0x1441d1=Math[_0xc434('0x14c')](0xa,_0x2a56b2-0x1);_0xf8db22=Math['pow'](0xa,_0x2a56b2)-0x1;return util[_0xc434('0x91')]('%s',_['replace'](_0x329a3d,_0x47ec28,_['random'](_0x1441d1,_0xf8db22)));}function extractCalleridName(_0x226e26){var _0x4dd1be=_0x226e26[_0xc434('0x14d')](/"(.*?)"/);return _0x4dd1be?_0x4dd1be[0x1]:_0x226e26;}function extractCalleridNumber(_0x24b256){var _0x58b182=_0x24b256[_0xc434('0x14d')](/<(.*?)>/);return _0x58b182?_0x58b182[0x1]:_0x24b256;}Dialer[_0xc434('0x1b')][_0xc434('0x14e')]=function(_0x11f4cb,_0x43afd4){var _0x7e7e21=this;var _0x356e9d=uuid['v4']();this[_0xc434('0x26')][_0x356e9d]=new Action(_0x11f4cb,_0x43afd4,_0x356e9d);return new BPromise(function(_0xc50c63,_0x4e1b3d){if(_['isUndefined'](_0x11f4cb)&&_0xc434('0x14f')!==typeof _0x11f4cb){return _0x4e1b3d(msgResponse(_0xc434('0x150'),_0xc434('0x128'),'voiceQueue\x20is\x20undefine'));}if(_[_0xc434('0x3b')](_0x43afd4[_0xc434('0x151')]['phone'])||_0x43afd4[_0xc434('0x151')][_0xc434('0x152')]===null){return _0x4e1b3d(msgResponse(_0xc434('0x150'),'Failure',_0xc434('0x153')));}var _0x319eda={'XMD-CALLERID':_0x7e7e21[_0xc434('0x26')][_0x356e9d][_0xc434('0x154')](),'XMD-AGI':_0x11f4cb[_0xc434('0xf1')]?util[_0xc434('0x91')]('\x22agi://%s/square,%s\x22',ipAgi,_0x11f4cb[_0xc434('0xf1')]):_0xc434('0x155'),'XMD-AGIAFTER':_0x11f4cb[_0xc434('0x106')]?util[_0xc434('0x91')](_0xc434('0x156'),ipAgi,_0x11f4cb[_0xc434('0x106')]):_0xc434('0x155'),'XMD-QUEUE':_0x11f4cb[_0xc434('0x4b')]==='outbound'?util[_0xc434('0x91')](_0xc434('0x157'),_0x11f4cb[_0xc434('0x3e')],_0x11f4cb[_0xc434('0x158')]||'',_0x11f4cb[_0xc434('0xf8')]?'c':'',_0x11f4cb[_0xc434('0x101')]||0x3):'NONE','XMD-CONTACTID':_0x43afd4['ContactId'],'XMD-CDRTYPE':_0xc434('0x7'),'CALLERID(all)':_0x7e7e21[_0xc434('0x26')][_0x356e9d][_0xc434('0x154')](),'XMD-AMD':_0x11f4cb['dialAMDActive']?'ACTIVE':'NONE','XMD-DESTINATION':_0xc434('0xde')};if(_0x11f4cb[_0xc434('0xdf')]){_0x319eda[_0xc434('0x159')]=_0x11f4cb['dialAMDInitialSilence']||0x9c4;_0x319eda[_0xc434('0x15a')]=_0x11f4cb[_0xc434('0x15b')]||0x5dc;_0x319eda[_0xc434('0x15c')]=_0x11f4cb[_0xc434('0x15d')]||0x320;_0x319eda['XMD-AMDTOTALANALYSISTIME']=_0x11f4cb[_0xc434('0x15e')]||0x1388;_0x319eda[_0xc434('0x15f')]=_0x11f4cb[_0xc434('0x160')]||0x64;_0x319eda[_0xc434('0x161')]=_0x11f4cb[_0xc434('0x162')]||0x32;_0x319eda[_0xc434('0x163')]=_0x11f4cb[_0xc434('0x164')]||0x3;_0x319eda[_0xc434('0x165')]=_0x11f4cb[_0xc434('0x166')]||0x100;_0x319eda['XMD-AMDMAXIMUMWORDLENGTH']=_0x11f4cb[_0xc434('0x167')]||0x1388;}if(_0x11f4cb[_0xc434('0x4b')]===_0xc434('0x4c')){_0x319eda[_0xc434('0x168')]=_0x43afd4[_0xc434('0xd2')];}else{_0x319eda['XMD-CAMPAIGNID']=_0x43afd4[_0xc434('0x117')];}for(var _0x5b586e in _0x43afd4['Contact']){if(_0x43afd4['Contact']['hasOwnProperty'](_0x5b586e)){if(isNotNull(_0x43afd4[_0xc434('0x151')][_0x5b586e])&&_0x5b586e!=='id'&&_0x5b586e!==_0xc434('0x169')&&_0x5b586e!==_0xc434('0x16a')&&_0x5b586e!==_0xc434('0x16b')){_0x319eda[util['format'](_0xc434('0x16c'),_0xc434('0x16d'),_[_0xc434('0x16e')](_0x5b586e))]=_0x43afd4['Contact'][_0x5b586e];}}}var _0x306d69=_0x7e7e21[_0xc434('0xd5')](_0x11f4cb['Trunk'])?getCallerId(_0x11f4cb['Trunk']['callerid'],_0x11f4cb[_0xc434('0x16f')],_0x11f4cb[_0xc434('0x170')]>0x0?getCallerIdRandom(_0x11f4cb[_0xc434('0x5b')],_0x11f4cb[_0xc434('0x170')]):_0x11f4cb[_0xc434('0x5b')]):getCallerId(_[_0xc434('0xaf')](_0x11f4cb['TrunkBackup'])?_0x11f4cb[_0xc434('0x75')][_0xc434('0x76')]:_0x11f4cb[_0xc434('0x125')][_0xc434('0x76')],_0x11f4cb[_0xc434('0x16f')],_0x11f4cb['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x11f4cb[_0xc434('0x5b')],_0x11f4cb[_0xc434('0x170')]):_0x11f4cb[_0xc434('0x5b')]);if(_0x306d69){_0x319eda[_0xc434('0x171')]=_0x7e7e21['actions'][_0x356e9d][_0xc434('0x172')]=extractCalleridName(_0x306d69);_0x319eda[_0xc434('0x173')]=_0x7e7e21[_0xc434('0x26')][_0x356e9d][_0xc434('0x174')]=extractCalleridNumber(_0x306d69);}return ami[_0xc434('0x12f')]({'actionid':_0x356e9d,'action':'originate','channel':_0x7e7e21['isTrunkReachable'](_0x11f4cb[_0xc434('0x75')])?util[_0xc434('0x91')]('SIP/%s/%s%s',_0x11f4cb[_0xc434('0x75')]['name'],isNotNull(_0x11f4cb[_0xc434('0x5d')])?_0x11f4cb[_0xc434('0x5d')][_0xc434('0x175')]()||'':'',_0x11f4cb[_0xc434('0x176')]>0x0?_0x43afd4['Contact'][_0xc434('0x152')][_0xc434('0x177')](_0x11f4cb[_0xc434('0x176')]):_0x43afd4[_0xc434('0x151')][_0xc434('0x152')]):util[_0xc434('0x91')](_0xc434('0x178'),_[_0xc434('0xaf')](_0x11f4cb[_0xc434('0x125')])?_0x11f4cb[_0xc434('0x75')][_0xc434('0x3e')]:_0x11f4cb['TrunkBackup']['name'],isNotNull(_0x11f4cb['dialPrefix'])?_0x11f4cb[_0xc434('0x5d')][_0xc434('0x175')]()||'':'',_0x11f4cb[_0xc434('0x176')]>0x0?_0x43afd4['Contact'][_0xc434('0x152')]['substring'](_0x11f4cb[_0xc434('0x176')]):_0x43afd4[_0xc434('0x151')]['phone']),'callerid':_0x306d69,'Exten':_0xc434('0xde'),'Context':_0xc434('0x179'),'Priority':'1','variable':_0x319eda,'timeout':(_0x11f4cb[_0xc434('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x356e9d})[_0xc434('0xb9')](function(_0x38bcc7){return _0xc50c63(_0x38bcc7);})['catch'](function(_0xecc004){_0x11f4cb[_0xc434('0x67')]+=0x1;var _0x1abce0=new History(_0x7e7e21[_0xc434('0x26')][_0x356e9d]);logger[_0xc434('0x94')](util[_0xc434('0x91')](_0xc434('0x17a'),JSON[_0xc434('0x48')](_0xecc004)));_0x1abce0[_0xc434('0xa7')]=0xe;_0x1abce0['statedesc']=_0xc434('0x17b');_0x1abce0['starttime']=moment()[_0xc434('0x91')](_0xc434('0xfc'));_0x1abce0['endtime']=_0x1abce0[_0xc434('0xaa')];_0x7e7e21[_0xc434('0xc9')](_0x1abce0)[_0xc434('0xb2')](loggerCatch(_0xc434('0x17c')));_0x7e7e21[_0xc434('0xc7')](_0x1abce0)[_0xc434('0xb2')](loggerCatch(_0xc434('0x17c')))['finally'](function(){delete _0x7e7e21[_0xc434('0x26')][_0x356e9d];return _0x4e1b3d(msgResponse(_0xc434('0x150'),_0xc434('0x47'),'originate\x20action\x20Error'));});});});};Dialer[_0xc434('0x1b')]['syncOriginateResponse']=function(_0x390918){var _0xa53faa=this[_0xc434('0x26')][_0x390918[_0xc434('0x109')]];var _0x5dc3f9=this;if(_0xa53faa){delete this[_0xc434('0x26')][_0x390918['actionid']];_0xa53faa[_0xc434('0x17d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4bdaff=_0xa53faa[_0xc434('0x4b')]===_0xc434('0x78')?this[_0xc434('0x21')][_0xa53faa[_0xc434('0xb5')]]:this[_0xc434('0x20')][_0xa53faa[_0xc434('0x17e')]()];if(!this['isSuccess'](_0x390918[_0xc434('0x17f')])){this['updateOriginated'](_0x4bdaff);return this[_0xc434('0x180')](_0xa53faa,_0x4bdaff,_0x390918)['then'](function(_0x4c9fde){})[_0xc434('0xb2')](loggerCatch(_0xc434('0x181')));}else{this[_0xc434('0xac')][_0x390918[_0xc434('0xe1')]]=_0xa53faa;}}};Dialer[_0xc434('0x1b')][_0xc434('0x182')]=function(_0x1fd727,_0x1e1019,_0x2c8e9d){var _0x3542d5=new History(_0x1e1019);if(_0x3542d5[_0xc434('0x183')]+_0x3542d5[_0xc434('0x184')]+_0x3542d5[_0xc434('0x185')]>=_0x2c8e9d['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x1fd727){case 0x3:if(_0x3542d5[_0xc434('0x185')]>=_0x2c8e9d['dialNoAnswerMaxRetry']-0x1){return!![];}else{this[_0xc434('0xc2')]({'active':![],'countnoanswerretry':_0x3542d5['countnoanswerretry']+=0x1,'scheduledat':moment()['add'](_0x2c8e9d[_0xc434('0x186')],'minutes')[_0xc434('0x91')](_0xc434('0xfc')),'ContactId':_0x3542d5[_0xc434('0x116')],'ListId':_0x3542d5[_0xc434('0xd0')],'VoiceQueueId':_0x3542d5[_0xc434('0xd2')]||undefined,'CampaignId':_0x3542d5[_0xc434('0x117')]||undefined})[_0xc434('0xb2')](loggerCatch(_0xc434('0x187')));}break;case 0x5:if(_0x3542d5[_0xc434('0x183')]>=_0x2c8e9d[_0xc434('0x188')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x3542d5['countbusyretry']+=0x1,'scheduledat':moment()[_0xc434('0x189')](_0x2c8e9d[_0xc434('0x18a')],_0xc434('0x18b'))[_0xc434('0x91')](_0xc434('0xfc')),'ContactId':_0x3542d5[_0xc434('0x116')],'ListId':_0x3542d5[_0xc434('0xd0')],'VoiceQueueId':_0x3542d5[_0xc434('0xd2')]||undefined,'CampaignId':_0x3542d5[_0xc434('0x117')]||undefined})[_0xc434('0xb2')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x3542d5[_0xc434('0x184')]>=_0x2c8e9d['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0xc434('0xc2')]({'active':![],'countcongestionretry':_0x3542d5[_0xc434('0x184')]+=0x1,'scheduledat':moment()[_0xc434('0x189')](_0x2c8e9d[_0xc434('0x18c')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3542d5['ContactId'],'ListId':_0x3542d5['ListId'],'VoiceQueueId':_0x3542d5[_0xc434('0xd2')]||undefined,'CampaignId':_0x3542d5[_0xc434('0x117')]||undefined})[_0xc434('0xb2')](loggerCatch(_0xc434('0x18d')));}break;default:return!![];}};Dialer[_0xc434('0x1b')][_0xc434('0x180')]=function(_0x22d45c,_0x49e490,_0x3bdb8b){var _0x1ddcb2=this;var _0x426b57=new History(_0x22d45c);return new BPromise(function(_0x400874,_0x1610b3){if(_[_0xc434('0x3b')](_0x49e490)&&_0xc434('0x14f')!==typeof _0x49e490){return _0x1610b3(msgResponse(_0xc434('0x18e'),_0xc434('0x128'),_0xc434('0x18f')));}if(_[_0xc434('0x3b')](_0x3bdb8b)&&'object'!==typeof _0x3bdb8b){return _0x1610b3(msgResponse(_0xc434('0x18e'),_0xc434('0x128'),_0xc434('0x190')));}switch(_0x3bdb8b[_0xc434('0xf5')]){case'0':_0x49e490[_0xc434('0x66')]+=0x1;_0x426b57['state']=0x0;_0x426b57[_0xc434('0xa8')]=_0xc434('0x191');_0x1ddcb2[_0xc434('0xc9')](_0x426b57)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1ddcb2[_0xc434('0x182')](0x0,_0x22d45c,_0x49e490)){if(_0x426b57[_0xc434('0x183')]+_0x426b57[_0xc434('0x184')]+_0x426b57[_0xc434('0x185')]>=_0x49e490[_0xc434('0x192')]){_0x1ddcb2[_0xc434('0x193')](_0x426b57,_0x400874,_0x1610b3,_0xc434('0x194'));}else{_0x1ddcb2[_0xc434('0x195')](_0x426b57,_0x400874,_0x1610b3,_0xc434('0x194'));}}break;case'3':_0x49e490[_0xc434('0x65')]+=0x1;_0x426b57[_0xc434('0xa7')]=0x3;_0x426b57[_0xc434('0xa8')]='NoAnswer';_0x426b57['countnoanswerretry']+=0x1;_0x426b57['countglobal']+=0x1;_0x1ddcb2[_0xc434('0xc9')](_0x426b57)[_0xc434('0xb2')](loggerCatch(_0xc434('0x196')));if(_0x1ddcb2[_0xc434('0x182')](0x3,_0x22d45c,_0x49e490)){if(_0x426b57[_0xc434('0x185')]>=_0x49e490['dialNoAnswerMaxRetry']){_0x1ddcb2[_0xc434('0x195')](_0x426b57,_0x400874,_0x1610b3,_0xc434('0x197'));}else{_0x1ddcb2['stateGlobal'](_0x426b57,_0x400874,_0x1610b3,_0xc434('0x197'));}}break;case'5':_0x49e490['outboundBusyCallsDay']+=0x1;_0x426b57[_0xc434('0xa7')]=0x5;_0x426b57[_0xc434('0xa8')]=_0xc434('0x198');_0x426b57['countbusyretry']+=0x1;_0x426b57[_0xc434('0x199')]+=0x1;_0x1ddcb2[_0xc434('0xc9')](_0x426b57)[_0xc434('0xb2')](loggerCatch(_0xc434('0x19a')));if(_0x1ddcb2[_0xc434('0x182')](0x5,_0x22d45c,_0x49e490)){if(_0x426b57['countbusyretry']>=_0x49e490[_0xc434('0x188')]){_0x1ddcb2[_0xc434('0x195')](_0x426b57,_0x400874,_0x1610b3,_0xc434('0x19b'));}else{_0x1ddcb2['stateGlobal'](_0x426b57,_0x400874,_0x1610b3,'reason\x205\x20busy');}}break;case'8':_0x49e490[_0xc434('0x61')]+=0x1;_0x426b57[_0xc434('0xa7')]=0x8;_0x426b57[_0xc434('0xa8')]='Congestion';_0x426b57['countcongestionretry']+=0x1;_0x426b57['countglobal']+=0x1;_0x1ddcb2[_0xc434('0xc9')](_0x426b57)[_0xc434('0xb2')](loggerCatch(_0xc434('0x19c')));if(_0x1ddcb2[_0xc434('0x182')](0x8,_0x22d45c,_0x49e490)){if(_0x426b57[_0xc434('0x184')]>=_0x49e490[_0xc434('0x19d')]){_0x1ddcb2[_0xc434('0x195')](_0x426b57,_0x400874,_0x1610b3,_0xc434('0x19e'));}else{_0x1ddcb2['stateGlobal'](_0x426b57,_0x400874,_0x1610b3,_0xc434('0x19e'));}}break;default:_0x49e490['outboundUnknownCallsDay']+=0x1;_0x426b57[_0xc434('0xa7')]=0xc;_0x426b57['statedesc']=_0x3bdb8b[_0xc434('0xf5')];_0x1ddcb2[_0xc434('0xc9')](_0x426b57)['catch'](loggerCatch(_0xc434('0x19f')));if(_0x1ddcb2[_0xc434('0x182')](_0x3bdb8b['reason'],_0x22d45c,_0x49e490)){if(_0x426b57[_0xc434('0x183')]+_0x426b57[_0xc434('0x184')]+_0x426b57[_0xc434('0x185')]>=_0x49e490[_0xc434('0x192')]){_0x1ddcb2[_0xc434('0x193')](_0x426b57,_0x400874,_0x1610b3,_0x3bdb8b[_0xc434('0xf5')]);}else{_0x1ddcb2[_0xc434('0x195')](_0x426b57,_0x400874,_0x1610b3,_0x3bdb8b['reason']);}}}});};Dialer['prototype'][_0xc434('0x193')]=function(_0x5e4ba9,_0x4b050c,_0x4b4188,_0x235da3){var _0x21dfd4=new Final(_0x5e4ba9);_0x21dfd4['state']=0xf;_0x21dfd4[_0xc434('0xa8')]=_0xc434('0x1a0');this[_0xc434('0x195')](_0x21dfd4,_0x4b050c,_0x4b4188,_0x235da3);};Dialer[_0xc434('0x1b')][_0xc434('0x195')]=function(_0x3cc9af,_0xbb8f02,_0x640fc7,_0x5c9972){this[_0xc434('0xc7')](_0x3cc9af)['then'](function(_0x582327){return _0xbb8f02(msgResponse(_0xc434('0x18e'),'Success',_0x5c9972));})[_0xc434('0xb2')](function(_0x10fac4){return _0x640fc7(msgResponse(_0xc434('0x1a1'),'Failure',_0xc434('0x1a2')));});};Dialer[_0xc434('0x1b')][_0xc434('0x9')]=function(_0x3eb6df){var _0x2b4a36=this;var _0xd475fc=_0x3eb6df[_0xc434('0x1a3')]/0x64;var _0x54a20a=_0x3eb6df[_0xc434('0x64')]/(_0x3eb6df[_0xc434('0x64')]+_0x3eb6df[_0xc434('0x5f')]);var _0x3245f5=Math[_0xc434('0x1a4')](_0x3eb6df['predictiveIntervalAvailable']*(_0x3eb6df[_0xc434('0x1a5')]/0x64));var _0x53e23f=Math[_0xc434('0x1a4')](_0x3eb6df[_0xc434('0x6e')]*(_0x3eb6df[_0xc434('0x1a6')]/0x64));var _0x6d897d=_0x3eb6df[_0xc434('0x4f')]+_0x3eb6df['talking'];var _0x59d021=Math['floor'](_0x3eb6df[_0xc434('0x71')]*_0x3eb6df[_0xc434('0x73')]*_0x3eb6df['predictiveIntervalHitRate']*_0x3eb6df['predictiveIntervalMultiplicativeFactor']);if(_[_0xc434('0x3b')](_0x3eb6df['startProgressive'])){if(!_[_0xc434('0x3b')](_0x3eb6df[_0xc434('0x29')])){_0x3eb6df[_0xc434('0x29')]=undefined;loggerPredictive[_0xc434('0x94')](_0xc434('0x1a7'),_0xc434('0x1a8'));}if(!_[_0xc434('0x3b')](_0x3eb6df[_0xc434('0x8d')])){loggerPredictive[_0xc434('0x94')](_0xc434('0x1a7'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3eb6df['handlePredictive']);_0x3eb6df[_0xc434('0x8d')]=undefined;}_0x3eb6df['startProgressive']=moment()[_0xc434('0x91')](_0xc434('0xfc'));loggerPredictive[_0xc434('0x7b')](_0x3eb6df['name'],_0xc434('0x1a9'),_0x3eb6df[_0xc434('0x2a')]);this[_0xc434('0x13e')](_0x3eb6df,0x1);}else if(ifInterval(_0x3eb6df[_0xc434('0x1aa')],_0x3eb6df[_0xc434('0x2a')])){this[_0xc434('0x13e')](_0x3eb6df,0x1);loggerPredictiveCalls[_0xc434('0x7b')](_0xc434('0x1ab'),_0x3eb6df[_0xc434('0x2a')],_0x3eb6df[_0xc434('0x3e')]);_0x3eb6df['erlangCalls']=0x0;_0x3eb6df['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0xd475fc<_0x54a20a&&_0x3eb6df[_0xc434('0x1ac')]===_0xc434('0x1ad')){freeVariablesPredictive(_0x3eb6df);loggerPredictive['info'](_0xc434('0x1ae'),'Dropped\x20calls\x20day',_0x54a20a,'startProgressive',_0x3eb6df[_0xc434('0x3e')]);}else if(_0x59d021<_0x3eb6df[_0xc434('0x102')]&&_0x3eb6df[_0xc434('0x1ac')]===_0xc434('0x1ad')){freeVariablesPredictive(_0x3eb6df);loggerPredictive[_0xc434('0x7b')](_0xc434('0x1af'),_0xc434('0x1b0'),_0x59d021,_0xc434('0x1b1'),_0x3eb6df[_0xc434('0x102')],_0xc434('0x2a'),_0x3eb6df[_0xc434('0x3e')]);}else if(!ifInterval(_0x3eb6df[_0xc434('0x1aa')],_0x3eb6df['startProgressive'])&&_[_0xc434('0x3b')](_0x3eb6df['startPredictive'])&&!_[_0xc434('0x3b')](_0x3eb6df['startProgressive'])){_0x3eb6df['startPredictive']=moment()[_0xc434('0x91')](_0xc434('0xfc'));loggerPredictive[_0xc434('0x7b')](_0x3eb6df[_0xc434('0x3e')],_0xc434('0x1b2'),_0x3eb6df[_0xc434('0x29')]);this[_0xc434('0xbf')](_0x3eb6df[_0xc434('0x1aa')])['then'](this[_0xc434('0x1b3')](_0x3eb6df))[_0xc434('0xb9')](mergeDataErlangB(_0x3eb6df))[_0xc434('0xb9')](this[_0xc434('0x1b4')](_0x3eb6df))[_0xc434('0xb2')](loggerCatchPredictive(_0xc434('0x1b5'),_0x3eb6df));}else if(!ifInterval(_0x3eb6df['dialPredictiveInterval'],_0x3eb6df[_0xc434('0x29')])){_0x3eb6df['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x3eb6df[_0xc434('0x29')]=moment()[_0xc434('0x91')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xc434('0x7b')](_0x3eb6df['name'],'recalculate\x20predictive\x20at',_0x3eb6df[_0xc434('0x29')]);clearInterval(_0x3eb6df['handlePredictive']);_0x3eb6df[_0xc434('0x8d')]=undefined;this[_0xc434('0xbf')](_0x3eb6df[_0xc434('0x1aa')])['then'](this[_0xc434('0x1b3')](_0x3eb6df))[_0xc434('0xb9')](mergeDataErlangB(_0x3eb6df))['then'](this['startMethodPredictive'](_0x3eb6df))[_0xc434('0xb2')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3eb6df));}else if(_0x3eb6df[_0xc434('0x6e')]&&_0x6d897d<_0x3eb6df[_0xc434('0x6e')]-_0x53e23f){freeVariablesPredictive(_0x3eb6df);loggerPredictive[_0xc434('0x7b')](_0x3eb6df[_0xc434('0x3e')],_0xc434('0x1b6'),_0x6d897d,_0xc434('0x1b7'),_0x3eb6df[_0xc434('0x6e')],'-',_0x53e23f,'=',_0x3eb6df['predictiveIntervalAvailable']-_0x53e23f,')');}else if(_0x3eb6df['predictiveIntervalAvailable']&&_0x6d897d>_0x3eb6df[_0xc434('0x6e')]+_0x3245f5){freeVariablesPredictive(_0x3eb6df);loggerPredictive[_0xc434('0x7b')](_0x3eb6df[_0xc434('0x3e')],_0xc434('0x1b6'),_0x6d897d,_0xc434('0x1b8'),_0x3eb6df[_0xc434('0x6e')],'+',_0x3245f5,'=',_0x3eb6df['predictiveIntervalAvailable']+_0x3245f5,')');}};Dialer[_0xc434('0x1b')][_0xc434('0x1b3')]=function(_0x40de50){var _0x39d99d=this;return function(_0x569cb8){return new BPromise(function(_0x5a6031,_0x557d82){_[_0xc434('0x89')](_0x40de50,_0x569cb8[0x0]);if(checkGetDataPredictive(_0x569cb8[0x0])){var _0xbacafb=_0x40de50['predictiveIntervalAvailable']=_0x40de50['talking']+_0x40de50['available'];var _0x1f65fc=_0x40de50[_0xc434('0x1aa')]*0x3c;var _0x3e8b2a=_0x569cb8[0x0][_0xc434('0x6b')]+_0x569cb8[0x0][_0xc434('0x83')];var _0xf37133=(_0x569cb8[0x0]['predictiveIntervalAnsweredCalls']+_0x569cb8[0x0][_0xc434('0x7f')]+_0x569cb8[0x0][_0xc434('0x80')])/_0x569cb8[0x0][_0xc434('0x6f')];_0x40de50[_0xc434('0x6d')]=_0xf37133>0x0?_0xf37133:0x1;switch(_0x40de50['dialPredictiveOptimization']){case _0xc434('0x1ad'):var _0x4bb363=_0x40de50['dialPredictiveOptimizationPercentage']/0x64;return _0x39d99d[_0xc434('0x1b9')](_0xbacafb,_0x1f65fc,_0x3e8b2a,_0xf37133,_0x4bb363)[_0xc434('0xb9')](function(_0x3877c3){return _0x5a6031(_0x3877c3);});case'agentBusyFactor':var _0x4e734a=_0x40de50[_0xc434('0x1a3')]/0x64;return _0x39d99d[_0xc434('0x1ba')](_0xbacafb,_0x1f65fc,_0x3e8b2a,_0xf37133,_0x4e734a)[_0xc434('0xb9')](function(_0x1e51ed){return _0x5a6031(_0x1e51ed);});default:return _0x557d82(msgResponse(_0xc434('0x1bb'),_0xc434('0x128'),'Unknown\x20Predictive'));}}else{return _0x557d82(msgResponse(_0xc434('0x1bb'),_0xc434('0x128'),_0xc434('0x1bc')));}});};};Dialer['prototype'][_0xc434('0x1bd')]=function(_0x10972d){var _0x2c52c5=this;return function(_0x1cfed6){return new BPromise(function(_0x2c1f4d,_0x5155e6){_[_0xc434('0x89')](_0x10972d,_0x1cfed6[0x0]);if(checkGetDataPredictive(_0x1cfed6[0x0])){loggerPredictive[_0xc434('0x7b')](JSON[_0xc434('0x48')](_0x1cfed6[0x0]));if(_0x10972d[_0xc434('0x1ac')]===_0xc434('0x1ad')){return _0x2c52c5['getVoiceQueueRtPauses'](_0x10972d['id'])[_0xc434('0xb9')](function(_0x3b9341){var _0x5eafe3=_0x10972d[_0xc434('0x50')]-_0x3b9341[0x0][_0xc434('0x1be')];var _0x1ca845=_0x10972d[_0xc434('0x1aa')]*0x3c;var _0x3f2712=_0x1cfed6[0x0][_0xc434('0x6b')]+_0x1cfed6[0x0]['predictiveIntervalAvgHoldtime'];var _0xdf0daa=(_0x1cfed6[0x0]['predictiveIntervalAnsweredCalls']+_0x1cfed6[0x0][_0xc434('0x7f')]+_0x1cfed6[0x0][_0xc434('0x80')])/_0x1cfed6[0x0][_0xc434('0x6f')];var _0x5c1708=_0x10972d[_0xc434('0x1a3')]/0x64;_0x10972d[_0xc434('0x1bf')]=_0x3b9341[0x0][_0xc434('0x1be')]||0x0;_0x10972d[_0xc434('0x6d')]=_0xdf0daa>0x0?_0xdf0daa:0x1;return _0x2c52c5['abandonmentRate'](_0x5eafe3,_0x1ca845,_0x3f2712,_0xdf0daa,_0x5c1708);})[_0xc434('0xb9')](function(_0x4d10de){return _0x2c1f4d(_0x4d10de);})[_0xc434('0xb2')](function(_0x45c47f){return _0x5155e6(msgResponse(_0xc434('0x1c0'),_0xc434('0x128'),JSON[_0xc434('0x48')](_0x45c47f)));});}if(_0x10972d[_0xc434('0x1ac')]===_0xc434('0x1c1')){return _0x2c52c5[_0xc434('0xc6')](_0x10972d['id'])[_0xc434('0xb9')](function(_0x100a96){var _0x35db5a=_0x10972d[_0xc434('0x50')]-_0x100a96[0x0][_0xc434('0x1be')];var _0x52cbc0=_0x10972d[_0xc434('0x1aa')]*0x3c;var _0x3ecf59=_0x1cfed6[0x0]['predictiveIntervalAvgTalktime']+_0x1cfed6[0x0]['predictiveIntervalAvgHoldtime'];var _0x427954=(_0x1cfed6[0x0][_0xc434('0x6a')]+_0x1cfed6[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1cfed6[0x0][_0xc434('0x80')])/_0x1cfed6[0x0]['predictiveIntervalTotalCalls'];var _0x6eb5ee=_0x10972d[_0xc434('0x1a3')]/0x64;_0x10972d['predictiveIntervalPauses']=_0x100a96[0x0][_0xc434('0x1be')]||0x0;_0x10972d[_0xc434('0x6d')]=_0x427954>0x0?_0x427954:0x1;return _0x2c52c5['busyFactor'](_0x35db5a,_0x52cbc0,_0x3ecf59,_0x427954,_0x6eb5ee);})[_0xc434('0xb9')](function(_0x132cd9){return _0x2c1f4d(_0x132cd9);})['catch'](function(_0x28a551){return _0x5155e6(msgResponse('[CatchErlangB]',_0xc434('0x128'),JSON['stringify'](_0x28a551)));});}}else{return _0x5155e6(msgResponse(_0xc434('0x1bb'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0xc434('0x1b4')]=function(_0x30c223){var _0x1450a4=this;return function(){var _0x1bc477=0x0;var _0x3185a4=Math[_0xc434('0x1c2')](_0x30c223[_0xc434('0x72')]*0x3e8);if(_0x3185a4>0x0){_0x3185a4=_0x3185a4<0x64?0x64:_0x3185a4;loggerPredictive[_0xc434('0x7b')](_0x30c223[_0xc434('0x3e')],_0xc434('0x1c3'),_0x3185a4,_0xc434('0x8a'));_0x30c223[_0xc434('0x8d')]=setInterval(function(){_0x1450a4[_0xc434('0x8d')](_0x30c223);loggerPredictiveCalls['info'](_0xc434('0x1c4'),_0x1bc477+=0x1);},_0x3185a4);}else{loggerPredictive[_0xc434('0x7b')](_0x30c223[_0xc434('0x3e')],_0xc434('0x1c5'));}};};Dialer[_0xc434('0x1b')]['checkContactBlack']=function(_0xb393d7,_0x4afc55){var _0x33165d=this;return function(_0x3aaa2e){if(_[_0xc434('0x45')](_0x3aaa2e)){if(_['isNil'](_0x4afc55['UserId'])||!_0x4afc55['recallme']){if(_0xb393d7[_0xc434('0x5a')]===_0xc434('0x8')){_0xb393d7['queueStatusComplete']=_[_0xc434('0x3b')](_0xb393d7[_0xc434('0x112')])?!![]:_0xb393d7[_0xc434('0x112')];var _0xd2ddbc=uuid['v4']();_0x33165d[_0xc434('0x26')][_0xd2ddbc]=new Action(_0xb393d7,_0x4afc55,_0xd2ddbc);loggerBooked['info']('[booked][checkContactBlack]',_0xd2ddbc,_0xc434('0x1c6'),JSON[_0xc434('0x48')](_0xb393d7[_0xc434('0x112')]),_0xc434('0x1c7'),_0xb393d7[_0xc434('0x3e')]);if(_0xb393d7[_0xc434('0x112')]){_0xb393d7[_0xc434('0x112')]=![];_0x33165d[_0xc434('0x10e')][_0x33165d[_0xc434('0x26')][_0xd2ddbc][_0xc434('0xb5')]]=[];ami[_0xc434('0x12f')]({'actionid':_0xd2ddbc,'action':_0xc434('0x1c8'),'queue':_0xb393d7[_0xc434('0x3e')]})['catch'](function(_0x5cd383){_0x33165d[_0xc434('0xb4')](_0xb393d7);_0x33165d['rescheduleContact']({'active':![],'ContactId':_0x33165d['actions'][_0xd2ddbc][_0xc434('0x116')],'ListId':_0x33165d[_0xc434('0x26')][_0xd2ddbc][_0xc434('0xd0')],'VoiceQueueId':_0x33165d[_0xc434('0x26')][_0xd2ddbc][_0xc434('0xd2')]||undefined,'CampaignId':_0x33165d[_0xc434('0x26')][_0xd2ddbc]['CampaignId']||undefined})[_0xc434('0xb2')](loggerCatch(_0xc434('0x1c9')));delete _0x33165d[_0xc434('0x26')][_0xd2ddbc];});}else{loggerBooked[_0xc434('0x7b')](_0xc434('0x1ca'),JSON['stringify'](_0xb393d7['queueStatusComplete']),'Queue:\x20',_0xb393d7['name']);_0x33165d[_0xc434('0xb4')](_0xb393d7);_0x33165d[_0xc434('0xc2')]({'active':![],'ContactId':_0x33165d[_0xc434('0x26')][_0xd2ddbc][_0xc434('0x116')],'ListId':_0x33165d[_0xc434('0x26')][_0xd2ddbc][_0xc434('0xd0')],'VoiceQueueId':_0x33165d[_0xc434('0x26')][_0xd2ddbc][_0xc434('0xd2')]||undefined,'CampaignId':_0x33165d[_0xc434('0x26')][_0xd2ddbc]['CampaignId']||undefined})[_0xc434('0xb2')](loggerCatch(_0xc434('0x1c9')));delete _0x33165d[_0xc434('0x26')][_0xd2ddbc];}}else{return _0x33165d[_0xc434('0x14e')](_0xb393d7,_0x4afc55);}}else{if(getDiff(_0x4afc55['scheduledat'])<_0xb393d7[_0xc434('0x1cb')]*0x3c){_0x33165d[_0xc434('0x8f')][_0xc434('0x114')](_0x4afc55['id'])[_0xc434('0x1e')](function(){_0x33165d['updateOriginated'](_0xb393d7);});}else{_0xb393d7[_0xc434('0x1cc')]+=0x1;_0x33165d[_0xc434('0xb4')](_0xb393d7);if(_0xb393d7[_0xc434('0x1cd')]){_0x33165d[_0xc434('0xc2')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4afc55[_0xc434('0x116')],'ListId':_0x4afc55[_0xc434('0xd0')],'VoiceQueueId':_0x4afc55[_0xc434('0xd2')]||undefined,'CampaignId':_0x4afc55['CampaignId']||undefined})[_0xc434('0xb2')](loggerCatch(_0xc434('0x1ce')));_0x33165d[_0xc434('0xc9')](createObjHistory(_0xb393d7,_0x4afc55,_0xc434('0x1cf'),0x17,_0xc434('0x1d0')))[_0xc434('0xb2')](loggerCatch(_0xc434('0x1d1')));}else{_0x33165d[_0xc434('0xce')](createObjHistory(_0xb393d7,_0x4afc55,_0xc434('0x1d2'),0x16,'RecallFailedTimeout'),_0xc434('0x1d3'),_0xc434('0x1d4'));}}}}else{_0xb393d7[_0xc434('0x1d5')]+=0x1;_0x33165d[_0xc434('0xce')](createObjHistory(_0xb393d7,_0x4afc55,'BLACKLIST',0xd,_0xc434('0x1d6')),'[Originate][historyBlacklist]',_0xc434('0x1d7'));throw _0xc434('0x1d8');}};};Dialer[_0xc434('0x1b')][_0xc434('0x144')]=function(_0x552f9b){var _0x22d2ae=this;var _0x3cfdc1=[];var _0x2a3dd4=_0x552f9b[_0xc434('0x1d9')]-_0x552f9b[_0xc434('0x70')]-_0x552f9b[_0xc434('0x1da')];emitCampaignSummary(_0x552f9b);if(_0x2a3dd4>0x0){if(_0x2a3dd4>this[_0xc434('0x24')]){_0x2a3dd4=this[_0xc434('0x24')];}_0x552f9b[_0xc434('0x1da')]+=_0x2a3dd4;this[_0xc434('0xc5')](_0x552f9b['id'],_0x2a3dd4,_0x552f9b[_0xc434('0x1db')])[_0xc434('0xb9')](function(_0x25abd8){_0x552f9b[_0xc434('0x1da')]-=_0x2a3dd4;_0x552f9b['temp']=_0x552f9b['temp']>0x0?_0x552f9b[_0xc434('0x1da')]:0x0;if(!checkContactEmpty(_0x25abd8)){_0x552f9b['message']=_0xc434('0x9e');logger[_0xc434('0x7b')]('[getContactCampaign2][Empty]'+_0x552f9b['name']);}else{_0x552f9b[_0xc434('0x70')]+=_0x25abd8[_0xc434('0x97')];_0x552f9b[_0xc434('0x3c')]='RUNNING';for(var _0x27328b=0x0;_0x27328b<_0x25abd8[_0xc434('0x97')];_0x27328b+=0x1){_0x552f9b[_0xc434('0x1dc')]+=0x1;if(_[_0xc434('0xaf')](_0x25abd8[_0x27328b])||_[_0xc434('0xaf')](_0x25abd8[_0x27328b][_0xc434('0x151')])||_['isNil'](_0x25abd8[_0x27328b]['Contact'][_0xc434('0x152')])){_0x22d2ae[_0xc434('0xcc')](_0xc434('0x1dd'),_0x552f9b,_0x25abd8[_0x27328b]);}else{_0x22d2ae[_0xc434('0xbd')](_[_0xc434('0xcf')](_0x25abd8[_0x27328b],[_0xc434('0x117'),_0xc434('0x1de')]))[_0xc434('0xb9')](_0x22d2ae[_0xc434('0x1df')](_0x552f9b,_0x25abd8[_0x27328b]))[_0xc434('0xb2')](_0x22d2ae[_0xc434('0x1e0')](_0xc434('0x1e1'),_0x552f9b));}}}})[_0xc434('0xb2')](loggerGetContactDialer(_0xc434('0x1e2'),_0x552f9b,_0x2a3dd4));}};Dialer[_0xc434('0x1b')][_0xc434('0x13e')]=function(_0x31b879,_0x14d513){var _0x5ae363=this;var _0x4a7f06=[];var _0x42bc6a=_0x14d513>=0x1?_0x14d513:0x1;var _0x48b0dd=[];if(_0x31b879[_0xc434('0x5a')]==='booked'){_0x42bc6a=0x1;}var _0x52ce96=Math[_0xc434('0x1c2')](_0x31b879[_0xc434('0x4f')]*_0x42bc6a)-_0x31b879[_0xc434('0x70')]-_0x31b879[_0xc434('0x1da')];emitVoiceQueueSummary(_0x31b879);if(_0x31b879[_0xc434('0x1e3')]>0x0){var _0x411337=_0x31b879[_0xc434('0x1e3')]-_0x31b879[_0xc434('0x70')]-_0x31b879['talking']-_0x31b879['temp']-_0x31b879[_0xc434('0xa1')];if(_0x52ce96>_0x411337){_0x52ce96=_0x411337;}}if(_0x52ce96>0x0){if(_0x31b879[_0xc434('0x5a')]==='booked'){_0x52ce96=0x1;}if(_0x52ce96>this[_0xc434('0x24')]){_0x52ce96=this['maxNumberOriginate'];}_0x31b879[_0xc434('0x1da')]+=_0x52ce96;for(var _0xed12bb in this['agents']){if(this[_0xc434('0x22')]['hasOwnProperty'](_0xed12bb)){if(this[_0xc434('0x22')][_0xed12bb][_0xc434('0xa7')]===_0xc434('0x1e4')&&this[_0xc434('0x22')][_0xed12bb][_0xc434('0xb0')]==='reachable'){_0x4a7f06[_0xc434('0x10f')](this[_0xc434('0x22')][_0xed12bb]['id']);}}}this[_0xc434('0xc3')](_0x31b879['id'],_0x4a7f06,_0x52ce96,_0x31b879['dialOrderByScheduledAt'])['then'](function(_0x3dfdc7){_0x31b879['temp']-=_0x52ce96;_0x31b879[_0xc434('0x1da')]=_0x31b879[_0xc434('0x1da')]>0x0?_0x31b879[_0xc434('0x1da')]:0x0;if(!checkContactEmpty(_0x3dfdc7)){_0x5ae363['countReScheduled'](_0x31b879)[_0xc434('0xb9')](sendMessageReschedule(_0x31b879))[_0xc434('0xb2')](loggerCatch(_0xc434('0xba')));}else{_0x31b879['originated']+=_0x3dfdc7[_0xc434('0x97')];_0x31b879['message']=_0x31b879[_0xc434('0x5a')]==='booked'?_0xc434('0x1e5'):_0xc434('0x1e6');for(var _0x52887c=0x0;_0x52887c<_0x3dfdc7[_0xc434('0x97')];_0x52887c+=0x1){if(_['isNil'](_0x3dfdc7[_0x52887c])||_[_0xc434('0xaf')](_0x3dfdc7[_0x52887c][_0xc434('0x151')])||_[_0xc434('0xaf')](_0x3dfdc7[_0x52887c][_0xc434('0x151')]['phone'])){_0x5ae363[_0xc434('0xcc')](_0xc434('0x1dd'),_0x31b879,_0x3dfdc7[_0x52887c]);}else{_0x5ae363[_0xc434('0xbb')](_[_0xc434('0xcf')](_0x3dfdc7[_0x52887c],['VoiceQueueId',_0xc434('0x1de')]))[_0xc434('0xb9')](_0x5ae363['checkContactBlack'](_0x31b879,_0x3dfdc7[_0x52887c]))[_0xc434('0xb2')](_0x5ae363[_0xc434('0x1e0')](_0xc434('0x1dd'),_0x31b879));}}}})[_0xc434('0xb2')](loggerGetContactDialer('[getContactDialer2]',_0x31b879,_0x52ce96));}};Dialer[_0xc434('0x1b')][_0xc434('0x8d')]=function(_0x52f31a){var _0x140cb5=this;if(_0x52f31a[_0xc434('0x1e3')]>0x0){var _0x1bfef1=_0x52f31a[_0xc434('0x1e3')]-_0x52f31a[_0xc434('0x70')]-_0x52f31a['talking'];if(_0x1bfef1>0x0){this[_0xc434('0x1e7')](_0x52f31a);}else{loggerPredictiveCalls[_0xc434('0x7b')]('[handlePredictive][limitChannel]');}}else{this[_0xc434('0x1e7')](_0x52f31a);}};Dialer[_0xc434('0x1b')]['tryOriginatePredictive']=function(_0x2d120a){var _0x1edc98=this;var _0x4c7d52=[];_0x2d120a['originated']+=0x1;for(var _0x41ec83 in this[_0xc434('0x22')]){if(this[_0xc434('0x22')][_0xc434('0x98')](_0x41ec83)){if(this['agents'][_0x41ec83][_0xc434('0xa7')]===_0xc434('0x1e4')&&this[_0xc434('0x22')][_0x41ec83][_0xc434('0xb0')]===_0xc434('0xd8')){_0x4c7d52[_0xc434('0x10f')](this[_0xc434('0x22')][_0x41ec83]['id']);}}}this[_0xc434('0xc3')](_0x2d120a['id'],_0x4c7d52,0x1,_0x2d120a[_0xc434('0x1db')])[_0xc434('0xb9')](function(_0x3da2fb){if(!checkContactEmpty(_0x3da2fb)){checkContactLowerLimitOriginate(_0x2d120a,0x1,0x0);_0x1edc98['countReScheduled'](_0x2d120a)['then'](sendMessageReschedule(_0x2d120a))[_0xc434('0xb2')](loggerCatch(_0xc434('0xba')));}else{_0x2d120a[_0xc434('0x3c')]=_0xc434('0x1e6');if(_[_0xc434('0xaf')](_0x3da2fb[0x0])||_[_0xc434('0xaf')](_0x3da2fb[0x0][_0xc434('0x151')])||_[_0xc434('0xaf')](_0x3da2fb[0x0][_0xc434('0x151')][_0xc434('0x152')])){_0x1edc98[_0xc434('0xcc')](_0xc434('0x1dd'),_0x2d120a,_0x3da2fb[0x0]);}else{_0x1edc98['checkIsBlackList'](_[_0xc434('0xcf')](_0x3da2fb[0x0],[_0xc434('0xd2'),_0xc434('0x1de')]))[_0xc434('0xb9')](_0x1edc98[_0xc434('0x1df')](_0x2d120a,_0x3da2fb[0x0]))['catch'](_0x1edc98[_0xc434('0x1e0')](_0xc434('0x1e8'),_0x2d120a));}}})[_0xc434('0xb2')](loggerGetContactDialer(_0xc434('0x1e9'),_0x2d120a,0x1));emitVoiceQueueSummary(_0x2d120a);};Dialer[_0xc434('0x1b')][_0xc434('0x1b9')]=function(_0xc08ae0,_0x13dbc8,_0x459b45,_0x2e6b03,_0x285b7f,_0x1504c2){loggerPredictive[_0xc434('0x7b')](_0xc434('0x1ea'));loggerPredictive[_0xc434('0x7b')](_0xc434('0x1eb'),_0xc08ae0);loggerPredictive[_0xc434('0x7b')](_0xc434('0x1ec'),_0x13dbc8);loggerPredictive['info'](_0xc434('0x1ed'),_0x459b45);loggerPredictive[_0xc434('0x7b')](_0xc434('0x1ee'),_0x2e6b03);loggerPredictive[_0xc434('0x7b')](_0xc434('0x1ef'),_0x285b7f);loggerPredictive[_0xc434('0x7b')]('---------------------------');return new BPromise(function(_0x3b9684,_0xdbb100){if(_0xc08ae0<=0x0||isNaN(_0xc08ae0)){return _0xdbb100(msgResponse(_0xc434('0x1f0'),'Error','m\x20=\x20'+_0xc08ae0));}if(_0x459b45<=0x0||isNaN(_0x459b45)){return _0xdbb100(msgResponse(_0xc434('0x1f0'),_0xc434('0x47'),_0xc434('0x1f1')+_0x459b45));}if(_0x2e6b03<=0x0||isNaN(_0x2e6b03)){return _0xdbb100(msgResponse(_0xc434('0x1f0'),_0xc434('0x47'),_0xc434('0x1f2')+_0x2e6b03));}if(_0x13dbc8<=0x0||isNaN(_0x13dbc8)){return _0xdbb100(msgResponse(_0xc434('0x1f0'),_0xc434('0x47'),'interval\x20=\x20'+_0x13dbc8));}if(_0x285b7f<=0x0||isNaN(_0x285b7f)){return _0xdbb100(msgResponse(_0xc434('0x1f0'),_0xc434('0x47'),_0xc434('0x1f3')+_0x285b7f));}_0x1504c2=_0x1504c2||0x0;var _0x5da412=0x1/_0x459b45;var _0x10f835=0x0;var _0x2f5fc7=0x0;var _0x552b6b=0x0;var _0x2b7b46=0x0;for(var _0x22a49d=0x0;_0x552b6b<_0x285b7f;_0x22a49d+=0x1){_0x2f5fc7=_0x22a49d/_0x13dbc8;_0x10f835=(_0x2e6b03*_0x2f5fc7+_0x1504c2)/_0x5da412;_0x552b6b=erlangb(_0x10f835,_0xc08ae0);_0x2b7b46=_0x10f835/_0xc08ae0*(0x1-erlangb(_0x10f835,_0xc08ae0));}return _0x3b9684({'erlangCalls':_0x22a49d,'erlangCallToSecond':_0x13dbc8/_0x22a49d,'erlangAbandonmentRate':_0x552b6b,'erlangBusyFactor':_0x2b7b46});});};Dialer[_0xc434('0x1b')][_0xc434('0x1ba')]=function(_0x514568,_0x22d92e,_0x21dbc1,_0x2f210b,_0x1e4914,_0x476dc4){loggerPredictive[_0xc434('0x7b')](_0xc434('0x1f4'));loggerPredictive[_0xc434('0x7b')]('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',_0x514568);loggerPredictive['info'](_0xc434('0x1ec'),_0x22d92e);loggerPredictive[_0xc434('0x7b')](_0xc434('0x1ed'),_0x21dbc1);loggerPredictive[_0xc434('0x7b')]('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',_0x2f210b);loggerPredictive[_0xc434('0x7b')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e4914);loggerPredictive[_0xc434('0x7b')](_0xc434('0x82'));return new BPromise(function(_0x125fcc,_0x481a70){if(_0x514568<=0x0||isNaN(_0x514568)){return _0x481a70(msgResponse(_0xc434('0x1f5'),_0xc434('0x47'),'m\x20=\x20'+_0x514568));}if(_0x21dbc1<=0x0||isNaN(_0x21dbc1)){return _0x481a70(msgResponse('[busyFactor]','Error',_0xc434('0x1f1')+_0x21dbc1));}if(_0x2f210b<=0x0||isNaN(_0x2f210b)){return _0x481a70(msgResponse(_0xc434('0x1f5'),'Error',_0xc434('0x1f2')+_0x2f210b));}if(_0x22d92e<=0x0||isNaN(_0x22d92e)){return _0x481a70(msgResponse(_0xc434('0x1f5'),'Error',_0xc434('0x1f6')+_0x22d92e));}if(_0x1e4914<=0x0||isNaN(_0x1e4914)){return _0x481a70(msgResponse(_0xc434('0x1f5'),_0xc434('0x47'),_0xc434('0x1f7')+_0x1e4914));}_0x476dc4=_0x476dc4||0x0;var _0x759a78=0x1/_0x21dbc1;var _0x1fe18b=0x0;var _0x5e1696=0x0;var _0x4b6afc=0x0;var _0x36c6f9=0x0;for(var _0x1e8081=0x0;_0x36c6f9<_0x1e4914;_0x1e8081+=0x1){_0x5e1696=_0x1e8081/_0x22d92e;_0x1fe18b=(_0x2f210b*_0x5e1696+_0x476dc4)/_0x759a78;_0x4b6afc=erlangb(_0x1fe18b,_0x514568);_0x36c6f9=_0x1fe18b/_0x514568*(0x1-erlangb(_0x1fe18b,_0x514568));}return _0x125fcc({'erlangCalls':_0x1e8081,'erlangCallToSecond':_0x22d92e/_0x1e8081,'erlangAbandonmentRate':_0x4b6afc,'erlangBusyFactor':_0x36c6f9});});};module[_0xc434('0x1f8')]=Dialer;
\ No newline at end of file