Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / services / ami / preview / index.js
index 374895d..39b878c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd58c=['IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','decrementTalkink','[16]','countglobal','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','Busy','busy','[callProgressDetectingCustomer][logBusy]','Global','countbusyretry','dialBusyMaxRetry','scheduledAt','dialBusyRetryFrequency','unlockAgent','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','isEmpty','idContact','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialCutDigit','substring','SIP/%s/%s%s','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridNumber','addVariables','merge','toLowerVariables','Action','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking][cause]','cause','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','syncVarSet','variable','keys','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','ioredis','../../../config/logger','preview','actionPreview','../ami','./util/util','redis','defaults','localhost','prototype','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','type','name','strategy','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emit','voice_queue_presence:remove','sendMessageOneNotActive','originated','available','paused','NOT_ACTIVE','IS_DISACTIVED','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','syncCampaigns','campaignsPreview','hasOwnProperty','dialMethod','booked','outbound','setMessage','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','status','channel','catch','message','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]'];(function(_0x4b8b8d,_0x20d376){var _0x1c4d47=function(_0x4df716){while(--_0x4df716){_0x4b8b8d['push'](_0x4b8b8d['shift']());}};_0x1c4d47(++_0x20d376);}(_0xd58c,0xb6));var _0xcd58=function(_0x2430f6,_0x128e37){_0x2430f6=_0x2430f6-0x0;var _0x3c43dd=_0xd58c[_0x2430f6];return _0x3c43dd;};'use strict';var util=require(_0xcd58('0x0'));var _=require(_0xcd58('0x1'));var BPromise=require(_0xcd58('0x2'));var uuid=require('uuid');var moment=require(_0xcd58('0x3'));var md5=require('md5');var Redis=require(_0xcd58('0x4'));var config=require('../../../config/environment');var logger=require(_0xcd58('0x5'))(_0xcd58('0x6'));var loggerAction=require(_0xcd58('0x5'))(_0xcd58('0x7'));var ami=require(_0xcd58('0x8'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0xcd58('0x9'));config[_0xcd58('0xa')]=_[_0xcd58('0xb')](config[_0xcd58('0xa')],{'host':_0xcd58('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcd58('0xa')]));var Sequence=function(){};Sequence[_0xcd58('0xd')]['enqueue']=function(_0x1e6f95){this['tail']=this[_0xcd58('0xe')]?this[_0xcd58('0xe')][_0xcd58('0xf')](_0x1e6f95):_0x1e6f95();};function Preview(_0x4f95e9){this[_0xcd58('0x10')]=new Sequence();this['campaignsPreview']=_0x4f95e9[_0xcd58('0x11')];this['trunks']=_0x4f95e9[_0xcd58('0x12')];this[_0xcd58('0x13')]={};this[_0xcd58('0x14')]=_0x4f95e9[_0xcd58('0x14')];this[_0xcd58('0x15')]=0x0;ami['on'](_0xcd58('0x16'),this[_0xcd58('0x17')][_0xcd58('0x18')](this));ami['on']('hangup',this['syncHangup'][_0xcd58('0x18')](this));ami['on'](_0xcd58('0x19'),this[_0xcd58('0x1a')]['bind'](this));ami['on']('dialend',this[_0xcd58('0x1b')][_0xcd58('0x18')](this));ami['on'](_0xcd58('0x1c'),this['syncNewExten']['bind'](this));ami['on'](_0xcd58('0x1d'),this['syncVarSet'][_0xcd58('0x18')](this));ami['on'](_0xcd58('0x1e'),this[_0xcd58('0x1f')][_0xcd58('0x18')](this));ami['on']('blindtransfer',this[_0xcd58('0x20')]['bind'](this));this['loopCampaigns'](this['campaignsPreview']);}function emit(_0x503c5,_0x1e6ce7,_0x44b002){io['to'](_0x503c5)['emit'](_0x1e6ce7,_0x44b002);}function emitCampaignPreview(_0xb7325f){if(_0xb7325f[_0xcd58('0x21')]==='outbound'){var _0x18f953={'id':_0xb7325f['id'],'name':_0xb7325f[_0xcd58('0x22')],'strategy':_0xb7325f[_0xcd58('0x23')],'answered':_0xb7325f['answered'],'available':_0xb7325f['available'],'loggedIn':_0xb7325f[_0xcd58('0x24')],'pTalking':_0xb7325f[_0xcd58('0x25')],'sumBillable':_0xb7325f[_0xcd58('0x26')],'sumDuration':_0xb7325f[_0xcd58('0x27')],'sumHoldTime':_0xb7325f[_0xcd58('0x28')]||0x0,'talking':_0xb7325f[_0xcd58('0x29')],'total':_0xb7325f[_0xcd58('0x2a')],'type':_0xb7325f['type'],'unmanaged':_0xb7325f['unmanaged'],'abandoned':_0xb7325f[_0xcd58('0x2b')],'waiting':_0xb7325f[_0xcd58('0x2c')],'loggedInDb':_0xb7325f['loggedInDb'],'dialActive':_0xb7325f[_0xcd58('0x2d')],'dialMethod':_0xb7325f['dialMethod'],'dialOriginateCallerIdName':_0xb7325f[_0xcd58('0x2e')],'dialOriginateCallerIdNumber':_0xb7325f[_0xcd58('0x2f')],'dialOriginateTimeout':_0xb7325f[_0xcd58('0x30')],'dialPrefix':_0xb7325f[_0xcd58('0x31')],'outboundAnswerAgiCallsDay':_0xb7325f[_0xcd58('0x32')],'outboundAnswerCallsDay':_0xb7325f[_0xcd58('0x33')],'outboundBlacklistCallsDay':_0xb7325f['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0xb7325f[_0xcd58('0x34')],'outboundCongestionCallsDay':_0xb7325f['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0xb7325f[_0xcd58('0x35')],'outboundDropCallsDayCallersExit':_0xb7325f['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0xb7325f[_0xcd58('0x36')],'outboundNoAnswerCallsDay':_0xb7325f['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xb7325f[_0xcd58('0x37')],'outboundOriginateFailureCallsDay':_0xb7325f['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xb7325f[_0xcd58('0x38')],'outboundRejectCallsDay':_0xb7325f[_0xcd58('0x39')],'outboundUnknownCallsDay':_0xb7325f[_0xcd58('0x3a')],'outboundAbandonedCallsDay':_0xb7325f[_0xcd58('0x3b')],'predictiveIntervalAnsweredCalls':_0xb7325f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0xb7325f[_0xcd58('0x3c')],'predictiveIntervalAvgTalktime':_0xb7325f['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xb7325f[_0xcd58('0x3d')],'predictiveIntervalDroppedCallsTimeout':_0xb7325f[_0xcd58('0x3e')],'predictiveIntervalErlangCalls':_0xb7325f[_0xcd58('0x3f')],'predictiveIntervalErlangCallsDroppedCalls':_0xb7325f[_0xcd58('0x40')],'predictiveIntervalHitRate':_0xb7325f[_0xcd58('0x41')],'predictiveIntervalMultiplicativeFactor':_0xb7325f[_0xcd58('0x42')],'predictiveIntervalPauses':_0xb7325f['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0xb7325f['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0xb7325f[_0xcd58('0x43')],'message':_0xb7325f['message'],'originated':_0xb7325f['originated'],'erlangCalls':_0xb7325f[_0xcd58('0x44')],'erlangCallToSecond':_0xb7325f[_0xcd58('0x45')],'erlangAbandonmentRate':_0xb7325f[_0xcd58('0x46')],'erlangBusyFactor':_0xb7325f[_0xcd58('0x47')],'startPredictive':_0xb7325f[_0xcd58('0x48')],'startProgressive':_0xb7325f[_0xcd58('0x49')]};if(_0xb7325f['Trunk']){_0x18f953['Trunk']={'id':_0xb7325f[_0xcd58('0x4a')]['id'],'name':_0xb7325f[_0xcd58('0x4a')][_0xcd58('0x22')],'active':_0xb7325f['Trunk'][_0xcd58('0x4b')],'callerid':_0xb7325f[_0xcd58('0x4a')][_0xcd58('0x4c')]};}if(_0xb7325f['Interval']){_0x18f953['Interval']={'id':_0xb7325f[_0xcd58('0x4d')]['id'],'name':_0xb7325f[_0xcd58('0x4d')][_0xcd58('0x22')]};}var _0x354924=md5(JSON[_0xcd58('0x4e')](_0x18f953));if(_0xb7325f[_0xcd58('0x4f')]!==_0x354924){_0xb7325f[_0xcd58('0x4f')]=_0x354924;emit(util[_0xcd58('0x50')](_0xcd58('0x51'),_0x18f953[_0xcd58('0x22')]),_0xcd58('0x52'),_0x18f953);}}}function emitVoiceQueueChannelRemove(_0x37e840){logger[_0xcd58('0x53')](_0xcd58('0x54'),JSON[_0xcd58('0x4e')](_0x37e840));emit(util[_0xcd58('0x50')](_0xcd58('0x51'),_0x37e840[_0xcd58('0x22')]),_0xcd58('0x55'),_0x37e840);io[_0xcd58('0x56')](_0xcd58('0x57'),_0x37e840);}function notSendMessagesQueue(_0x5cd1eb){if(_0x5cd1eb[_0xcd58('0x58')]){if(_0x5cd1eb[_0xcd58('0x59')]===0x0&&_0x5cd1eb[_0xcd58('0x25')]===0x0){_0x5cd1eb['sendMessageOneNotActive']=![];_0x5cd1eb[_0xcd58('0x5a')]=0x0;_0x5cd1eb[_0xcd58('0x5b')]=0x0;_0x5cd1eb['message']=_0xcd58('0x5c');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5cd1eb[_0xcd58('0x22')]+'\x20is\x20not\x20active');}else{_0x5cd1eb['message']=_0xcd58('0x5d');ut[_0xcd58('0x5e')](_0xcd58('0x5f'),_0x5cd1eb['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x5cd1eb);}}Preview[_0xcd58('0xd')]['loopCampaigns']=function(){var _0x3ab135=this;setInterval(function(){_0x3ab135[_0xcd58('0x60')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x1f5e98=this[_0xcd58('0x61')];this[_0xcd58('0x15')]+=0x1;for(var _0x3ac023 in _0x1f5e98){if(_0x1f5e98[_0xcd58('0x62')](_0x3ac023)&&(_0x1f5e98[_0x3ac023][_0xcd58('0x63')]===_0xcd58('0x6')||_0x1f5e98[_0x3ac023][_0xcd58('0x63')]===_0xcd58('0x64'))&&_0x1f5e98[_0x3ac023][_0xcd58('0x21')]===_0xcd58('0x65')){if(this[_0xcd58('0x15')]>0x7){this[_0xcd58('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x1f5e98[_0xcd58('0x62')](_0x3ac023)&&_0x1f5e98[_0x3ac023][_0xcd58('0x63')]===_0xcd58('0x6')&&_0x1f5e98[_0x3ac023]['type']===_0xcd58('0x65')){if(_0x1f5e98[_0x3ac023][_0xcd58('0x2d')]){this[_0xcd58('0x66')](_0x1f5e98[_0x3ac023]);this[_0xcd58('0x67')](_0x1f5e98[_0x3ac023]);}else{notSendMessagesQueue(_0x1f5e98[_0x3ac023]);}}}};Preview['prototype'][_0xcd58('0x68')]=function(_0x26dd8f){var _0x16be8c=this;this[_0xcd58('0x10')][_0xcd58('0x69')](function(){if(!_[_0xcd58('0x6a')](_0x16be8c[_0xcd58('0x13')][_0x26dd8f])){loggerAction[_0xcd58('0x53')](_0xcd58('0x6b'),_0x26dd8f,_0xcd58('0x6c'),_0x16be8c['actions'][_0x26dd8f][_0xcd58('0x6d')],_0xcd58('0x6e'),JSON[_0xcd58('0x4e')](_0x16be8c[_0xcd58('0x61')][_0x16be8c[_0xcd58('0x13')][_0x26dd8f][_0xcd58('0x6d')]][_0xcd58('0x59')]),_0xcd58('0x6f'),JSON[_0xcd58('0x4e')](_0x16be8c[_0xcd58('0x61')][_0x16be8c[_0xcd58('0x13')][_0x26dd8f][_0xcd58('0x6d')]]['pTalking']),JSON[_0xcd58('0x4e')](_0x16be8c[_0xcd58('0x13')][_0x26dd8f]['dialAnswer']),JSON[_0xcd58('0x4e')](_[_0xcd58('0x70')](_0x16be8c[_0xcd58('0x13')][_0x26dd8f],[_0xcd58('0x71'),_0xcd58('0x72'),_0xcd58('0x73'),'ListId'])));return ami['Action']({'action':_0xcd58('0x74'),'channel':_0x16be8c['actions'][_0x26dd8f][_0xcd58('0x75')]})[_0xcd58('0x76')](function(_0x3eb747){if(_0x3eb747[_0xcd58('0x77')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x16be8c['actions'][_0x26dd8f]){ut[_0xcd58('0x78')](_0x16be8c['campaignsPreview'][_0x16be8c['actions'][_0x26dd8f][_0xcd58('0x6d')]],_0xcd58('0x79'));if(_0x16be8c[_0xcd58('0x13')][_0x26dd8f][_0xcd58('0x7a')]===!![]){ut['decrementTalkink'](_0x16be8c[_0xcd58('0x61')][_0x16be8c['actions'][_0x26dd8f]['queue']],_0xcd58('0x79'));ut[_0xcd58('0x7b')]('[Dialer][checkChannel][pTalking][Preview]'+_0x26dd8f,_0x16be8c[_0xcd58('0x13')][_0x26dd8f]['queue']);}ut[_0xcd58('0x7b')](_0xcd58('0x7c')+_0x26dd8f,_0x16be8c[_0xcd58('0x13')][_0x26dd8f][_0xcd58('0x6d')]);delete _0x16be8c[_0xcd58('0x13')][_0x26dd8f];}},0x2328);}});}});};Preview[_0xcd58('0xd')][_0xcd58('0x7d')]=function(){var _0xe1a29a=this;loggerAction[_0xcd58('0x53')](_0xcd58('0x7e'),_[_0xcd58('0x7f')](this[_0xcd58('0x13')]));for(var _0x532af6 in this[_0xcd58('0x13')]){if(_0xe1a29a['actions'][_0xcd58('0x62')](_0x532af6)){_0xe1a29a[_0xcd58('0x68')](_0x532af6);}}};Preview[_0xcd58('0xd')][_0xcd58('0x67')]=function(_0x4fc347){var _0x3d2fe7=this;rpcDb[_0xcd58('0x80')](_0x4fc347['id'],ut[_0xcd58('0x81')](this[_0xcd58('0x14')]))['then'](function(_0x5ab979){if(!_[_0xcd58('0x6a')](_0x5ab979)){for(var _0x386388=0x0;_0x386388<_0x5ab979[_0xcd58('0x82')];_0x386388+=0x1){if(ut[_0xcd58('0x83')](_0x5ab979[_0x386388][_0xcd58('0x84')])<_0x4fc347[_0xcd58('0x85')]*0x3c){if(_0x5ab979[_0x386388][_0xcd58('0x86')]&&!_0x5ab979[_0x386388]['Agent'][_0xcd58('0x87')]){_0x3d2fe7[_0xcd58('0x88')](_0x5ab979[_0x386388]['id'])[_0xcd58('0x89')](ut[_0xcd58('0x8a')](_0xcd58('0x8b')))[_0xcd58('0x76')](ut[_0xcd58('0x8a')](_0xcd58('0x8b')));}else{rpcDb[_0xcd58('0x8c')](_0x5ab979[_0x386388]['id']);}}else{var _0x2d16d0=new Action(_0x5ab979[_0x386388],_0x4fc347);_0x2d16d0[_0xcd58('0x8d')]=moment()[_0xcd58('0x50')](_0xcd58('0x8e'));_0x4fc347[_0xcd58('0x38')]+=0x1;ut[_0xcd58('0x8f')](_0x2d16d0,0x17,_0xcd58('0x90'));if(_0x4fc347[_0xcd58('0x91')]){rpcDb['rescheduleContactInQueue'](ut[_0xcd58('0x92')](_0x5ab979[_0x386388]));rpcDb[_0xcd58('0x93')](_0x2d16d0,_0xcd58('0x94'));}else{ut[_0xcd58('0x8f')](_0x2d16d0,0x16,'RecallFailedTimeout');rpcDb[_0xcd58('0x93')](_0x2d16d0,_0xcd58('0x95'));rpcDb[_0xcd58('0x96')](_0x2d16d0,_0xcd58('0x95'));}}}}})[_0xcd58('0x76')](ut['logger2'](_0xcd58('0x97')));};Preview[_0xcd58('0xd')][_0xcd58('0x66')]=function(_0x1cc739){_0x1cc739[_0xcd58('0x58')]=!![];if(ut[_0xcd58('0x98')](_0x1cc739[_0xcd58('0x24')])){_0x1cc739[_0xcd58('0x77')]=_0xcd58('0x99');}else if(!ut[_0xcd58('0x9a')](_0x1cc739['dialActive'])){_0x1cc739['message']=_0xcd58('0x5c');}else if(!this[_0xcd58('0x9b')](_0x1cc739[_0xcd58('0x4a')])){if(!this['isTrunkReachable'](_0x1cc739[_0xcd58('0x9c')])){_0x1cc739[_0xcd58('0x77')]='TRUNK_IS_NOT_REACHABLE';}else{_0x1cc739[_0xcd58('0x77')]=_0xcd58('0x9d');}}else{_0x1cc739[_0xcd58('0x77')]=_0xcd58('0x9d');}emitCampaignPreview(_0x1cc739);};Preview[_0xcd58('0xd')][_0xcd58('0x9e')]=function(_0xab6ee,_0x75aa96,_0x4dd355){var _0x56e190=this;var _0x104aa2=this['actions'][_0x75aa96];var _0x33807d=this['campaignsPreview'][_0x104aa2[_0xcd58('0x6d')]];var _0x1e6d77;if(_0x33807d){switch(_0x4dd355){case'1':_0x33807d[_0xcd58('0x37')]+=0x1;_0x104aa2[_0xcd58('0x9f')]+=0x1;_0x104aa2['countglobal']=ut[_0xcd58('0xa0')](_0x104aa2);ut[_0xcd58('0x8f')](_0x104aa2,0x0,'NoSuchNumber');ami[_0xcd58('0x56')](_0xcd58('0xa1'),ut[_0xcd58('0xa2')](_0x104aa2,_0xcd58('0xa3')));rpcDb['createCustomerHistory'](_0x104aa2,_0xcd58('0xa4'));if(ut[_0xcd58('0xa0')](_0x104aa2)>=_0x33807d[_0xcd58('0xa5')]){_0x1e6d77=ut[_0xcd58('0xa6')](_0x104aa2,0xf,'Global');rpcDb[_0xcd58('0x96')](_0x1e6d77,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x104aa2[_0xcd58('0x9f')]>=_0x33807d[_0xcd58('0xa7')]){rpcDb[_0xcd58('0x96')](_0x104aa2,_0xcd58('0xa8'));}else{rpcDb[_0xcd58('0xa9')](ut['scheduledAt'](_0x104aa2,_0xcd58('0x9f'),_0x33807d[_0xcd58('0xaa')]),_0x104aa2['unlockAgent'],_0x104aa2[_0xcd58('0xab')]);}}delete this['actions'][_0xab6ee[_0xcd58('0xac')]];break;case _0xcd58('0xad'):var _0x150792=moment()[_0xcd58('0x50')](_0xcd58('0x8e'));_0x104aa2[_0xcd58('0xae')]=_0x150792;_0x104aa2[_0xcd58('0xaf')]=_0x150792;_0x104aa2['dialAnswer']=!![];_0x33807d[_0xcd58('0x25')]+=0x1;logger[_0xcd58('0x53')](_0xcd58('0xb0'),_0x104aa2[_0xcd58('0xb1')],_0xcd58('0xb2'),_0x33807d[_0xcd58('0x22')],_0xcd58('0x6f'),_0x33807d[_0xcd58('0x25')]);ami[_0xcd58('0x56')](_0xcd58('0xb3'),ut[_0xcd58('0xa2')](_0x104aa2,_0xcd58('0xb4'),this['campaignsPreview'][_0x104aa2['queue']]));if(_0x33807d[_0xcd58('0xb5')]){ami[_0xcd58('0x56')](_0xcd58('0xb6'),ut[_0xcd58('0xb7')](_0x104aa2));}break;case'16':ami[_0xcd58('0x56')](_0xcd58('0xb8'),ut[_0xcd58('0xa2')](_0x104aa2,'complete',this[_0xcd58('0x61')][_0x104aa2[_0xcd58('0x6d')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x104aa2,_0xcd58('0xb9')));_0x33807d[_0xcd58('0x33')]+=0x1;_0x33807d[_0xcd58('0x2a')]+=0x1;_0x33807d[_0xcd58('0xba')]+=0x1;ut[_0xcd58('0xbb')](_0x33807d,_0xcd58('0xbc'));_0x104aa2[_0xcd58('0xbd')]=ut[_0xcd58('0xa0')](_0x104aa2);ut[_0xcd58('0x8f')](_0x104aa2,0x4,'Answer');rpcDb['createCustomerHistory'](_0x104aa2,_0xcd58('0xbe'));rpcDb['createCustomerFinal'](_0x104aa2,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xcd58('0xbf')](_0x104aa2);_0x33807d['sumDuration']+=_0x104aa2[_0xcd58('0xc0')];_0x33807d[_0xcd58('0x26')]+=_0x104aa2[_0xcd58('0xc0')];logger[_0xcd58('0x53')](_0xcd58('0xc1'),_0x104aa2['uniqueid'],'\x20Queue',_0x33807d['name'],_0xcd58('0x6f'),_0x33807d[_0xcd58('0x25')]);delete this['actions'][_0xab6ee[_0xcd58('0xac')]];break;case _0xcd58('0xc2'):_0x33807d[_0xcd58('0x34')]+=0x1;_0x104aa2['countbusyretry']+=0x1;_0x104aa2['countglobal']=ut[_0xcd58('0xa0')](_0x104aa2);ut[_0xcd58('0x8f')](_0x104aa2,0x5,_0xcd58('0xc3'));ami[_0xcd58('0x56')]('custom:agentbusy',ut[_0xcd58('0xa2')](_0x104aa2,_0xcd58('0xc4')));rpcDb[_0xcd58('0x93')](_0x104aa2,_0xcd58('0xc5'));if(ut['totalGlobal'](_0x104aa2)>=_0x33807d['dialGlobalMaxRetry']){_0x1e6d77=ut[_0xcd58('0xa6')](_0x104aa2,0xf,_0xcd58('0xc6'));rpcDb[_0xcd58('0x96')](_0x1e6d77,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x104aa2[_0xcd58('0xc7')]>=_0x33807d[_0xcd58('0xc8')]){rpcDb[_0xcd58('0x96')](_0x104aa2,_0xcd58('0xc5'));}else{rpcDb[_0xcd58('0xa9')](ut[_0xcd58('0xc9')](_0x104aa2,_0xcd58('0xc7'),_0x33807d[_0xcd58('0xca')]),_0x104aa2[_0xcd58('0xcb')],_0x104aa2[_0xcd58('0xab')]);}}break;case'NOANSWER':_0x33807d[_0xcd58('0xcc')]+=0x1;_0x104aa2[_0xcd58('0xcd')]+=0x1;_0x104aa2[_0xcd58('0xbd')]=ut[_0xcd58('0xa0')](_0x104aa2);ut[_0xcd58('0x8f')](_0x104aa2,0x3,_0xcd58('0xce'));ami['emit'](_0xcd58('0xcf'),ut[_0xcd58('0xa2')](_0x104aa2,_0xcd58('0xd0')));rpcDb[_0xcd58('0x93')](_0x104aa2,_0xcd58('0xd1'));if(ut[_0xcd58('0xa0')](_0x104aa2)>=_0x33807d[_0xcd58('0xa5')]){_0x1e6d77=ut[_0xcd58('0xa6')](_0x104aa2,0xf,_0xcd58('0xc6'));rpcDb[_0xcd58('0x96')](_0x1e6d77,_0xcd58('0xd2'));}else{if(_0x104aa2[_0xcd58('0xcd')]>=_0x33807d[_0xcd58('0xd3')]){rpcDb[_0xcd58('0x96')](_0x104aa2,_0xcd58('0xd1'));}else{rpcDb[_0xcd58('0xa9')](ut['scheduledAt'](_0x104aa2,'countnoanswerretry',_0x33807d[_0xcd58('0xd4')]),_0x104aa2[_0xcd58('0xcb')],_0x104aa2['activeContact']);}}break;case _0xcd58('0xd5'):_0x33807d[_0xcd58('0xd6')]+=0x1;_0x104aa2[_0xcd58('0xd7')]+=0x1;_0x104aa2[_0xcd58('0xbd')]=ut[_0xcd58('0xa0')](_0x104aa2);ut[_0xcd58('0x8f')](_0x104aa2,0x8,_0xcd58('0xd8'));ami[_0xcd58('0x56')](_0xcd58('0xd9'),ut[_0xcd58('0xa2')](_0x104aa2,_0xcd58('0xda')));rpcDb[_0xcd58('0x93')](_0x104aa2,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x104aa2)>=_0x33807d[_0xcd58('0xa5')]){_0x1e6d77=ut['cloneAction'](_0x104aa2,0xf,_0xcd58('0xc6'));rpcDb[_0xcd58('0x96')](_0x1e6d77,_0xcd58('0xdb'));}else{if(_0x104aa2['countcongestionretry']>=_0x33807d[_0xcd58('0xdc')]){rpcDb[_0xcd58('0x96')](_0x104aa2,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0xcd58('0xc9')](_0x104aa2,_0xcd58('0xd7'),_0x33807d['dialBusyRetryFrequency']),_0x104aa2[_0xcd58('0xcb')],_0x104aa2[_0xcd58('0xab')]);}}break;case _0xcd58('0xdd'):_0x33807d[_0xcd58('0x39')]+=0x1;_0x104aa2[_0xcd58('0xde')]+=0x1;_0x104aa2[_0xcd58('0xbd')]=ut[_0xcd58('0xa0')](_0x104aa2);ut[_0xcd58('0x8f')](_0x104aa2,0x14,'AgentReject');ami['emit'](_0xcd58('0xdf'),ut['buildObj'](_0x104aa2,_0xcd58('0xe0')));rpcDb[_0xcd58('0x93')](_0x104aa2,_0xcd58('0xe1'));if(ut[_0xcd58('0xa0')](_0x104aa2)>=_0x33807d[_0xcd58('0xa5')]){_0x1e6d77=ut[_0xcd58('0xa6')](_0x104aa2,0x14,_0xcd58('0xe2'));rpcDb['createCustomerFinal'](_0x1e6d77,_0xcd58('0xe3'));}else{if(_0x104aa2[_0xcd58('0xde')]>=_0x33807d[_0xcd58('0xe4')]){rpcDb[_0xcd58('0x96')](_0x104aa2,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xcd58('0xa9')](ut[_0xcd58('0xc9')](_0x104aa2,_0xcd58('0xde'),_0x33807d['dialAgentRejectRetryFrequency']),_0x104aa2[_0xcd58('0xcb')],_0x104aa2[_0xcd58('0xab')]);}}break;case _0xcd58('0xe5'):_0x33807d[_0xcd58('0x3b')]+=0x1;_0x104aa2[_0xcd58('0xe6')]+=0x1;_0x104aa2[_0xcd58('0xbd')]=ut[_0xcd58('0xa0')](_0x104aa2);ut[_0xcd58('0x8f')](_0x104aa2,0xb,_0xcd58('0xe7'));rpcDb[_0xcd58('0x93')](_0x104aa2,_0xcd58('0xe8'));if(ut[_0xcd58('0xa0')](_0x104aa2)>=_0x33807d['dialGlobalMaxRetry']){_0x1e6d77=ut[_0xcd58('0xa6')](_0x104aa2,0xf,_0xcd58('0xc6'));rpcDb[_0xcd58('0x96')](_0x1e6d77,_0xcd58('0xe8'));}else{if(_0x104aa2[_0xcd58('0xe9')]>=_0x33807d[_0xcd58('0xea')]){rpcDb['createCustomerFinal'](_0x104aa2,_0xcd58('0xe8'));}else{rpcDb[_0xcd58('0xa9')](ut[_0xcd58('0xc9')](_0x104aa2,'countabandonedretry',_0x33807d[_0xcd58('0xeb')]),_0x104aa2[_0xcd58('0xcb')],_0x104aa2[_0xcd58('0xab')]);}}break;case'18':_0x33807d[_0xcd58('0x3a')]+=0x1;_0x104aa2[_0xcd58('0xec')]+=0x1;_0x104aa2[_0xcd58('0xbd')]=ut[_0xcd58('0xa0')](_0x104aa2);ut['logCustomer'](_0x104aa2,0x12,_0xab6ee[_0xcd58('0xed')]||_0xab6ee['dialstatus']);ami[_0xcd58('0x56')](_0xcd58('0xee'),ut['buildObj'](_0x104aa2,_0xcd58('0xef')));rpcDb[_0xcd58('0x93')](_0x104aa2,_0xcd58('0xf0'));if(ut['totalGlobal'](_0x104aa2)>=_0x33807d[_0xcd58('0xa5')]){_0x1e6d77=ut[_0xcd58('0xa6')](_0x104aa2,0xf,'Global');rpcDb[_0xcd58('0x96')](_0x1e6d77,_0xcd58('0xf0'));}else{rpcDb[_0xcd58('0x96')](_0x104aa2,_0xcd58('0xf0'));}delete this['actions'][_0xab6ee[_0xcd58('0xac')]];break;case'19':_0x33807d[_0xcd58('0x3a')]+=0x1;_0x104aa2[_0xcd58('0xbd')]=ut[_0xcd58('0xa0')](_0x104aa2);ut[_0xcd58('0x8f')](_0x104aa2,0x13,_0xab6ee[_0xcd58('0xed')]||_0xab6ee['dialstatus']);ami[_0xcd58('0x56')](_0xcd58('0xee'),ut['buildObj'](_0x104aa2,_0xcd58('0xef')));rpcDb[_0xcd58('0x93')](_0x104aa2,_0xcd58('0xf1'));if(ut['totalGlobal'](_0x104aa2)>=_0x33807d[_0xcd58('0xa5')]){_0x1e6d77=ut[_0xcd58('0xa6')](_0x104aa2,0xf,_0xcd58('0xc6'));rpcDb[_0xcd58('0x96')](_0x1e6d77,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xcd58('0x96')](_0x104aa2,_0xcd58('0xf1'));}delete this[_0xcd58('0x13')][_0xab6ee[_0xcd58('0xac')]];break;default:if(_0x104aa2[_0xcd58('0x7a')]){ut['decrementTalkink'](_0x33807d,_0xcd58('0xf2'));ut[_0xcd58('0x7b')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x33807d['name'],_0xab6ee);}_0x33807d[_0xcd58('0x3a')]+=0x1;_0x104aa2[_0xcd58('0xbd')]=ut[_0xcd58('0xa0')](_0x104aa2);ut['logCustomer'](_0x104aa2,0xc,_0xab6ee['cause-txt']||_0xab6ee[_0xcd58('0xf3')]);rpcDb[_0xcd58('0x93')](_0x104aa2,_0xcd58('0xf4'));if(ut[_0xcd58('0xa0')](_0x104aa2)>=_0x33807d[_0xcd58('0xa5')]){_0x1e6d77=ut[_0xcd58('0xa6')](_0x104aa2,0xf,_0xcd58('0xc6'));rpcDb[_0xcd58('0x96')](_0x1e6d77,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xcd58('0x96')](_0x104aa2,_0xcd58('0xf5'));}delete this['actions'][_0xab6ee['linkedid']];}if(!(_0x104aa2[_0xcd58('0x7a')]&&_0x4dd355==='16')){ut[_0xcd58('0x78')](_0x33807d,_0xcd58('0xf6'));logger[_0xcd58('0x53')]('[originated][decrement][callProgressDetectingCustomer]',_0x104aa2[_0xcd58('0xb1')],_0xcd58('0xb2'),_0x33807d['name'],_0xcd58('0x6e'),_0x33807d[_0xcd58('0x59')]);}if(_0x4dd355!==_0xcd58('0xad')){delete this[_0xcd58('0x13')][_0xab6ee[_0xcd58('0xac')]];delete this[_0xcd58('0x13')][_0xab6ee['destlinkedid']];}}};Preview['prototype'][_0xcd58('0xf7')]=function(_0x50e508,_0x365c62,_0x2224ad){if(_['isUndefined'](_0x365c62)&&_0xcd58('0xf8')!==typeof _0x365c62){return;}if(_[_0xcd58('0xf9')](_0x2224ad)&&_0xcd58('0xf8')!==typeof _0x2224ad){return;}switch(_0x2224ad[_0xcd58('0xfa')]){case'0':ut[_0xcd58('0xfb')](_0x50e508,0x0,'NoSuchNumber');rpcDb[_0xcd58('0xfc')](_0x50e508,_0xcd58('0xfd'));break;case'3':ut[_0xcd58('0xfb')](_0x50e508,0x3,_0xcd58('0xce'));rpcDb[_0xcd58('0xfc')](_0x50e508,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xcd58('0xfb')](_0x50e508,0x5,'Busy');rpcDb[_0xcd58('0xfc')](_0x50e508,_0xcd58('0xfe'));break;case'8':ut[_0xcd58('0xfb')](_0x50e508,0x8,_0xcd58('0xd8'));rpcDb['createAgentHistory'](_0x50e508,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xcd58('0xfb')](_0x50e508,0x16,_0xcd58('0xff'));rpcDb['createAgentHistory'](_0x50e508,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xcd58('0xfb')](_0x50e508,0xc,_0x2224ad['reason']);rpcDb[_0xcd58('0xfc')](_0x50e508,'[callProgressDetectingAgent][logCongestion]');}ut[_0xcd58('0x78')](_0x365c62,_0xcd58('0x100'));logger[_0xcd58('0x53')](_0xcd58('0x101'),_0x50e508['uniqueid'],'\x20Queue',_0x365c62['name'],_0xcd58('0x6e'),_0x365c62[_0xcd58('0x59')]);delete this[_0xcd58('0x13')][_0x50e508[_0xcd58('0xb1')]];};Preview[_0xcd58('0xd')][_0xcd58('0x102')]=function(_0x3c3ee4,_0x1735b2,_0x173383,_0x239071,_0x36a642){var _0x217f77=this;return new BPromise(function(_0x74003a,_0x1103d9){if(_[_0xcd58('0x6a')](_0x1735b2)||_[_0xcd58('0x6a')](_0x1735b2[_0xcd58('0x103')])||_[_0xcd58('0x6a')](_0x1735b2[_0xcd58('0x103')][_0xcd58('0x104')])||_[_0xcd58('0x6a')](_0x1735b2[_0xcd58('0x73')])){_0x1103d9(ut[_0xcd58('0x77')]('Contact\x20is\x20undefined',_0x239071,_0x36a642));return;}var _0x339897=uuid['v4']();var _0x17eaa3=_0x217f77[_0xcd58('0x61')][_0x1735b2[_0xcd58('0x6c')][_0xcd58('0x22')]];var _0x521486=_0x173383?_0x217f77['agents'][_0x173383]['id']:undefined;_0x217f77[_0xcd58('0x13')][_0x339897]=new Action(_0x1735b2,_0x17eaa3,_0x339897,_0x173383,_0x521486);var _0x36a75=_0x217f77[_0xcd58('0x13')][_0x339897];_0x36a75[_0xcd58('0xcb')]=_0x239071;_0x36a75[_0xcd58('0xab')]=_0x36a642;_0x36a75[_0xcd58('0x105')]=_0x173383;if(_[_0xcd58('0x106')](_0x3c3ee4)){_0x217f77['execCall'](_0x36a75,_0x17eaa3,_0x1735b2,_0x173383)[_0xcd58('0x89')](function(_0x543266){logger[_0xcd58('0x53')]('[Preview][execCall][success]','Queue:\x20'+_0x36a75[_0xcd58('0x6d')]+'\x20IdHopper:\x20'+_0x36a75[_0xcd58('0x107')],JSON['stringify'](_0x543266));ami[_0xcd58('0x56')](_0xcd58('0x108'),ut[_0xcd58('0xa2')](_0x36a75,_0xcd58('0x109'),_0x217f77[_0xcd58('0x61')][_0x36a75[_0xcd58('0x6d')]]));_0x74003a(ut[_0xcd58('0x77')]('Calling'));})['catch'](function(_0xb7f782){ut['logger'](_0xcd58('0x10a'),_0xb7f782);_0x1103d9(ut[_0xcd58('0x77')](_0xcd58('0x10b'),_0x239071,_0x36a642));});}else{_0x17eaa3[_0xcd58('0x10c')]+=0x1;ut['logBlacklist'](_0x36a75);rpcDb[_0xcd58('0x10d')](_0x36a75,_0xcd58('0x10e'));delete _0x217f77[_0xcd58('0x13')][_0x339897];_0x1103d9(ut[_0xcd58('0x77')]('Contact\x20in\x20black\x20List',_0x239071,_0x36a642));}});};Preview[_0xcd58('0xd')][_0xcd58('0x9b')]=function(_0x8c95f3){return!_[_0xcd58('0x6a')](_0x8c95f3)&&!_[_0xcd58('0x6a')](_0x8c95f3[_0xcd58('0x22')])&&!_['isNil'](_0x8c95f3['active'])&&_0x8c95f3[_0xcd58('0x4b')]&&!_[_0xcd58('0x6a')](this['trunks'][util['format'](_0xcd58('0x10f'),_0x8c95f3[_0xcd58('0x22')])])&&!_[_0xcd58('0x6a')](this[_0xcd58('0x12')][util[_0xcd58('0x50')]('SIP/%s',_0x8c95f3[_0xcd58('0x22')])]['status'])&&(this[_0xcd58('0x12')][util[_0xcd58('0x50')](_0xcd58('0x10f'),_0x8c95f3['name'])][_0xcd58('0x74')]===_0xcd58('0x110')||this[_0xcd58('0x12')][util[_0xcd58('0x50')](_0xcd58('0x10f'),_0x8c95f3[_0xcd58('0x22')])]['status']===_0xcd58('0x111'));};Preview[_0xcd58('0xd')][_0xcd58('0x88')]=function(_0x3c1e71,_0x18d295){var _0x50a427=this;return new BPromise(function(_0x22962c,_0x125c45){_0x50a427[_0xcd58('0x112')](_0x3c1e71,_0x18d295)['then'](function(_0x5f5145){_0x22962c(_[_0xcd58('0x70')](_0x5f5145,[_0xcd58('0x77')]));})['catch'](function(_0x1b512e){if(_0x1b512e[_0xcd58('0x113')]){rpcDb[_0xcd58('0x114')](_0x3c1e71);}if(_0x1b512e[_0xcd58('0x4b')]){rpcDb[_0xcd58('0x8c')](_0x3c1e71);}_0x125c45(_[_0xcd58('0x70')](_0x1b512e,['message']));});});};Preview['prototype'][_0xcd58('0x112')]=function(_0xad0a9a,_0x538683){var _0x4097aa=this;return new BPromise(function(_0x144c14,_0x137516){var _0x1af61a,_0xe81813;rpcDb[_0xcd58('0x115')](_0xad0a9a)[_0xcd58('0x89')](function(_0x3c8f98){if(!_[_0xcd58('0x6a')](_0x3c8f98[0x0])){_0xe81813=_0x3c8f98[0x0][_0xcd58('0x116')]?![]:!![];_0x1af61a=_0x3c8f98[0x0][_0xcd58('0x116')]?!![]:![];_0x1af61a=_0x538683?!![]:_0x1af61a;}var _0x35ff7f=_0x4097aa[_0xcd58('0x117')](_0x3c8f98);if(_0x35ff7f[_0xcd58('0x118')]){rpcDb['checkIsBlackList'](_[_0xcd58('0x70')](_0x3c8f98[0x0],[_0xcd58('0x73'),_0xcd58('0x119')]))[_0xcd58('0x89')](function(_0x5ca4d2){_0x4097aa['checkInBlack'](_0x5ca4d2,_0x3c8f98[0x0],_0x538683,_0xe81813,_0x1af61a)[_0xcd58('0x89')](function(_0x283384){_0x144c14(_0x283384);})[_0xcd58('0x76')](function(_0x4b4ce2){_0x137516(_0x4b4ce2);});})[_0xcd58('0x76')](function(_0x3c0cb2){ut['logger']('[Preview][checkIsBlackList]',_0x3c0cb2);_0x137516(ut[_0xcd58('0x77')]('Call\x20unsuccessful',_0xe81813,_0x1af61a));});}else{_0x137516(ut[_0xcd58('0x77')](_0x35ff7f[_0xcd58('0x77')],_0xe81813,_0x1af61a));}})['catch'](function(_0x593d54){ut[_0xcd58('0x5e')](_0xcd58('0x11a'),_0x593d54);_0x137516(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0xcd58('0xd')][_0xcd58('0x117')]=function(_0x5fceaa){if(_[_0xcd58('0x6a')](_0x5fceaa)||_[_0xcd58('0x106')](_0x5fceaa)||!_[_0xcd58('0x6a')](_0x5fceaa[0x0]['Agent'])&&_[_0xcd58('0x6a')](_0x5fceaa[0x0][_0xcd58('0x86')][_0xcd58('0x22')])){ut['logger'](_0xcd58('0x11b'),_0x5fceaa);return{'isValid':![],'message':_0xcd58('0x11c')};}var _0x55409d=this[_0xcd58('0x61')][_0x5fceaa[0x0][_0xcd58('0x6c')]['name']];_0x55409d[_0xcd58('0x77')]='ACTIVE';if(_[_0xcd58('0x6a')](_0x55409d)){ut[_0xcd58('0x5e')]('[Preview][validateContact][Empty\x20Campaign]',_0x55409d);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x55409d[_0xcd58('0x4a')])){ut[_0xcd58('0x5e')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xcd58('0x11d')+_0x55409d['name']+_0xcd58('0x11e'));if(!this[_0xcd58('0x9b')](_0x55409d[_0xcd58('0x9c')])){ut['logger'](_0xcd58('0x11f'),_0x55409d[_0xcd58('0x22')]+_0xcd58('0x120'));return{'isValid':![],'message':_0xcd58('0x121')};}}if(!ut[_0xcd58('0x9a')](_0x55409d['dialActive'])){ut['logger'](_0xcd58('0x122'),_0x55409d['name']+_0xcd58('0x123'));return{'isValid':![],'message':_0xcd58('0x11d')+_0x55409d[_0xcd58('0x22')]+_0xcd58('0x123')};}return{'isValid':!![],'message':_0xcd58('0x124')};};Preview[_0xcd58('0xd')]['execCall']=function(_0x462553,_0x44c6d5,_0xca198c,_0x135db8){var _0x5d2722=this;return new BPromise(function(_0xfb975,_0x56da7f){var _0x118424=_0x462553['uniqueid'];var _0x39de0f=_0x5d2722[_0xcd58('0x9b')](_0x44c6d5[_0xcd58('0x4a')])?util[_0xcd58('0x50')]('SIP/%s/%s%s',_0x44c6d5[_0xcd58('0x4a')][_0xcd58('0x22')],_[_0xcd58('0x6a')](_0x44c6d5['dialPrefix'])?'':_0x44c6d5[_0xcd58('0x31')]['trim']()||'',_0x44c6d5[_0xcd58('0x125')]>0x0?_0xca198c[_0xcd58('0x103')][_0xcd58('0x104')][_0xcd58('0x126')](_0x44c6d5[_0xcd58('0x125')]):_0xca198c[_0xcd58('0x103')]['phone']):util[_0xcd58('0x50')](_0xcd58('0x127'),_[_0xcd58('0x6a')](_0x44c6d5['TrunkBackup'])?_0x44c6d5[_0xcd58('0x4a')][_0xcd58('0x22')]:_0x44c6d5['TrunkBackup'][_0xcd58('0x22')],_[_0xcd58('0x6a')](_0x44c6d5['dialPrefix'])?'':_0x44c6d5[_0xcd58('0x31')][_0xcd58('0x128')]()||'',_0x44c6d5[_0xcd58('0x125')]>0x0?_0xca198c[_0xcd58('0x103')][_0xcd58('0x104')][_0xcd58('0x126')](_0x44c6d5[_0xcd58('0x125')]):_0xca198c[_0xcd58('0x103')]['phone']);var _0x2cf402=_0x5d2722[_0xcd58('0x9b')](_0x44c6d5[_0xcd58('0x4a')])?ut[_0xcd58('0x129')](_0x44c6d5[_0xcd58('0x4a')][_0xcd58('0x4c')],_0x44c6d5[_0xcd58('0x2e')],_0x44c6d5[_0xcd58('0x12a')]>0x0?ut[_0xcd58('0x12b')](_0x44c6d5['dialOriginateCallerIdNumber'],_0x44c6d5[_0xcd58('0x12a')]):_0x44c6d5[_0xcd58('0x2f')]):ut[_0xcd58('0x129')](_[_0xcd58('0x6a')](_0x44c6d5[_0xcd58('0x9c')])?_0x44c6d5[_0xcd58('0x4a')]['callerid']:_0x44c6d5['TrunkBackup'][_0xcd58('0x4c')],_0x44c6d5['dialOriginateCallerIdName'],_0x44c6d5[_0xcd58('0x12a')]>0x0?ut['getCallerIdRandom'](_0x44c6d5[_0xcd58('0x2f')],_0x44c6d5[_0xcd58('0x12a')]):_0x44c6d5[_0xcd58('0x2f')]);if(_0x2cf402){_0x462553[_0xcd58('0x12c')]=ut['extractCalleridName'](_0x2cf402);_0x462553['originatecalleridnum']=ut[_0xcd58('0x12d')](_0x2cf402);}var _0x3efb31=ut[_0xcd58('0x12e')](_0x44c6d5,_0xca198c,_0x39de0f,_0x2cf402,_0x118424,_0x462553);_[_0xcd58('0x12f')](_0x462553,ut[_0xcd58('0x130')](_0x3efb31));_0x462553[_0xcd58('0x8d')]=moment()[_0xcd58('0x50')](_0xcd58('0x8e'));ami[_0xcd58('0x131')](ut[_0xcd58('0x132')](_0x462553,_0x44c6d5,_0x3efb31,_0x462553[_0xcd58('0xab')],_0x135db8))[_0xcd58('0x89')](function(_0x596b9b){_0x44c6d5['originated']+=0x1;logger['info']('[originated][increment]',_0x118424,'\x20Queue',_0x44c6d5[_0xcd58('0x22')],_0xcd58('0x6e'),_0x44c6d5[_0xcd58('0x59')]);_0xfb975(_0x596b9b);})[_0xcd58('0x76')](function(_0x4922f9){ut['logAgent'](_0x462553,0xe,_0xcd58('0x133'));rpcDb[_0xcd58('0xfc')](_0x462553,_0xcd58('0x134'));_0x56da7f(_0x4922f9);});});};Preview[_0xcd58('0xd')][_0xcd58('0x135')]=function(_0x6766ab){if(this[_0xcd58('0x13')][_0x6766ab[_0xcd58('0xac')]]){this[_0xcd58('0x13')][_0x6766ab['linkedid']][_0xcd58('0x75')]=_0x6766ab[_0xcd58('0x75')];}};Preview[_0xcd58('0xd')][_0xcd58('0x17')]=function(_0x289cfa){var _0x1301a1=this;var _0x2c1d17=this[_0xcd58('0x13')][_0x289cfa[_0xcd58('0x136')]];if(_0x2c1d17){if(_0x2c1d17[_0xcd58('0x105')]&&this[_0xcd58('0x14')][_0x2c1d17['lookAgent']]){ut[_0xcd58('0x137')](_0x2c1d17,this[_0xcd58('0x14')][_0x2c1d17[_0xcd58('0x105')]][_0xcd58('0x22')],this[_0xcd58('0x14')][_0x2c1d17[_0xcd58('0x105')]]['id']);}var _0x2db176=_[_0xcd58('0x138')](_0x2c1d17);_0x2db176[_0xcd58('0xae')]=moment()[_0xcd58('0x50')](_0xcd58('0x8e'));var _0x5c4999=_0x1301a1[_0xcd58('0x61')][_0x2c1d17[_0xcd58('0x6d')]];if(ut[_0xcd58('0x139')](_0x289cfa[_0xcd58('0x13a')])){if(_0x2c1d17[_0xcd58('0xcb')]){rpcDb[_0xcd58('0x114')](_0x2c1d17['idContact']);}if(_0x2c1d17[_0xcd58('0xab')]){rpcDb[_0xcd58('0x8c')](_0x2c1d17[_0xcd58('0x107')]);}ami[_0xcd58('0x56')](_0xcd58('0x13b'),ut[_0xcd58('0xa2')](_0x2c1d17,'rejected',this[_0xcd58('0x61')][_0x2c1d17[_0xcd58('0x6d')]]));this[_0xcd58('0xf7')](_0x2db176,_0x5c4999,_0x289cfa);}else{_0x2c1d17['starttime']=moment()[_0xcd58('0x50')]('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x2db176,0x4,_0xcd58('0x13c'));rpcDb[_0xcd58('0xfc')](_0x2db176,_0xcd58('0x13d'));}}};Preview[_0xcd58('0xd')]['syncHangup']=function(_0x48e536){var _0x6b92=this;var _0x3dff36=this[_0xcd58('0x13')][_0x48e536[_0xcd58('0xac')]];var _0x44545f;if(_0x3dff36){_0x44545f=this[_0xcd58('0x61')][_0x3dff36['queue']];logger['info']('[syncHangup][talking]',_0x48e536[_0xcd58('0xac')],_0xcd58('0xb2'),_0x44545f[_0xcd58('0x22')],_0xcd58('0x6f'),_0x44545f[_0xcd58('0x25')]);}if(this[_0xcd58('0x13')][_0x48e536[_0xcd58('0xac')]]&&_0x48e536['linkedid']!==_0x48e536[_0xcd58('0xb1')]){if(_0x48e536['cause']==='16'&&this[_0xcd58('0x13')][_0x48e536[_0xcd58('0xac')]][_0xcd58('0x7a')]){this['callProgressDetectingCustomer'](_0x48e536,_0x48e536[_0xcd58('0xac')],_0x48e536['cause']);}else if(this[_0xcd58('0x13')][_0x48e536[_0xcd58('0xac')]]['dialAnswer']){logger[_0xcd58('0x53')](_0xcd58('0x13e'),_0x48e536['linkedid'],_0x48e536[_0xcd58('0x13f')],_0xcd58('0xb2'),_0x44545f['name'],_0xcd58('0x6f'),_0x44545f[_0xcd58('0x25')]);this['callProgressDetectingCustomer'](_0x48e536,_0x48e536[_0xcd58('0xac')],_0x48e536[_0xcd58('0x13f')]);}}else if(_0x3dff36&&_[_0xcd58('0x6a')](_0x3dff36['statedesc'])&&_0x44545f['dialQueueProject']&&_0x48e536['linkedid']===_0x48e536[_0xcd58('0xb1')]&&_[_0xcd58('0x6a')](_0x48e536[_0xcd58('0xfa')])&&_0x48e536['cause']==='16'&&_0x48e536['channelstate']==='6'&&_[_0xcd58('0xf9')](_0x3dff36[_0xcd58('0x140')])){if(_0x3dff36['unlockAgent']){rpcDb['unlockContact'](_0x3dff36[_0xcd58('0x107')]);}if(_0x3dff36[_0xcd58('0xab')]){rpcDb[_0xcd58('0x8c')](_0x3dff36[_0xcd58('0x107')]);}_0x48e536[_0xcd58('0xfa')]='22';this[_0xcd58('0xf7')](_0x3dff36,_0x44545f,_0x48e536);}else if(_0x3dff36&&_0x3dff36[_0xcd58('0x140')]){if(_0x48e536['cause']==='16'&&this['actions'][_0x48e536[_0xcd58('0xac')]][_0xcd58('0x7a')]){logger[_0xcd58('0x53')](_0xcd58('0x141'),_0x48e536[_0xcd58('0xac')],_0x48e536[_0xcd58('0x13f')],_0xcd58('0xb2'),_0x44545f['name'],'pTalking:\x20',_0x44545f[_0xcd58('0x25')]);this[_0xcd58('0x9e')](_0x48e536,_0x48e536[_0xcd58('0xac')],_0x48e536['cause']);}else if(this[_0xcd58('0x13')][_0x48e536[_0xcd58('0xac')]][_0xcd58('0x7a')]){logger[_0xcd58('0x53')](_0xcd58('0x13e'),_0x48e536['linkedid'],_0x48e536[_0xcd58('0x13f')],_0xcd58('0xb2'),_0x44545f[_0xcd58('0x22')],_0xcd58('0x6f'),_0x44545f[_0xcd58('0x25')]);this[_0xcd58('0x9e')](_0x48e536,_0x48e536['linkedid'],_0x48e536[_0xcd58('0x13f')]);}}};Preview['prototype'][_0xcd58('0x1b')]=function(_0x21a269){if(this[_0xcd58('0x13')][_0x21a269[_0xcd58('0x142')]]&&_0x21a269[_0xcd58('0x142')]!==_0x21a269[_0xcd58('0x143')]){this[_0xcd58('0x9e')](_0x21a269,_0x21a269[_0xcd58('0x142')],_0x21a269[_0xcd58('0xf3')]);}};Preview[_0xcd58('0xd')][_0xcd58('0x1a')]=function(_0x18fcdc){if(this[_0xcd58('0x13')][_0x18fcdc[_0xcd58('0xac')]]&&_0x18fcdc['linkedid']!==_0x18fcdc[_0xcd58('0xb1')]&&!this[_0xcd58('0x13')][_0x18fcdc[_0xcd58('0xac')]][_0xcd58('0x7a')]){if(_0x18fcdc[_0xcd58('0x13f')]==='1'){this['callProgressDetectingCustomer'](_0x18fcdc,_0x18fcdc[_0xcd58('0xac')],_0x18fcdc[_0xcd58('0x13f')]);}}};Preview[_0xcd58('0xd')][_0xcd58('0x144')]=function(_0x234334,_0x1c0900,_0xc0814d){if(this[_0xcd58('0x13')][_0x234334]){if(_[_0xcd58('0x6a')](this[_0xcd58('0x13')][_0x234334]['variables'])){this[_0xcd58('0x13')][_0x234334]['variables']={};}this[_0xcd58('0x13')][_0x234334]['variables'][_0x1c0900]=_0xc0814d;}};Preview[_0xcd58('0xd')][_0xcd58('0x145')]=function(_0x365cdb){try{if(!_[_0xcd58('0x6a')](_0x365cdb)){if(ut['filterKey'](_['keys'](_0x365cdb[_0xcd58('0x146')])[0x0])){this[_0xcd58('0x144')](_0x365cdb[_0xcd58('0xb1')],_[_0xcd58('0x147')](_0x365cdb[_0xcd58('0x146')])[0x0],_0x365cdb[_0xcd58('0x148')]);}}}catch(_0x30b74e){logger[_0xcd58('0x149')]('[syncVarSet][Preview]',util[_0xcd58('0x14a')](_0x30b74e,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xcd58('0x1f')]=function(_0x48871a){if(_0x48871a){if(this[_0xcd58('0x13')][_0x48871a[_0xcd58('0x14b')]]){this[_0xcd58('0x13')][_0x48871a['transfertargetlinkedid']][_0xcd58('0x140')]=!![];}}};Preview[_0xcd58('0xd')][_0xcd58('0x20')]=function(_0x4d09fc){if(_0x4d09fc){if(this[_0xcd58('0x13')][_0x4d09fc[_0xcd58('0x14c')]]){this[_0xcd58('0x13')][_0x4d09fc[_0xcd58('0x14c')]]['transfer']=!![];}}};module[_0xcd58('0x14d')]=Preview;
\ No newline at end of file
+var _0x6953=['[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','NOANSWER','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','unlockAgent','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer]','\x20Queue','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','Calling','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','disableContact','getContactPreview','recallme','isValid','checkIsBlackList','VoiceQueueId','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','logLookAgent','isFailure','unlockContact','idContact','custom:agentringnoanswer','callProgressDetectingAgent','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','variable','keys','value','error','[syncVarSet][Preview]','inspect','transfererlinkedid','exports','util','lodash','md5','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','defaults','localhost','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','available','loggedIn','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','Interval','stringify','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','prototype','syncCampaigns','dialMethod','booked','clearZombieChannels','hasOwnProperty','setMessage','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','Action','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','starttime','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','catch','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','activeContact','linkedid','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumBillable','talktime','countbusyretry','Busy','custom:agentbusy','busy','dialGlobalMaxRetry'];(function(_0x461981,_0x302d72){var _0x212fcd=function(_0x4d0db3){while(--_0x4d0db3){_0x461981['push'](_0x461981['shift']());}};_0x212fcd(++_0x302d72);}(_0x6953,0x91));var _0x3695=function(_0xcf7425,_0x2ec7b4){_0xcf7425=_0xcf7425-0x0;var _0xd76b28=_0x6953[_0xcf7425];return _0xd76b28;};'use strict';var util=require(_0x3695('0x0'));var _=require(_0x3695('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var md5=require(_0x3695('0x2'));var Redis=require('ioredis');var config=require(_0x3695('0x3'));var logger=require(_0x3695('0x4'))(_0x3695('0x5'));var loggerAction=require('../../../config/logger')(_0x3695('0x6'));var ami=require('../ami');var rpcDb=require(_0x3695('0x7'));var Action=require(_0x3695('0x8'));var ut=require(_0x3695('0x9'));config[_0x3695('0xa')]=_[_0x3695('0xb')](config['redis'],{'host':_0x3695('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3695('0xa')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0xd21435){this['tail']=this[_0x3695('0xd')]?this[_0x3695('0xd')][_0x3695('0xe')](_0xd21435):_0xd21435();};function Preview(_0x149594){this[_0x3695('0xf')]=new Sequence();this[_0x3695('0x10')]=_0x149594['voiceQueues'];this[_0x3695('0x11')]=_0x149594[_0x3695('0x11')];this[_0x3695('0x12')]={};this[_0x3695('0x13')]=_0x149594[_0x3695('0x13')];this[_0x3695('0x14')]=0x0;ami['on'](_0x3695('0x15'),this[_0x3695('0x16')][_0x3695('0x17')](this));ami['on'](_0x3695('0x18'),this[_0x3695('0x19')]['bind'](this));ami['on'](_0x3695('0x1a'),this[_0x3695('0x1b')][_0x3695('0x17')](this));ami['on'](_0x3695('0x1c'),this[_0x3695('0x1d')][_0x3695('0x17')](this));ami['on'](_0x3695('0x1e'),this['syncNewExten'][_0x3695('0x17')](this));ami['on']('varset',this[_0x3695('0x1f')][_0x3695('0x17')](this));ami['on'](_0x3695('0x20'),this[_0x3695('0x21')][_0x3695('0x17')](this));ami['on']('blindtransfer',this[_0x3695('0x22')][_0x3695('0x17')](this));this[_0x3695('0x23')](this[_0x3695('0x10')]);}function emit(_0xc076a9,_0x1ebba8,_0x34b0fc){io['to'](_0xc076a9)[_0x3695('0x24')](_0x1ebba8,_0x34b0fc);}function emitCampaignPreview(_0x1f267a){if(_0x1f267a[_0x3695('0x25')]===_0x3695('0x26')){var _0xf2c747={'id':_0x1f267a['id'],'name':_0x1f267a[_0x3695('0x27')],'strategy':_0x1f267a[_0x3695('0x28')],'answered':_0x1f267a['answered'],'available':_0x1f267a[_0x3695('0x29')],'loggedIn':_0x1f267a[_0x3695('0x2a')],'pTalking':_0x1f267a['pTalking'],'sumBillable':_0x1f267a['sumBillable'],'sumDuration':_0x1f267a[_0x3695('0x2b')],'sumHoldTime':_0x1f267a[_0x3695('0x2c')]||0x0,'talking':_0x1f267a[_0x3695('0x2d')],'total':_0x1f267a[_0x3695('0x2e')],'type':_0x1f267a['type'],'unmanaged':_0x1f267a[_0x3695('0x2f')],'abandoned':_0x1f267a['abandoned'],'waiting':_0x1f267a[_0x3695('0x30')],'loggedInDb':_0x1f267a['loggedInDb'],'dialActive':_0x1f267a[_0x3695('0x31')],'dialMethod':_0x1f267a['dialMethod'],'dialOriginateCallerIdName':_0x1f267a[_0x3695('0x32')],'dialOriginateCallerIdNumber':_0x1f267a[_0x3695('0x33')],'dialOriginateTimeout':_0x1f267a[_0x3695('0x34')],'dialPrefix':_0x1f267a[_0x3695('0x35')],'outboundAnswerAgiCallsDay':_0x1f267a[_0x3695('0x36')],'outboundAnswerCallsDay':_0x1f267a[_0x3695('0x37')],'outboundBlacklistCallsDay':_0x1f267a['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1f267a[_0x3695('0x38')],'outboundCongestionCallsDay':_0x1f267a[_0x3695('0x39')],'outboundDropCallsDayACS':_0x1f267a['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1f267a[_0x3695('0x3a')],'outboundDropCallsDayTimeout':_0x1f267a['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x1f267a[_0x3695('0x3b')],'outboundNoSuchCallsDay':_0x1f267a[_0x3695('0x3c')],'outboundOriginateFailureCallsDay':_0x1f267a[_0x3695('0x3d')],'outboundReCallsDay':_0x1f267a[_0x3695('0x3e')],'outboundRejectCallsDay':_0x1f267a[_0x3695('0x3f')],'outboundUnknownCallsDay':_0x1f267a[_0x3695('0x40')],'outboundAbandonedCallsDay':_0x1f267a[_0x3695('0x41')],'predictiveIntervalAnsweredCalls':_0x1f267a[_0x3695('0x42')],'predictiveIntervalAvgHoldtime':_0x1f267a['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1f267a[_0x3695('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x1f267a[_0x3695('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x1f267a[_0x3695('0x45')],'predictiveIntervalErlangCalls':_0x1f267a['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x1f267a['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1f267a[_0x3695('0x46')],'predictiveIntervalMultiplicativeFactor':_0x1f267a['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1f267a[_0x3695('0x47')],'predictiveIntervalAvailable':_0x1f267a[_0x3695('0x48')],'predictiveIntervalTotalCalls':_0x1f267a['predictiveIntervalTotalCalls'],'message':_0x1f267a[_0x3695('0x49')],'originated':_0x1f267a['originated'],'erlangCalls':_0x1f267a[_0x3695('0x4a')],'erlangCallToSecond':_0x1f267a[_0x3695('0x4b')],'erlangAbandonmentRate':_0x1f267a[_0x3695('0x4c')],'erlangBusyFactor':_0x1f267a[_0x3695('0x4d')],'startPredictive':_0x1f267a[_0x3695('0x4e')],'startProgressive':_0x1f267a[_0x3695('0x4f')]};if(_0x1f267a['Trunk']){_0xf2c747[_0x3695('0x50')]={'id':_0x1f267a[_0x3695('0x50')]['id'],'name':_0x1f267a['Trunk'][_0x3695('0x27')],'active':_0x1f267a[_0x3695('0x50')]['active'],'callerid':_0x1f267a['Trunk']['callerid']};}if(_0x1f267a['Interval']){_0xf2c747[_0x3695('0x51')]={'id':_0x1f267a[_0x3695('0x51')]['id'],'name':_0x1f267a['Interval'][_0x3695('0x27')]};}var _0x323e21=md5(JSON[_0x3695('0x52')](_0xf2c747));if(_0x1f267a[_0x3695('0x2')]!==_0x323e21){_0x1f267a['md5']=_0x323e21;emit(util['format'](_0x3695('0x53'),_0xf2c747[_0x3695('0x27')]),'voice_queue:save',_0xf2c747);}}}function emitVoiceQueueChannelRemove(_0x12ebe9){logger[_0x3695('0x54')](_0x3695('0x55'),JSON[_0x3695('0x52')](_0x12ebe9));emit(util[_0x3695('0x56')](_0x3695('0x53'),_0x12ebe9[_0x3695('0x27')]),_0x3695('0x57'),_0x12ebe9);io[_0x3695('0x24')](_0x3695('0x58'),_0x12ebe9);}function notSendMessagesQueue(_0x460b49){if(_0x460b49[_0x3695('0x59')]){if(_0x460b49[_0x3695('0x5a')]===0x0&&_0x460b49[_0x3695('0x5b')]===0x0){_0x460b49[_0x3695('0x59')]=![];_0x460b49[_0x3695('0x29')]=0x0;_0x460b49['paused']=0x0;_0x460b49[_0x3695('0x49')]=_0x3695('0x5c');ut[_0x3695('0x5d')](_0x3695('0x5e'),_0x460b49[_0x3695('0x27')]+_0x3695('0x5f'));}else{_0x460b49[_0x3695('0x49')]='IS_DISACTIVED';ut[_0x3695('0x5d')](_0x3695('0x5e'),_0x460b49[_0x3695('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x460b49);}}Preview[_0x3695('0x60')][_0x3695('0x23')]=function(){var _0x3ffc79=this;setInterval(function(){_0x3ffc79[_0x3695('0x61')]();},0x7cf);};Preview[_0x3695('0x60')][_0x3695('0x61')]=function(){var _0x4261d1=this['campaignsPreview'];this[_0x3695('0x14')]+=0x1;for(var _0x49a9d8 in _0x4261d1){if(_0x4261d1['hasOwnProperty'](_0x49a9d8)&&(_0x4261d1[_0x49a9d8][_0x3695('0x62')]==='preview'||_0x4261d1[_0x49a9d8][_0x3695('0x62')]===_0x3695('0x63'))&&_0x4261d1[_0x49a9d8][_0x3695('0x25')]===_0x3695('0x26')){if(this['clockClearZombieChannels']>0x7){this[_0x3695('0x14')]=0x0;this[_0x3695('0x64')]();}}if(_0x4261d1[_0x3695('0x65')](_0x49a9d8)&&_0x4261d1[_0x49a9d8]['dialMethod']===_0x3695('0x5')&&_0x4261d1[_0x49a9d8][_0x3695('0x25')]===_0x3695('0x26')){if(_0x4261d1[_0x49a9d8][_0x3695('0x31')]){this[_0x3695('0x66')](_0x4261d1[_0x49a9d8]);this[_0x3695('0x67')](_0x4261d1[_0x49a9d8]);}else{notSendMessagesQueue(_0x4261d1[_0x49a9d8]);}}}};Preview[_0x3695('0x60')][_0x3695('0x68')]=function(_0x3dd06a){var _0x5d5d70=this;this['sequence'][_0x3695('0x69')](function(){if(!_[_0x3695('0x6a')](_0x5d5d70[_0x3695('0x12')][_0x3dd06a])){loggerAction['info'](_0x3695('0x6b'),_0x3dd06a,_0x3695('0x6c'),_0x5d5d70[_0x3695('0x12')][_0x3dd06a]['queue'],_0x3695('0x6d'),JSON[_0x3695('0x52')](_0x5d5d70[_0x3695('0x10')][_0x5d5d70[_0x3695('0x12')][_0x3dd06a][_0x3695('0x6e')]]['originated']),_0x3695('0x6f'),JSON[_0x3695('0x52')](_0x5d5d70[_0x3695('0x10')][_0x5d5d70[_0x3695('0x12')][_0x3dd06a]['queue']][_0x3695('0x5b')]),JSON['stringify'](_0x5d5d70['actions'][_0x3dd06a][_0x3695('0x70')]),JSON[_0x3695('0x52')](_[_0x3695('0x71')](_0x5d5d70[_0x3695('0x12')][_0x3dd06a],[_0x3695('0x72'),'UserId','VoiceQueueId','ListId'])));return ami[_0x3695('0x73')]({'action':'status','channel':_0x5d5d70['actions'][_0x3dd06a]['channel']})['catch'](function(_0x3b1c1c){if(_0x3b1c1c[_0x3695('0x49')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x5d5d70[_0x3695('0x12')][_0x3dd06a]){ut[_0x3695('0x74')](_0x5d5d70['campaignsPreview'][_0x5d5d70['actions'][_0x3dd06a][_0x3695('0x6e')]],_0x3695('0x75'));if(_0x5d5d70[_0x3695('0x12')][_0x3dd06a]['dialAnswer']===!![]){ut[_0x3695('0x76')](_0x5d5d70[_0x3695('0x10')][_0x5d5d70[_0x3695('0x12')][_0x3dd06a][_0x3695('0x6e')]],_0x3695('0x75'));ut[_0x3695('0x77')](_0x3695('0x78')+_0x3dd06a,_0x5d5d70[_0x3695('0x12')][_0x3dd06a][_0x3695('0x6e')]);}ut[_0x3695('0x77')](_0x3695('0x79')+_0x3dd06a,_0x5d5d70[_0x3695('0x12')][_0x3dd06a][_0x3695('0x6e')]);delete _0x5d5d70[_0x3695('0x12')][_0x3dd06a];}},0x2328);}});}});};Preview[_0x3695('0x60')][_0x3695('0x64')]=function(){var _0x441997=this;loggerAction[_0x3695('0x54')](_0x3695('0x7a'),_[_0x3695('0x7b')](this[_0x3695('0x12')]));for(var _0x4148ec in this[_0x3695('0x12')]){if(_0x441997['actions']['hasOwnProperty'](_0x4148ec)){_0x441997[_0x3695('0x68')](_0x4148ec);}}};Preview[_0x3695('0x60')]['recallMe']=function(_0x323411){var _0x43f6f5=this;rpcDb[_0x3695('0x7c')](_0x323411['id'],ut[_0x3695('0x7d')](this[_0x3695('0x13')]))[_0x3695('0x7e')](function(_0x38d20c){if(!_[_0x3695('0x6a')](_0x38d20c)){for(var _0x520fd3=0x0;_0x520fd3<_0x38d20c[_0x3695('0x7f')];_0x520fd3+=0x1){if(ut['getDiff'](_0x38d20c[_0x520fd3][_0x3695('0x80')])<_0x323411[_0x3695('0x81')]*0x3c){if(_0x38d20c[_0x520fd3][_0x3695('0x82')]&&!_0x38d20c[_0x520fd3][_0x3695('0x82')][_0x3695('0x83')]){_0x43f6f5['run'](_0x38d20c[_0x520fd3]['id'])[_0x3695('0x7e')](ut[_0x3695('0x84')](_0x3695('0x85')))['catch'](ut[_0x3695('0x84')](_0x3695('0x85')));}else{rpcDb['disableContact'](_0x38d20c[_0x520fd3]['id']);}}else{var _0x47cd30=new Action(_0x38d20c[_0x520fd3],_0x323411);_0x47cd30[_0x3695('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x323411[_0x3695('0x3e')]+=0x1;ut[_0x3695('0x87')](_0x47cd30,0x17,_0x3695('0x88'));if(_0x323411[_0x3695('0x89')]){rpcDb[_0x3695('0x8a')](ut['createBody'](_0x38d20c[_0x520fd3]));rpcDb[_0x3695('0x8b')](_0x47cd30,_0x3695('0x8c'));}else{ut[_0x3695('0x87')](_0x47cd30,0x16,'RecallFailedTimeout');rpcDb[_0x3695('0x8b')](_0x47cd30,_0x3695('0x8d'));rpcDb[_0x3695('0x8e')](_0x47cd30,_0x3695('0x8d'));}}}}})[_0x3695('0x8f')](ut[_0x3695('0x84')]('[getContactRecallMe]'));};Preview[_0x3695('0x60')][_0x3695('0x66')]=function(_0x41e8de){_0x41e8de[_0x3695('0x59')]=!![];if(ut[_0x3695('0x90')](_0x41e8de['loggedIn'])){_0x41e8de[_0x3695('0x49')]=_0x3695('0x91');}else if(!ut[_0x3695('0x92')](_0x41e8de[_0x3695('0x31')])){_0x41e8de[_0x3695('0x49')]=_0x3695('0x5c');}else if(!this['isTrunkReachable'](_0x41e8de[_0x3695('0x50')])){if(!this[_0x3695('0x93')](_0x41e8de['TrunkBackup'])){_0x41e8de['message']=_0x3695('0x94');}else{_0x41e8de[_0x3695('0x49')]=_0x3695('0x95');}}else{_0x41e8de['message']=_0x3695('0x95');}emitCampaignPreview(_0x41e8de);};Preview[_0x3695('0x60')][_0x3695('0x96')]=function(_0x46ca05,_0x2f149a,_0x4e8d2a){var _0x41f968=this;var _0x4ed632=this['actions'][_0x2f149a];var _0x47def1=this[_0x3695('0x10')][_0x4ed632[_0x3695('0x6e')]];var _0xfe1cf7;if(_0x47def1){switch(_0x4e8d2a){case'1':_0x47def1[_0x3695('0x3c')]+=0x1;_0x4ed632[_0x3695('0x97')]+=0x1;_0x4ed632[_0x3695('0x98')]=ut[_0x3695('0x99')](_0x4ed632);ut[_0x3695('0x87')](_0x4ed632,0x0,_0x3695('0x9a'));ami[_0x3695('0x24')](_0x3695('0x9b'),ut[_0x3695('0x9c')](_0x4ed632,_0x3695('0x9d')));rpcDb[_0x3695('0x8b')](_0x4ed632,_0x3695('0x9e'));if(ut[_0x3695('0x99')](_0x4ed632)>=_0x47def1['dialGlobalMaxRetry']){_0xfe1cf7=ut[_0x3695('0x9f')](_0x4ed632,0xf,_0x3695('0xa0'));rpcDb[_0x3695('0x8e')](_0xfe1cf7,_0x3695('0xa1'));}else{if(_0x4ed632[_0x3695('0x97')]>=_0x47def1[_0x3695('0xa2')]){rpcDb['createCustomerFinal'](_0x4ed632,_0x3695('0xa1'));}else{rpcDb[_0x3695('0xa3')](ut['scheduledAt'](_0x4ed632,'countnosuchnumberretry',_0x47def1[_0x3695('0xa4')]),_0x4ed632['unlockAgent'],_0x4ed632[_0x3695('0xa5')]);}}delete this[_0x3695('0x12')][_0x46ca05[_0x3695('0xa6')]];break;case _0x3695('0xa7'):var _0x75339d=moment()['format'](_0x3695('0xa8'));_0x4ed632[_0x3695('0xa9')]=_0x75339d;_0x4ed632[_0x3695('0xaa')]=_0x75339d;_0x4ed632['dialAnswer']=!![];_0x47def1['pTalking']+=0x1;logger['info'](_0x3695('0xab'),_0x4ed632[_0x3695('0xac')],'\x20Queue',_0x47def1[_0x3695('0x27')],_0x3695('0x6f'),_0x47def1[_0x3695('0x5b')]);ami[_0x3695('0x24')](_0x3695('0xad'),ut[_0x3695('0x9c')](_0x4ed632,_0x3695('0xae'),this[_0x3695('0x10')][_0x4ed632['queue']]));if(_0x47def1[_0x3695('0xaf')]){ami[_0x3695('0x24')](_0x3695('0xb0'),ut[_0x3695('0xb1')](_0x4ed632));}break;case'16':ami[_0x3695('0x24')](_0x3695('0xb2'),ut[_0x3695('0x9c')](_0x4ed632,_0x3695('0xb3'),this['campaignsPreview'][_0x4ed632[_0x3695('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0x3695('0x9c')](_0x4ed632,_0x3695('0xb3')));_0x47def1[_0x3695('0x37')]+=0x1;_0x47def1[_0x3695('0x2e')]+=0x1;_0x47def1[_0x3695('0xb4')]+=0x1;ut[_0x3695('0x76')](_0x47def1,_0x3695('0xb5'));_0x4ed632[_0x3695('0x98')]=ut[_0x3695('0x99')](_0x4ed632);ut[_0x3695('0x87')](_0x4ed632,0x4,_0x3695('0xb6'));rpcDb[_0x3695('0x8b')](_0x4ed632,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x4ed632,_0x3695('0xb7'));rpcDb[_0x3695('0xb8')](_0x4ed632);_0x47def1[_0x3695('0x2b')]+=_0x4ed632['talktime'];_0x47def1[_0x3695('0xb9')]+=_0x4ed632[_0x3695('0xba')];logger[_0x3695('0x54')]('[syncHangup][talking][decrement]',_0x4ed632[_0x3695('0xac')],'\x20Queue',_0x47def1[_0x3695('0x27')],_0x3695('0x6f'),_0x47def1[_0x3695('0x5b')]);delete this[_0x3695('0x12')][_0x46ca05[_0x3695('0xa6')]];break;case'BUSY':_0x47def1[_0x3695('0x38')]+=0x1;_0x4ed632[_0x3695('0xbb')]+=0x1;_0x4ed632[_0x3695('0x98')]=ut[_0x3695('0x99')](_0x4ed632);ut[_0x3695('0x87')](_0x4ed632,0x5,_0x3695('0xbc'));ami[_0x3695('0x24')](_0x3695('0xbd'),ut['buildObj'](_0x4ed632,_0x3695('0xbe')));rpcDb['createCustomerHistory'](_0x4ed632,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x4ed632)>=_0x47def1[_0x3695('0xbf')]){_0xfe1cf7=ut[_0x3695('0x9f')](_0x4ed632,0xf,_0x3695('0xa0'));rpcDb['createCustomerFinal'](_0xfe1cf7,_0x3695('0xc0'));}else{if(_0x4ed632['countbusyretry']>=_0x47def1[_0x3695('0xc1')]){rpcDb[_0x3695('0x8e')](_0x4ed632,_0x3695('0xc2'));}else{rpcDb['rescheduleContact'](ut[_0x3695('0xc3')](_0x4ed632,_0x3695('0xbb'),_0x47def1['dialBusyRetryFrequency']),_0x4ed632['unlockAgent'],_0x4ed632['activeContact']);}}break;case _0x3695('0xc4'):_0x47def1[_0x3695('0x3b')]+=0x1;_0x4ed632[_0x3695('0xc5')]+=0x1;_0x4ed632['countglobal']=ut['totalGlobal'](_0x4ed632);ut['logCustomer'](_0x4ed632,0x3,'NoAnswer');ami['emit'](_0x3695('0xc6'),ut[_0x3695('0x9c')](_0x4ed632,_0x3695('0xc7')));rpcDb[_0x3695('0x8b')](_0x4ed632,_0x3695('0xc8'));if(ut[_0x3695('0x99')](_0x4ed632)>=_0x47def1['dialGlobalMaxRetry']){_0xfe1cf7=ut[_0x3695('0x9f')](_0x4ed632,0xf,_0x3695('0xa0'));rpcDb[_0x3695('0x8e')](_0xfe1cf7,_0x3695('0xc9'));}else{if(_0x4ed632[_0x3695('0xc5')]>=_0x47def1[_0x3695('0xca')]){rpcDb[_0x3695('0x8e')](_0x4ed632,_0x3695('0xc8'));}else{rpcDb[_0x3695('0xa3')](ut[_0x3695('0xc3')](_0x4ed632,_0x3695('0xc5'),_0x47def1[_0x3695('0xcb')]),_0x4ed632[_0x3695('0xcc')],_0x4ed632[_0x3695('0xa5')]);}}break;case _0x3695('0xcd'):_0x47def1[_0x3695('0x39')]+=0x1;_0x4ed632[_0x3695('0xce')]+=0x1;_0x4ed632[_0x3695('0x98')]=ut[_0x3695('0x99')](_0x4ed632);ut[_0x3695('0x87')](_0x4ed632,0x8,_0x3695('0xcf'));ami[_0x3695('0x24')](_0x3695('0xd0'),ut[_0x3695('0x9c')](_0x4ed632,_0x3695('0xd1')));rpcDb[_0x3695('0x8b')](_0x4ed632,_0x3695('0xd2'));if(ut['totalGlobal'](_0x4ed632)>=_0x47def1[_0x3695('0xbf')]){_0xfe1cf7=ut[_0x3695('0x9f')](_0x4ed632,0xf,'Global');rpcDb[_0x3695('0x8e')](_0xfe1cf7,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x4ed632[_0x3695('0xce')]>=_0x47def1['dialCongestionMaxRetry']){rpcDb[_0x3695('0x8e')](_0x4ed632,_0x3695('0xd2'));}else{rpcDb[_0x3695('0xa3')](ut[_0x3695('0xc3')](_0x4ed632,_0x3695('0xce'),_0x47def1[_0x3695('0xd3')]),_0x4ed632['unlockAgent'],_0x4ed632[_0x3695('0xa5')]);}}break;case _0x3695('0xd4'):_0x47def1[_0x3695('0x3f')]+=0x1;_0x4ed632[_0x3695('0xd5')]+=0x1;_0x4ed632[_0x3695('0x98')]=ut[_0x3695('0x99')](_0x4ed632);ut[_0x3695('0x87')](_0x4ed632,0x14,'AgentReject');ami['emit'](_0x3695('0xd6'),ut['buildObj'](_0x4ed632,_0x3695('0xd7')));rpcDb[_0x3695('0x8b')](_0x4ed632,_0x3695('0xd8'));if(ut[_0x3695('0x99')](_0x4ed632)>=_0x47def1['dialGlobalMaxRetry']){_0xfe1cf7=ut[_0x3695('0x9f')](_0x4ed632,0x14,_0x3695('0xd9'));rpcDb['createCustomerFinal'](_0xfe1cf7,_0x3695('0xda'));}else{if(_0x4ed632['countagentrejectretry']>=_0x47def1[_0x3695('0xdb')]){rpcDb[_0x3695('0x8e')](_0x4ed632,_0x3695('0xda'));}else{rpcDb[_0x3695('0xa3')](ut[_0x3695('0xc3')](_0x4ed632,_0x3695('0xd5'),_0x47def1[_0x3695('0xdc')]),_0x4ed632['unlockAgent'],_0x4ed632[_0x3695('0xa5')]);}}break;case _0x3695('0xdd'):_0x47def1[_0x3695('0x41')]+=0x1;_0x4ed632[_0x3695('0xde')]+=0x1;_0x4ed632[_0x3695('0x98')]=ut[_0x3695('0x99')](_0x4ed632);ut['logCustomer'](_0x4ed632,0xb,'Abandoned');rpcDb[_0x3695('0x8b')](_0x4ed632,'[callProgressDetectingCustomer][logAbandoned]');if(ut['totalGlobal'](_0x4ed632)>=_0x47def1[_0x3695('0xbf')]){_0xfe1cf7=ut['cloneAction'](_0x4ed632,0xf,_0x3695('0xa0'));rpcDb['createCustomerFinal'](_0xfe1cf7,_0x3695('0xdf'));}else{if(_0x4ed632[_0x3695('0xe0')]>=_0x47def1['dialAbandonedMaxRety']){rpcDb[_0x3695('0x8e')](_0x4ed632,_0x3695('0xdf'));}else{rpcDb[_0x3695('0xa3')](ut[_0x3695('0xc3')](_0x4ed632,'countabandonedretry',_0x47def1[_0x3695('0xe1')]),_0x4ed632[_0x3695('0xcc')],_0x4ed632[_0x3695('0xa5')]);}}break;case'18':_0x47def1[_0x3695('0x40')]+=0x1;_0x4ed632[_0x3695('0xe2')]+=0x1;_0x4ed632[_0x3695('0x98')]=ut['totalGlobal'](_0x4ed632);ut[_0x3695('0x87')](_0x4ed632,0x12,_0x46ca05[_0x3695('0xe3')]||_0x46ca05[_0x3695('0xe4')]);ami[_0x3695('0x24')]('custom:amd',ut['buildObj'](_0x4ed632,_0x3695('0xe5')));rpcDb['createCustomerHistory'](_0x4ed632,_0x3695('0xe6'));if(ut[_0x3695('0x99')](_0x4ed632)>=_0x47def1[_0x3695('0xbf')]){_0xfe1cf7=ut[_0x3695('0x9f')](_0x4ed632,0xf,_0x3695('0xa0'));rpcDb[_0x3695('0x8e')](_0xfe1cf7,_0x3695('0xe6'));}else{rpcDb['createCustomerFinal'](_0x4ed632,_0x3695('0xe6'));}delete this['actions'][_0x46ca05[_0x3695('0xa6')]];break;case'19':_0x47def1['outboundUnknownCallsDay']+=0x1;_0x4ed632['countglobal']=ut[_0x3695('0x99')](_0x4ed632);ut['logCustomer'](_0x4ed632,0x13,_0x46ca05[_0x3695('0xe3')]||_0x46ca05[_0x3695('0xe4')]);ami['emit'](_0x3695('0xe7'),ut[_0x3695('0x9c')](_0x4ed632,'amd'));rpcDb['createCustomerHistory'](_0x4ed632,_0x3695('0xe8'));if(ut['totalGlobal'](_0x4ed632)>=_0x47def1[_0x3695('0xbf')]){_0xfe1cf7=ut[_0x3695('0x9f')](_0x4ed632,0xf,_0x3695('0xa0'));rpcDb[_0x3695('0x8e')](_0xfe1cf7,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x3695('0x8e')](_0x4ed632,_0x3695('0xe8'));}delete this[_0x3695('0x12')][_0x46ca05[_0x3695('0xa6')]];break;default:if(_0x4ed632[_0x3695('0x70')]){ut[_0x3695('0x76')](_0x47def1,_0x3695('0xe9'));ut['loggerError'](_0x3695('0xea')+_0x47def1[_0x3695('0x27')],_0x46ca05);}_0x47def1[_0x3695('0x40')]+=0x1;_0x4ed632[_0x3695('0x98')]=ut[_0x3695('0x99')](_0x4ed632);ut[_0x3695('0x87')](_0x4ed632,0xc,_0x46ca05[_0x3695('0xe3')]||_0x46ca05[_0x3695('0xe4')]);rpcDb['createCustomerHistory'](_0x4ed632,_0x3695('0xeb'));if(ut['totalGlobal'](_0x4ed632)>=_0x47def1[_0x3695('0xbf')]){_0xfe1cf7=ut['cloneAction'](_0x4ed632,0xf,_0x3695('0xa0'));rpcDb[_0x3695('0x8e')](_0xfe1cf7,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x3695('0x8e')](_0x4ed632,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x3695('0x12')][_0x46ca05[_0x3695('0xa6')]];}if(!(_0x4ed632[_0x3695('0x70')]&&_0x4e8d2a==='16')){ut[_0x3695('0x74')](_0x47def1,_0x3695('0xec'));logger[_0x3695('0x54')]('[originated][decrement][callProgressDetectingCustomer]',_0x4ed632[_0x3695('0xac')],_0x3695('0xed'),_0x47def1['name'],_0x3695('0x6d'),_0x47def1[_0x3695('0x5a')]);}if(_0x4e8d2a!==_0x3695('0xa7')){delete this['actions'][_0x46ca05['linkedid']];delete this[_0x3695('0x12')][_0x46ca05['destlinkedid']];}}};Preview[_0x3695('0x60')]['callProgressDetectingAgent']=function(_0x287f2d,_0x554a34,_0x458976){if(_[_0x3695('0xee')](_0x554a34)&&'object'!==typeof _0x554a34){return;}if(_['isUndefined'](_0x458976)&&'object'!==typeof _0x458976){return;}switch(_0x458976[_0x3695('0xef')]){case'0':ut[_0x3695('0xf0')](_0x287f2d,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x287f2d,_0x3695('0xf1'));break;case'3':ut[_0x3695('0xf0')](_0x287f2d,0x3,'NoAnswer');rpcDb[_0x3695('0xf2')](_0x287f2d,_0x3695('0xf3'));break;case'5':ut[_0x3695('0xf0')](_0x287f2d,0x5,_0x3695('0xbc'));rpcDb[_0x3695('0xf2')](_0x287f2d,_0x3695('0xf4'));break;case'8':ut[_0x3695('0xf0')](_0x287f2d,0x8,_0x3695('0xcf'));rpcDb['createAgentHistory'](_0x287f2d,_0x3695('0xf5'));break;case'22':ut[_0x3695('0xf0')](_0x287f2d,0x16,'AnswerAGI');rpcDb[_0x3695('0xf2')](_0x287f2d,_0x3695('0xf6'));break;default:ut[_0x3695('0xf0')](_0x287f2d,0xc,_0x458976[_0x3695('0xef')]);rpcDb[_0x3695('0xf2')](_0x287f2d,'[callProgressDetectingAgent][logCongestion]');}ut[_0x3695('0x74')](_0x554a34,_0x3695('0xf7'));logger[_0x3695('0x54')](_0x3695('0xf8'),_0x287f2d['uniqueid'],_0x3695('0xed'),_0x554a34[_0x3695('0x27')],_0x3695('0x6d'),_0x554a34[_0x3695('0x5a')]);delete this[_0x3695('0x12')][_0x287f2d['uniqueid']];};Preview[_0x3695('0x60')][_0x3695('0xf9')]=function(_0xc6fcfe,_0xd00c2,_0x15b654,_0x457f01,_0x106f3d){var _0xd8e854=this;return new BPromise(function(_0x2cdbac,_0x59160d){if(_[_0x3695('0x6a')](_0xd00c2)||_[_0x3695('0x6a')](_0xd00c2['Contact'])||_['isNil'](_0xd00c2[_0x3695('0xfa')][_0x3695('0xfb')])||_[_0x3695('0x6a')](_0xd00c2['VoiceQueueId'])){_0x59160d(ut[_0x3695('0x49')](_0x3695('0xfc'),_0x457f01,_0x106f3d));return;}var _0x4ece50=uuid['v4']();var _0x4fd970=_0xd8e854[_0x3695('0x10')][_0xd00c2[_0x3695('0x6c')][_0x3695('0x27')]];var _0x4c3b9d=_0x15b654?_0xd8e854[_0x3695('0x13')][_0x15b654]['id']:undefined;_0xd8e854['actions'][_0x4ece50]=new Action(_0xd00c2,_0x4fd970,_0x4ece50,_0x15b654,_0x4c3b9d);var _0x3ff010=_0xd8e854[_0x3695('0x12')][_0x4ece50];_0x3ff010['unlockAgent']=_0x457f01;_0x3ff010[_0x3695('0xa5')]=_0x106f3d;_0x3ff010[_0x3695('0xfd')]=_0x15b654;if(_[_0x3695('0xfe')](_0xc6fcfe)){_0xd8e854[_0x3695('0xff')](_0x3ff010,_0x4fd970,_0xd00c2,_0x15b654)['then'](function(_0x52c2ad){logger['info']('[Preview][execCall][success]',_0x3695('0x100')+_0x3ff010[_0x3695('0x6e')]+_0x3695('0x101')+_0x3ff010['idContact'],JSON['stringify'](_0x52c2ad));ami[_0x3695('0x24')](_0x3695('0x102'),ut[_0x3695('0x9c')](_0x3ff010,'called',_0xd8e854[_0x3695('0x10')][_0x3ff010[_0x3695('0x6e')]]));_0x2cdbac(ut[_0x3695('0x49')](_0x3695('0x103')));})[_0x3695('0x8f')](function(_0x4c2121){ut['logger']('[Preview][execCall][failure]',_0x4c2121);_0x59160d(ut[_0x3695('0x49')](_0x3695('0x104'),_0x457f01,_0x106f3d));});}else{_0x4fd970[_0x3695('0x105')]+=0x1;ut[_0x3695('0x106')](_0x3ff010);rpcDb[_0x3695('0x107')](_0x3ff010,'[Blacklist][error]');delete _0xd8e854[_0x3695('0x12')][_0x4ece50];_0x59160d(ut['message'](_0x3695('0x108'),_0x457f01,_0x106f3d));}});};Preview['prototype'][_0x3695('0x93')]=function(_0x767379){return!_[_0x3695('0x6a')](_0x767379)&&!_['isNil'](_0x767379['name'])&&!_['isNil'](_0x767379[_0x3695('0x109')])&&_0x767379[_0x3695('0x109')]&&!_[_0x3695('0x6a')](this[_0x3695('0x11')][util[_0x3695('0x56')](_0x3695('0x10a'),_0x767379[_0x3695('0x27')])])&&!_[_0x3695('0x6a')](this[_0x3695('0x11')][util[_0x3695('0x56')](_0x3695('0x10a'),_0x767379[_0x3695('0x27')])][_0x3695('0x10b')])&&(this[_0x3695('0x11')][util[_0x3695('0x56')](_0x3695('0x10a'),_0x767379[_0x3695('0x27')])]['status']===_0x3695('0x10c')||this[_0x3695('0x11')][util[_0x3695('0x56')](_0x3695('0x10a'),_0x767379['name'])][_0x3695('0x10b')]===_0x3695('0x10d'));};Preview[_0x3695('0x60')]['run']=function(_0x19cdbb,_0x2d2afc){var _0x17c090=this;return new BPromise(function(_0x56dd41,_0x52768a){_0x17c090[_0x3695('0x10e')](_0x19cdbb,_0x2d2afc)['then'](function(_0x598f40){_0x56dd41(_[_0x3695('0x71')](_0x598f40,[_0x3695('0x49')]));})['catch'](function(_0x1b47e6){if(_0x1b47e6[_0x3695('0x10f')]){rpcDb['unlockContact'](_0x19cdbb);}if(_0x1b47e6[_0x3695('0x109')]){rpcDb[_0x3695('0x110')](_0x19cdbb);}_0x52768a(_[_0x3695('0x71')](_0x1b47e6,[_0x3695('0x49')]));});});};Preview[_0x3695('0x60')][_0x3695('0x10e')]=function(_0x9c6ba5,_0x2481c9){var _0x399bfd=this;return new BPromise(function(_0x18cd28,_0xd7d33a){var _0xd79f74,_0x170f71;rpcDb[_0x3695('0x111')](_0x9c6ba5)['then'](function(_0x2b675c){if(!_['isNil'](_0x2b675c[0x0])){_0x170f71=_0x2b675c[0x0][_0x3695('0x112')]?![]:!![];_0xd79f74=_0x2b675c[0x0][_0x3695('0x112')]?!![]:![];_0xd79f74=_0x2481c9?!![]:_0xd79f74;}var _0x4b8ce8=_0x399bfd['validateContact'](_0x2b675c);if(_0x4b8ce8[_0x3695('0x113')]){rpcDb[_0x3695('0x114')](_['pick'](_0x2b675c[0x0],[_0x3695('0x115'),_0x3695('0x116')]))[_0x3695('0x7e')](function(_0x29467a){_0x399bfd[_0x3695('0xf9')](_0x29467a,_0x2b675c[0x0],_0x2481c9,_0x170f71,_0xd79f74)[_0x3695('0x7e')](function(_0x3dd8f0){_0x18cd28(_0x3dd8f0);})[_0x3695('0x8f')](function(_0xe3a87b){_0xd7d33a(_0xe3a87b);});})[_0x3695('0x8f')](function(_0x31e7d3){ut[_0x3695('0x5d')]('[Preview][checkIsBlackList]',_0x31e7d3);_0xd7d33a(ut[_0x3695('0x49')](_0x3695('0x117'),_0x170f71,_0xd79f74));});}else{_0xd7d33a(ut[_0x3695('0x49')](_0x4b8ce8[_0x3695('0x49')],_0x170f71,_0xd79f74));}})[_0x3695('0x8f')](function(_0x1b9285){ut[_0x3695('0x5d')](_0x3695('0x118'),_0x1b9285);_0xd7d33a(ut[_0x3695('0x49')](_0x3695('0x117'),![],!![]));});});};Preview[_0x3695('0x60')][_0x3695('0x119')]=function(_0x1b152f){if(_['isNil'](_0x1b152f)||_[_0x3695('0xfe')](_0x1b152f)||!_['isNil'](_0x1b152f[0x0][_0x3695('0x82')])&&_[_0x3695('0x6a')](_0x1b152f[0x0]['Agent']['name'])){ut[_0x3695('0x5d')](_0x3695('0x11a'),_0x1b152f);return{'isValid':![],'message':_0x3695('0x11b')};}var _0x323ba3=this[_0x3695('0x10')][_0x1b152f[0x0][_0x3695('0x6c')][_0x3695('0x27')]];_0x323ba3['message']='ACTIVE';if(_[_0x3695('0x6a')](_0x323ba3)){ut[_0x3695('0x5d')]('[Preview][validateContact][Empty\x20Campaign]',_0x323ba3);return{'isValid':![],'message':_0x3695('0x11c')};}if(!this[_0x3695('0x93')](_0x323ba3[_0x3695('0x50')])){ut[_0x3695('0x5d')](_0x3695('0x11d'),'campaign\x20Name:\x20'+_0x323ba3[_0x3695('0x27')]+_0x3695('0x11e'));if(!this[_0x3695('0x93')](_0x323ba3[_0x3695('0x11f')])){ut[_0x3695('0x5d')](_0x3695('0x11d'),_0x323ba3[_0x3695('0x27')]+_0x3695('0x120'));return{'isValid':![],'message':_0x3695('0x121')};}}if(!ut[_0x3695('0x92')](_0x323ba3[_0x3695('0x31')])){ut[_0x3695('0x5d')](_0x3695('0x122'),_0x323ba3[_0x3695('0x27')]+_0x3695('0x123'));return{'isValid':![],'message':_0x3695('0x124')+_0x323ba3['name']+_0x3695('0x123')};}return{'isValid':!![],'message':_0x3695('0x125')};};Preview[_0x3695('0x60')][_0x3695('0xff')]=function(_0x39129b,_0x3f388e,_0x562bad,_0x1a6289){var _0x2e2499=this;return new BPromise(function(_0x2fd576,_0x504811){var _0x5809ef=_0x39129b[_0x3695('0xac')];var _0x5c598d=_0x2e2499[_0x3695('0x93')](_0x3f388e[_0x3695('0x50')])?util['format'](_0x3695('0x126'),_0x3f388e['Trunk'][_0x3695('0x27')],_['isNil'](_0x3f388e[_0x3695('0x35')])?'':_0x3f388e[_0x3695('0x35')][_0x3695('0x127')]()||'',_0x3f388e[_0x3695('0x128')]>0x0?_0x562bad[_0x3695('0xfa')][_0x3695('0xfb')][_0x3695('0x129')](_0x3f388e[_0x3695('0x128')]):_0x562bad['Contact'][_0x3695('0xfb')]):util[_0x3695('0x56')](_0x3695('0x126'),_['isNil'](_0x3f388e[_0x3695('0x11f')])?_0x3f388e['Trunk'][_0x3695('0x27')]:_0x3f388e[_0x3695('0x11f')]['name'],_[_0x3695('0x6a')](_0x3f388e[_0x3695('0x35')])?'':_0x3f388e[_0x3695('0x35')][_0x3695('0x127')]()||'',_0x3f388e[_0x3695('0x128')]>0x0?_0x562bad['Contact']['phone'][_0x3695('0x129')](_0x3f388e[_0x3695('0x128')]):_0x562bad[_0x3695('0xfa')][_0x3695('0xfb')]);var _0x30e9dc=_0x2e2499[_0x3695('0x93')](_0x3f388e['Trunk'])?ut[_0x3695('0x12a')](_0x3f388e[_0x3695('0x50')][_0x3695('0x12b')],_0x3f388e['dialOriginateCallerIdName'],_0x3f388e['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x3f388e[_0x3695('0x33')],_0x3f388e[_0x3695('0x12c')]):_0x3f388e['dialOriginateCallerIdNumber']):ut[_0x3695('0x12a')](_[_0x3695('0x6a')](_0x3f388e[_0x3695('0x11f')])?_0x3f388e[_0x3695('0x50')][_0x3695('0x12b')]:_0x3f388e[_0x3695('0x11f')][_0x3695('0x12b')],_0x3f388e['dialOriginateCallerIdName'],_0x3f388e[_0x3695('0x12c')]>0x0?ut[_0x3695('0x12d')](_0x3f388e[_0x3695('0x33')],_0x3f388e['dialRandomLastDigitCallerIdNumber']):_0x3f388e[_0x3695('0x33')]);if(_0x30e9dc){_0x39129b['originatecalleridname']=ut[_0x3695('0x12e')](_0x30e9dc);_0x39129b[_0x3695('0x12f')]=ut[_0x3695('0x130')](_0x30e9dc);}var _0x21d299=ut[_0x3695('0x131')](_0x3f388e,_0x562bad,_0x5c598d,_0x30e9dc,_0x5809ef,_0x39129b);_[_0x3695('0x132')](_0x39129b,ut[_0x3695('0x133')](_0x21d299));_0x39129b[_0x3695('0x86')]=moment()[_0x3695('0x56')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x3695('0x73')](ut[_0x3695('0x134')](_0x39129b,_0x3f388e,_0x21d299,_0x39129b['activeContact'],_0x1a6289))[_0x3695('0x7e')](function(_0x1f8421){_0x3f388e[_0x3695('0x5a')]+=0x1;logger[_0x3695('0x54')]('[originated][increment]',_0x5809ef,'\x20Queue',_0x3f388e['name'],_0x3695('0x6d'),_0x3f388e[_0x3695('0x5a')]);_0x2fd576(_0x1f8421);})['catch'](function(_0x5d0359){ut['logAgent'](_0x39129b,0xe,_0x3695('0x135'));rpcDb['createAgentHistory'](_0x39129b,_0x3695('0x136'));_0x504811(_0x5d0359);});});};Preview[_0x3695('0x60')][_0x3695('0x137')]=function(_0x331e5c){if(this[_0x3695('0x12')][_0x331e5c[_0x3695('0xa6')]]){this['actions'][_0x331e5c[_0x3695('0xa6')]][_0x3695('0x138')]=_0x331e5c[_0x3695('0x138')];}};Preview['prototype']['syncOriginateResponse']=function(_0x34c94f){var _0xcf5bad=this;var _0x1ee6f4=this[_0x3695('0x12')][_0x34c94f['actionid']];if(_0x1ee6f4){if(_0x1ee6f4['lookAgent']&&this[_0x3695('0x13')][_0x1ee6f4['lookAgent']]){ut[_0x3695('0x139')](_0x1ee6f4,this[_0x3695('0x13')][_0x1ee6f4[_0x3695('0xfd')]][_0x3695('0x27')],this[_0x3695('0x13')][_0x1ee6f4[_0x3695('0xfd')]]['id']);}var _0x2a5557=_['clone'](_0x1ee6f4);_0x2a5557[_0x3695('0xa9')]=moment()[_0x3695('0x56')](_0x3695('0xa8'));var _0x3c5f9e=_0xcf5bad['campaignsPreview'][_0x1ee6f4[_0x3695('0x6e')]];if(ut[_0x3695('0x13a')](_0x34c94f['response'])){if(_0x1ee6f4[_0x3695('0xcc')]){rpcDb[_0x3695('0x13b')](_0x1ee6f4['idContact']);}if(_0x1ee6f4[_0x3695('0xa5')]){rpcDb[_0x3695('0x110')](_0x1ee6f4[_0x3695('0x13c')]);}ami[_0x3695('0x24')](_0x3695('0x13d'),ut[_0x3695('0x9c')](_0x1ee6f4,'rejected',this[_0x3695('0x10')][_0x1ee6f4[_0x3695('0x6e')]]));this[_0x3695('0x13e')](_0x2a5557,_0x3c5f9e,_0x34c94f);}else{_0x1ee6f4['starttime']=moment()['format'](_0x3695('0xa8'));ut['logAgent'](_0x2a5557,0x4,_0x3695('0xb6'));rpcDb[_0x3695('0xf2')](_0x2a5557,_0x3695('0x13f'));}}};Preview['prototype'][_0x3695('0x19')]=function(_0x5dd597){var _0x799c35=this;var _0x9dbefe=this[_0x3695('0x12')][_0x5dd597[_0x3695('0xa6')]];var _0x29aa4c;if(_0x9dbefe){_0x29aa4c=this[_0x3695('0x10')][_0x9dbefe[_0x3695('0x6e')]];logger[_0x3695('0x54')]('[syncHangup][talking]',_0x5dd597[_0x3695('0xa6')],_0x3695('0xed'),_0x29aa4c[_0x3695('0x27')],_0x3695('0x6f'),_0x29aa4c[_0x3695('0x5b')]);}if(this['actions'][_0x5dd597[_0x3695('0xa6')]]&&_0x5dd597[_0x3695('0xa6')]!==_0x5dd597[_0x3695('0xac')]){if(_0x5dd597[_0x3695('0x140')]==='16'&&this[_0x3695('0x12')][_0x5dd597[_0x3695('0xa6')]][_0x3695('0x70')]){this['callProgressDetectingCustomer'](_0x5dd597,_0x5dd597[_0x3695('0xa6')],_0x5dd597[_0x3695('0x140')]);}else if(this[_0x3695('0x12')][_0x5dd597[_0x3695('0xa6')]][_0x3695('0x70')]){logger[_0x3695('0x54')](_0x3695('0x141'),_0x5dd597[_0x3695('0xa6')],_0x5dd597[_0x3695('0x140')],_0x3695('0xed'),_0x29aa4c['name'],_0x3695('0x6f'),_0x29aa4c[_0x3695('0x5b')]);this[_0x3695('0x96')](_0x5dd597,_0x5dd597[_0x3695('0xa6')],_0x5dd597['cause']);}}else if(_0x9dbefe&&_['isNil'](_0x9dbefe['statedesc'])&&_0x29aa4c[_0x3695('0x142')]&&_0x5dd597['linkedid']===_0x5dd597[_0x3695('0xac')]&&_[_0x3695('0x6a')](_0x5dd597[_0x3695('0xef')])&&_0x5dd597[_0x3695('0x140')]==='16'&&_0x5dd597['channelstate']==='6'&&_[_0x3695('0xee')](_0x9dbefe['transfer'])){if(_0x9dbefe[_0x3695('0xcc')]){rpcDb[_0x3695('0x13b')](_0x9dbefe[_0x3695('0x13c')]);}if(_0x9dbefe['activeContact']){rpcDb[_0x3695('0x110')](_0x9dbefe['idContact']);}_0x5dd597[_0x3695('0xef')]='22';this[_0x3695('0x13e')](_0x9dbefe,_0x29aa4c,_0x5dd597);}else if(_0x9dbefe&&_0x9dbefe[_0x3695('0x143')]){if(_0x5dd597[_0x3695('0x140')]==='16'&&this[_0x3695('0x12')][_0x5dd597[_0x3695('0xa6')]][_0x3695('0x70')]){logger[_0x3695('0x54')](_0x3695('0x144'),_0x5dd597['linkedid'],_0x5dd597[_0x3695('0x140')],'\x20Queue',_0x29aa4c[_0x3695('0x27')],_0x3695('0x6f'),_0x29aa4c[_0x3695('0x5b')]);this[_0x3695('0x96')](_0x5dd597,_0x5dd597[_0x3695('0xa6')],_0x5dd597[_0x3695('0x140')]);}else if(this['actions'][_0x5dd597[_0x3695('0xa6')]][_0x3695('0x70')]){logger['info'](_0x3695('0x141'),_0x5dd597[_0x3695('0xa6')],_0x5dd597['cause'],'\x20Queue',_0x29aa4c['name'],_0x3695('0x6f'),_0x29aa4c[_0x3695('0x5b')]);this[_0x3695('0x96')](_0x5dd597,_0x5dd597[_0x3695('0xa6')],_0x5dd597[_0x3695('0x140')]);}}};Preview['prototype'][_0x3695('0x1d')]=function(_0x3d29fd){if(this[_0x3695('0x12')][_0x3d29fd[_0x3695('0x145')]]&&_0x3d29fd[_0x3695('0x145')]!==_0x3d29fd[_0x3695('0x146')]){this[_0x3695('0x96')](_0x3d29fd,_0x3d29fd[_0x3695('0x145')],_0x3d29fd['dialstatus']);}};Preview['prototype'][_0x3695('0x1b')]=function(_0x5a59e5){if(this[_0x3695('0x12')][_0x5a59e5[_0x3695('0xa6')]]&&_0x5a59e5[_0x3695('0xa6')]!==_0x5a59e5[_0x3695('0xac')]&&!this[_0x3695('0x12')][_0x5a59e5[_0x3695('0xa6')]][_0x3695('0x70')]){if(_0x5a59e5[_0x3695('0x140')]==='1'){this[_0x3695('0x96')](_0x5a59e5,_0x5a59e5['linkedid'],_0x5a59e5[_0x3695('0x140')]);}}};Preview[_0x3695('0x60')][_0x3695('0x147')]=function(_0x1f914e,_0x1164b7,_0x25c5ef){if(this[_0x3695('0x12')][_0x1f914e]){if(_[_0x3695('0x6a')](this[_0x3695('0x12')][_0x1f914e][_0x3695('0x148')])){this[_0x3695('0x12')][_0x1f914e]['variables']={};}this[_0x3695('0x12')][_0x1f914e][_0x3695('0x148')][_0x1164b7]=_0x25c5ef;}};Preview[_0x3695('0x60')]['syncVarSet']=function(_0x550fae){try{if(!_[_0x3695('0x6a')](_0x550fae)){if(ut['filterKey'](_['keys'](_0x550fae[_0x3695('0x149')])[0x0])){this[_0x3695('0x147')](_0x550fae['uniqueid'],_[_0x3695('0x14a')](_0x550fae[_0x3695('0x149')])[0x0],_0x550fae[_0x3695('0x14b')]);}}}catch(_0x53121c){logger[_0x3695('0x14c')](_0x3695('0x14d'),util[_0x3695('0x14e')](_0x53121c,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x3695('0x21')]=function(_0x1fa0c4){if(_0x1fa0c4){if(this[_0x3695('0x12')][_0x1fa0c4['transfertargetlinkedid']]){this['actions'][_0x1fa0c4['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0x3695('0x60')][_0x3695('0x22')]=function(_0x13839b){if(_0x13839b){if(this[_0x3695('0x12')][_0x13839b[_0x3695('0x14f')]]){this[_0x3695('0x12')][_0x13839b[_0x3695('0x14f')]][_0x3695('0x143')]=!![];}}};module[_0x3695('0x150')]=Preview;
\ No newline at end of file