Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / services / ami / preview / util / util.js
index 8a44a60..2f5ffc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x736a=['bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','isEmpty','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','isNil','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','state','responsetime','ringtime','membername','logCustomer','endtime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','ListId','decrementTalkink','[decrementTalkink]\x20is\x20null\x20or\x20undefined','name','queue','interface','buildAcw','agentReadyId','not_inuse','reachable','push','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackuniqueid','callbackat','recallme','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosloss'];(function(_0x413aea,_0x35ceda){var _0x59a0b5=function(_0x17b345){while(--_0x17b345){_0x413aea['push'](_0x413aea['shift']());}};_0x59a0b5(++_0x35ceda);}(_0x736a,0x96));var _0xa736=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x736a[_0x45bf86];return _0x1f02b7;};'use strict';var util=require('util');var _=require(_0xa736('0x0'));var moment=require(_0xa736('0x1'));var logger=require(_0xa736('0x2'))(_0xa736('0x3'));var ipAgi=process[_0xa736('0x4')][_0xa736('0x5')]||_0xa736('0x6');function getSeconds(_0x192f17,_0x2ccb98){var _0x3bd7dd=moment(_0x192f17)[_0xa736('0x7')](0x0);var _0x2c8c5c=moment(_0x2ccb98)[_0xa736('0x7')](0x0);return _0x3bd7dd[_0xa736('0x8')](_0x2c8c5c,'seconds');}exports['loggerCatch']=function(_0x70a3cf){return function(_0xd9ba88){logger[_0xa736('0x9')](_0x70a3cf,util[_0xa736('0xa')](_0xd9ba88,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x22463e,_0x360df7){logger[_0xa736('0xb')](_0x22463e,util['inspect'](_0x360df7,{'showHidden':![],'depth':null}));};exports[_0xa736('0xc')]=function(_0x37bd95,_0x5b0bdc){logger[_0xa736('0x9')](_0x37bd95,util[_0xa736('0xa')](_0x5b0bdc,{'showHidden':![],'depth':null}));};exports[_0xa736('0xd')]=function(_0x34a1e5){return function(_0x1010cb){logger[_0xa736('0xb')](_0x34a1e5,util['inspect'](_0x1010cb,{'showHidden':![],'depth':null}));};};exports[_0xa736('0xe')]=function(_0x33eba9,_0x368994,_0x52180e){return{'message':_0x33eba9,'unlock':_0x368994,'active':_0x52180e};};exports[_0xa736('0xf')]=function(_0x42f708,_0x57a2ab,_0x3047fe){if(!_[_0xa736('0x10')](_0x3047fe)&&_0xa736('0x11')===typeof _0x3047fe&&!_['isEmpty'](_0x3047fe)){if(!_[_0xa736('0x10')](_0x57a2ab)&&_0xa736('0x11')===typeof _0x57a2ab&&!_['isEmpty'](_0x57a2ab)){return util[_0xa736('0x12')](_0xa736('0x13'),_0x57a2ab,_0x3047fe);}return util[_0xa736('0x12')]('\x22%s\x22\x20<%s>',_0x3047fe,_0x3047fe);}if(!_[_0xa736('0x10')](_0x42f708)&&_0xa736('0x11')===typeof _0x42f708&&!_['isEmpty'](_0x42f708)){return _0x42f708;}return _0xa736('0x14');};exports[_0xa736('0x15')]=function(_0x15b1d4){if(_['isNil'](_0x15b1d4)){return![];}return _0x15b1d4;};exports[_0xa736('0x16')]=function(_0x3fb37d,_0x517d4e,_0x9f2ed1,_0x2bd226,_0x219003,_0x1c1f67){var _0x1acb93={'XMD-QUEUE':_0x517d4e['Queue']?_0x517d4e[_0xa736('0x17')]['name']:'','XMD-CALLERID':_0x2bd226,'XMD-CALLERID-PREVIEW':_0x1c1f67?util[_0xa736('0x12')](_0xa736('0x13'),_0x1c1f67[_0xa736('0x18')],_0x1c1f67[_0xa736('0x19')]):_0x2bd226,'XMD-DIALID':_0x219003,'XMD-CONTACTID':_0x517d4e[_0xa736('0x1a')],'XMD-CDRTYPE':_0xa736('0x1b'),'CALLERID(all)':_0x2bd226,'XMD-VOICEQUEUEID':_0x517d4e[_0xa736('0x1c')],'XMD-DIALCHANNEL':_0x9f2ed1,'XMD-DIALTIMEOUT':_0x3fb37d[_0xa736('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xa736('0x12')](_0xa736('0x1e'),_0x3fb37d[_0xa736('0x1f')]?'g':'',_[_0xa736('0x20')](_0x3fb37d[_0xa736('0x21')])?'':_0xa736('0x22')),'XMD-DIALURL':_0x3fb37d[_0xa736('0x23')]||'','XMD-AGI':_0x3fb37d[_0xa736('0x24')]?util[_0xa736('0x12')](_0xa736('0x25'),ipAgi,_0x3fb37d[_0xa736('0x24')]):_0xa736('0x26'),'XMD-AGIAFTER':_0x3fb37d[_0xa736('0x1f')]?util[_0xa736('0x12')](_0xa736('0x25'),ipAgi,_0x3fb37d['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x1c1f67?_0x1c1f67[_0xa736('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x1c1f67?_0x1c1f67[_0xa736('0x28')]:'','XMD-DESTINATION':_0xa736('0x29')};if(!_['isEmpty'](_0x3fb37d['monitor_format'])){_0x1acb93[util[_0xa736('0x12')]('%s',_0xa736('0x2a'))]=_0x3fb37d[_0xa736('0x21')];_0x1acb93[util[_0xa736('0x12')]('%s',_0xa736('0x2b'))]=_0x219003;}if(_0x517d4e&&_0x517d4e[_0xa736('0x2c')]){for(var _0x172246 in _0x517d4e['Contact']){if(_0x517d4e['Contact'][_0xa736('0x2d')](_0x172246)){if(!_['isNil'](_0x517d4e[_0xa736('0x2c')][_0x172246])&&_0x172246!=='id'&&_0x172246!==_0xa736('0x2e')&&_0x172246!==_0xa736('0x2f')&&_0x172246!=='updatedAt'){_0x1acb93[util[_0xa736('0x12')](_0xa736('0x30'),_0xa736('0x31'),_[_0xa736('0x32')](_0x172246))]=_0x517d4e[_0xa736('0x2c')][_0x172246];}}}}return _0x1acb93;};exports[_0xa736('0x33')]=function(_0x319c60){var _0x33a2e3={};for(var _0xe86c76 in _0x319c60){if(_0x319c60[_0xa736('0x2d')](_0xe86c76)){_0x33a2e3[util[_0xa736('0x12')]('%s',_[_0xa736('0x34')](_0xe86c76))]=_0x319c60[_0xe86c76];}}return{'variables':_0x33a2e3};};exports['updateOriginated']=function(_0x36144c,_0x1abb0c){if(!_[_0xa736('0x35')](_0x36144c)){if(_0x36144c['hasOwnProperty'](_0xa736('0x36'))){if(_0x36144c[_0xa736('0x36')]>0x0){_0x36144c[_0xa736('0x36')]-=0x1;}else{logger[_0xa736('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x1abb0c);}}}else{logger[_0xa736('0x9')](_0xa736('0x37'),_0x1abb0c);}};exports[_0xa736('0x38')]=function(_0x312130){var _0xe6cf02=moment()[_0xa736('0x12')](_0xa736('0x39'));_0x312130['state']=0xd;_0x312130[_0xa736('0x3a')]=_0xa736('0x3b');_0x312130[_0xa736('0x3c')]=_0xe6cf02;_0x312130['responsetime']=_0xe6cf02;_0x312130['endtime']=_0xe6cf02;};exports['logAgent']=function(_0x444627,_0x1e8fa9,_0x5e18a6){var _0x2742c5=moment()['format'](_0xa736('0x39'));_0x444627[_0xa736('0x3d')]=_0x1e8fa9;_0x444627[_0xa736('0x3a')]=_0x5e18a6;_0x444627[_0xa736('0x3e')]=_0x2742c5;_0x444627[_0xa736('0x3f')]=getSeconds(_0x444627[_0xa736('0x3e')],_0x444627[_0xa736('0x3c')]);};exports['logLookAgent']=function(_0x54dcb8,_0x538175,_0x12ff7b){_0x54dcb8[_0xa736('0x40')]=_0x538175;_0x54dcb8['UserId']=_0x12ff7b;};exports[_0xa736('0x41')]=function(_0x3b44ba,_0x43217b,_0x31fe3c){var _0x1bd6fb=moment()[_0xa736('0x12')](_0xa736('0x39'));_0x3b44ba['state']=_0x43217b;_0x3b44ba[_0xa736('0x3a')]=_0x31fe3c;_0x3b44ba[_0xa736('0x3e')]=_0x3b44ba[_0xa736('0x3e')]?_0x3b44ba[_0xa736('0x3e')]:_0x1bd6fb;_0x3b44ba[_0xa736('0x42')]=_0x3b44ba['endtime']?_0x3b44ba['endtime']:_0x1bd6fb;_0x3b44ba[_0xa736('0x3f')]=getSeconds(_0x3b44ba[_0xa736('0x3e')]||0x0,_0x3b44ba['starttime']||0x0);_0x3b44ba['talktime']=_0x3b44ba[_0xa736('0x43')]?getSeconds(_0x3b44ba[_0xa736('0x42')],_0x3b44ba[_0xa736('0x43')]):0x0;};exports[_0xa736('0x44')]=function(_0xdef759){return _0xdef759==='Failure';};exports[_0xa736('0x45')]=function(_0x4422fa,_0x1573b7,_0x31277,_0xebffcc,_0x420a2c){var _0x14fcb3=_0xebffcc?_0xa736('0x46'):_0x4422fa[_0xa736('0x18')];_0x14fcb3=_0x420a2c?_0xa736('0x47'):_0x14fcb3;return{'actionid':_0x4422fa[_0xa736('0x48')],'action':_0xa736('0x49'),'channel':_0x4422fa[_0xa736('0x4a')],'callerid':util[_0xa736('0x12')](_0xa736('0x13'),_0x14fcb3,_0x4422fa['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xa736('0x4b'),'Priority':'1','variable':_0x31277,'timeout':(_0x1573b7[_0xa736('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4422fa[_0xa736('0x48')]};};exports[_0xa736('0x4d')]=function(_0x2434d1){return _0x2434d1[_0xa736('0x4e')]+_0x2434d1[_0xa736('0x4f')]+_0x2434d1[_0xa736('0x50')];};exports[_0xa736('0x51')]=function(_0x295983){var _0x519a14=_[_0xa736('0x52')](_0x295983);_0x519a14[_0xa736('0x3d')]=0xf;_0x519a14['statedesc']=_0xa736('0x53');return _0x519a14;};exports[_0xa736('0x54')]=function(_0x20e801,_0x306fd3,_0x1399af){var _0x355942={};_0x355942[_0x306fd3]=_0x20e801[_0x306fd3];_0x355942[_0xa736('0x55')]=![];_0x355942[_0xa736('0x56')]=moment()['add'](_0x1399af,'minutes')[_0xa736('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x355942[_0xa736('0x1a')]=_0x20e801[_0xa736('0x1a')];_0x355942[_0xa736('0x57')]=_0x20e801[_0xa736('0x57')];_0x355942[_0xa736('0x1c')]=_0x20e801['VoiceQueueId']||undefined;return _0x355942;};exports[_0xa736('0x58')]=function(_0x537600,_0xb8ba7a){if(!_[_0xa736('0x35')](_0x537600)){if(_0x537600['pTalking']>0x0){_0x537600['pTalking']-=0x1;}else{logger['error'](_0xb8ba7a,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xa736('0x9')](_0xb8ba7a,_0xa736('0x59'));}};exports['IsNotLoggedIn']=function(_0x1de560){if(_0x1de560<=0x0){return!![];}return![];};exports['buildObj']=function(_0xea304c,_0x3c64fc){_0xea304c['lastevent']=_0x3c64fc;_0xea304c[_0xa736('0x5a')]=_0xea304c[_0xa736('0x5b')];_0xea304c[_0xa736('0x5c')]=_0xea304c['channelAgent'];return _0xea304c;};exports[_0xa736('0x5d')]=function(_0x28c644){var _0x55d21b={};_0x55d21b[_0xa736('0x5b')]=_0x28c644[_0xa736('0x5b')];_0x55d21b[_0xa736('0x5c')]=_0x28c644['channelAgent'];_0x55d21b[_0xa736('0x48')]=_0x28c644[_0xa736('0x48')];return _0x55d21b;};exports[_0xa736('0x5e')]=function(_0x51f30a){var _0x444e37=[];for(var _0x1e6c50 in _0x51f30a){if(_0x51f30a[_0xa736('0x2d')](_0x1e6c50)){if(!_[_0xa736('0x35')](_0x51f30a[_0x1e6c50])&&_0x51f30a[_0x1e6c50][_0xa736('0x3d')]===_0xa736('0x5f')&&_0x51f30a[_0x1e6c50]['status']===_0xa736('0x60')){_0x444e37[_0xa736('0x61')](_0x51f30a[_0x1e6c50]['id']);}}}return _0x444e37;};exports['getDiff']=function(_0x2f1b1b){var _0x13bb3f=moment()[_0xa736('0x7')](0x0);var _0x24025f=moment(_0x2f1b1b)[_0xa736('0x7')](0x0);return _0x13bb3f['diff'](_0x24025f,_0xa736('0x62'));};exports[_0xa736('0x63')]=function(_0x2b694a){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2b694a[_0xa736('0x1a')],'ListId':_0x2b694a[_0xa736('0x57')],'VoiceQueueId':_0x2b694a[_0xa736('0x1c')]||undefined,'CampaignId':_0x2b694a[_0xa736('0x64')]||undefined};};exports[_0xa736('0x65')]=function(_0x21676c){if(_0x21676c===_0xa736('0x48')||_0x21676c===_0xa736('0x66')||_0x21676c===_0xa736('0x5b')||_0x21676c===_0xa736('0x67')||_0x21676c===_0xa736('0x68')||_0x21676c===_0xa736('0x69')||_0x21676c===_0xa736('0x40')||_0x21676c===_0xa736('0x4a')||_0x21676c===_0xa736('0x18')||_0x21676c==='active'||_0x21676c===_0xa736('0x19')||_0x21676c===_0xa736('0x56')||_0x21676c===_0xa736('0x4e')||_0x21676c==='countcongestionretry'||_0x21676c===_0xa736('0x50')||_0x21676c==='countglobal'||_0x21676c===_0xa736('0x6a')||_0x21676c===_0xa736('0x6b')||_0x21676c===_0xa736('0x6c')||_0x21676c===_0xa736('0x6d')||_0x21676c===_0xa736('0x1a')||_0x21676c===_0xa736('0x57')||_0x21676c===_0xa736('0x6e')||_0x21676c==='VoiceQueueId'||_0x21676c===_0xa736('0x6f')||_0x21676c===_0xa736('0x70')||_0x21676c===_0xa736('0x71')||_0x21676c===_0xa736('0x72')||_0x21676c==='xmd-listid'||_0x21676c==='xmd-dialurl'||_0x21676c===_0xa736('0x73')||_0x21676c===_0xa736('0x74')||_0x21676c===_0xa736('0x75')||_0x21676c==='xmd-dialchannel'||_0x21676c===_0xa736('0x76')||_0x21676c===_0xa736('0x77')||_0x21676c==='xmd-callerid'||_0x21676c===_0xa736('0x78')||_0x21676c===_0xa736('0x79')||_0x21676c===_0xa736('0x7a')||_0x21676c===_0xa736('0x7b')||_0x21676c===_0xa736('0x7c')||_0x21676c===_0xa736('0x7d')||_0x21676c==='rtpaudioqosloss'||_0x21676c===_0xa736('0x7e')||_0x21676c===_0xa736('0x7f')||_0x21676c===_0xa736('0x80')||_0x21676c===_0xa736('0x7a')||_0x21676c===_0xa736('0x7b')||_0x21676c===_0xa736('0x7c')||_0x21676c===_0xa736('0x7d')||_0x21676c===_0xa736('0x81')||_0x21676c===_0xa736('0x7e')||_0x21676c===_0xa736('0x7f')||_0x21676c===_0xa736('0x80')||_0x21676c===_0xa736('0x82')||_0x21676c===_0xa736('0x83')||_0x21676c===_0xa736('0x3d')||_0x21676c===_0xa736('0x3a')){return![];}return!![];};exports[_0xa736('0x84')]=function(_0x48c6e2,_0x245bf9){var _0xd0bd32,_0x1c50bf,_0x1482a3;if(_0x245bf9<=0x0){_0x245bf9=0x1;}_0xd0bd32=new RegExp(_0xa736('0x85')+_0x245bf9+'}$');_0x1c50bf=Math[_0xa736('0x86')](0xa,_0x245bf9-0x1);_0x1482a3=Math[_0xa736('0x86')](0xa,_0x245bf9)-0x1;return util[_0xa736('0x12')]('%s',_[_0xa736('0x87')](_0x48c6e2,_0xd0bd32,_[_0xa736('0x88')](_0x1c50bf,_0x1482a3)));};exports[_0xa736('0x89')]=function(_0x17cbef){var _0x986192=_0x17cbef[_0xa736('0x8a')](/"(.*?)"/);return _0x986192?_0x986192[0x1]:_0x17cbef;};exports[_0xa736('0x8b')]=function(_0x30a173){var _0x1b1e5b=_0x30a173[_0xa736('0x8a')](/<(.*?)>/);return _0x1b1e5b?_0x1b1e5b[0x1]:_0x30a173;};
\ No newline at end of file
+var _0x6ec6=['%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','channelAgent','mandatoryDisposition','not_inuse','reachable','push','ListId','CampaignId','idContact','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','logger','inspect','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt'];(function(_0x263aa2,_0x7795b2){var _0x4ed9a1=function(_0x55b340){while(--_0x55b340){_0x263aa2['push'](_0x263aa2['shift']());}};_0x4ed9a1(++_0x7795b2);}(_0x6ec6,0xd5));var _0x66ec=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x6ec6[_0x556bb1];return _0x45455f;};'use strict';var util=require(_0x66ec('0x0'));var _=require(_0x66ec('0x1'));var moment=require('moment');var logger=require(_0x66ec('0x2'))(_0x66ec('0x3'));var ipAgi=process['env'][_0x66ec('0x4')]||_0x66ec('0x5');function getSeconds(_0x9dac14,_0xc4addd){var _0x4d5c68=moment(_0x9dac14)[_0x66ec('0x6')](0x0);var _0x283d7a=moment(_0xc4addd)[_0x66ec('0x6')](0x0);return _0x4d5c68[_0x66ec('0x7')](_0x283d7a,_0x66ec('0x8'));}exports['loggerCatch']=function(_0x438802){return function(_0x15805d){logger[_0x66ec('0x9')](_0x438802,util['inspect'](_0x15805d,{'showHidden':![],'depth':null}));};};exports[_0x66ec('0xa')]=function(_0x35c982,_0x268a4c){logger['info'](_0x35c982,util[_0x66ec('0xb')](_0x268a4c,{'showHidden':![],'depth':null}));};exports[_0x66ec('0xc')]=function(_0x28f1de,_0x2fd5e0){logger[_0x66ec('0x9')](_0x28f1de,util[_0x66ec('0xb')](_0x2fd5e0,{'showHidden':![],'depth':null}));};exports[_0x66ec('0xd')]=function(_0x490d93){return function(_0x3fb48f){logger['info'](_0x490d93,util[_0x66ec('0xb')](_0x3fb48f,{'showHidden':![],'depth':null}));};};exports[_0x66ec('0xe')]=function(_0x26da34,_0x36cf85,_0x56e827){return{'message':_0x26da34,'unlock':_0x36cf85,'active':_0x56e827};};exports[_0x66ec('0xf')]=function(_0x1c8c82,_0x3c91ac,_0x22ac8c){if(!_[_0x66ec('0x10')](_0x22ac8c)&&_0x66ec('0x11')===typeof _0x22ac8c&&!_[_0x66ec('0x12')](_0x22ac8c)){if(!_[_0x66ec('0x10')](_0x3c91ac)&&_0x66ec('0x11')===typeof _0x3c91ac&&!_['isEmpty'](_0x3c91ac)){return util['format'](_0x66ec('0x13'),_0x3c91ac,_0x22ac8c);}return util[_0x66ec('0x14')](_0x66ec('0x13'),_0x22ac8c,_0x22ac8c);}if(!_[_0x66ec('0x10')](_0x1c8c82)&&_0x66ec('0x11')===typeof _0x1c8c82&&!_[_0x66ec('0x12')](_0x1c8c82)){return _0x1c8c82;}return _0x66ec('0x15');};exports[_0x66ec('0x16')]=function(_0x347eac){if(_[_0x66ec('0x17')](_0x347eac)){return![];}return _0x347eac;};exports['addVariables']=function(_0x1f7fbf,_0x134b01,_0xf14ca7,_0x17c3ed,_0x3e57da,_0x2930b2){var _0x1b1bc6={'XMD-QUEUE':_0x134b01['Queue']?_0x134b01['Queue'][_0x66ec('0x18')]:'','XMD-CALLERID':_0x17c3ed,'XMD-CALLERID-PREVIEW':_0x2930b2?util[_0x66ec('0x14')](_0x66ec('0x13'),_0x2930b2[_0x66ec('0x19')],_0x2930b2[_0x66ec('0x1a')]):_0x17c3ed,'XMD-DIALID':_0x3e57da,'XMD-CONTACTID':_0x134b01[_0x66ec('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x17c3ed,'XMD-VOICEQUEUEID':_0x134b01[_0x66ec('0x1c')],'XMD-DIALCHANNEL':_0xf14ca7,'XMD-DIALTIMEOUT':_0x1f7fbf[_0x66ec('0x1d')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x66ec('0x1e'),_0x1f7fbf[_0x66ec('0x1f')]?'g':'',_['isEmpty'](_0x1f7fbf[_0x66ec('0x20')])?'':_0x66ec('0x21')),'XMD-DIALURL':_0x1f7fbf[_0x66ec('0x22')]||'','XMD-AGI':_0x1f7fbf[_0x66ec('0x23')]?util[_0x66ec('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1f7fbf['dialQueueProject']):_0x66ec('0x24'),'XMD-AGIAFTER':_0x1f7fbf[_0x66ec('0x1f')]?util[_0x66ec('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1f7fbf[_0x66ec('0x1f')]):_0x66ec('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x2930b2?_0x2930b2['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x2930b2?_0x2930b2[_0x66ec('0x25')]:'','XMD-DESTINATION':_0x66ec('0x26')};if(!_[_0x66ec('0x12')](_0x1f7fbf['monitor_format'])){_0x1b1bc6[util[_0x66ec('0x14')]('%s',_0x66ec('0x27'))]=_0x1f7fbf[_0x66ec('0x20')];_0x1b1bc6[util[_0x66ec('0x14')]('%s',_0x66ec('0x28'))]=_0x3e57da;}if(_0x134b01&&_0x134b01[_0x66ec('0x29')]){for(var _0x311b1e in _0x134b01[_0x66ec('0x29')]){if(_0x134b01['Contact'][_0x66ec('0x2a')](_0x311b1e)){if(!_[_0x66ec('0x17')](_0x134b01[_0x66ec('0x29')][_0x311b1e])&&_0x311b1e!=='id'&&_0x311b1e!==_0x66ec('0x2b')&&_0x311b1e!==_0x66ec('0x2c')&&_0x311b1e!=='updatedAt'){_0x1b1bc6[util[_0x66ec('0x14')](_0x66ec('0x2d'),_0x66ec('0x2e'),_['toUpper'](_0x311b1e))]=_0x134b01['Contact'][_0x311b1e];}}}}return _0x1b1bc6;};exports[_0x66ec('0x2f')]=function(_0x12c11d){var _0x4cd46e={};for(var _0x3f2640 in _0x12c11d){if(_0x12c11d[_0x66ec('0x2a')](_0x3f2640)){_0x4cd46e[util[_0x66ec('0x14')]('%s',_[_0x66ec('0x30')](_0x3f2640))]=_0x12c11d[_0x3f2640];}}return{'variables':_0x4cd46e};};exports[_0x66ec('0x31')]=function(_0x57f1eb,_0x5044fe){if(!_[_0x66ec('0x17')](_0x57f1eb)){if(_0x57f1eb[_0x66ec('0x2a')](_0x66ec('0x32'))){if(_0x57f1eb[_0x66ec('0x32')]>0x0){_0x57f1eb[_0x66ec('0x32')]-=0x1;}else{logger[_0x66ec('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x5044fe);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5044fe);}};exports['logBlacklist']=function(_0x505a85){var _0x4b4bf1=moment()[_0x66ec('0x14')](_0x66ec('0x33'));_0x505a85[_0x66ec('0x34')]=0xd;_0x505a85['statedesc']=_0x66ec('0x35');_0x505a85[_0x66ec('0x36')]=_0x4b4bf1;_0x505a85[_0x66ec('0x37')]=_0x4b4bf1;_0x505a85[_0x66ec('0x38')]=_0x4b4bf1;};exports['logAgent']=function(_0x54ee1e,_0x12c372,_0x39c96c){var _0x4fc1bb=moment()[_0x66ec('0x14')](_0x66ec('0x33'));_0x54ee1e[_0x66ec('0x34')]=_0x12c372;_0x54ee1e[_0x66ec('0x39')]=_0x39c96c;_0x54ee1e[_0x66ec('0x37')]=_0x4fc1bb;_0x54ee1e[_0x66ec('0x3a')]=getSeconds(_0x54ee1e[_0x66ec('0x37')],_0x54ee1e[_0x66ec('0x36')]);};exports[_0x66ec('0x3b')]=function(_0x3274b0,_0x1aee92,_0x58e069){_0x3274b0[_0x66ec('0x3c')]=_0x1aee92;_0x3274b0[_0x66ec('0x3d')]=_0x58e069;};exports[_0x66ec('0x3e')]=function(_0x1ef975,_0x173803,_0x5567db){var _0x388417=moment()[_0x66ec('0x14')](_0x66ec('0x33'));_0x1ef975[_0x66ec('0x34')]=_0x173803;_0x1ef975[_0x66ec('0x39')]=_0x5567db;_0x1ef975[_0x66ec('0x37')]=_0x1ef975[_0x66ec('0x37')]?_0x1ef975[_0x66ec('0x37')]:_0x388417;_0x1ef975['endtime']=_0x1ef975[_0x66ec('0x38')]?_0x1ef975[_0x66ec('0x38')]:_0x388417;_0x1ef975[_0x66ec('0x3a')]=getSeconds(_0x1ef975[_0x66ec('0x37')]||0x0,_0x1ef975[_0x66ec('0x36')]||0x0);_0x1ef975[_0x66ec('0x3f')]=_0x1ef975[_0x66ec('0x40')]?getSeconds(_0x1ef975[_0x66ec('0x38')],_0x1ef975['answertime']):0x0;};exports[_0x66ec('0x41')]=function(_0x396288){return _0x396288===_0x66ec('0x42');};exports[_0x66ec('0x43')]=function(_0x1bc0ea,_0x2b4a0d,_0x39a366,_0x23f1d3,_0x36d3c6){var _0xff4cfd=_0x23f1d3?_0x66ec('0x44'):_0x1bc0ea[_0x66ec('0x19')];_0xff4cfd=_0x36d3c6?_0x66ec('0x45'):_0xff4cfd;return{'actionid':_0x1bc0ea[_0x66ec('0x46')],'action':_0x66ec('0x47'),'channel':_0x1bc0ea['channelAgent'],'callerid':util[_0x66ec('0x14')](_0x66ec('0x13'),_0xff4cfd,_0x1bc0ea[_0x66ec('0x1a')]),'Exten':_0x66ec('0x26'),'Context':_0x66ec('0x48'),'Priority':'1','variable':_0x39a366,'timeout':(_0x2b4a0d[_0x66ec('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1bc0ea['uniqueid']};};exports[_0x66ec('0x4a')]=function(_0x4c0016){return _0x4c0016[_0x66ec('0x4b')]+_0x4c0016[_0x66ec('0x4c')]+_0x4c0016[_0x66ec('0x4d')]+_0x4c0016[_0x66ec('0x4e')]+_0x4c0016[_0x66ec('0x4f')];};exports[_0x66ec('0x50')]=function(_0x375bb8){var _0x356b7e=_['clone'](_0x375bb8);_0x356b7e[_0x66ec('0x34')]=0xf;_0x356b7e[_0x66ec('0x39')]=_0x66ec('0x51');return _0x356b7e;};exports[_0x66ec('0x52')]=function(_0xabed9b,_0x4b05d5,_0x179f59){var _0xf8f982={};_0xf8f982[_0x4b05d5]=_0xabed9b[_0x4b05d5];_0xf8f982[_0x66ec('0x53')]=![];_0xf8f982[_0x66ec('0x54')]=moment()[_0x66ec('0x55')](_0x179f59,_0x66ec('0x56'))[_0x66ec('0x14')](_0x66ec('0x33'));_0xf8f982[_0x66ec('0x1b')]=_0xabed9b[_0x66ec('0x1b')];_0xf8f982['ListId']=_0xabed9b['ListId'];_0xf8f982['VoiceQueueId']=_0xabed9b['VoiceQueueId']||undefined;return _0xf8f982;};exports['decrementTalkink']=function(_0x13ff36,_0x41f0dc){if(!_[_0x66ec('0x17')](_0x13ff36)){if(_0x13ff36[_0x66ec('0x57')]>0x0){_0x13ff36['pTalking']-=0x1;}else{logger['error'](_0x41f0dc,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x66ec('0x9')](_0x41f0dc,_0x66ec('0x58'));}};exports['IsNotLoggedIn']=function(_0x48528b){if(_0x48528b<=0x0){return!![];}return![];};exports[_0x66ec('0x59')]=function(_0x20e380,_0x5cd24a,_0x4f768a){_0x20e380[_0x66ec('0x5a')]=_0x5cd24a;_0x20e380[_0x66ec('0x18')]=_0x20e380[_0x66ec('0x5b')];_0x20e380[_0x66ec('0x5c')]=_0x20e380[_0x66ec('0x5d')];if(_0x4f768a){_0x20e380['mandatoryDisposition']=_0x4f768a[_0x66ec('0x5e')];}return _0x20e380;};exports['buildAcw']=function(_0x23c772){var _0x5878a7={};_0x5878a7[_0x66ec('0x5b')]=_0x23c772[_0x66ec('0x5b')];_0x5878a7[_0x66ec('0x5c')]=_0x23c772[_0x66ec('0x5d')];_0x5878a7['uniqueid']=_0x23c772[_0x66ec('0x46')];return _0x5878a7;};exports['agentReadyId']=function(_0x17fba5){var _0x3b76d7=[];for(var _0x354d89 in _0x17fba5){if(_0x17fba5[_0x66ec('0x2a')](_0x354d89)){if(!_[_0x66ec('0x17')](_0x17fba5[_0x354d89])&&_0x17fba5[_0x354d89][_0x66ec('0x34')]===_0x66ec('0x5f')&&_0x17fba5[_0x354d89]['status']===_0x66ec('0x60')){_0x3b76d7[_0x66ec('0x61')](_0x17fba5[_0x354d89]['id']);}}}return _0x3b76d7;};exports['getDiff']=function(_0x5d7b82){var _0x49e10f=moment()[_0x66ec('0x6')](0x0);var _0x1fd68e=moment(_0x5d7b82)[_0x66ec('0x6')](0x0);return _0x49e10f[_0x66ec('0x7')](_0x1fd68e,_0x66ec('0x8'));};exports['createBody']=function(_0x3054b5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3054b5[_0x66ec('0x1b')],'ListId':_0x3054b5[_0x66ec('0x62')],'VoiceQueueId':_0x3054b5[_0x66ec('0x1c')]||undefined,'CampaignId':_0x3054b5[_0x66ec('0x63')]||undefined};};exports['filterKey']=function(_0xf8c356){if(_0xf8c356===_0x66ec('0x46')||_0xf8c356===_0x66ec('0x64')||_0xf8c356===_0x66ec('0x5b')||_0xf8c356==='type'||_0xf8c356==='campaigntype'||_0xf8c356==='dialAnswer'||_0xf8c356===_0x66ec('0x3c')||_0xf8c356===_0x66ec('0x5d')||_0xf8c356==='calleridname'||_0xf8c356===_0x66ec('0x53')||_0xf8c356===_0x66ec('0x1a')||_0xf8c356==='scheduledat'||_0xf8c356===_0x66ec('0x4b')||_0xf8c356===_0x66ec('0x4c')||_0xf8c356===_0x66ec('0x4d')||_0xf8c356===_0x66ec('0x65')||_0xf8c356===_0x66ec('0x66')||_0xf8c356===_0x66ec('0x67')||_0xf8c356===_0x66ec('0x68')||_0xf8c356==='recallme'||_0xf8c356===_0x66ec('0x1b')||_0xf8c356===_0x66ec('0x62')||_0xf8c356===_0x66ec('0x3d')||_0xf8c356===_0x66ec('0x1c')||_0xf8c356===_0x66ec('0x69')||_0xf8c356==='xmd-voicequeueid'||_0xf8c356===_0x66ec('0x6a')||_0xf8c356==='xmd-phone'||_0xf8c356==='xmd-listid'||_0xf8c356==='xmd-dialurl'||_0xf8c356==='xmd-dialtimeout'||_0xf8c356===_0x66ec('0x6b')||_0xf8c356===_0x66ec('0x6c')||_0xf8c356===_0x66ec('0x6d')||_0xf8c356===_0x66ec('0x6e')||_0xf8c356===_0x66ec('0x6f')||_0xf8c356===_0x66ec('0x70')||_0xf8c356===_0x66ec('0x71')||_0xf8c356===_0x66ec('0x72')||_0xf8c356===_0x66ec('0x73')||_0xf8c356==='rtpaudioqosbridged'||_0xf8c356===_0x66ec('0x74')||_0xf8c356===_0x66ec('0x75')||_0xf8c356==='rtpaudioqosloss'||_0xf8c356===_0x66ec('0x76')||_0xf8c356===_0x66ec('0x77')||_0xf8c356==='rtpaudioqosrttbridged'||_0xf8c356===_0x66ec('0x73')||_0xf8c356===_0x66ec('0x78')||_0xf8c356==='rtpaudioqosjitter'||_0xf8c356==='rtpaudioqosjitterbridged'||_0xf8c356==='rtpaudioqosloss'||_0xf8c356===_0x66ec('0x76')||_0xf8c356===_0x66ec('0x77')||_0xf8c356===_0x66ec('0x79')||_0xf8c356===_0x66ec('0x7a')||_0xf8c356===_0x66ec('0x7b')||_0xf8c356===_0x66ec('0x34')||_0xf8c356==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x107e23,_0x29d525){var _0x3a02f,_0x25e307,_0x5afb36;if(_0x29d525<=0x0){_0x29d525=0x1;}_0x3a02f=new RegExp(_0x66ec('0x7c')+_0x29d525+'}$');_0x25e307=Math['pow'](0xa,_0x29d525-0x1);_0x5afb36=Math[_0x66ec('0x7d')](0xa,_0x29d525)-0x1;return util[_0x66ec('0x14')]('%s',_[_0x66ec('0x7e')](_0x107e23,_0x3a02f,_['random'](_0x25e307,_0x5afb36)));};exports['extractCalleridName']=function(_0x4d1dc2){var _0x477d09=_0x4d1dc2[_0x66ec('0x7f')](/"(.*?)"/);return _0x477d09?_0x477d09[0x1]:_0x4d1dc2;};exports[_0x66ec('0x80')]=function(_0x1b13d4){var _0x26f931=_0x1b13d4[_0x66ec('0x7f')](/<(.*?)>/);return _0x26f931?_0x26f931[0x1]:_0x1b13d4;};
\ No newline at end of file