Built motion from commit 0900f080.|2.5.45
[motion2.git] / server / services / ami / preview / util / util.js
index 39b2e05..d95f992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c48=['Blacklist','starttime','responsetime','endtime','logAgent','state','statedesc','logLookAgent','membername','ringtime','talktime','answertime','Failure','variablesAction','calleridname','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','countbusyretry','countnoanswerretry','cloneAction','clone','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','push','getDiff','CampaignId','idContact','type','campaigntype','active','countcongestionretry','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4b070d,_0x4d48cc){var _0x192210=function(_0x145d05){while(--_0x145d05){_0x4b070d['push'](_0x4b070d['shift']());}};_0x192210(++_0x4d48cc);}(_0x0c48,0xd3));var _0x80c4=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x0c48[_0x393500];return _0x120d3b;};'use strict';var util=require(_0x80c4('0x0'));var _=require(_0x80c4('0x1'));var moment=require(_0x80c4('0x2'));var logger=require(_0x80c4('0x3'))(_0x80c4('0x4'));var ipAgi=process[_0x80c4('0x5')][_0x80c4('0x6')]||_0x80c4('0x7');function getSeconds(_0x1dd1cd,_0x528121){var _0x292235=moment(_0x1dd1cd)[_0x80c4('0x8')](0x0);var _0x2ab2bc=moment(_0x528121)[_0x80c4('0x8')](0x0);return _0x292235[_0x80c4('0x9')](_0x2ab2bc,_0x80c4('0xa'));}exports[_0x80c4('0xb')]=function(_0x4a25ec){return function(_0x31b127){logger[_0x80c4('0xc')](_0x4a25ec,util[_0x80c4('0xd')](_0x31b127,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x43c1f7,_0x34d6d5){logger[_0x80c4('0xe')](_0x43c1f7,util[_0x80c4('0xd')](_0x34d6d5,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x519234,_0xb1ea8c){logger[_0x80c4('0xc')](_0x519234,util[_0x80c4('0xd')](_0xb1ea8c,{'showHidden':![],'depth':null}));};exports[_0x80c4('0xf')]=function(_0xece124){return function(_0x1281dd){logger[_0x80c4('0xe')](_0xece124,util[_0x80c4('0xd')](_0x1281dd,{'showHidden':![],'depth':null}));};};exports[_0x80c4('0x10')]=function(_0x5b6cb5,_0x1d9a82,_0x8fd455){return{'message':_0x5b6cb5,'unlock':_0x1d9a82,'active':_0x8fd455};};exports[_0x80c4('0x11')]=function(_0x4521b1,_0x6237c6,_0x5adb6f){if(!_[_0x80c4('0x12')](_0x5adb6f)&&_0x80c4('0x13')===typeof _0x5adb6f&&!_[_0x80c4('0x14')](_0x5adb6f)){if(!_[_0x80c4('0x12')](_0x6237c6)&&_0x80c4('0x13')===typeof _0x6237c6&&!_[_0x80c4('0x14')](_0x6237c6)){return util[_0x80c4('0x15')](_0x80c4('0x16'),_0x6237c6,_0x5adb6f);}return util['format']('\x22%s\x22\x20<%s>',_0x5adb6f,_0x5adb6f);}if(!_[_0x80c4('0x12')](_0x4521b1)&&_0x80c4('0x13')===typeof _0x4521b1&&!_[_0x80c4('0x14')](_0x4521b1)){return _0x4521b1;}return _0x80c4('0x17');};exports[_0x80c4('0x18')]=function(_0x1faf67){if(_[_0x80c4('0x19')](_0x1faf67)){return![];}return _0x1faf67;};exports[_0x80c4('0x1a')]=function(_0x4346cc,_0x5135d,_0x349d7f,_0x3f505a,_0xa1df4b,_0x3b9b84){var _0x483004={'XMD-QUEUE':_0x5135d[_0x80c4('0x1b')]?_0x5135d[_0x80c4('0x1b')][_0x80c4('0x1c')]:'','XMD-CALLERID':_0x3f505a,'XMD-CALLERID-PREVIEW':_0x3b9b84?util[_0x80c4('0x15')](_0x80c4('0x16'),_0x3b9b84['calleridname'],_0x3b9b84[_0x80c4('0x1d')]):_0x3f505a,'XMD-DIALID':_0xa1df4b,'XMD-CONTACTID':_0x5135d[_0x80c4('0x1e')],'XMD-CDRTYPE':_0x80c4('0x1f'),'CALLERID(all)':_0x3f505a,'XMD-VOICEQUEUEID':_0x5135d[_0x80c4('0x20')],'XMD-DIALCHANNEL':_0x349d7f,'XMD-DIALTIMEOUT':_0x4346cc[_0x80c4('0x21')]||0x1e,'XMD-DIALOPTIONS':util[_0x80c4('0x15')](_0x80c4('0x22'),_0x4346cc['dialQueueProject2']?'g':'',_[_0x80c4('0x14')](_0x4346cc[_0x80c4('0x23')])?'':_0x80c4('0x24')),'XMD-DIALURL':_0x4346cc['dialPreviewUrl']||'','XMD-AGI':_0x4346cc['dialQueueProject']?util['format'](_0x80c4('0x25'),ipAgi,_0x4346cc['dialQueueProject']):_0x80c4('0x26'),'XMD-AGIAFTER':_0x4346cc[_0x80c4('0x27')]?util['format'](_0x80c4('0x25'),ipAgi,_0x4346cc[_0x80c4('0x27')]):_0x80c4('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x3b9b84?_0x3b9b84[_0x80c4('0x28')]:'','XMD-ORIGINATECALLERIDNAME':_0x3b9b84?_0x3b9b84[_0x80c4('0x29')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x80c4('0x14')](_0x4346cc['monitor_format'])){_0x483004[util[_0x80c4('0x15')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4346cc[_0x80c4('0x23')];_0x483004[util[_0x80c4('0x15')]('%s',_0x80c4('0x2a'))]=_0xa1df4b;}if(_0x5135d&&_0x5135d[_0x80c4('0x2b')]){for(var _0x24e816 in _0x5135d[_0x80c4('0x2b')]){if(_0x5135d[_0x80c4('0x2b')][_0x80c4('0x2c')](_0x24e816)){if(!_[_0x80c4('0x19')](_0x5135d[_0x80c4('0x2b')][_0x24e816])&&_0x24e816!=='id'&&_0x24e816!==_0x80c4('0x2d')&&_0x24e816!==_0x80c4('0x2e')&&_0x24e816!==_0x80c4('0x2f')){_0x483004[util[_0x80c4('0x15')](_0x80c4('0x30'),_0x80c4('0x31'),_[_0x80c4('0x32')](_0x24e816))]=_0x5135d[_0x80c4('0x2b')][_0x24e816];}}}}return _0x483004;};exports['toLowerVariables']=function(_0xd7ae5b){var _0x18f520={};for(var _0xdf9c3c in _0xd7ae5b){if(_0xd7ae5b['hasOwnProperty'](_0xdf9c3c)){_0x18f520[util['format']('%s',_[_0x80c4('0x33')](_0xdf9c3c))]=_0xd7ae5b[_0xdf9c3c];}}return{'variables':_0x18f520};};exports[_0x80c4('0x34')]=function(_0x4ff49d,_0x2b5375){if(!_['isNil'](_0x4ff49d)){if(_0x4ff49d[_0x80c4('0x2c')]('originated')){if(_0x4ff49d[_0x80c4('0x35')]>0x0){_0x4ff49d[_0x80c4('0x35')]-=0x1;}else{logger[_0x80c4('0xc')](_0x80c4('0x36'),_0x2b5375);}}}else{logger[_0x80c4('0xc')](_0x80c4('0x37'),_0x2b5375);}};exports['logBlacklist']=function(_0x1f0fa3){var _0x167803=moment()['format'](_0x80c4('0x38'));_0x1f0fa3['state']=0xd;_0x1f0fa3['statedesc']=_0x80c4('0x39');_0x1f0fa3[_0x80c4('0x3a')]=_0x167803;_0x1f0fa3[_0x80c4('0x3b')]=_0x167803;_0x1f0fa3[_0x80c4('0x3c')]=_0x167803;};exports[_0x80c4('0x3d')]=function(_0x4cd4ed,_0x4925ce,_0x2e350c){var _0x188bee=moment()['format'](_0x80c4('0x38'));_0x4cd4ed[_0x80c4('0x3e')]=_0x4925ce;_0x4cd4ed[_0x80c4('0x3f')]=_0x2e350c;_0x4cd4ed[_0x80c4('0x3b')]=_0x188bee;_0x4cd4ed['ringtime']=getSeconds(_0x4cd4ed['responsetime'],_0x4cd4ed[_0x80c4('0x3a')]);};exports[_0x80c4('0x40')]=function(_0x4b0416,_0x424f17,_0x48b3b8){_0x4b0416[_0x80c4('0x41')]=_0x424f17;_0x4b0416['UserId']=_0x48b3b8;};exports['logCustomer']=function(_0x1dea2f,_0x509871,_0x8d1cbe){var _0x5bcaf6=moment()[_0x80c4('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x1dea2f['state']=_0x509871;_0x1dea2f[_0x80c4('0x3f')]=_0x8d1cbe;_0x1dea2f[_0x80c4('0x3b')]=_0x1dea2f['responsetime']?_0x1dea2f[_0x80c4('0x3b')]:_0x5bcaf6;_0x1dea2f[_0x80c4('0x3c')]=_0x1dea2f[_0x80c4('0x3c')]?_0x1dea2f[_0x80c4('0x3c')]:_0x5bcaf6;_0x1dea2f[_0x80c4('0x42')]=getSeconds(_0x1dea2f[_0x80c4('0x3b')]||0x0,_0x1dea2f[_0x80c4('0x3a')]||0x0);_0x1dea2f[_0x80c4('0x43')]=_0x1dea2f[_0x80c4('0x44')]?getSeconds(_0x1dea2f['endtime'],_0x1dea2f[_0x80c4('0x44')]):0x0;};exports['isFailure']=function(_0x39cfa5){return _0x39cfa5===_0x80c4('0x45');};exports[_0x80c4('0x46')]=function(_0x420242,_0x11d74c,_0x4ecccf,_0x2cbb90,_0x553a0b){var _0x283cd5=_0x2cbb90?'RECALL':_0x420242[_0x80c4('0x47')];_0x283cd5=_0x553a0b?_0x80c4('0x48'):_0x283cd5;return{'actionid':_0x420242[_0x80c4('0x49')],'action':_0x80c4('0x4a'),'channel':_0x420242[_0x80c4('0x4b')],'callerid':util[_0x80c4('0x15')](_0x80c4('0x16'),_0x283cd5,_0x420242[_0x80c4('0x1d')]),'Exten':_0x80c4('0x4c'),'Context':_0x80c4('0x4d'),'Priority':'1','variable':_0x4ecccf,'timeout':(_0x11d74c[_0x80c4('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x420242[_0x80c4('0x49')]};};exports['totalGlobal']=function(_0x7b43d9){return _0x7b43d9[_0x80c4('0x4f')]+_0x7b43d9['countcongestionretry']+_0x7b43d9[_0x80c4('0x50')];};exports[_0x80c4('0x51')]=function(_0x2d48cd){var _0x2759d0=_[_0x80c4('0x52')](_0x2d48cd);_0x2759d0[_0x80c4('0x3e')]=0xf;_0x2759d0[_0x80c4('0x3f')]='Global';return _0x2759d0;};exports['scheduledAt']=function(_0x4fac47,_0xd59b7a,_0x7360e8){var _0x336132={};_0x336132[_0xd59b7a]=_0x4fac47[_0xd59b7a];_0x336132['active']=![];_0x336132[_0x80c4('0x53')]=moment()['add'](_0x7360e8,_0x80c4('0x54'))[_0x80c4('0x15')](_0x80c4('0x38'));_0x336132['ContactId']=_0x4fac47[_0x80c4('0x1e')];_0x336132[_0x80c4('0x55')]=_0x4fac47[_0x80c4('0x55')];_0x336132['VoiceQueueId']=_0x4fac47[_0x80c4('0x20')]||undefined;return _0x336132;};exports[_0x80c4('0x56')]=function(_0x15f797,_0x5dcf4f){if(!_[_0x80c4('0x19')](_0x15f797)){if(_0x15f797[_0x80c4('0x57')]>0x0){_0x15f797['pTalking']-=0x1;}else{logger['error'](_0x5dcf4f,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x80c4('0xc')](_0x5dcf4f,_0x80c4('0x58'));}};exports['IsNotLoggedIn']=function(_0x4efd12){if(_0x4efd12<=0x0){return!![];}return![];};exports['buildObj']=function(_0x474ce5,_0x1613ea){_0x474ce5[_0x80c4('0x59')]=_0x1613ea;_0x474ce5[_0x80c4('0x1c')]=_0x474ce5[_0x80c4('0x5a')];_0x474ce5[_0x80c4('0x5b')]=_0x474ce5[_0x80c4('0x4b')];return _0x474ce5;};exports[_0x80c4('0x5c')]=function(_0x49544c){var _0x261147={};_0x261147['queue']=_0x49544c['queue'];_0x261147['interface']=_0x49544c[_0x80c4('0x4b')];_0x261147[_0x80c4('0x49')]=_0x49544c[_0x80c4('0x49')];return _0x261147;};exports[_0x80c4('0x5d')]=function(_0x255c04){var _0x4c63fb=[];for(var _0x67a938 in _0x255c04){if(_0x255c04[_0x80c4('0x2c')](_0x67a938)){if(!_[_0x80c4('0x19')](_0x255c04[_0x67a938])&&_0x255c04[_0x67a938][_0x80c4('0x3e')]===_0x80c4('0x5e')&&_0x255c04[_0x67a938]['status']==='reachable'){_0x4c63fb[_0x80c4('0x5f')](_0x255c04[_0x67a938]['id']);}}}return _0x4c63fb;};exports[_0x80c4('0x60')]=function(_0x3707a1){var _0x43c328=moment()[_0x80c4('0x8')](0x0);var _0x1271a8=moment(_0x3707a1)[_0x80c4('0x8')](0x0);return _0x43c328['diff'](_0x1271a8,'seconds');};exports['createBody']=function(_0x21ac36){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x21ac36[_0x80c4('0x1e')],'ListId':_0x21ac36[_0x80c4('0x55')],'VoiceQueueId':_0x21ac36[_0x80c4('0x20')]||undefined,'CampaignId':_0x21ac36[_0x80c4('0x61')]||undefined};};exports['filterKey']=function(_0x1da39f){if(_0x1da39f===_0x80c4('0x49')||_0x1da39f===_0x80c4('0x62')||_0x1da39f===_0x80c4('0x5a')||_0x1da39f===_0x80c4('0x63')||_0x1da39f===_0x80c4('0x64')||_0x1da39f==='dialAnswer'||_0x1da39f===_0x80c4('0x41')||_0x1da39f===_0x80c4('0x4b')||_0x1da39f===_0x80c4('0x47')||_0x1da39f===_0x80c4('0x65')||_0x1da39f===_0x80c4('0x1d')||_0x1da39f===_0x80c4('0x53')||_0x1da39f===_0x80c4('0x4f')||_0x1da39f===_0x80c4('0x66')||_0x1da39f===_0x80c4('0x50')||_0x1da39f==='countglobal'||_0x1da39f===_0x80c4('0x67')||_0x1da39f===_0x80c4('0x68')||_0x1da39f===_0x80c4('0x69')||_0x1da39f===_0x80c4('0x6a')||_0x1da39f==='ContactId'||_0x1da39f===_0x80c4('0x55')||_0x1da39f==='UserId'||_0x1da39f===_0x80c4('0x20')||_0x1da39f===_0x80c4('0x6b')||_0x1da39f===_0x80c4('0x6c')||_0x1da39f===_0x80c4('0x6d')||_0x1da39f===_0x80c4('0x6e')||_0x1da39f==='xmd-listid'||_0x1da39f===_0x80c4('0x6f')||_0x1da39f===_0x80c4('0x70')||_0x1da39f===_0x80c4('0x71')||_0x1da39f===_0x80c4('0x72')||_0x1da39f==='xmd-dialchannel'||_0x1da39f===_0x80c4('0x73')||_0x1da39f===_0x80c4('0x74')||_0x1da39f===_0x80c4('0x75')||_0x1da39f==='xmd-agiafter'||_0x1da39f==='xmd-agi'||_0x1da39f===_0x80c4('0x76')||_0x1da39f===_0x80c4('0x77')||_0x1da39f===_0x80c4('0x78')||_0x1da39f==='rtpaudioqosjitterbridged'||_0x1da39f===_0x80c4('0x79')||_0x1da39f===_0x80c4('0x7a')||_0x1da39f===_0x80c4('0x7b')||_0x1da39f===_0x80c4('0x7c')||_0x1da39f===_0x80c4('0x76')||_0x1da39f===_0x80c4('0x77')||_0x1da39f===_0x80c4('0x78')||_0x1da39f===_0x80c4('0x7d')||_0x1da39f===_0x80c4('0x79')||_0x1da39f===_0x80c4('0x7a')||_0x1da39f==='rtpaudioqosrtt'||_0x1da39f===_0x80c4('0x7c')||_0x1da39f===_0x80c4('0x7e')||_0x1da39f==='bridgepvtcallid'||_0x1da39f===_0x80c4('0x3e')||_0x1da39f===_0x80c4('0x3f')){return![];}return!![];};exports[_0x80c4('0x7f')]=function(_0x323335,_0x447430){var _0x8d8eb0,_0x4da5c3,_0x523d62;if(_0x447430<=0x0){_0x447430=0x1;}_0x8d8eb0=new RegExp(_0x80c4('0x80')+_0x447430+'}$');_0x4da5c3=Math[_0x80c4('0x81')](0xa,_0x447430-0x1);_0x523d62=Math[_0x80c4('0x81')](0xa,_0x447430)-0x1;return util['format']('%s',_[_0x80c4('0x82')](_0x323335,_0x8d8eb0,_['random'](_0x4da5c3,_0x523d62)));};exports[_0x80c4('0x83')]=function(_0x452f58){var _0x226aac=_0x452f58[_0x80c4('0x84')](/"(.*?)"/);return _0x226aac?_0x226aac[0x1]:_0x452f58;};exports[_0x80c4('0x85')]=function(_0x214e52){var _0x163868=_0x214e52['match'](/<(.*?)>/);return _0x163868?_0x163868[0x1]:_0x214e52;};
\ No newline at end of file
+var _0xe7f8=['idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','replace','random','extractCalleridNumber','match','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isEmpty','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','updatedAt','XMD-','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','logAgent','statedesc','logLookAgent','membername','logCustomer','endtime','talktime','answertime','variablesAction','calleridname','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','buildAcw','agentReadyId','reachable','push','createBody','filterKey'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0xe7f8,0xac));var _0x8e7f=function(_0x441bad,_0x27ce55){_0x441bad=_0x441bad-0x0;var _0x1f94d1=_0xe7f8[_0x441bad];return _0x1f94d1;};'use strict';var util=require(_0x8e7f('0x0'));var _=require(_0x8e7f('0x1'));var moment=require('moment');var logger=require(_0x8e7f('0x2'))(_0x8e7f('0x3'));var ipAgi=process[_0x8e7f('0x4')][_0x8e7f('0x5')]||'127.0.0.1';function getSeconds(_0x1c736e,_0x2cf404){var _0x26afa6=moment(_0x1c736e)[_0x8e7f('0x6')](0x0);var _0x4befa2=moment(_0x2cf404)['milliseconds'](0x0);return _0x26afa6[_0x8e7f('0x7')](_0x4befa2,_0x8e7f('0x8'));}exports[_0x8e7f('0x9')]=function(_0x456e8e){return function(_0x4db72b){logger[_0x8e7f('0xa')](_0x456e8e,util[_0x8e7f('0xb')](_0x4db72b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1c050c,_0x2dc74f){logger[_0x8e7f('0xc')](_0x1c050c,util['inspect'](_0x2dc74f,{'showHidden':![],'depth':null}));};exports[_0x8e7f('0xd')]=function(_0x4f3547,_0x4d03c2){logger[_0x8e7f('0xa')](_0x4f3547,util['inspect'](_0x4d03c2,{'showHidden':![],'depth':null}));};exports[_0x8e7f('0xe')]=function(_0x5b8ba6){return function(_0x401048){logger['info'](_0x5b8ba6,util['inspect'](_0x401048,{'showHidden':![],'depth':null}));};};exports[_0x8e7f('0xf')]=function(_0x218321,_0x833fc0,_0x2fb31f){return{'message':_0x218321,'unlock':_0x833fc0,'active':_0x2fb31f};};exports[_0x8e7f('0x10')]=function(_0x2ba34e,_0x366607,_0x1c911b){if(!_['isUndefined'](_0x1c911b)&&'string'===typeof _0x1c911b&&!_[_0x8e7f('0x11')](_0x1c911b)){if(!_[_0x8e7f('0x12')](_0x366607)&&_0x8e7f('0x13')===typeof _0x366607&&!_['isEmpty'](_0x366607)){return util['format'](_0x8e7f('0x14'),_0x366607,_0x1c911b);}return util[_0x8e7f('0x15')](_0x8e7f('0x14'),_0x1c911b,_0x1c911b);}if(!_['isUndefined'](_0x2ba34e)&&_0x8e7f('0x13')===typeof _0x2ba34e&&!_[_0x8e7f('0x11')](_0x2ba34e)){return _0x2ba34e;}return _0x8e7f('0x16');};exports[_0x8e7f('0x17')]=function(_0x193594){if(_['isNil'](_0x193594)){return![];}return _0x193594;};exports[_0x8e7f('0x18')]=function(_0x3f8d4c,_0x2695ae,_0x54ca3f,_0x594142,_0x2cc8fe,_0x516d0c){var _0x45ea64={'XMD-QUEUE':_0x2695ae['Queue']?_0x2695ae[_0x8e7f('0x19')][_0x8e7f('0x1a')]:'','XMD-CALLERID':_0x594142,'XMD-CALLERID-PREVIEW':_0x516d0c?util[_0x8e7f('0x15')](_0x8e7f('0x14'),_0x516d0c['calleridname'],_0x516d0c[_0x8e7f('0x1b')]):_0x594142,'XMD-DIALID':_0x2cc8fe,'XMD-CONTACTID':_0x2695ae['ContactId'],'XMD-CDRTYPE':_0x8e7f('0x1c'),'CALLERID(all)':_0x594142,'XMD-VOICEQUEUEID':_0x2695ae[_0x8e7f('0x1d')],'XMD-DIALCHANNEL':_0x54ca3f,'XMD-DIALTIMEOUT':_0x3f8d4c[_0x8e7f('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x8e7f('0x15')]('\x22rtTxX%s%s\x22',_0x3f8d4c[_0x8e7f('0x1f')]?'g':'',_[_0x8e7f('0x11')](_0x3f8d4c[_0x8e7f('0x20')])?'':_0x8e7f('0x21')),'XMD-DIALURL':_0x3f8d4c['dialPreviewUrl']||'','XMD-AGI':_0x3f8d4c[_0x8e7f('0x22')]?util[_0x8e7f('0x15')](_0x8e7f('0x23'),ipAgi,_0x3f8d4c['dialQueueProject']):_0x8e7f('0x24'),'XMD-AGIAFTER':_0x3f8d4c[_0x8e7f('0x1f')]?util[_0x8e7f('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3f8d4c[_0x8e7f('0x1f')]):_0x8e7f('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x516d0c?_0x516d0c['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x516d0c?_0x516d0c[_0x8e7f('0x25')]:'','XMD-DESTINATION':_0x8e7f('0x26'),'SIPADDHEADER':_0x8e7f('0x27')};if(!_['isEmpty'](_0x3f8d4c['monitor_format'])){_0x45ea64[util['format']('%s',_0x8e7f('0x28'))]=_0x3f8d4c['monitor_format'];_0x45ea64[util['format']('%s',_0x8e7f('0x29'))]=_0x2cc8fe;}if(_0x2695ae&&_0x2695ae[_0x8e7f('0x2a')]){for(var _0x23be94 in _0x2695ae['Contact']){if(_0x2695ae['Contact'][_0x8e7f('0x2b')](_0x23be94)){if(!_[_0x8e7f('0x2c')](_0x2695ae[_0x8e7f('0x2a')][_0x23be94])&&_0x23be94!=='id'&&_0x23be94!==_0x8e7f('0x2d')&&_0x23be94!=='createdAt'&&_0x23be94!==_0x8e7f('0x2e')){_0x45ea64[util[_0x8e7f('0x15')]('%s%s',_0x8e7f('0x2f'),_['toUpper'](_0x23be94))]=_0x2695ae[_0x8e7f('0x2a')][_0x23be94];}}}}return _0x45ea64;};exports['toLowerVariables']=function(_0x100753){var _0x116f63={};for(var _0x41f941 in _0x100753){if(_0x100753[_0x8e7f('0x2b')](_0x41f941)){_0x116f63[util[_0x8e7f('0x15')]('%s',_['toLower'](_0x41f941))]=_0x100753[_0x41f941];}}return{'variables':_0x116f63};};exports['updateOriginated']=function(_0x212963,_0x4a5816){if(!_[_0x8e7f('0x2c')](_0x212963)){if(_0x212963[_0x8e7f('0x2b')]('originated')){if(_0x212963[_0x8e7f('0x30')]>0x0){_0x212963[_0x8e7f('0x30')]-=0x1;}else{logger['error'](_0x8e7f('0x31'),_0x4a5816);}}}else{logger[_0x8e7f('0xa')](_0x8e7f('0x32'),_0x4a5816);}};exports[_0x8e7f('0x33')]=function(_0x4b23cf){var _0x56d95d=moment()[_0x8e7f('0x15')](_0x8e7f('0x34'));_0x4b23cf[_0x8e7f('0x35')]=0xd;_0x4b23cf['statedesc']=_0x8e7f('0x36');_0x4b23cf[_0x8e7f('0x37')]=_0x56d95d;_0x4b23cf[_0x8e7f('0x38')]=_0x56d95d;_0x4b23cf['endtime']=_0x56d95d;};exports[_0x8e7f('0x39')]=function(_0x5b9d83,_0x297677,_0x5269e9){var _0x4bef44=moment()[_0x8e7f('0x15')](_0x8e7f('0x34'));_0x5b9d83[_0x8e7f('0x35')]=_0x297677;_0x5b9d83[_0x8e7f('0x3a')]=_0x5269e9;_0x5b9d83[_0x8e7f('0x38')]=_0x4bef44;_0x5b9d83['ringtime']=getSeconds(_0x5b9d83[_0x8e7f('0x38')],_0x5b9d83[_0x8e7f('0x37')]);};exports[_0x8e7f('0x3b')]=function(_0x125bc4,_0x3be4ba,_0x320330){_0x125bc4[_0x8e7f('0x3c')]=_0x3be4ba;_0x125bc4['UserId']=_0x320330;};exports[_0x8e7f('0x3d')]=function(_0x29c7b6,_0xae8e91,_0xf0a464){var _0x1d8684=moment()[_0x8e7f('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x29c7b6['state']=_0xae8e91;_0x29c7b6[_0x8e7f('0x3a')]=_0xf0a464;_0x29c7b6['responsetime']=_0x29c7b6[_0x8e7f('0x38')]?_0x29c7b6['responsetime']:_0x1d8684;_0x29c7b6['endtime']=_0x29c7b6[_0x8e7f('0x3e')]?_0x29c7b6['endtime']:_0x1d8684;_0x29c7b6['ringtime']=getSeconds(_0x29c7b6[_0x8e7f('0x38')]||0x0,_0x29c7b6[_0x8e7f('0x37')]||0x0);_0x29c7b6[_0x8e7f('0x3f')]=_0x29c7b6[_0x8e7f('0x40')]?getSeconds(_0x29c7b6[_0x8e7f('0x3e')],_0x29c7b6[_0x8e7f('0x40')]):0x0;};exports['isFailure']=function(_0x2543ff){return _0x2543ff==='Failure';};exports[_0x8e7f('0x41')]=function(_0x3f7998,_0x35a1f7,_0x4c790b,_0x30dc7d,_0x2436ac){var _0x5521f9=_0x30dc7d?'RECALL':_0x3f7998[_0x8e7f('0x42')];_0x5521f9=_0x2436ac?'BOOKED':_0x5521f9;return{'actionid':_0x3f7998[_0x8e7f('0x43')],'action':_0x8e7f('0x44'),'channel':_0x3f7998[_0x8e7f('0x45')],'callerid':util[_0x8e7f('0x15')](_0x8e7f('0x14'),_0x5521f9,_0x3f7998[_0x8e7f('0x1b')]),'Exten':_0x8e7f('0x26'),'Context':_0x8e7f('0x46'),'Priority':'1','variable':_0x4c790b,'timeout':(_0x35a1f7[_0x8e7f('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3f7998['uniqueid']};};exports[_0x8e7f('0x48')]=function(_0x23d356){return _0x23d356[_0x8e7f('0x49')]+_0x23d356[_0x8e7f('0x4a')]+_0x23d356['countnoanswerretry']+_0x23d356[_0x8e7f('0x4b')]+_0x23d356['countnosuchnumberretry'];};exports[_0x8e7f('0x4c')]=function(_0x4f5d54){var _0x5144fb=_[_0x8e7f('0x4d')](_0x4f5d54);_0x5144fb[_0x8e7f('0x35')]=0xf;_0x5144fb[_0x8e7f('0x3a')]=_0x8e7f('0x4e');return _0x5144fb;};exports[_0x8e7f('0x4f')]=function(_0x32bc56,_0x3cb24d,_0x4e649d){var _0x39f8e0={};_0x39f8e0[_0x3cb24d]=_0x32bc56[_0x3cb24d];_0x39f8e0[_0x8e7f('0x50')]=![];_0x39f8e0['scheduledat']=moment()[_0x8e7f('0x51')](_0x4e649d,_0x8e7f('0x52'))[_0x8e7f('0x15')](_0x8e7f('0x34'));_0x39f8e0['ContactId']=_0x32bc56[_0x8e7f('0x53')];_0x39f8e0[_0x8e7f('0x54')]=_0x32bc56['ListId'];_0x39f8e0[_0x8e7f('0x1d')]=_0x32bc56['VoiceQueueId']||undefined;return _0x39f8e0;};exports[_0x8e7f('0x55')]=function(_0x4ff826,_0xa8113c){if(!_['isNil'](_0x4ff826)){if(_0x4ff826['pTalking']>0x0){_0x4ff826[_0x8e7f('0x56')]-=0x1;}else{logger['error'](_0xa8113c,_0x8e7f('0x57'));}}else{logger[_0x8e7f('0xa')](_0xa8113c,_0x8e7f('0x58'));}};exports['IsNotLoggedIn']=function(_0x4d81d2){if(_0x4d81d2<=0x0){return!![];}return![];};exports[_0x8e7f('0x59')]=function(_0x40b800,_0xd361dc,_0x5b9424){_0x40b800[_0x8e7f('0x5a')]=_0xd361dc;_0x40b800[_0x8e7f('0x1a')]=_0x40b800[_0x8e7f('0x5b')];_0x40b800[_0x8e7f('0x5c')]=_0x40b800[_0x8e7f('0x45')];_0x40b800[_0x8e7f('0x5d')]=_0x8e7f('0x5e');if(_0x5b9424){_0x40b800[_0x8e7f('0x5f')]=_0x5b9424[_0x8e7f('0x5f')];}return _0x40b800;};exports[_0x8e7f('0x60')]=function(_0x27f4fb){var _0x523d3d={};_0x523d3d['queue']=_0x27f4fb[_0x8e7f('0x5b')];_0x523d3d[_0x8e7f('0x5c')]=_0x27f4fb[_0x8e7f('0x45')];_0x523d3d[_0x8e7f('0x43')]=_0x27f4fb[_0x8e7f('0x43')];return _0x523d3d;};exports[_0x8e7f('0x61')]=function(_0x5de156){var _0x46d696=[];for(var _0x52f8cb in _0x5de156){if(_0x5de156[_0x8e7f('0x2b')](_0x52f8cb)){if(!_[_0x8e7f('0x2c')](_0x5de156[_0x52f8cb])&&_0x5de156[_0x52f8cb][_0x8e7f('0x35')]==='not_inuse'&&_0x5de156[_0x52f8cb]['status']===_0x8e7f('0x62')){_0x46d696[_0x8e7f('0x63')](_0x5de156[_0x52f8cb]['id']);}}}return _0x46d696;};exports['getDiff']=function(_0x4fd389){var _0x158466=moment()[_0x8e7f('0x6')](0x0);var _0x535ff2=moment(_0x4fd389)[_0x8e7f('0x6')](0x0);return _0x158466[_0x8e7f('0x7')](_0x535ff2,'seconds');};exports[_0x8e7f('0x64')]=function(_0x8427f8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x8427f8[_0x8e7f('0x53')],'ListId':_0x8427f8[_0x8e7f('0x54')],'VoiceQueueId':_0x8427f8['VoiceQueueId']||undefined,'CampaignId':_0x8427f8['CampaignId']||undefined};};exports[_0x8e7f('0x65')]=function(_0x1cfa85){if(_0x1cfa85===_0x8e7f('0x43')||_0x1cfa85===_0x8e7f('0x66')||_0x1cfa85===_0x8e7f('0x5b')||_0x1cfa85===_0x8e7f('0x67')||_0x1cfa85===_0x8e7f('0x68')||_0x1cfa85===_0x8e7f('0x69')||_0x1cfa85==='membername'||_0x1cfa85===_0x8e7f('0x45')||_0x1cfa85===_0x8e7f('0x42')||_0x1cfa85===_0x8e7f('0x50')||_0x1cfa85===_0x8e7f('0x1b')||_0x1cfa85==='scheduledat'||_0x1cfa85===_0x8e7f('0x49')||_0x1cfa85===_0x8e7f('0x4a')||_0x1cfa85===_0x8e7f('0x6a')||_0x1cfa85===_0x8e7f('0x6b')||_0x1cfa85==='callback'||_0x1cfa85===_0x8e7f('0x6c')||_0x1cfa85===_0x8e7f('0x6d')||_0x1cfa85==='recallme'||_0x1cfa85===_0x8e7f('0x53')||_0x1cfa85==='ListId'||_0x1cfa85===_0x8e7f('0x6e')||_0x1cfa85==='VoiceQueueId'||_0x1cfa85===_0x8e7f('0x6f')||_0x1cfa85===_0x8e7f('0x70')||_0x1cfa85===_0x8e7f('0x71')||_0x1cfa85==='xmd-phone'||_0x1cfa85===_0x8e7f('0x72')||_0x1cfa85===_0x8e7f('0x73')||_0x1cfa85===_0x8e7f('0x74')||_0x1cfa85===_0x8e7f('0x75')||_0x1cfa85===_0x8e7f('0x76')||_0x1cfa85===_0x8e7f('0x77')||_0x1cfa85===_0x8e7f('0x78')||_0x1cfa85===_0x8e7f('0x79')||_0x1cfa85==='xmd-callerid'||_0x1cfa85==='xmd-agiafter'||_0x1cfa85===_0x8e7f('0x7a')||_0x1cfa85===_0x8e7f('0x7b')||_0x1cfa85===_0x8e7f('0x7c')||_0x1cfa85==='rtpaudioqosjitter'||_0x1cfa85==='rtpaudioqosjitterbridged'||_0x1cfa85===_0x8e7f('0x7d')||_0x1cfa85===_0x8e7f('0x7e')||_0x1cfa85===_0x8e7f('0x7f')||_0x1cfa85===_0x8e7f('0x80')||_0x1cfa85===_0x8e7f('0x7b')||_0x1cfa85===_0x8e7f('0x7c')||_0x1cfa85===_0x8e7f('0x81')||_0x1cfa85==='rtpaudioqosjitterbridged'||_0x1cfa85===_0x8e7f('0x7d')||_0x1cfa85===_0x8e7f('0x7e')||_0x1cfa85===_0x8e7f('0x7f')||_0x1cfa85===_0x8e7f('0x80')||_0x1cfa85===_0x8e7f('0x82')||_0x1cfa85===_0x8e7f('0x83')||_0x1cfa85==='state'||_0x1cfa85===_0x8e7f('0x3a')){return![];}return!![];};exports[_0x8e7f('0x84')]=function(_0x43cbda,_0x271d80){var _0x554392,_0x78e6f4,_0x358e3a;if(_0x271d80<=0x0){_0x271d80=0x1;}_0x554392=new RegExp('\x5cw{0,'+_0x271d80+'}$');_0x78e6f4=Math['pow'](0xa,_0x271d80-0x1);_0x358e3a=Math['pow'](0xa,_0x271d80)-0x1;return util['format']('%s',_[_0x8e7f('0x85')](_0x43cbda,_0x554392,_[_0x8e7f('0x86')](_0x78e6f4,_0x358e3a)));};exports['extractCalleridName']=function(_0x8a189){var _0x3c5dc4=_0x8a189['match'](/"(.*?)"/);return _0x3c5dc4?_0x3c5dc4[0x1]:_0x8a189;};exports[_0x8e7f('0x87')]=function(_0x10f3fd){var _0x3a6fff=_0x10f3fd[_0x8e7f('0x88')](/<(.*?)>/);return _0x3a6fff?_0x3a6fff[0x1]:_0x10f3fd;};
\ No newline at end of file