Built motion from commit bfc7a72f7045b27461c9a5d1f71c1a658cfd0b8b. Version 3.0.0...
[motion-next.git] / server / services / ami / preview / util / util.js
index 82ded97..ca569bc 100644 (file)
@@ -1 +1 @@
-const a1090_0x260c=['\x22agi://%s/square,%s\x22','rtpaudioqoslossbridged','queue','YYYY-MM-DD\x20HH:mm:ss','Queue','filterKey','callbackuniqueid','dialer','tags','lastevent','match','membername','util','VoiceQueueId','statedesc','talktime','\x22%s\x22\x20<%s>','milliseconds','monitor_format','xcally-motion-preview','agiIp','addVariables','xmd-agi','countbusyretry','RECALL','scheduledat','xmd-queue','xmd-contactid','sipcallid','rtpaudioqosjitterbridged','loggerCatch','bridgepvtcallid','clone','buildObj','from-sip','string','XMD-','originatecalleridname','\x22rtTxX%s%s\x22','status','uniqueid','dialAnswer','starttime','Global','toLowerVariables','calleridnum','inspect','diff','xmd-dialoptions','xmd-phone','IsNotLoggedIn','rtpaudioqosrttbridged','logger','minutes','message','seconds','NONE','xmd-callerid','[decrementTalkink]\x20object\x20talking\x20is\x20negative','loggerError','callbackat','isNil','ringtime','isActive','getDiff','ContactId','Contact','state','[updateOriginated]\x20object\x20originated\x20is\x20negative','rtpaudioqosjitter','xmd-listid','[updateOriginated]\x20is\x20null\x20or\x20undefined','undefined','[decrementTalkink]\x20is\x20null\x20or\x20undefined','originatecalleridnum','isFailure','dialOriginateTimeout','random','rtpaudioqosbridged','countnoanswerretry','dialQueueProject2','extractCalleridName','info','add','BOOKED','createdAt','moment','lodash','timeout','extractCalleridNumber','calleridname','active','rtpaudioqos','getCallerId','buildAcw','xmd-cdrtype','logger2','updateOriginated','originate','%s%s','format','responsetime','recallme','not_inuse','createBody','channelAgent','xmd-dialchannel','rtpaudioqosloss','name','isUndefined','dialPreviewUrl','answertime','reachable','logCustomer','agentReadyId','logAgent','originated','campaigntype','interface','_XCALLY_MIXMONITOR_UNIQUEID','error','countcongestionretry','xmd-dialurl','endtime','\x5cw{0,','cloneAction','countagentrejectretry','countnosuchnumberretry','dialQueueProject','CampaignId','isEmpty','scheduledAt','pTalking','pow','Failure','rtpaudioqosrtt','UserId','ListId','type','decrementTalkink','variablesAction','toUpper'];(function(_0x597831,_0x260c8e){const _0x5de39a=function(_0x5c3854){while(--_0x5c3854){_0x597831['push'](_0x597831['shift']());}};_0x5de39a(++_0x260c8e);}(a1090_0x260c,0x1c1));const a1090_0x5de3=function(_0x597831,_0x260c8e){_0x597831=_0x597831-0x0;let _0x5de39a=a1090_0x260c[_0x597831];return _0x5de39a;};const _0x384fc5=a1090_0x5de3;'use strict';const util=require(_0x384fc5('0x83')),_=require(_0x384fc5('0x40')),moment=require(_0x384fc5('0x3f')),logger=require('../../../../config/logger')('preview'),{getConfigService}=require('../../../../config/config.service');function getSeconds(_0x5c3854,_0x3dc278){const _0x5d144a=_0x384fc5,_0x275da7=moment(_0x5c3854)[_0x5d144a('0x88')](0x0),_0x3beb71=moment(_0x3dc278)[_0x5d144a('0x88')](0x0);return _0x275da7[_0x5d144a('0x18')](_0x3beb71,_0x5d144a('0x20'));}exports[_0x384fc5('0x7')]=function(_0x4331a6){return function(_0x42da43){const _0x48e057=a1090_0x5de3;logger[_0x48e057('0x61')](_0x4331a6,util[_0x48e057('0x17')](_0x42da43,{'showHidden':![],'depth':null}));};},exports[_0x384fc5('0x1d')]=function(_0xa56370,_0x4dfe03){const _0xea7d93=_0x384fc5;logger['info'](_0xa56370,util[_0xea7d93('0x17')](_0x4dfe03,{'showHidden':![],'depth':null}));},exports[_0x384fc5('0x24')]=function(_0x559868,_0x15d737){const _0x4e174f=_0x384fc5;logger[_0x4e174f('0x61')](_0x559868,util['inspect'](_0x15d737,{'showHidden':![],'depth':null}));},exports[_0x384fc5('0x49')]=function(_0x288bbf){return function(_0x1c6c1b){const _0xdb0ef5=a1090_0x5de3;logger[_0xdb0ef5('0x3b')](_0x288bbf,util['inspect'](_0x1c6c1b,{'showHidden':![],'depth':null}));};},exports[_0x384fc5('0x1f')]=function(_0x4d574c,_0x176df7,_0x3ff139){return{'message':_0x4d574c,'unlock':_0x176df7,'active':_0x3ff139};},exports[_0x384fc5('0x46')]=function(_0x2e29f8,_0x489e71,_0x9d73de){const _0x209330=_0x384fc5;if(!_['isUndefined'](_0x9d73de)&&_0x209330('0xc')===typeof _0x9d73de&&!_[_0x209330('0x6b')](_0x9d73de)){if(!_[_0x209330('0x56')](_0x489e71)&&'string'===typeof _0x489e71&&!_[_0x209330('0x6b')](_0x489e71))return util[_0x209330('0x4d')](_0x209330('0x87'),_0x489e71,_0x9d73de);return util[_0x209330('0x4d')](_0x209330('0x87'),_0x9d73de,_0x9d73de);}if(!_[_0x209330('0x56')](_0x2e29f8)&&_0x209330('0xc')===typeof _0x2e29f8&&!_['isEmpty'](_0x2e29f8))return _0x2e29f8;return'\x22\x22\x20<>';},exports[_0x384fc5('0x28')]=function(_0xf967d2){const _0x3a3c79=_0x384fc5;if(_[_0x3a3c79('0x26')](_0xf967d2))return![];return _0xf967d2;},exports[_0x384fc5('0x8c')]=function(_0x30780e,_0x303a11,_0x36009d,_0x274a15,_0x3da07c,_0x47129e){const _0x1c9a14=_0x384fc5,_0x11ee56=getConfigService(),_0x625614={'XMD-QUEUE':_0x303a11['Queue']?_0x303a11[_0x1c9a14('0x7b')]['name']:'','XMD-CALLERID':_0x274a15,'XMD-CALLERID-PREVIEW':_0x47129e?util[_0x1c9a14('0x4d')]('\x22%s\x22\x20<%s>',_0x47129e[_0x1c9a14('0x43')],_0x47129e[_0x1c9a14('0x16')]):_0x274a15,'XMD-DIALID':_0x3da07c,'XMD-CONTACTID':_0x303a11[_0x1c9a14('0x2a')],'XMD-CDRTYPE':_0x1c9a14('0x7e'),'CALLERID(all)':_0x274a15,'XMD-VOICEQUEUEID':_0x303a11[_0x1c9a14('0x84')],'XMD-DIALCHANNEL':_0x36009d,'XMD-DIALTIMEOUT':_0x30780e[_0x1c9a14('0x35')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x1c9a14('0xf'),_0x30780e['dialQueueProject2']?'g':'',_[_0x1c9a14('0x6b')](_0x30780e['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x30780e[_0x1c9a14('0x57')]||'','XMD-AGI':_0x30780e[_0x1c9a14('0x69')]?util[_0x1c9a14('0x4d')]('\x22agi://%s/square,%s\x22',_0x11ee56[_0x1c9a14('0x8b')],_0x30780e[_0x1c9a14('0x69')]):_0x1c9a14('0x21'),'XMD-AGIAFTER':_0x30780e[_0x1c9a14('0x39')]?util[_0x1c9a14('0x4d')](_0x1c9a14('0x77'),_0x11ee56[_0x1c9a14('0x8b')],_0x30780e[_0x1c9a14('0x39')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x47129e?_0x47129e[_0x1c9a14('0x33')]:'','XMD-ORIGINATECALLERIDNAME':_0x47129e?_0x47129e[_0x1c9a14('0xe')]:'','XMD-DESTINATION':_0x1c9a14('0x8a')};!_['isEmpty'](_0x30780e[_0x1c9a14('0x89')])&&(_0x625614[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x30780e[_0x1c9a14('0x89')],_0x625614[util['format']('%s',_0x1c9a14('0x60'))]=_0x3da07c);if(_0x303a11&&_0x303a11[_0x1c9a14('0x2b')])for(const _0x81862c in _0x303a11[_0x1c9a14('0x2b')]){typeof _0x303a11['Contact'][_0x81862c]!==_0x1c9a14('0x31')&&(!_[_0x1c9a14('0x26')](_0x303a11[_0x1c9a14('0x2b')][_0x81862c])&&_0x81862c!=='id'&&_0x81862c!==_0x1c9a14('0x7f')&&_0x81862c!==_0x1c9a14('0x3e')&&_0x81862c!=='updatedAt'&&(_0x625614[util[_0x1c9a14('0x4d')](_0x1c9a14('0x4c'),_0x1c9a14('0xd'),_[_0x1c9a14('0x76')](_0x81862c))]=_0x303a11[_0x1c9a14('0x2b')][_0x81862c]));}return _0x625614;},exports[_0x384fc5('0x15')]=function(_0xb54e2c){const _0x35f51e=_0x384fc5,_0x39121a={};for(const _0x36adbf in _0xb54e2c){typeof _0xb54e2c[_0x36adbf]!==_0x35f51e('0x31')&&(_0x39121a[util[_0x35f51e('0x4d')]('%s',_['toLower'](_0x36adbf))]=_0xb54e2c[_0x36adbf]);}return{'variables':_0x39121a};},exports[_0x384fc5('0x4a')]=function(_0x4de6c7,_0x24328d){const _0x466b19=_0x384fc5;!_[_0x466b19('0x26')](_0x4de6c7)?typeof _0x4de6c7['originated']!==_0x466b19('0x31')&&(_0x4de6c7[_0x466b19('0x5d')]>0x0?_0x4de6c7[_0x466b19('0x5d')]-=0x1:logger[_0x466b19('0x61')](_0x466b19('0x2d'),_0x24328d)):logger[_0x466b19('0x61')](_0x466b19('0x30'),_0x24328d);},exports['logBlacklist']=function(_0x4dbd85){const _0x421a2e=_0x384fc5,_0x2a8093=moment()[_0x421a2e('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4dbd85[_0x421a2e('0x2c')]=0xd,_0x4dbd85[_0x421a2e('0x85')]='Blacklist',_0x4dbd85['starttime']=_0x2a8093,_0x4dbd85[_0x421a2e('0x4e')]=_0x2a8093,_0x4dbd85[_0x421a2e('0x64')]=_0x2a8093;},exports[_0x384fc5('0x5c')]=function(_0x401bc1,_0x1d921f,_0x481fbc){const _0x3ed1fd=_0x384fc5,_0x3bf1c6=moment()[_0x3ed1fd('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x401bc1[_0x3ed1fd('0x2c')]=_0x1d921f,_0x401bc1[_0x3ed1fd('0x85')]=_0x481fbc,_0x401bc1[_0x3ed1fd('0x4e')]=_0x3bf1c6,_0x401bc1[_0x3ed1fd('0x27')]=getSeconds(_0x401bc1[_0x3ed1fd('0x4e')],_0x401bc1[_0x3ed1fd('0x13')]);},exports['logLookAgent']=function(_0x24810a,_0x29f1ab,_0x1985c3){const _0x58e0d5=_0x384fc5;_0x24810a[_0x58e0d5('0x82')]=_0x29f1ab,_0x24810a['UserId']=_0x1985c3;},exports[_0x384fc5('0x5a')]=function(_0x5e54dd,_0x25ec77,_0x37692a){const _0x281932=_0x384fc5,_0x2fe50c=moment()['format'](_0x281932('0x7a'));_0x5e54dd['state']=_0x25ec77,_0x5e54dd[_0x281932('0x85')]=_0x37692a,_0x5e54dd['responsetime']=_0x5e54dd[_0x281932('0x4e')]?_0x5e54dd[_0x281932('0x4e')]:_0x2fe50c,_0x5e54dd[_0x281932('0x64')]=_0x5e54dd[_0x281932('0x64')]?_0x5e54dd[_0x281932('0x64')]:_0x2fe50c,_0x5e54dd['ringtime']=getSeconds(_0x5e54dd[_0x281932('0x4e')]||0x0,_0x5e54dd[_0x281932('0x13')]||0x0),_0x5e54dd[_0x281932('0x86')]=_0x5e54dd[_0x281932('0x58')]?getSeconds(_0x5e54dd[_0x281932('0x64')],_0x5e54dd[_0x281932('0x58')]):0x0;},exports[_0x384fc5('0x34')]=function(_0x3439fc){const _0x2137f0=_0x384fc5;return _0x3439fc===_0x2137f0('0x6f');},exports[_0x384fc5('0x75')]=function(_0x409cac,_0x25c7ce,_0x43b0f4,_0x47cf6f,_0x1c3591){const _0x39b749=_0x384fc5;let _0x2a8914=_0x47cf6f?_0x39b749('0x1'):_0x409cac['calleridname'];return _0x2a8914=_0x1c3591?_0x39b749('0x3d'):_0x2a8914,{'actionid':_0x409cac[_0x39b749('0x11')],'action':_0x39b749('0x4b'),'channel':_0x409cac[_0x39b749('0x52')],'callerid':util[_0x39b749('0x4d')](_0x39b749('0x87'),_0x2a8914,_0x409cac['calleridnum']),'Exten':_0x39b749('0x8a'),'Context':_0x39b749('0xb'),'Priority':'1','variable':_0x43b0f4,'timeout':(_0x25c7ce[_0x39b749('0x41')]||0x1e)*0x3e8,'async':!![],'channelid':_0x409cac[_0x39b749('0x11')]};},exports['totalGlobal']=function(_0x24e178){const _0xddf7ac=_0x384fc5;return _0x24e178[_0xddf7ac('0x0')]+_0x24e178['countcongestionretry']+_0x24e178['countnoanswerretry']+_0x24e178[_0xddf7ac('0x67')]+_0x24e178[_0xddf7ac('0x68')];},exports[_0x384fc5('0x66')]=function(_0xd5dff9){const _0x26eb37=_0x384fc5,_0x162fc4=_[_0x26eb37('0x9')](_0xd5dff9);return _0x162fc4[_0x26eb37('0x2c')]=0xf,_0x162fc4[_0x26eb37('0x85')]=_0x26eb37('0x14'),_0x162fc4;},exports[_0x384fc5('0x6c')]=function(_0x14a23c,_0x1e67ce,_0x48b4ef){const _0x1bc848=_0x384fc5,_0x4da6ff={};return _0x4da6ff[_0x1e67ce]=_0x14a23c[_0x1e67ce],_0x4da6ff[_0x1bc848('0x44')]=![],_0x4da6ff['scheduledat']=moment()[_0x1bc848('0x3c')](_0x48b4ef,_0x1bc848('0x1e'))[_0x1bc848('0x4d')](_0x1bc848('0x7a')),_0x4da6ff[_0x1bc848('0x2a')]=_0x14a23c['ContactId'],_0x4da6ff['ListId']=_0x14a23c['ListId'],_0x4da6ff[_0x1bc848('0x84')]=_0x14a23c['VoiceQueueId']||undefined,_0x4da6ff;},exports[_0x384fc5('0x74')]=function(_0x4b8883,_0x2b19d4){const _0x2aa134=_0x384fc5;!_[_0x2aa134('0x26')](_0x4b8883)?_0x4b8883[_0x2aa134('0x6d')]>0x0?_0x4b8883['pTalking']-=0x1:logger[_0x2aa134('0x61')](_0x2b19d4,_0x2aa134('0x23')):logger['error'](_0x2b19d4,_0x2aa134('0x32'));},exports[_0x384fc5('0x1b')]=function(_0x20529b){if(_0x20529b<=0x0)return!![];return![];},exports[_0x384fc5('0xa')]=function(_0x59db30,_0x5775c3){const _0x310622=_0x384fc5;return _0x59db30[_0x310622('0x80')]=_0x5775c3,_0x59db30[_0x310622('0x55')]=_0x59db30[_0x310622('0x79')],_0x59db30['interface']=_0x59db30[_0x310622('0x52')],_0x59db30;},exports[_0x384fc5('0x47')]=function(_0x585217){const _0x22fb53=_0x384fc5,_0x17c677={};return _0x17c677[_0x22fb53('0x79')]=_0x585217['queue'],_0x17c677[_0x22fb53('0x5f')]=_0x585217[_0x22fb53('0x52')],_0x17c677['uniqueid']=_0x585217[_0x22fb53('0x11')],_0x17c677;},exports[_0x384fc5('0x5b')]=function(_0x508f04){const _0x2bf7bf=_0x384fc5,_0xe49cf1=[];for(const _0x189962 in _0x508f04){typeof _0x508f04[_0x189962]!=='undefined'&&(!_[_0x2bf7bf('0x26')](_0x508f04[_0x189962])&&_0x508f04[_0x189962]['state']===_0x2bf7bf('0x50')&&_0x508f04[_0x189962][_0x2bf7bf('0x10')]===_0x2bf7bf('0x59')&&_0xe49cf1['push'](_0x508f04[_0x189962]['id']));}return _0xe49cf1;},exports[_0x384fc5('0x29')]=function(_0xda6fc2){const _0x44c6dc=_0x384fc5,_0x5643e6=moment()[_0x44c6dc('0x88')](0x0),_0x5be2a4=moment(_0xda6fc2)[_0x44c6dc('0x88')](0x0);return _0x5643e6[_0x44c6dc('0x18')](_0x5be2a4,_0x44c6dc('0x20'));},exports[_0x384fc5('0x51')]=function(_0x53760a){const _0x129bcd=_0x384fc5;return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x53760a[_0x129bcd('0x2a')],'ListId':_0x53760a[_0x129bcd('0x72')],'VoiceQueueId':_0x53760a[_0x129bcd('0x84')]||undefined,'CampaignId':_0x53760a[_0x129bcd('0x6a')]||undefined};},exports[_0x384fc5('0x7c')]=function(_0x4f4cc1){const _0x51faca=_0x384fc5;if(_0x4f4cc1===_0x51faca('0x11')||_0x4f4cc1==='idContact'||_0x4f4cc1==='queue'||_0x4f4cc1===_0x51faca('0x73')||_0x4f4cc1===_0x51faca('0x5e')||_0x4f4cc1===_0x51faca('0x12')||_0x4f4cc1===_0x51faca('0x82')||_0x4f4cc1===_0x51faca('0x52')||_0x4f4cc1===_0x51faca('0x43')||_0x4f4cc1===_0x51faca('0x44')||_0x4f4cc1===_0x51faca('0x16')||_0x4f4cc1===_0x51faca('0x2')||_0x4f4cc1===_0x51faca('0x0')||_0x4f4cc1===_0x51faca('0x62')||_0x4f4cc1===_0x51faca('0x38')||_0x4f4cc1==='countglobal'||_0x4f4cc1==='callback'||_0x4f4cc1===_0x51faca('0x7d')||_0x4f4cc1===_0x51faca('0x25')||_0x4f4cc1===_0x51faca('0x4f')||_0x4f4cc1==='ContactId'||_0x4f4cc1===_0x51faca('0x72')||_0x4f4cc1===_0x51faca('0x71')||_0x4f4cc1===_0x51faca('0x84')||_0x4f4cc1===_0x51faca('0x5')||_0x4f4cc1==='xmd-voicequeueid'||_0x4f4cc1===_0x51faca('0x3')||_0x4f4cc1===_0x51faca('0x1a')||_0x4f4cc1===_0x51faca('0x2f')||_0x4f4cc1===_0x51faca('0x63')||_0x4f4cc1==='xmd-dialtimeout'||_0x4f4cc1===_0x51faca('0x19')||_0x4f4cc1==='xmd-dialid'||_0x4f4cc1===_0x51faca('0x53')||_0x4f4cc1===_0x51faca('0x4')||_0x4f4cc1===_0x51faca('0x48')||_0x4f4cc1===_0x51faca('0x22')||_0x4f4cc1==='xmd-agiafter'||_0x4f4cc1===_0x51faca('0x8d')||_0x4f4cc1===_0x51faca('0x45')||_0x4f4cc1===_0x51faca('0x37')||_0x4f4cc1===_0x51faca('0x2e')||_0x4f4cc1===_0x51faca('0x6')||_0x4f4cc1===_0x51faca('0x54')||_0x4f4cc1===_0x51faca('0x78')||_0x4f4cc1===_0x51faca('0x70')||_0x4f4cc1===_0x51faca('0x1c')||_0x4f4cc1===_0x51faca('0x45')||_0x4f4cc1==='rtpaudioqosbridged'||_0x4f4cc1===_0x51faca('0x2e')||_0x4f4cc1===_0x51faca('0x6')||_0x4f4cc1==='rtpaudioqosloss'||_0x4f4cc1===_0x51faca('0x78')||_0x4f4cc1===_0x51faca('0x70')||_0x4f4cc1===_0x51faca('0x1c')||_0x4f4cc1==='bridgepeer'||_0x4f4cc1===_0x51faca('0x8')||_0x4f4cc1===_0x51faca('0x2c')||_0x4f4cc1===_0x51faca('0x85'))return![];return!![];},exports['getCallerIdRandom']=function(_0xe41acb,_0x342391){const _0x4a0a5e=_0x384fc5;_0x342391<=0x0&&(_0x342391=0x1);const _0x29635e=new RegExp(_0x4a0a5e('0x65')+_0x342391+'}$'),_0x4ad212=Math[_0x4a0a5e('0x6e')](0xa,_0x342391-0x1),_0x1795e5=Math['pow'](0xa,_0x342391)-0x1;return util['format']('%s',_['replace'](_0xe41acb,_0x29635e,_[_0x4a0a5e('0x36')](_0x4ad212,_0x1795e5)));},exports[_0x384fc5('0x3a')]=function(_0x9b8200){const _0x2dd773=_0x384fc5,_0x491cc8=_0x9b8200[_0x2dd773('0x81')](/"(.*?)"/);return _0x491cc8?_0x491cc8[0x1]:_0x9b8200;},exports[_0x384fc5('0x42')]=function(_0xcaf45b){const _0x19f1bd=_0x384fc5,_0xc0c9a3=_0xcaf45b[_0x19f1bd('0x81')](/<(.*?)>/);return _0xc0c9a3?_0xc0c9a3[0x1]:_0xcaf45b;};
\ No newline at end of file
+const a1090_0x4354=['bridgepeer','../../../../config/config.service','rtpaudioqos','string','countbusyretry','countcongestionretry','xmd-dialtimeout','countagentrejectretry','match','pow','logCustomer','clone','timeout','variablesAction','isEmpty','xmd-dialoptions','filterKey','toUpper','isFailure','isActive','xmd-contactid','YYYY-MM-DD\x20HH:mm:ss','createBody','endtime','countnosuchnumberretry','\x22agi://%s/square,%s\x22','pTalking','getDiff','scheduledat','interface','xmd-dialchannel','xmd-listid','error','dialPreviewUrl','toLower','active','sipcallid','rtpaudioqosjitterbridged','IsNotLoggedIn','dialOriginateTimeout','idContact','membername','push','undefined','updateOriginated','dialQueueProject','agiIp','\x22%s\x22\x20<%s>','lastevent','rtpaudioqosrttbridged','inspect','updatedAt','loggerError','getCallerIdRandom','buildAcw','callback','getCallerId','\x5cw{0,','[updateOriginated]\x20object\x20originated\x20is\x20negative','starttime','rtpaudioqosrtt','rtpaudioqosloss','originatecalleridnum','queue','xmd-voicequeueid','ListId','Contact','countglobal','Failure','loggerCatch','RECALL','extractCalleridName','dialer','calleridnum','dialAnswer','VoiceQueueId','XMD-','../../../../config/logger','answertime','dialQueueProject2','isNil','[decrementTalkink]\x20object\x20talking\x20is\x20negative','\x22\x22\x20<>','add','info','ringtime','Queue','seconds','util','lodash','rtpaudioqoslossbridged','message','not_inuse','replace','uniqueid','logBlacklist','milliseconds','monitor_format','state','recallme','status','minutes','[updateOriginated]\x20is\x20null\x20or\x20undefined','tags','channelAgent','addVariables','xmd-callerid','calleridname','createdAt','rtpaudioqosbridged','countnoanswerretry','statedesc','CampaignId','type','isUndefined','ContactId','scheduledAt','Global','format','moment','[decrementTalkink]\x20is\x20null\x20or\x20undefined','callbackuniqueid','responsetime','campaigntype','preview','%s%s','BOOKED','originatecalleridname','logAgent','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','xmd-dialid','agentReadyId','totalGlobal','rtpaudioqosjitter','U(xcally-mixmonitor-context)','UserId','random'];(function(_0x2bd930,_0x4354c4){const _0x467452=function(_0x579f71){while(--_0x579f71){_0x2bd930['push'](_0x2bd930['shift']());}};_0x467452(++_0x4354c4);}(a1090_0x4354,0x81));const a1090_0x4674=function(_0x2bd930,_0x4354c4){_0x2bd930=_0x2bd930-0x0;let _0x467452=a1090_0x4354[_0x2bd930];return _0x467452;};const _0x92f61f=a1090_0x4674;'use strict';const util=require(_0x92f61f('0x61')),_=require(_0x92f61f('0x62')),moment=require(_0x92f61f('0x80')),logger=require(_0x92f61f('0x56'))(_0x92f61f('0x85')),{getConfigService}=require(_0x92f61f('0xa'));function getSeconds(_0x579f71,_0x4102d7){const _0x14e1f5=_0x92f61f,_0x5019c2=moment(_0x579f71)[_0x14e1f5('0x69')](0x0),_0x1ace0b=moment(_0x4102d7)[_0x14e1f5('0x69')](0x0);return _0x5019c2['diff'](_0x1ace0b,'seconds');}exports[_0x92f61f('0x4e')]=function(_0x1feaf3){return function(_0x4386cc){const _0x360fcd=a1090_0x4674;logger[_0x360fcd('0x29')](_0x1feaf3,util[_0x360fcd('0x3b')](_0x4386cc,{'showHidden':![],'depth':null}));};},exports['logger']=function(_0x61cb30,_0x4e80cb){const _0x108d92=_0x92f61f;logger['info'](_0x61cb30,util[_0x108d92('0x3b')](_0x4e80cb,{'showHidden':![],'depth':null}));},exports[_0x92f61f('0x3d')]=function(_0x14a4b6,_0x3772f0){const _0x1e0365=_0x92f61f;logger[_0x1e0365('0x29')](_0x14a4b6,util[_0x1e0365('0x3b')](_0x3772f0,{'showHidden':![],'depth':null}));},exports['logger2']=function(_0x4b67d1){return function(_0x585717){const _0x52d2e2=a1090_0x4674;logger[_0x52d2e2('0x5d')](_0x4b67d1,util[_0x52d2e2('0x3b')](_0x585717,{'showHidden':![],'depth':null}));};},exports[_0x92f61f('0x64')]=function(_0x145af4,_0x2a3358,_0x47ab82){return{'message':_0x145af4,'unlock':_0x2a3358,'active':_0x47ab82};},exports[_0x92f61f('0x41')]=function(_0x49f842,_0x49cf5e,_0xef6176){const _0x56d846=_0x92f61f;if(!_[_0x56d846('0x7b')](_0xef6176)&&_0x56d846('0xc')===typeof _0xef6176&&!_[_0x56d846('0x17')](_0xef6176)){if(!_[_0x56d846('0x7b')](_0x49cf5e)&&'string'===typeof _0x49cf5e&&!_[_0x56d846('0x17')](_0x49cf5e))return util[_0x56d846('0x7f')](_0x56d846('0x38'),_0x49cf5e,_0xef6176);return util[_0x56d846('0x7f')]('\x22%s\x22\x20<%s>',_0xef6176,_0xef6176);}if(!_[_0x56d846('0x7b')](_0x49f842)&&_0x56d846('0xc')===typeof _0x49f842&&!_[_0x56d846('0x17')](_0x49f842))return _0x49f842;return _0x56d846('0x5b');},exports[_0x92f61f('0x1c')]=function(_0x19a8b0){const _0x23daa7=_0x92f61f;if(_[_0x23daa7('0x59')](_0x19a8b0))return![];return _0x19a8b0;},exports[_0x92f61f('0x72')]=function(_0x4e4198,_0xec1ddb,_0x524027,_0x5b07ef,_0x56b4b4,_0x5b431f){const _0x46483b=_0x92f61f,_0x48d6f2=getConfigService(),_0x3f728d={'XMD-QUEUE':_0xec1ddb[_0x46483b('0x5f')]?_0xec1ddb[_0x46483b('0x5f')]['name']:'','XMD-CALLERID':_0x5b07ef,'XMD-CALLERID-PREVIEW':_0x5b431f?util[_0x46483b('0x7f')]('\x22%s\x22\x20<%s>',_0x5b431f[_0x46483b('0x74')],_0x5b431f[_0x46483b('0x52')]):_0x5b07ef,'XMD-DIALID':_0x56b4b4,'XMD-CONTACTID':_0xec1ddb[_0x46483b('0x7c')],'XMD-CDRTYPE':_0x46483b('0x51'),'CALLERID(all)':_0x5b07ef,'XMD-VOICEQUEUEID':_0xec1ddb[_0x46483b('0x54')],'XMD-DIALCHANNEL':_0x524027,'XMD-DIALTIMEOUT':_0x4e4198[_0x46483b('0x30')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x4e4198['dialQueueProject2']?'g':'',_['isEmpty'](_0x4e4198['monitor_format'])?'':_0x46483b('0x6')),'XMD-DIALURL':_0x4e4198[_0x46483b('0x2a')]||'','XMD-AGI':_0x4e4198['dialQueueProject']?util[_0x46483b('0x7f')](_0x46483b('0x22'),_0x48d6f2[_0x46483b('0x37')],_0x4e4198[_0x46483b('0x36')]):'NONE','XMD-AGIAFTER':_0x4e4198['dialQueueProject2']?util[_0x46483b('0x7f')]('\x22agi://%s/square,%s\x22',_0x48d6f2[_0x46483b('0x37')],_0x4e4198[_0x46483b('0x58')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x5b431f?_0x5b431f[_0x46483b('0x47')]:'','XMD-ORIGINATECALLERIDNAME':_0x5b431f?_0x5b431f[_0x46483b('0x88')]:'','XMD-DESTINATION':'xcally-motion-preview'};!_[_0x46483b('0x17')](_0x4e4198[_0x46483b('0x6a')])&&(_0x3f728d[util[_0x46483b('0x7f')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4e4198[_0x46483b('0x6a')],_0x3f728d[util[_0x46483b('0x7f')]('%s',_0x46483b('0x0'))]=_0x56b4b4);if(_0xec1ddb&&_0xec1ddb[_0x46483b('0x4b')])for(const _0x36b392 in _0xec1ddb['Contact']){typeof _0xec1ddb[_0x46483b('0x4b')][_0x36b392]!==_0x46483b('0x34')&&(!_['isNil'](_0xec1ddb[_0x46483b('0x4b')][_0x36b392])&&_0x36b392!=='id'&&_0x36b392!==_0x46483b('0x70')&&_0x36b392!==_0x46483b('0x75')&&_0x36b392!==_0x46483b('0x3c')&&(_0x3f728d[util['format'](_0x46483b('0x86'),_0x46483b('0x55'),_[_0x46483b('0x1a')](_0x36b392))]=_0xec1ddb[_0x46483b('0x4b')][_0x36b392]));}return _0x3f728d;},exports[_0x92f61f('0x1')]=function(_0x2bf9b8){const _0x269270=_0x92f61f,_0x31f062={};for(const _0x24a516 in _0x2bf9b8){typeof _0x2bf9b8[_0x24a516]!==_0x269270('0x34')&&(_0x31f062[util[_0x269270('0x7f')]('%s',_[_0x269270('0x2b')](_0x24a516))]=_0x2bf9b8[_0x24a516]);}return{'variables':_0x31f062};},exports[_0x92f61f('0x35')]=function(_0x1372f5,_0xa61239){const _0x4f3fab=_0x92f61f;!_['isNil'](_0x1372f5)?typeof _0x1372f5['originated']!==_0x4f3fab('0x34')&&(_0x1372f5['originated']>0x0?_0x1372f5['originated']-=0x1:logger[_0x4f3fab('0x29')](_0x4f3fab('0x43'),_0xa61239)):logger[_0x4f3fab('0x29')](_0x4f3fab('0x6f'),_0xa61239);},exports[_0x92f61f('0x68')]=function(_0x34625c){const _0x12985f=_0x92f61f,_0x332d71=moment()['format'](_0x12985f('0x1e'));_0x34625c['state']=0xd,_0x34625c[_0x12985f('0x78')]='Blacklist',_0x34625c[_0x12985f('0x44')]=_0x332d71,_0x34625c[_0x12985f('0x83')]=_0x332d71,_0x34625c[_0x12985f('0x20')]=_0x332d71;},exports[_0x92f61f('0x89')]=function(_0x5c1bd7,_0x35b95d,_0x4a4bff){const _0x29c2b0=_0x92f61f,_0x32fa45=moment()[_0x29c2b0('0x7f')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c1bd7[_0x29c2b0('0x6b')]=_0x35b95d,_0x5c1bd7['statedesc']=_0x4a4bff,_0x5c1bd7['responsetime']=_0x32fa45,_0x5c1bd7[_0x29c2b0('0x5e')]=getSeconds(_0x5c1bd7[_0x29c2b0('0x83')],_0x5c1bd7[_0x29c2b0('0x44')]);},exports['logLookAgent']=function(_0x245594,_0x3497fa,_0x278979){const _0x3082f9=_0x92f61f;_0x245594[_0x3082f9('0x32')]=_0x3497fa,_0x245594[_0x3082f9('0x7')]=_0x278979;},exports[_0x92f61f('0x13')]=function(_0x4a4502,_0x3373e4,_0x47650c){const _0x4b4e87=_0x92f61f,_0x52e72c=moment()[_0x4b4e87('0x7f')](_0x4b4e87('0x1e'));_0x4a4502[_0x4b4e87('0x6b')]=_0x3373e4,_0x4a4502[_0x4b4e87('0x78')]=_0x47650c,_0x4a4502[_0x4b4e87('0x83')]=_0x4a4502[_0x4b4e87('0x83')]?_0x4a4502[_0x4b4e87('0x83')]:_0x52e72c,_0x4a4502['endtime']=_0x4a4502[_0x4b4e87('0x20')]?_0x4a4502[_0x4b4e87('0x20')]:_0x52e72c,_0x4a4502['ringtime']=getSeconds(_0x4a4502[_0x4b4e87('0x83')]||0x0,_0x4a4502['starttime']||0x0),_0x4a4502['talktime']=_0x4a4502[_0x4b4e87('0x57')]?getSeconds(_0x4a4502[_0x4b4e87('0x20')],_0x4a4502[_0x4b4e87('0x57')]):0x0;},exports[_0x92f61f('0x1b')]=function(_0x1d76bb){const _0x57a86e=_0x92f61f;return _0x1d76bb===_0x57a86e('0x4d');},exports[_0x92f61f('0x16')]=function(_0x475190,_0x49e1ff,_0x456201,_0x5adf62,_0x113edf){const _0x19f930=_0x92f61f;let _0x422a1e=_0x5adf62?_0x19f930('0x4f'):_0x475190[_0x19f930('0x74')];return _0x422a1e=_0x113edf?_0x19f930('0x87'):_0x422a1e,{'actionid':_0x475190['uniqueid'],'action':'originate','channel':_0x475190[_0x19f930('0x71')],'callerid':util[_0x19f930('0x7f')](_0x19f930('0x38'),_0x422a1e,_0x475190['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x456201,'timeout':(_0x49e1ff[_0x19f930('0x15')]||0x1e)*0x3e8,'async':!![],'channelid':_0x475190[_0x19f930('0x67')]};},exports[_0x92f61f('0x4')]=function(_0x2a4054){const _0x161906=_0x92f61f;return _0x2a4054[_0x161906('0xd')]+_0x2a4054['countcongestionretry']+_0x2a4054['countnoanswerretry']+_0x2a4054[_0x161906('0x10')]+_0x2a4054[_0x161906('0x21')];},exports['cloneAction']=function(_0x36df41){const _0x431605=_0x92f61f,_0x3a90e5=_[_0x431605('0x14')](_0x36df41);return _0x3a90e5[_0x431605('0x6b')]=0xf,_0x3a90e5[_0x431605('0x78')]=_0x431605('0x7e'),_0x3a90e5;},exports[_0x92f61f('0x7d')]=function(_0x439ebf,_0x2ae76a,_0x2c598b){const _0x156cc0=_0x92f61f,_0x1d7f16={};return _0x1d7f16[_0x2ae76a]=_0x439ebf[_0x2ae76a],_0x1d7f16[_0x156cc0('0x2c')]=![],_0x1d7f16['scheduledat']=moment()[_0x156cc0('0x5c')](_0x2c598b,_0x156cc0('0x6e'))[_0x156cc0('0x7f')](_0x156cc0('0x1e')),_0x1d7f16[_0x156cc0('0x7c')]=_0x439ebf[_0x156cc0('0x7c')],_0x1d7f16[_0x156cc0('0x4a')]=_0x439ebf[_0x156cc0('0x4a')],_0x1d7f16[_0x156cc0('0x54')]=_0x439ebf[_0x156cc0('0x54')]||undefined,_0x1d7f16;},exports['decrementTalkink']=function(_0x271c67,_0xe0429b){const _0xf31045=_0x92f61f;!_['isNil'](_0x271c67)?_0x271c67[_0xf31045('0x23')]>0x0?_0x271c67[_0xf31045('0x23')]-=0x1:logger[_0xf31045('0x29')](_0xe0429b,_0xf31045('0x5a')):logger[_0xf31045('0x29')](_0xe0429b,_0xf31045('0x81'));},exports[_0x92f61f('0x2f')]=function(_0x3e6e07){if(_0x3e6e07<=0x0)return!![];return![];},exports['buildObj']=function(_0x96bea2,_0x552132){const _0x5c72eb=_0x92f61f;return _0x96bea2[_0x5c72eb('0x39')]=_0x552132,_0x96bea2['name']=_0x96bea2[_0x5c72eb('0x48')],_0x96bea2[_0x5c72eb('0x26')]=_0x96bea2[_0x5c72eb('0x71')],_0x96bea2;},exports[_0x92f61f('0x3f')]=function(_0x22e3d0){const _0x35054a=_0x92f61f,_0xd190e6={};return _0xd190e6[_0x35054a('0x48')]=_0x22e3d0[_0x35054a('0x48')],_0xd190e6[_0x35054a('0x26')]=_0x22e3d0[_0x35054a('0x71')],_0xd190e6[_0x35054a('0x67')]=_0x22e3d0['uniqueid'],_0xd190e6;},exports[_0x92f61f('0x3')]=function(_0x3fc323){const _0x52745d=_0x92f61f,_0x4f02f4=[];for(const _0x26491f in _0x3fc323){typeof _0x3fc323[_0x26491f]!==_0x52745d('0x34')&&(!_[_0x52745d('0x59')](_0x3fc323[_0x26491f])&&_0x3fc323[_0x26491f][_0x52745d('0x6b')]===_0x52745d('0x65')&&_0x3fc323[_0x26491f][_0x52745d('0x6d')]==='reachable'&&_0x4f02f4[_0x52745d('0x33')](_0x3fc323[_0x26491f]['id']));}return _0x4f02f4;},exports[_0x92f61f('0x24')]=function(_0x10f04f){const _0x2d29a3=_0x92f61f,_0x4ba109=moment()[_0x2d29a3('0x69')](0x0),_0x27beaf=moment(_0x10f04f)['milliseconds'](0x0);return _0x4ba109['diff'](_0x27beaf,_0x2d29a3('0x60'));},exports[_0x92f61f('0x1f')]=function(_0x4270ff){const _0x24c3cb=_0x92f61f;return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4270ff['ContactId'],'ListId':_0x4270ff[_0x24c3cb('0x4a')],'VoiceQueueId':_0x4270ff[_0x24c3cb('0x54')]||undefined,'CampaignId':_0x4270ff[_0x24c3cb('0x79')]||undefined};},exports[_0x92f61f('0x19')]=function(_0x1228d2){const _0x4a9a88=_0x92f61f;if(_0x1228d2==='uniqueid'||_0x1228d2===_0x4a9a88('0x31')||_0x1228d2===_0x4a9a88('0x48')||_0x1228d2===_0x4a9a88('0x7a')||_0x1228d2===_0x4a9a88('0x84')||_0x1228d2===_0x4a9a88('0x53')||_0x1228d2===_0x4a9a88('0x32')||_0x1228d2===_0x4a9a88('0x71')||_0x1228d2==='calleridname'||_0x1228d2===_0x4a9a88('0x2c')||_0x1228d2===_0x4a9a88('0x52')||_0x1228d2===_0x4a9a88('0x25')||_0x1228d2===_0x4a9a88('0xd')||_0x1228d2===_0x4a9a88('0xe')||_0x1228d2===_0x4a9a88('0x77')||_0x1228d2===_0x4a9a88('0x4c')||_0x1228d2===_0x4a9a88('0x40')||_0x1228d2===_0x4a9a88('0x82')||_0x1228d2==='callbackat'||_0x1228d2===_0x4a9a88('0x6c')||_0x1228d2===_0x4a9a88('0x7c')||_0x1228d2===_0x4a9a88('0x4a')||_0x1228d2===_0x4a9a88('0x7')||_0x1228d2==='VoiceQueueId'||_0x1228d2===_0x4a9a88('0x2d')||_0x1228d2===_0x4a9a88('0x49')||_0x1228d2==='xmd-queue'||_0x1228d2==='xmd-phone'||_0x1228d2===_0x4a9a88('0x28')||_0x1228d2==='xmd-dialurl'||_0x1228d2===_0x4a9a88('0xf')||_0x1228d2===_0x4a9a88('0x18')||_0x1228d2===_0x4a9a88('0x2')||_0x1228d2===_0x4a9a88('0x27')||_0x1228d2===_0x4a9a88('0x1d')||_0x1228d2==='xmd-cdrtype'||_0x1228d2===_0x4a9a88('0x73')||_0x1228d2==='xmd-agiafter'||_0x1228d2==='xmd-agi'||_0x1228d2==='rtpaudioqos'||_0x1228d2===_0x4a9a88('0x76')||_0x1228d2===_0x4a9a88('0x5')||_0x1228d2===_0x4a9a88('0x2e')||_0x1228d2===_0x4a9a88('0x46')||_0x1228d2===_0x4a9a88('0x63')||_0x1228d2===_0x4a9a88('0x45')||_0x1228d2===_0x4a9a88('0x3a')||_0x1228d2===_0x4a9a88('0xb')||_0x1228d2===_0x4a9a88('0x76')||_0x1228d2==='rtpaudioqosjitter'||_0x1228d2===_0x4a9a88('0x2e')||_0x1228d2===_0x4a9a88('0x46')||_0x1228d2==='rtpaudioqoslossbridged'||_0x1228d2===_0x4a9a88('0x45')||_0x1228d2===_0x4a9a88('0x3a')||_0x1228d2===_0x4a9a88('0x9')||_0x1228d2==='bridgepvtcallid'||_0x1228d2===_0x4a9a88('0x6b')||_0x1228d2===_0x4a9a88('0x78'))return![];return!![];},exports[_0x92f61f('0x3e')]=function(_0x13551c,_0x3bb538){const _0x4948db=_0x92f61f;_0x3bb538<=0x0&&(_0x3bb538=0x1);const _0x5d5e68=new RegExp(_0x4948db('0x42')+_0x3bb538+'}$'),_0x3c02b3=Math['pow'](0xa,_0x3bb538-0x1),_0x454fcb=Math[_0x4948db('0x12')](0xa,_0x3bb538)-0x1;return util[_0x4948db('0x7f')]('%s',_[_0x4948db('0x66')](_0x13551c,_0x5d5e68,_[_0x4948db('0x8')](_0x3c02b3,_0x454fcb)));},exports[_0x92f61f('0x50')]=function(_0x392d02){const _0x2a1c3a=_0x92f61f,_0x1f1a03=_0x392d02[_0x2a1c3a('0x11')](/"(.*?)"/);return _0x1f1a03?_0x1f1a03[0x1]:_0x392d02;},exports['extractCalleridNumber']=function(_0x1c973e){const _0x502673=_0x92f61f,_0x491c67=_0x1c973e[_0x502673('0x11')](/<(.*?)>/);return _0x491c67?_0x491c67[0x1]:_0x1c973e;};
\ No newline at end of file