Built motion from commit (unavailable).|2.5.1
[motion2.git] / server / services / ami / preview / util / util.js
index fb4c5b7..1517d00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9413=['diff','seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','calleridname','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','updatedAt','%s%s','toUpper','toLowerVariables','hasOwnProperty','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','answertime','RECALL','BOOKED','uniqueid','originate','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','minutes','ContactId','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','interface','channelAgent','not_inuse','status','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','countnoanswerretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds'];(function(_0x3dbb87,_0x47419d){var _0x141ca0=function(_0x3c101c){while(--_0x3c101c){_0x3dbb87['push'](_0x3dbb87['shift']());}};_0x141ca0(++_0x47419d);}(_0x9413,0x85));var _0x3941=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x9413[_0x26bcec];return _0x1049dc;};'use strict';var util=require('util');var _=require(_0x3941('0x0'));var moment=require(_0x3941('0x1'));var logger=require(_0x3941('0x2'))(_0x3941('0x3'));var ipAgi=process[_0x3941('0x4')][_0x3941('0x5')]||'127.0.0.1';function getSeconds(_0x300e49,_0x4f35d1){var _0x17639e=moment(_0x300e49)[_0x3941('0x6')](0x0);var _0x338071=moment(_0x4f35d1)['milliseconds'](0x0);return _0x17639e[_0x3941('0x7')](_0x338071,_0x3941('0x8'));}exports[_0x3941('0x9')]=function(_0x26cc76){return function(_0x507968){logger['error'](_0x26cc76,util[_0x3941('0xa')](_0x507968,{'showHidden':![],'depth':null}));};};exports[_0x3941('0xb')]=function(_0x4dd784,_0x494bbe){logger[_0x3941('0xc')](_0x4dd784,util[_0x3941('0xa')](_0x494bbe,{'showHidden':![],'depth':null}));};exports[_0x3941('0xd')]=function(_0xdfddad,_0x3b3685){logger[_0x3941('0xe')](_0xdfddad,util[_0x3941('0xa')](_0x3b3685,{'showHidden':![],'depth':null}));};exports[_0x3941('0xf')]=function(_0x443bdf){return function(_0x2d4a61){logger[_0x3941('0xc')](_0x443bdf,util[_0x3941('0xa')](_0x2d4a61,{'showHidden':![],'depth':null}));};};exports[_0x3941('0x10')]=function(_0x2b2f05,_0x3c4fd2,_0x140c84){return{'message':_0x2b2f05,'unlock':_0x3c4fd2,'active':_0x140c84};};exports[_0x3941('0x11')]=function(_0x5d4cdf,_0x407976,_0x2c5f71){if(!_[_0x3941('0x12')](_0x2c5f71)&&_0x3941('0x13')===typeof _0x2c5f71&&!_[_0x3941('0x14')](_0x2c5f71)){if(!_[_0x3941('0x12')](_0x407976)&&_0x3941('0x13')===typeof _0x407976&&!_[_0x3941('0x14')](_0x407976)){return util['format']('\x22%s\x22\x20<%s>',_0x407976,_0x2c5f71);}return util[_0x3941('0x15')](_0x3941('0x16'),_0x2c5f71,_0x2c5f71);}if(!_[_0x3941('0x12')](_0x5d4cdf)&&_0x3941('0x13')===typeof _0x5d4cdf&&!_['isEmpty'](_0x5d4cdf)){return _0x5d4cdf;}return _0x3941('0x17');};exports[_0x3941('0x18')]=function(_0x2b97d8){if(_[_0x3941('0x19')](_0x2b97d8)){return![];}return _0x2b97d8;};exports['addVariables']=function(_0x39f98d,_0x55aec2,_0x53d30a,_0x5b9e68,_0x39d9f0,_0x77b29f){var _0x26424c={'XMD-QUEUE':_0x55aec2['Queue']?_0x55aec2[_0x3941('0x1a')]['name']:'','XMD-CALLERID':_0x5b9e68,'XMD-CALLERID-PREVIEW':_0x77b29f?util[_0x3941('0x15')](_0x3941('0x16'),_0x77b29f[_0x3941('0x1b')],_0x77b29f['calleridnum']):_0x5b9e68,'XMD-DIALID':_0x39d9f0,'XMD-CONTACTID':_0x55aec2['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5b9e68,'XMD-VOICEQUEUEID':_0x55aec2[_0x3941('0x1c')],'XMD-DIALCHANNEL':_0x53d30a,'XMD-DIALTIMEOUT':_0x39f98d[_0x3941('0x1d')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x3941('0x1e'),_0x39f98d[_0x3941('0x1f')]?'g':'',_[_0x3941('0x14')](_0x39f98d[_0x3941('0x20')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x39f98d['dialPreviewUrl']||'','XMD-AGI':_0x39f98d[_0x3941('0x21')]?util[_0x3941('0x15')](_0x3941('0x22'),ipAgi,_0x39f98d[_0x3941('0x21')]):'NONE','XMD-AGIAFTER':_0x39f98d[_0x3941('0x1f')]?util[_0x3941('0x15')](_0x3941('0x22'),ipAgi,_0x39f98d[_0x3941('0x1f')]):_0x3941('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x77b29f?_0x77b29f[_0x3941('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x77b29f?_0x77b29f[_0x3941('0x25')]:'','XMD-DESTINATION':_0x3941('0x26')};if(!_[_0x3941('0x14')](_0x39f98d[_0x3941('0x20')])){_0x26424c[util[_0x3941('0x15')]('%s',_0x3941('0x27'))]=_0x39f98d[_0x3941('0x20')];_0x26424c[util['format']('%s',_0x3941('0x28'))]=_0x39d9f0;}if(_0x55aec2&&_0x55aec2['Contact']){for(var _0x2e6b00 in _0x55aec2[_0x3941('0x29')]){if(_0x55aec2['Contact']['hasOwnProperty'](_0x2e6b00)){if(!_[_0x3941('0x19')](_0x55aec2[_0x3941('0x29')][_0x2e6b00])&&_0x2e6b00!=='id'&&_0x2e6b00!=='tags'&&_0x2e6b00!=='createdAt'&&_0x2e6b00!==_0x3941('0x2a')){_0x26424c[util[_0x3941('0x15')](_0x3941('0x2b'),'XMD-',_[_0x3941('0x2c')](_0x2e6b00))]=_0x55aec2[_0x3941('0x29')][_0x2e6b00];}}}}return _0x26424c;};exports[_0x3941('0x2d')]=function(_0x459ada){var _0x482a08={};for(var _0x1923fb in _0x459ada){if(_0x459ada[_0x3941('0x2e')](_0x1923fb)){_0x482a08[util[_0x3941('0x15')]('%s',_['toLower'](_0x1923fb))]=_0x459ada[_0x1923fb];}}return{'variables':_0x482a08};};exports['updateOriginated']=function(_0x43d18e,_0x1deda6){if(!_[_0x3941('0x19')](_0x43d18e)){if(_0x43d18e[_0x3941('0x2e')]('originated')){if(_0x43d18e[_0x3941('0x2f')]>0x0){_0x43d18e[_0x3941('0x2f')]-=0x1;}else{logger['error'](_0x3941('0x30'),_0x1deda6);}}}else{logger[_0x3941('0xe')](_0x3941('0x31'),_0x1deda6);}};exports['logBlacklist']=function(_0xc93b2){var _0x3a4353=moment()[_0x3941('0x15')](_0x3941('0x32'));_0xc93b2[_0x3941('0x33')]=0xd;_0xc93b2['statedesc']=_0x3941('0x34');_0xc93b2[_0x3941('0x35')]=_0x3a4353;_0xc93b2[_0x3941('0x36')]=_0x3a4353;_0xc93b2[_0x3941('0x37')]=_0x3a4353;};exports[_0x3941('0x38')]=function(_0x3ab23d,_0x35ed17,_0x140e22){var _0x5d0026=moment()['format'](_0x3941('0x32'));_0x3ab23d['state']=_0x35ed17;_0x3ab23d[_0x3941('0x39')]=_0x140e22;_0x3ab23d[_0x3941('0x36')]=_0x5d0026;_0x3ab23d[_0x3941('0x3a')]=getSeconds(_0x3ab23d[_0x3941('0x36')],_0x3ab23d['starttime']);};exports[_0x3941('0x3b')]=function(_0xf1c4a7,_0xa13ad3,_0x41fd9f){_0xf1c4a7[_0x3941('0x3c')]=_0xa13ad3;_0xf1c4a7[_0x3941('0x3d')]=_0x41fd9f;};exports[_0x3941('0x3e')]=function(_0x4d733d,_0x11e36b,_0x1e10c3){var _0x93286a=moment()[_0x3941('0x15')](_0x3941('0x32'));_0x4d733d[_0x3941('0x33')]=_0x11e36b;_0x4d733d[_0x3941('0x39')]=_0x1e10c3;_0x4d733d[_0x3941('0x36')]=_0x4d733d['responsetime']?_0x4d733d[_0x3941('0x36')]:_0x93286a;_0x4d733d['endtime']=_0x4d733d[_0x3941('0x37')]?_0x4d733d[_0x3941('0x37')]:_0x93286a;_0x4d733d['ringtime']=getSeconds(_0x4d733d[_0x3941('0x36')]||0x0,_0x4d733d[_0x3941('0x35')]||0x0);_0x4d733d['talktime']=_0x4d733d['answertime']?getSeconds(_0x4d733d['endtime'],_0x4d733d[_0x3941('0x3f')]):0x0;};exports['isFailure']=function(_0x47311a){return _0x47311a==='Failure';};exports['variablesAction']=function(_0x173a91,_0x4b368d,_0x227897,_0x1f6955,_0x5ba180){var _0xd1a24f=_0x1f6955?_0x3941('0x40'):_0x173a91['calleridname'];_0xd1a24f=_0x5ba180?_0x3941('0x41'):_0xd1a24f;return{'actionid':_0x173a91[_0x3941('0x42')],'action':_0x3941('0x43'),'channel':_0x173a91['channelAgent'],'callerid':util['format']('\x22%s\x22\x20<%s>',_0xd1a24f,_0x173a91[_0x3941('0x44')]),'Exten':'xcally-motion-preview','Context':_0x3941('0x45'),'Priority':'1','variable':_0x227897,'timeout':(_0x4b368d[_0x3941('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x173a91[_0x3941('0x42')]};};exports[_0x3941('0x47')]=function(_0x201061){return _0x201061[_0x3941('0x48')]+_0x201061[_0x3941('0x49')]+_0x201061['countnoanswerretry']+_0x201061[_0x3941('0x4a')]+_0x201061[_0x3941('0x4b')];};exports[_0x3941('0x4c')]=function(_0x2e7b4b){var _0xfa1295=_[_0x3941('0x4d')](_0x2e7b4b);_0xfa1295[_0x3941('0x33')]=0xf;_0xfa1295['statedesc']='Global';return _0xfa1295;};exports[_0x3941('0x4e')]=function(_0x14c213,_0x48e774,_0x478013){var _0x1d15ed={};_0x1d15ed[_0x48e774]=_0x14c213[_0x48e774];_0x1d15ed[_0x3941('0x4f')]=![];_0x1d15ed['scheduledat']=moment()['add'](_0x478013,_0x3941('0x50'))[_0x3941('0x15')](_0x3941('0x32'));_0x1d15ed[_0x3941('0x51')]=_0x14c213[_0x3941('0x51')];_0x1d15ed[_0x3941('0x52')]=_0x14c213[_0x3941('0x52')];_0x1d15ed[_0x3941('0x1c')]=_0x14c213[_0x3941('0x1c')]||undefined;return _0x1d15ed;};exports[_0x3941('0x53')]=function(_0x55fc47,_0x148d18){if(!_['isNil'](_0x55fc47)){if(_0x55fc47['pTalking']>0x0){_0x55fc47['pTalking']-=0x1;}else{logger[_0x3941('0xe')](_0x148d18,_0x3941('0x54'));}}else{logger[_0x3941('0xe')](_0x148d18,_0x3941('0x55'));}};exports[_0x3941('0x56')]=function(_0x4ff214){if(_0x4ff214<=0x0){return!![];}return![];};exports[_0x3941('0x57')]=function(_0x17577c,_0x46b144,_0x244585){_0x17577c[_0x3941('0x58')]=_0x46b144;_0x17577c[_0x3941('0x59')]=_0x17577c[_0x3941('0x5a')];_0x17577c['interface']=_0x17577c['channelAgent'];if(_0x244585){_0x17577c['mandatoryDisposition']=_0x244585['mandatoryDisposition'];}return _0x17577c;};exports['buildAcw']=function(_0x1f3390){var _0xa2de96={};_0xa2de96['queue']=_0x1f3390[_0x3941('0x5a')];_0xa2de96[_0x3941('0x5b')]=_0x1f3390[_0x3941('0x5c')];_0xa2de96['uniqueid']=_0x1f3390[_0x3941('0x42')];return _0xa2de96;};exports['agentReadyId']=function(_0x2c7ab8){var _0x555787=[];for(var _0x511700 in _0x2c7ab8){if(_0x2c7ab8[_0x3941('0x2e')](_0x511700)){if(!_['isNil'](_0x2c7ab8[_0x511700])&&_0x2c7ab8[_0x511700][_0x3941('0x33')]===_0x3941('0x5d')&&_0x2c7ab8[_0x511700][_0x3941('0x5e')]==='reachable'){_0x555787['push'](_0x2c7ab8[_0x511700]['id']);}}}return _0x555787;};exports[_0x3941('0x5f')]=function(_0x1d259d){var _0x446042=moment()[_0x3941('0x6')](0x0);var _0x52a864=moment(_0x1d259d)[_0x3941('0x6')](0x0);return _0x446042[_0x3941('0x7')](_0x52a864,_0x3941('0x8'));};exports[_0x3941('0x60')]=function(_0x524644){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x524644['ContactId'],'ListId':_0x524644[_0x3941('0x52')],'VoiceQueueId':_0x524644[_0x3941('0x1c')]||undefined,'CampaignId':_0x524644[_0x3941('0x61')]||undefined};};exports[_0x3941('0x62')]=function(_0x53e15d){if(_0x53e15d===_0x3941('0x42')||_0x53e15d===_0x3941('0x63')||_0x53e15d==='queue'||_0x53e15d===_0x3941('0x64')||_0x53e15d===_0x3941('0x65')||_0x53e15d==='dialAnswer'||_0x53e15d==='membername'||_0x53e15d===_0x3941('0x5c')||_0x53e15d===_0x3941('0x1b')||_0x53e15d===_0x3941('0x4f')||_0x53e15d===_0x3941('0x44')||_0x53e15d==='scheduledat'||_0x53e15d==='countbusyretry'||_0x53e15d==='countcongestionretry'||_0x53e15d===_0x3941('0x66')||_0x53e15d===_0x3941('0x67')||_0x53e15d==='callback'||_0x53e15d===_0x3941('0x68')||_0x53e15d===_0x3941('0x69')||_0x53e15d===_0x3941('0x6a')||_0x53e15d==='ContactId'||_0x53e15d===_0x3941('0x52')||_0x53e15d===_0x3941('0x3d')||_0x53e15d===_0x3941('0x1c')||_0x53e15d===_0x3941('0x6b')||_0x53e15d===_0x3941('0x6c')||_0x53e15d===_0x3941('0x6d')||_0x53e15d===_0x3941('0x6e')||_0x53e15d===_0x3941('0x6f')||_0x53e15d===_0x3941('0x70')||_0x53e15d===_0x3941('0x71')||_0x53e15d===_0x3941('0x72')||_0x53e15d===_0x3941('0x73')||_0x53e15d===_0x3941('0x74')||_0x53e15d===_0x3941('0x75')||_0x53e15d===_0x3941('0x76')||_0x53e15d===_0x3941('0x77')||_0x53e15d===_0x3941('0x78')||_0x53e15d===_0x3941('0x79')||_0x53e15d===_0x3941('0x7a')||_0x53e15d===_0x3941('0x7b')||_0x53e15d===_0x3941('0x7c')||_0x53e15d===_0x3941('0x7d')||_0x53e15d===_0x3941('0x7e')||_0x53e15d===_0x3941('0x7f')||_0x53e15d===_0x3941('0x80')||_0x53e15d===_0x3941('0x81')||_0x53e15d===_0x3941('0x7a')||_0x53e15d===_0x3941('0x7b')||_0x53e15d===_0x3941('0x7c')||_0x53e15d==='rtpaudioqosjitterbridged'||_0x53e15d===_0x3941('0x7e')||_0x53e15d===_0x3941('0x7f')||_0x53e15d===_0x3941('0x80')||_0x53e15d===_0x3941('0x81')||_0x53e15d===_0x3941('0x82')||_0x53e15d===_0x3941('0x83')||_0x53e15d==='state'||_0x53e15d==='statedesc'){return![];}return!![];};exports[_0x3941('0x84')]=function(_0x2202d6,_0xe88460){var _0x184841,_0x269497,_0x4e1a77;if(_0xe88460<=0x0){_0xe88460=0x1;}_0x184841=new RegExp(_0x3941('0x85')+_0xe88460+'}$');_0x269497=Math[_0x3941('0x86')](0xa,_0xe88460-0x1);_0x4e1a77=Math[_0x3941('0x86')](0xa,_0xe88460)-0x1;return util['format']('%s',_[_0x3941('0x87')](_0x2202d6,_0x184841,_[_0x3941('0x88')](_0x269497,_0x4e1a77)));};exports[_0x3941('0x89')]=function(_0x2e23b1){var _0x4ccc66=_0x2e23b1[_0x3941('0x8a')](/"(.*?)"/);return _0x4ccc66?_0x4ccc66[0x1]:_0x2e23b1;};exports[_0x3941('0x8b')]=function(_0x5c3925){var _0x19b25e=_0x5c3925[_0x3941('0x8a')](/<(.*?)>/);return _0x19b25e?_0x19b25e[0x1]:_0x5c3925;};
\ No newline at end of file
+var _0xc63f=['answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','clone','Global','active','scheduledat','add','ContactId','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','name','queue','interface','mandatoryDisposition','agentReadyId','not_inuse','status','push','getDiff','seconds','createBody','CampaignId','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','calleridname','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','createdAt','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','logCustomer','talktime'];(function(_0x47e1c9,_0x3884f3){var _0x5e4ebb=function(_0x4d5b43){while(--_0x4d5b43){_0x47e1c9['push'](_0x47e1c9['shift']());}};_0x5e4ebb(++_0x3884f3);}(_0xc63f,0x1e2));var _0xfc63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc63f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xfc63('0x0'));var _=require(_0xfc63('0x1'));var moment=require(_0xfc63('0x2'));var logger=require(_0xfc63('0x3'))(_0xfc63('0x4'));var ipAgi=process[_0xfc63('0x5')][_0xfc63('0x6')]||_0xfc63('0x7');function getSeconds(_0x11e013,_0x5952e3){var _0x1dfe6d=moment(_0x11e013)[_0xfc63('0x8')](0x0);var _0x22ee9e=moment(_0x5952e3)['milliseconds'](0x0);return _0x1dfe6d[_0xfc63('0x9')](_0x22ee9e,'seconds');}exports['loggerCatch']=function(_0x474bd4){return function(_0x25d31f){logger[_0xfc63('0xa')](_0x474bd4,util[_0xfc63('0xb')](_0x25d31f,{'showHidden':![],'depth':null}));};};exports[_0xfc63('0xc')]=function(_0x250555,_0x300bf3){logger[_0xfc63('0xd')](_0x250555,util[_0xfc63('0xb')](_0x300bf3,{'showHidden':![],'depth':null}));};exports[_0xfc63('0xe')]=function(_0x34629e,_0x229882){logger['error'](_0x34629e,util[_0xfc63('0xb')](_0x229882,{'showHidden':![],'depth':null}));};exports[_0xfc63('0xf')]=function(_0x5dcf1d){return function(_0x3abfac){logger[_0xfc63('0xd')](_0x5dcf1d,util['inspect'](_0x3abfac,{'showHidden':![],'depth':null}));};};exports[_0xfc63('0x10')]=function(_0x2b9ab8,_0x54232a,_0x2ca618){return{'message':_0x2b9ab8,'unlock':_0x54232a,'active':_0x2ca618};};exports[_0xfc63('0x11')]=function(_0x2d6a95,_0x49b9de,_0x2e4af2){if(!_['isUndefined'](_0x2e4af2)&&'string'===typeof _0x2e4af2&&!_['isEmpty'](_0x2e4af2)){if(!_[_0xfc63('0x12')](_0x49b9de)&&_0xfc63('0x13')===typeof _0x49b9de&&!_[_0xfc63('0x14')](_0x49b9de)){return util[_0xfc63('0x15')](_0xfc63('0x16'),_0x49b9de,_0x2e4af2);}return util[_0xfc63('0x15')](_0xfc63('0x16'),_0x2e4af2,_0x2e4af2);}if(!_[_0xfc63('0x12')](_0x2d6a95)&&_0xfc63('0x13')===typeof _0x2d6a95&&!_['isEmpty'](_0x2d6a95)){return _0x2d6a95;}return _0xfc63('0x17');};exports[_0xfc63('0x18')]=function(_0x17e98a){if(_[_0xfc63('0x19')](_0x17e98a)){return![];}return _0x17e98a;};exports[_0xfc63('0x1a')]=function(_0x25d82b,_0x5a1796,_0x4218c8,_0xfbfea5,_0x483bad,_0x5e7a3a){var _0x557a51={'XMD-QUEUE':_0x5a1796['Queue']?_0x5a1796['Queue']['name']:'','XMD-CALLERID':_0xfbfea5,'XMD-CALLERID-PREVIEW':_0x5e7a3a?util[_0xfc63('0x15')](_0xfc63('0x16'),_0x5e7a3a[_0xfc63('0x1b')],_0x5e7a3a['calleridnum']):_0xfbfea5,'XMD-DIALID':_0x483bad,'XMD-CONTACTID':_0x5a1796['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xfbfea5,'XMD-VOICEQUEUEID':_0x5a1796['VoiceQueueId'],'XMD-DIALCHANNEL':_0x4218c8,'XMD-DIALTIMEOUT':_0x25d82b[_0xfc63('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xfc63('0x15')]('\x22rtTxX%s%s\x22',_0x25d82b[_0xfc63('0x1d')]?'g':'',_[_0xfc63('0x14')](_0x25d82b[_0xfc63('0x1e')])?'':_0xfc63('0x1f')),'XMD-DIALURL':_0x25d82b['dialPreviewUrl']||'','XMD-AGI':_0x25d82b[_0xfc63('0x20')]?util[_0xfc63('0x15')](_0xfc63('0x21'),ipAgi,_0x25d82b[_0xfc63('0x20')]):'NONE','XMD-AGIAFTER':_0x25d82b['dialQueueProject2']?util['format'](_0xfc63('0x21'),ipAgi,_0x25d82b[_0xfc63('0x1d')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x5e7a3a?_0x5e7a3a[_0xfc63('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x5e7a3a?_0x5e7a3a[_0xfc63('0x23')]:'','XMD-DESTINATION':_0xfc63('0x24')};if(!_[_0xfc63('0x14')](_0x25d82b[_0xfc63('0x1e')])){_0x557a51[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x25d82b[_0xfc63('0x1e')];_0x557a51[util[_0xfc63('0x15')]('%s',_0xfc63('0x25'))]=_0x483bad;}if(_0x5a1796&&_0x5a1796[_0xfc63('0x26')]){for(var _0x574637 in _0x5a1796[_0xfc63('0x26')]){if(_0x5a1796[_0xfc63('0x26')][_0xfc63('0x27')](_0x574637)){if(!_[_0xfc63('0x19')](_0x5a1796[_0xfc63('0x26')][_0x574637])&&_0x574637!=='id'&&_0x574637!=='tags'&&_0x574637!==_0xfc63('0x28')&&_0x574637!=='updatedAt'){_0x557a51[util[_0xfc63('0x15')]('%s%s',_0xfc63('0x29'),_[_0xfc63('0x2a')](_0x574637))]=_0x5a1796[_0xfc63('0x26')][_0x574637];}}}}return _0x557a51;};exports['toLowerVariables']=function(_0x4cf381){var _0x87b9b0={};for(var _0x4854f0 in _0x4cf381){if(_0x4cf381[_0xfc63('0x27')](_0x4854f0)){_0x87b9b0[util['format']('%s',_[_0xfc63('0x2b')](_0x4854f0))]=_0x4cf381[_0x4854f0];}}return{'variables':_0x87b9b0};};exports[_0xfc63('0x2c')]=function(_0x1c787d,_0x29bd66){if(!_['isNil'](_0x1c787d)){if(_0x1c787d[_0xfc63('0x27')](_0xfc63('0x2d'))){if(_0x1c787d['originated']>0x0){_0x1c787d[_0xfc63('0x2d')]-=0x1;}else{logger['error'](_0xfc63('0x2e'),_0x29bd66);}}}else{logger[_0xfc63('0xa')](_0xfc63('0x2f'),_0x29bd66);}};exports[_0xfc63('0x30')]=function(_0x5ea471){var _0x39cc5b=moment()[_0xfc63('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ea471[_0xfc63('0x31')]=0xd;_0x5ea471[_0xfc63('0x32')]='Blacklist';_0x5ea471[_0xfc63('0x33')]=_0x39cc5b;_0x5ea471[_0xfc63('0x34')]=_0x39cc5b;_0x5ea471[_0xfc63('0x35')]=_0x39cc5b;};exports[_0xfc63('0x36')]=function(_0x3fc2c1,_0x1d3188,_0x21d1ba){var _0x2f1017=moment()['format'](_0xfc63('0x37'));_0x3fc2c1['state']=_0x1d3188;_0x3fc2c1[_0xfc63('0x32')]=_0x21d1ba;_0x3fc2c1[_0xfc63('0x34')]=_0x2f1017;_0x3fc2c1[_0xfc63('0x38')]=getSeconds(_0x3fc2c1['responsetime'],_0x3fc2c1[_0xfc63('0x33')]);};exports[_0xfc63('0x39')]=function(_0x908ef3,_0x1483e6,_0x5cd106){_0x908ef3[_0xfc63('0x3a')]=_0x1483e6;_0x908ef3[_0xfc63('0x3b')]=_0x5cd106;};exports[_0xfc63('0x3c')]=function(_0x41f30a,_0x3bf1dd,_0x1fc6af){var _0x48ffeb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x41f30a[_0xfc63('0x31')]=_0x3bf1dd;_0x41f30a['statedesc']=_0x1fc6af;_0x41f30a[_0xfc63('0x34')]=_0x41f30a['responsetime']?_0x41f30a[_0xfc63('0x34')]:_0x48ffeb;_0x41f30a[_0xfc63('0x35')]=_0x41f30a[_0xfc63('0x35')]?_0x41f30a['endtime']:_0x48ffeb;_0x41f30a[_0xfc63('0x38')]=getSeconds(_0x41f30a[_0xfc63('0x34')]||0x0,_0x41f30a[_0xfc63('0x33')]||0x0);_0x41f30a[_0xfc63('0x3d')]=_0x41f30a[_0xfc63('0x3e')]?getSeconds(_0x41f30a[_0xfc63('0x35')],_0x41f30a[_0xfc63('0x3e')]):0x0;};exports[_0xfc63('0x3f')]=function(_0x149be8){return _0x149be8===_0xfc63('0x40');};exports[_0xfc63('0x41')]=function(_0x230e3e,_0x28199e,_0xcb3ce4,_0x2e6e46,_0x4befe3){var _0x139675=_0x2e6e46?_0xfc63('0x42'):_0x230e3e[_0xfc63('0x1b')];_0x139675=_0x4befe3?_0xfc63('0x43'):_0x139675;return{'actionid':_0x230e3e[_0xfc63('0x44')],'action':_0xfc63('0x45'),'channel':_0x230e3e[_0xfc63('0x46')],'callerid':util[_0xfc63('0x15')](_0xfc63('0x16'),_0x139675,_0x230e3e[_0xfc63('0x47')]),'Exten':_0xfc63('0x24'),'Context':_0xfc63('0x48'),'Priority':'1','variable':_0xcb3ce4,'timeout':(_0x28199e['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x230e3e[_0xfc63('0x44')]};};exports[_0xfc63('0x49')]=function(_0x28dc0c){return _0x28dc0c[_0xfc63('0x4a')]+_0x28dc0c[_0xfc63('0x4b')]+_0x28dc0c['countnoanswerretry']+_0x28dc0c['countagentrejectretry']+_0x28dc0c[_0xfc63('0x4c')];};exports['cloneAction']=function(_0x15031){var _0x3ed4d4=_[_0xfc63('0x4d')](_0x15031);_0x3ed4d4[_0xfc63('0x31')]=0xf;_0x3ed4d4[_0xfc63('0x32')]=_0xfc63('0x4e');return _0x3ed4d4;};exports['scheduledAt']=function(_0xf381c7,_0x5493d7,_0x5520b2){var _0x2d9714={};_0x2d9714[_0x5493d7]=_0xf381c7[_0x5493d7];_0x2d9714[_0xfc63('0x4f')]=![];_0x2d9714[_0xfc63('0x50')]=moment()[_0xfc63('0x51')](_0x5520b2,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2d9714['ContactId']=_0xf381c7[_0xfc63('0x52')];_0x2d9714[_0xfc63('0x53')]=_0xf381c7[_0xfc63('0x53')];_0x2d9714[_0xfc63('0x54')]=_0xf381c7[_0xfc63('0x54')]||undefined;return _0x2d9714;};exports['decrementTalkink']=function(_0x5e6fee,_0x40810c){if(!_['isNil'](_0x5e6fee)){if(_0x5e6fee['pTalking']>0x0){_0x5e6fee[_0xfc63('0x55')]-=0x1;}else{logger[_0xfc63('0xa')](_0x40810c,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xfc63('0xa')](_0x40810c,_0xfc63('0x56'));}};exports['IsNotLoggedIn']=function(_0x2464f9){if(_0x2464f9<=0x0){return!![];}return![];};exports[_0xfc63('0x57')]=function(_0x29d534,_0x3fd54b,_0x14be9e){_0x29d534['lastevent']=_0x3fd54b;_0x29d534[_0xfc63('0x58')]=_0x29d534[_0xfc63('0x59')];_0x29d534[_0xfc63('0x5a')]=_0x29d534[_0xfc63('0x46')];if(_0x14be9e){_0x29d534['mandatoryDisposition']=_0x14be9e[_0xfc63('0x5b')];}return _0x29d534;};exports['buildAcw']=function(_0x5f5932){var _0xed0dfb={};_0xed0dfb[_0xfc63('0x59')]=_0x5f5932['queue'];_0xed0dfb['interface']=_0x5f5932['channelAgent'];_0xed0dfb[_0xfc63('0x44')]=_0x5f5932['uniqueid'];return _0xed0dfb;};exports[_0xfc63('0x5c')]=function(_0x3750ef){var _0x4fc4fd=[];for(var _0x319a78 in _0x3750ef){if(_0x3750ef[_0xfc63('0x27')](_0x319a78)){if(!_['isNil'](_0x3750ef[_0x319a78])&&_0x3750ef[_0x319a78]['state']===_0xfc63('0x5d')&&_0x3750ef[_0x319a78][_0xfc63('0x5e')]==='reachable'){_0x4fc4fd[_0xfc63('0x5f')](_0x3750ef[_0x319a78]['id']);}}}return _0x4fc4fd;};exports[_0xfc63('0x60')]=function(_0x41e643){var _0x8754a5=moment()[_0xfc63('0x8')](0x0);var _0x5ed01c=moment(_0x41e643)[_0xfc63('0x8')](0x0);return _0x8754a5[_0xfc63('0x9')](_0x5ed01c,_0xfc63('0x61'));};exports[_0xfc63('0x62')]=function(_0xcf79d7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xcf79d7[_0xfc63('0x52')],'ListId':_0xcf79d7[_0xfc63('0x53')],'VoiceQueueId':_0xcf79d7[_0xfc63('0x54')]||undefined,'CampaignId':_0xcf79d7[_0xfc63('0x63')]||undefined};};exports['filterKey']=function(_0x25f2b8){if(_0x25f2b8===_0xfc63('0x44')||_0x25f2b8===_0xfc63('0x64')||_0x25f2b8===_0xfc63('0x59')||_0x25f2b8===_0xfc63('0x65')||_0x25f2b8===_0xfc63('0x66')||_0x25f2b8===_0xfc63('0x67')||_0x25f2b8===_0xfc63('0x3a')||_0x25f2b8==='channelAgent'||_0x25f2b8==='calleridname'||_0x25f2b8===_0xfc63('0x4f')||_0x25f2b8===_0xfc63('0x47')||_0x25f2b8==='scheduledat'||_0x25f2b8===_0xfc63('0x4a')||_0x25f2b8===_0xfc63('0x4b')||_0x25f2b8===_0xfc63('0x68')||_0x25f2b8===_0xfc63('0x69')||_0x25f2b8===_0xfc63('0x6a')||_0x25f2b8==='callbackuniqueid'||_0x25f2b8===_0xfc63('0x6b')||_0x25f2b8===_0xfc63('0x6c')||_0x25f2b8===_0xfc63('0x52')||_0x25f2b8===_0xfc63('0x53')||_0x25f2b8===_0xfc63('0x3b')||_0x25f2b8===_0xfc63('0x54')||_0x25f2b8===_0xfc63('0x6d')||_0x25f2b8===_0xfc63('0x6e')||_0x25f2b8===_0xfc63('0x6f')||_0x25f2b8===_0xfc63('0x70')||_0x25f2b8==='xmd-listid'||_0x25f2b8===_0xfc63('0x71')||_0x25f2b8===_0xfc63('0x72')||_0x25f2b8===_0xfc63('0x73')||_0x25f2b8===_0xfc63('0x74')||_0x25f2b8==='xmd-dialchannel'||_0x25f2b8==='xmd-contactid'||_0x25f2b8==='xmd-cdrtype'||_0x25f2b8===_0xfc63('0x75')||_0x25f2b8===_0xfc63('0x76')||_0x25f2b8===_0xfc63('0x77')||_0x25f2b8===_0xfc63('0x78')||_0x25f2b8===_0xfc63('0x79')||_0x25f2b8===_0xfc63('0x7a')||_0x25f2b8===_0xfc63('0x7b')||_0x25f2b8===_0xfc63('0x7c')||_0x25f2b8===_0xfc63('0x7d')||_0x25f2b8===_0xfc63('0x7e')||_0x25f2b8===_0xfc63('0x7f')||_0x25f2b8==='rtpaudioqos'||_0x25f2b8===_0xfc63('0x79')||_0x25f2b8===_0xfc63('0x7a')||_0x25f2b8===_0xfc63('0x7b')||_0x25f2b8===_0xfc63('0x7c')||_0x25f2b8===_0xfc63('0x7d')||_0x25f2b8===_0xfc63('0x7e')||_0x25f2b8===_0xfc63('0x7f')||_0x25f2b8===_0xfc63('0x80')||_0x25f2b8===_0xfc63('0x81')||_0x25f2b8===_0xfc63('0x31')||_0x25f2b8===_0xfc63('0x32')){return![];}return!![];};exports[_0xfc63('0x82')]=function(_0x435956,_0xefb4ab){var _0x36cb11,_0x446dfe,_0x4a597a;if(_0xefb4ab<=0x0){_0xefb4ab=0x1;}_0x36cb11=new RegExp(_0xfc63('0x83')+_0xefb4ab+'}$');_0x446dfe=Math[_0xfc63('0x84')](0xa,_0xefb4ab-0x1);_0x4a597a=Math[_0xfc63('0x84')](0xa,_0xefb4ab)-0x1;return util[_0xfc63('0x15')]('%s',_[_0xfc63('0x85')](_0x435956,_0x36cb11,_['random'](_0x446dfe,_0x4a597a)));};exports[_0xfc63('0x86')]=function(_0x2bde86){var _0x4cbd45=_0x2bde86[_0xfc63('0x87')](/"(.*?)"/);return _0x4cbd45?_0x4cbd45[0x1]:_0x2bde86;};exports['extractCalleridNumber']=function(_0x16fd86){var _0x34c8f7=_0x16fd86[_0xfc63('0x87')](/<(.*?)>/);return _0x34c8f7?_0x34c8f7[0x1]:_0x16fd86;};
\ No newline at end of file