Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / services / ami / preview / util / util.js
index 036c143..0702127 100644 (file)
@@ -1 +1 @@
-const a1254_0x1f36=['extractCalleridName','logger','[decrementTalkink]\x20is\x20null\x20or\x20undefined','UserId','scheduledAt','message','xmd-dialurl','milliseconds','toLower','moment','createdAt','YYYY-MM-DD\x20HH:mm:ss','idContact','ListId','filterKey','lastevent','interface','pow','getCallerId','inspect','format','uniqueid','logAgent','logger2','countnoanswerretry','createBody','add','bridgepeer','mandatoryDisposition','preview','countnosuchnumberretry','type','buildAcw','state','callback','decrementTalkink','rtpaudioqosloss','xmd-dialchannel','tags','_XCALLY_MIXMONITOR_FORMAT','membername','not_inuse','util','dialOriginateTimeout','answertime','name','Blacklist','responsetime','xmd-dialid','seconds','Failure','talktime','originate','statedesc','[updateOriginated]\x20is\x20null\x20or\x20undefined','_XCALLY_MIXMONITOR_UNIQUEID','scheduledat','endtime','isUndefined','dialer','rtpaudioqos','getDiff','starttime','calleridnum','xmd-phone','rtpaudioqosbridged','BOOKED','status','logLookAgent','string','rtpaudioqosjitterbridged','calleridname','xmd-voicequeueid','match','from-sip','lodash','xmd-queue','countbusyretry','\x22agi://%s/square,%s\x22','NONE','IsNotLoggedIn','ContactId','undefined','isNil','Contact','VoiceQueueId','[updateOriginated]\x20object\x20originated\x20is\x20negative','isFailure','xmd-dialtimeout','queue','dialQueueProject2','[decrementTalkink]\x20object\x20talking\x20is\x20negative','loggerError','channelAgent','xmd-callerid','info','dialPreviewUrl','rtpaudioqosrttbridged','active','loggerCatch','../../../../config/logger','\x22rtTxX%s%s\x22','monitor_format','\x22%s\x22\x20<%s>','dialQueueProject','../../../../config/config.service','originatecalleridnum','originated','callbackuniqueid','rtpaudioqosjitter','pTalking','isEmpty','diff','rtpaudioqosrtt','error','\x22\x22\x20<>','agentReadyId','rtpaudioqoslossbridged','minutes','countcongestionretry','xmd-agiafter','recallme','ringtime','countglobal','extractCalleridNumber','cloneAction','updatedAt','Queue'];(function(_0x26493d,_0x564c1c){const _0x1f36ce=function(_0x3b2291){while(--_0x3b2291){_0x26493d['push'](_0x26493d['shift']());}};_0x1f36ce(++_0x564c1c);}(a1254_0x1f36,0x1cd));const a1254_0x3b22=function(_0x26493d,_0x564c1c){_0x26493d=_0x26493d-0xc2;let _0x1f36ce=a1254_0x1f36[_0x26493d];return _0x1f36ce;};const a1254_0x36bdde=a1254_0x3b22;'use strict';const util=require(a1254_0x36bdde(0x11f)),_=require(a1254_0x36bdde(0x140)),moment=require(a1254_0x36bdde(0xfe)),logger=require(a1254_0x36bdde(0xd9))(a1254_0x36bdde(0x112)),{getConfigService}=require(a1254_0x36bdde(0xde));function getSeconds(_0x1b9b6d,_0xd2e44){const _0x407950=a1254_0x36bdde,_0xf1fe0c=moment(_0x1b9b6d)[_0x407950(0xfc)](0x0),_0x5746ea=moment(_0xd2e44)['milliseconds'](0x0);return _0xf1fe0c[_0x407950(0xe5)](_0x5746ea,_0x407950(0x126));}exports[a1254_0x36bdde(0xd8)]=function(_0x387307){return function(_0x537569){const _0x11fa27=a1254_0x3b22;logger[_0x11fa27(0xe7)](_0x387307,util[_0x11fa27(0x108)](_0x537569,{'showHidden':![],'depth':null}));};},exports[a1254_0x36bdde(0xf6)]=function(_0x13559e,_0x49ed5f){const _0x281b27=a1254_0x36bdde;logger[_0x281b27(0xd4)](_0x13559e,util[_0x281b27(0x108)](_0x49ed5f,{'showHidden':![],'depth':null}));},exports[a1254_0x36bdde(0xd1)]=function(_0xa9e018,_0x26d526){logger['error'](_0xa9e018,util['inspect'](_0x26d526,{'showHidden':![],'depth':null}));},exports[a1254_0x36bdde(0x10c)]=function(_0x41fd42){return function(_0x57c009){const _0x460aa5=a1254_0x3b22;logger[_0x460aa5(0xd4)](_0x41fd42,util[_0x460aa5(0x108)](_0x57c009,{'showHidden':![],'depth':null}));};},exports[a1254_0x36bdde(0xfa)]=function(_0x163fed,_0x4daf90,_0x52effb){return{'message':_0x163fed,'unlock':_0x4daf90,'active':_0x52effb};},exports[a1254_0x36bdde(0x107)]=function(_0xe394a,_0x5d86ed,_0x2c2efa){const _0x466ed1=a1254_0x36bdde;if(!_['isUndefined'](_0x2c2efa)&&_0x466ed1(0x13a)===typeof _0x2c2efa&&!_[_0x466ed1(0xe4)](_0x2c2efa)){if(!_[_0x466ed1(0x12f)](_0x5d86ed)&&_0x466ed1(0x13a)===typeof _0x5d86ed&&!_['isEmpty'](_0x5d86ed))return util[_0x466ed1(0x109)](_0x466ed1(0xdc),_0x5d86ed,_0x2c2efa);return util[_0x466ed1(0x109)](_0x466ed1(0xdc),_0x2c2efa,_0x2c2efa);}if(!_[_0x466ed1(0x12f)](_0xe394a)&&_0x466ed1(0x13a)===typeof _0xe394a&&!_['isEmpty'](_0xe394a))return _0xe394a;return _0x466ed1(0xe8);},exports['isActive']=function(_0x3b0b79){const _0x2d5389=a1254_0x36bdde;if(_[_0x2d5389(0xc8)](_0x3b0b79))return![];return _0x3b0b79;},exports['addVariables']=function(_0x52c1db,_0x5a9ded,_0x327997,_0x4c0557,_0x57a60d,_0x4a8299){const _0x39f2cd=a1254_0x36bdde,_0x1407b3=getConfigService(),_0x1d0dfc={'XMD-QUEUE':_0x5a9ded[_0x39f2cd(0xf4)]?_0x5a9ded[_0x39f2cd(0xf4)][_0x39f2cd(0x122)]:'','XMD-CALLERID':_0x4c0557,'XMD-CALLERID-PREVIEW':_0x4a8299?util[_0x39f2cd(0x109)](_0x39f2cd(0xdc),_0x4a8299[_0x39f2cd(0x13c)],_0x4a8299[_0x39f2cd(0x134)]):_0x4c0557,'XMD-DIALID':_0x57a60d,'XMD-CONTACTID':_0x5a9ded[_0x39f2cd(0xc6)],'XMD-CDRTYPE':_0x39f2cd(0x130),'CALLERID(all)':_0x4c0557,'XMD-VOICEQUEUEID':_0x5a9ded[_0x39f2cd(0xca)],'XMD-DIALCHANNEL':_0x327997,'XMD-DIALTIMEOUT':_0x52c1db[_0x39f2cd(0x120)]||0x1e,'XMD-DIALOPTIONS':util[_0x39f2cd(0x109)](_0x39f2cd(0xda),_0x52c1db[_0x39f2cd(0xcf)]?'g':'',_[_0x39f2cd(0xe4)](_0x52c1db['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x52c1db[_0x39f2cd(0xd5)]||'','XMD-AGI':_0x52c1db[_0x39f2cd(0xdd)]?util[_0x39f2cd(0x109)]('\x22agi://%s/square,%s\x22',_0x1407b3['agiIp'],_0x52c1db[_0x39f2cd(0xdd)]):_0x39f2cd(0xc4),'XMD-AGIAFTER':_0x52c1db['dialQueueProject2']?util['format'](_0x39f2cd(0xc3),_0x1407b3['agiIp'],_0x52c1db['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4a8299?_0x4a8299[_0x39f2cd(0xdf)]:'','XMD-ORIGINATECALLERIDNAME':_0x4a8299?_0x4a8299['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};!_[_0x39f2cd(0xe4)](_0x52c1db[_0x39f2cd(0xdb)])&&(_0x1d0dfc[util[_0x39f2cd(0x109)]('%s',_0x39f2cd(0x11c))]=_0x52c1db['monitor_format'],_0x1d0dfc[util[_0x39f2cd(0x109)]('%s',_0x39f2cd(0x12c))]=_0x57a60d);if(_0x5a9ded&&_0x5a9ded[_0x39f2cd(0xc9)])for(const _0x5db332 in _0x5a9ded[_0x39f2cd(0xc9)]){typeof _0x5a9ded['Contact'][_0x5db332]!=='undefined'&&(!_[_0x39f2cd(0xc8)](_0x5a9ded[_0x39f2cd(0xc9)][_0x5db332])&&_0x5db332!=='id'&&_0x5db332!==_0x39f2cd(0x11b)&&_0x5db332!==_0x39f2cd(0xff)&&_0x5db332!==_0x39f2cd(0xf3)&&(_0x1d0dfc[util[_0x39f2cd(0x109)]('%s%s','XMD-',_['toUpper'](_0x5db332))]=_0x5a9ded[_0x39f2cd(0xc9)][_0x5db332]));}return _0x1d0dfc;},exports['toLowerVariables']=function(_0x5c2989){const _0x4536d6=a1254_0x36bdde,_0x550d4e={};for(const _0x1db61b in _0x5c2989){typeof _0x5c2989[_0x1db61b]!=='undefined'&&(_0x550d4e[util[_0x4536d6(0x109)]('%s',_[_0x4536d6(0xfd)](_0x1db61b))]=_0x5c2989[_0x1db61b]);}return{'variables':_0x550d4e};},exports['updateOriginated']=function(_0x17ce0a,_0x1ee1f2){const _0x2810ba=a1254_0x36bdde;!_['isNil'](_0x17ce0a)?typeof _0x17ce0a[_0x2810ba(0xe0)]!==_0x2810ba(0xc7)&&(_0x17ce0a[_0x2810ba(0xe0)]>0x0?_0x17ce0a['originated']-=0x1:logger[_0x2810ba(0xe7)](_0x2810ba(0xcb),_0x1ee1f2)):logger[_0x2810ba(0xe7)](_0x2810ba(0x12b),_0x1ee1f2);},exports['logBlacklist']=function(_0x343b20){const _0x354e3b=a1254_0x36bdde,_0x594eef=moment()[_0x354e3b(0x109)]('YYYY-MM-DD\x20HH:mm:ss');_0x343b20[_0x354e3b(0x116)]=0xd,_0x343b20[_0x354e3b(0x12a)]=_0x354e3b(0x123),_0x343b20[_0x354e3b(0x133)]=_0x594eef,_0x343b20[_0x354e3b(0x124)]=_0x594eef,_0x343b20[_0x354e3b(0x12e)]=_0x594eef;},exports[a1254_0x36bdde(0x10b)]=function(_0xc840bb,_0x46cade,_0x3a46b3){const _0x6b6206=a1254_0x36bdde,_0x58a612=moment()[_0x6b6206(0x109)](_0x6b6206(0x100));_0xc840bb[_0x6b6206(0x116)]=_0x46cade,_0xc840bb[_0x6b6206(0x12a)]=_0x3a46b3,_0xc840bb[_0x6b6206(0x124)]=_0x58a612,_0xc840bb[_0x6b6206(0xef)]=getSeconds(_0xc840bb['responsetime'],_0xc840bb[_0x6b6206(0x133)]);},exports[a1254_0x36bdde(0x139)]=function(_0x379dc7,_0x465653,_0x5e6253){_0x379dc7['membername']=_0x465653,_0x379dc7['UserId']=_0x5e6253;},exports['logCustomer']=function(_0x91d72,_0x5b3c58,_0x4ed5c7){const _0x238c84=a1254_0x36bdde,_0x42ff40=moment()[_0x238c84(0x109)](_0x238c84(0x100));_0x91d72['state']=_0x5b3c58,_0x91d72[_0x238c84(0x12a)]=_0x4ed5c7,_0x91d72['responsetime']=_0x91d72[_0x238c84(0x124)]?_0x91d72[_0x238c84(0x124)]:_0x42ff40,_0x91d72[_0x238c84(0x12e)]=_0x91d72[_0x238c84(0x12e)]?_0x91d72[_0x238c84(0x12e)]:_0x42ff40,_0x91d72[_0x238c84(0xef)]=getSeconds(_0x91d72[_0x238c84(0x124)]||0x0,_0x91d72['starttime']||0x0),_0x91d72[_0x238c84(0x128)]=_0x91d72[_0x238c84(0x121)]?getSeconds(_0x91d72[_0x238c84(0x12e)],_0x91d72[_0x238c84(0x121)]):0x0;},exports[a1254_0x36bdde(0xcc)]=function(_0x1a7f44){const _0x294026=a1254_0x36bdde;return _0x1a7f44===_0x294026(0x127);},exports['variablesAction']=function(_0x5eb2a4,_0x5d1b6e,_0x494dbd,_0x2cfa4d,_0x24931d){const _0x4420e5=a1254_0x36bdde;let _0x4a6240=_0x2cfa4d?'RECALL':_0x5eb2a4[_0x4420e5(0x13c)];return _0x4a6240=_0x24931d?_0x4420e5(0x137):_0x4a6240,{'actionid':_0x5eb2a4[_0x4420e5(0x10a)],'action':_0x4420e5(0x129),'channel':_0x5eb2a4['channelAgent'],'callerid':util[_0x4420e5(0x109)](_0x4420e5(0xdc),_0x4a6240,_0x5eb2a4['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x4420e5(0x13f),'Priority':'1','variable':_0x494dbd,'timeout':(_0x5d1b6e['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5eb2a4['uniqueid']};},exports['totalGlobal']=function(_0xccf8e3){const _0x1f7f7e=a1254_0x36bdde;return _0xccf8e3['countbusyretry']+_0xccf8e3[_0x1f7f7e(0xec)]+_0xccf8e3['countnoanswerretry']+_0xccf8e3['countagentrejectretry']+_0xccf8e3[_0x1f7f7e(0x113)];},exports[a1254_0x36bdde(0xf2)]=function(_0x428fff){const _0x348301=a1254_0x36bdde,_0x414d6c=_['clone'](_0x428fff);return _0x414d6c['state']=0xf,_0x414d6c[_0x348301(0x12a)]='Global',_0x414d6c;},exports[a1254_0x36bdde(0xf9)]=function(_0x5f2b76,_0xee4518,_0x1922aa){const _0x1722e3=a1254_0x36bdde,_0x15cfa2={};return _0x15cfa2[_0xee4518]=_0x5f2b76[_0xee4518],_0x15cfa2[_0x1722e3(0xd7)]=![],_0x15cfa2[_0x1722e3(0x12d)]=moment()[_0x1722e3(0x10f)](_0x1922aa,_0x1722e3(0xeb))[_0x1722e3(0x109)](_0x1722e3(0x100)),_0x15cfa2[_0x1722e3(0xc6)]=_0x5f2b76[_0x1722e3(0xc6)],_0x15cfa2[_0x1722e3(0x102)]=_0x5f2b76[_0x1722e3(0x102)],_0x15cfa2[_0x1722e3(0xca)]=_0x5f2b76[_0x1722e3(0xca)]||undefined,_0x15cfa2;},exports[a1254_0x36bdde(0x118)]=function(_0x53f90a,_0x352f9a){const _0x5ad891=a1254_0x36bdde;!_['isNil'](_0x53f90a)?_0x53f90a[_0x5ad891(0xe3)]>0x0?_0x53f90a[_0x5ad891(0xe3)]-=0x1:logger[_0x5ad891(0xe7)](_0x352f9a,_0x5ad891(0xd0)):logger[_0x5ad891(0xe7)](_0x352f9a,_0x5ad891(0xf7));},exports[a1254_0x36bdde(0xc5)]=function(_0xca408c){if(_0xca408c<=0x0)return!![];return![];},exports['buildObj']=function(_0x22ec7e,_0x2d575a,_0x36255a){const _0x4a52a4=a1254_0x36bdde;return _0x22ec7e[_0x4a52a4(0x104)]=_0x2d575a,_0x22ec7e[_0x4a52a4(0x122)]=_0x22ec7e['queue'],_0x22ec7e[_0x4a52a4(0x105)]=_0x22ec7e[_0x4a52a4(0xd2)],_0x36255a&&(_0x22ec7e[_0x4a52a4(0x111)]=_0x36255a[_0x4a52a4(0x111)]),_0x22ec7e;},exports[a1254_0x36bdde(0x115)]=function(_0x414b0d){const _0x4e76d3=a1254_0x36bdde,_0x8241b3={};return _0x8241b3[_0x4e76d3(0xce)]=_0x414b0d[_0x4e76d3(0xce)],_0x8241b3['interface']=_0x414b0d['channelAgent'],_0x8241b3[_0x4e76d3(0x10a)]=_0x414b0d['uniqueid'],_0x8241b3;},exports[a1254_0x36bdde(0xe9)]=function(_0x58c456){const _0x45e152=a1254_0x36bdde,_0x27bc3f=[];for(const _0x5fda1 in _0x58c456){typeof _0x58c456[_0x5fda1]!==_0x45e152(0xc7)&&(!_['isNil'](_0x58c456[_0x5fda1])&&_0x58c456[_0x5fda1]['state']===_0x45e152(0x11e)&&_0x58c456[_0x5fda1][_0x45e152(0x138)]==='reachable'&&_0x27bc3f['push'](_0x58c456[_0x5fda1]['id']));}return _0x27bc3f;},exports[a1254_0x36bdde(0x132)]=function(_0x47c2f4){const _0x399e0b=a1254_0x36bdde,_0x4ca391=moment()['milliseconds'](0x0),_0x4dc65c=moment(_0x47c2f4)[_0x399e0b(0xfc)](0x0);return _0x4ca391[_0x399e0b(0xe5)](_0x4dc65c,_0x399e0b(0x126));},exports[a1254_0x36bdde(0x10e)]=function(_0x3f5bf9){const _0x28b6cc=a1254_0x36bdde;return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3f5bf9[_0x28b6cc(0xc6)],'ListId':_0x3f5bf9[_0x28b6cc(0x102)],'VoiceQueueId':_0x3f5bf9['VoiceQueueId']||undefined,'CampaignId':_0x3f5bf9['CampaignId']||undefined};},exports[a1254_0x36bdde(0x103)]=function(_0x3a02b9){const _0x5316f8=a1254_0x36bdde;if(_0x3a02b9===_0x5316f8(0x10a)||_0x3a02b9===_0x5316f8(0x101)||_0x3a02b9==='queue'||_0x3a02b9===_0x5316f8(0x114)||_0x3a02b9==='campaigntype'||_0x3a02b9==='dialAnswer'||_0x3a02b9===_0x5316f8(0x11d)||_0x3a02b9==='channelAgent'||_0x3a02b9===_0x5316f8(0x13c)||_0x3a02b9===_0x5316f8(0xd7)||_0x3a02b9==='calleridnum'||_0x3a02b9===_0x5316f8(0x12d)||_0x3a02b9===_0x5316f8(0xc2)||_0x3a02b9===_0x5316f8(0xec)||_0x3a02b9===_0x5316f8(0x10d)||_0x3a02b9===_0x5316f8(0xf0)||_0x3a02b9===_0x5316f8(0x117)||_0x3a02b9===_0x5316f8(0xe1)||_0x3a02b9==='callbackat'||_0x3a02b9===_0x5316f8(0xee)||_0x3a02b9==='ContactId'||_0x3a02b9==='ListId'||_0x3a02b9===_0x5316f8(0xf8)||_0x3a02b9===_0x5316f8(0xca)||_0x3a02b9==='sipcallid'||_0x3a02b9===_0x5316f8(0x13d)||_0x3a02b9===_0x5316f8(0x141)||_0x3a02b9===_0x5316f8(0x135)||_0x3a02b9==='xmd-listid'||_0x3a02b9===_0x5316f8(0xfb)||_0x3a02b9===_0x5316f8(0xcd)||_0x3a02b9==='xmd-dialoptions'||_0x3a02b9===_0x5316f8(0x125)||_0x3a02b9===_0x5316f8(0x11a)||_0x3a02b9==='xmd-contactid'||_0x3a02b9==='xmd-cdrtype'||_0x3a02b9===_0x5316f8(0xd3)||_0x3a02b9===_0x5316f8(0xed)||_0x3a02b9==='xmd-agi'||_0x3a02b9==='rtpaudioqos'||_0x3a02b9===_0x5316f8(0x136)||_0x3a02b9===_0x5316f8(0xe2)||_0x3a02b9===_0x5316f8(0x13b)||_0x3a02b9==='rtpaudioqosloss'||_0x3a02b9===_0x5316f8(0xea)||_0x3a02b9===_0x5316f8(0xe6)||_0x3a02b9===_0x5316f8(0xd6)||_0x3a02b9===_0x5316f8(0x131)||_0x3a02b9===_0x5316f8(0x136)||_0x3a02b9===_0x5316f8(0xe2)||_0x3a02b9==='rtpaudioqosjitterbridged'||_0x3a02b9===_0x5316f8(0x119)||_0x3a02b9===_0x5316f8(0xea)||_0x3a02b9===_0x5316f8(0xe6)||_0x3a02b9==='rtpaudioqosrttbridged'||_0x3a02b9===_0x5316f8(0x110)||_0x3a02b9==='bridgepvtcallid'||_0x3a02b9===_0x5316f8(0x116)||_0x3a02b9===_0x5316f8(0x12a))return![];return!![];},exports['getCallerIdRandom']=function(_0x5bb23e,_0x55fe5d){const _0xf456ff=a1254_0x36bdde;_0x55fe5d<=0x0&&(_0x55fe5d=0x1);const _0x53b869=new RegExp('\x5cw{0,'+_0x55fe5d+'}$'),_0x460fea=Math[_0xf456ff(0x106)](0xa,_0x55fe5d-0x1),_0x5e14cb=Math[_0xf456ff(0x106)](0xa,_0x55fe5d)-0x1;return util[_0xf456ff(0x109)]('%s',_['replace'](_0x5bb23e,_0x53b869,_['random'](_0x460fea,_0x5e14cb)));},exports[a1254_0x36bdde(0xf5)]=function(_0x324f0b){const _0x36dd33=a1254_0x36bdde,_0x5bde58=_0x324f0b[_0x36dd33(0x13e)](/"(.*?)"/);return _0x5bde58?_0x5bde58[0x1]:_0x324f0b;},exports[a1254_0x36bdde(0xf1)]=function(_0x5ae916){const _0x5268fe=a1254_0x36bdde,_0x5f0df3=_0x5ae916[_0x5268fe(0x13e)](/<(.*?)>/);return _0x5f0df3?_0x5f0df3[0x1]:_0x5ae916;};
\ No newline at end of file
+const a1258_0x3bc6=['dialQueueProject','xcally-motion-preview','extractCalleridName','xmd-queue','uniqueid','responsetime','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerError','pTalking','countagentrejectretry','dialer','format','RECALL','isFailure','agiIp','xmd-contactid','xmd-dialid','agentReadyId','error','bridgepvtcallid','rtpaudioqosjitterbridged','endtime','createdAt','isUndefined','ListId','extractCalleridNumber','originatecalleridnum','updatedAt','sipcallid','countnosuchnumberretry','membername','recallme','calleridnum','xmd-cdrtype','rtpaudioqosrtt','dialQueueProject2','countcongestionretry','clone','countnoanswerretry','NONE','Blacklist','name','logLookAgent','monitor_format','idContact','logger','totalGlobal','rtpaudioqosrttbridged','channelAgent','interface','xmd-voicequeueid','starttime','Queue','UserId','countbusyretry','xmd-agi','scheduledat','talktime','\x22agi://%s/square,%s\x22','lodash','push','dialOriginateTimeout','addVariables','seconds','not_inuse','tags','buildAcw','_XCALLY_MIXMONITOR_UNIQUEID','milliseconds','util','xmd-callerid','buildObj','[decrementTalkink]\x20object\x20talking\x20is\x20negative','getCallerIdRandom','moment','\x22%s\x22\x20<%s>','ContactId','toLowerVariables','xmd-dialoptions','mandatoryDisposition','xmd-dialurl','diff','scheduledAt','createBody','countglobal','xmd-phone','variablesAction','originatecalleridname','updateOriginated','type','decrementTalkink','rtpaudioqosbridged','xmd-listid','rtpaudioqos','toLower','preview','Failure','reachable','minutes','../../../../config/config.service','calleridname','[updateOriginated]\x20object\x20originated\x20is\x20negative','active','originate','rtpaudioqosloss','info','logBlacklist','[decrementTalkink]\x20is\x20null\x20or\x20undefined','add','callbackuniqueid','xmd-agiafter','dialPreviewUrl','xmd-dialtimeout','pow','statedesc','isEmpty','xmd-dialchannel','match','isNil','loggerCatch','inspect','Contact','getCallerId','logAgent','state','undefined','replace','\x5cw{0,','logger2','YYYY-MM-DD\x20HH:mm:ss','originated','timeout','cloneAction','logCustomer','queue','rtpaudioqosjitter','string','IsNotLoggedIn','answertime','XMD-'];(function(_0x196923,_0x4eddf7){const _0x3bc66c=function(_0x4f5200){while(--_0x4f5200){_0x196923['push'](_0x196923['shift']());}};_0x3bc66c(++_0x4eddf7);}(a1258_0x3bc6,0x195));const a1258_0x4f52=function(_0x196923,_0x4eddf7){_0x196923=_0x196923-0x1c2;let _0x3bc66c=a1258_0x3bc6[_0x196923];return _0x3bc66c;};const a1258_0x5c71d8=a1258_0x4f52;'use strict';const util=require(a1258_0x5c71d8(0x216)),_=require(a1258_0x5c71d8(0x20c)),moment=require(a1258_0x5c71d8(0x21b)),logger=require('../../../../config/logger')(a1258_0x5c71d8(0x230)),{getConfigService}=require(a1258_0x5c71d8(0x234));function getSeconds(_0x43f147,_0x2684f7){const _0xb2afd4=a1258_0x5c71d8,_0x573bf4=moment(_0x43f147)[_0xb2afd4(0x215)](0x0),_0xef473c=moment(_0x2684f7)[_0xb2afd4(0x215)](0x0);return _0x573bf4[_0xb2afd4(0x222)](_0xef473c,_0xb2afd4(0x210));}exports[a1258_0x5c71d8(0x248)]=function(_0x3ecd59){return function(_0x56a94b){const _0x519104=a1258_0x4f52;logger[_0x519104(0x1e3)](_0x3ecd59,util['inspect'](_0x56a94b,{'showHidden':![],'depth':null}));};},exports[a1258_0x5c71d8(0x1fe)]=function(_0x255eba,_0x293851){const _0x59e1d3=a1258_0x5c71d8;logger['info'](_0x255eba,util[_0x59e1d3(0x249)](_0x293851,{'showHidden':![],'depth':null}));},exports[a1258_0x5c71d8(0x1d8)]=function(_0x44070b,_0x361387){const _0x39bec8=a1258_0x5c71d8;logger[_0x39bec8(0x1e3)](_0x44070b,util[_0x39bec8(0x249)](_0x361387,{'showHidden':![],'depth':null}));},exports[a1258_0x5c71d8(0x1c5)]=function(_0x56d1a0){return function(_0x4fb45c){const _0xfd52d5=a1258_0x4f52;logger[_0xfd52d5(0x23a)](_0x56d1a0,util[_0xfd52d5(0x249)](_0x4fb45c,{'showHidden':![],'depth':null}));};},exports['message']=function(_0x11f07f,_0x50ee1f,_0x446de6){return{'message':_0x11f07f,'unlock':_0x50ee1f,'active':_0x446de6};},exports[a1258_0x5c71d8(0x24b)]=function(_0x28e555,_0xb34cfb,_0xa2e0ca){const _0x599814=a1258_0x5c71d8;if(!_[_0x599814(0x1e8)](_0xa2e0ca)&&_0x599814(0x1cd)===typeof _0xa2e0ca&&!_[_0x599814(0x244)](_0xa2e0ca)){if(!_[_0x599814(0x1e8)](_0xb34cfb)&&_0x599814(0x1cd)===typeof _0xb34cfb&&!_[_0x599814(0x244)](_0xb34cfb))return util[_0x599814(0x1dc)](_0x599814(0x21c),_0xb34cfb,_0xa2e0ca);return util[_0x599814(0x1dc)]('\x22%s\x22\x20<%s>',_0xa2e0ca,_0xa2e0ca);}if(!_[_0x599814(0x1e8)](_0x28e555)&&'string'===typeof _0x28e555&&!_['isEmpty'](_0x28e555))return _0x28e555;return'\x22\x22\x20<>';},exports['isActive']=function(_0x449888){const _0x4989ab=a1258_0x5c71d8;if(_[_0x4989ab(0x247)](_0x449888))return![];return _0x449888;},exports[a1258_0x5c71d8(0x20f)]=function(_0x4c3d93,_0x3fd5b9,_0x22d995,_0x48ac6e,_0x24fa96,_0x35f37b){const _0x2d6e9b=a1258_0x5c71d8,_0x27c3ba=getConfigService(),_0xf2858e={'XMD-QUEUE':_0x3fd5b9[_0x2d6e9b(0x205)]?_0x3fd5b9['Queue']['name']:'','XMD-CALLERID':_0x48ac6e,'XMD-CALLERID-PREVIEW':_0x35f37b?util[_0x2d6e9b(0x1dc)](_0x2d6e9b(0x21c),_0x35f37b[_0x2d6e9b(0x235)],_0x35f37b[_0x2d6e9b(0x1f1)]):_0x48ac6e,'XMD-DIALID':_0x24fa96,'XMD-CONTACTID':_0x3fd5b9['ContactId'],'XMD-CDRTYPE':_0x2d6e9b(0x1db),'CALLERID(all)':_0x48ac6e,'XMD-VOICEQUEUEID':_0x3fd5b9['VoiceQueueId'],'XMD-DIALCHANNEL':_0x22d995,'XMD-DIALTIMEOUT':_0x4c3d93[_0x2d6e9b(0x20e)]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x4c3d93[_0x2d6e9b(0x1f4)]?'g':'',_[_0x2d6e9b(0x244)](_0x4c3d93[_0x2d6e9b(0x1fc)])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x4c3d93[_0x2d6e9b(0x240)]||'','XMD-AGI':_0x4c3d93[_0x2d6e9b(0x1d1)]?util['format'](_0x2d6e9b(0x20b),_0x27c3ba[_0x2d6e9b(0x1df)],_0x4c3d93[_0x2d6e9b(0x1d1)]):_0x2d6e9b(0x1f8),'XMD-AGIAFTER':_0x4c3d93['dialQueueProject2']?util['format'](_0x2d6e9b(0x20b),_0x27c3ba['agiIp'],_0x4c3d93['dialQueueProject2']):_0x2d6e9b(0x1f8),'XMD-ORIGINATECALLERIDNUM':_0x35f37b?_0x35f37b[_0x2d6e9b(0x1eb)]:'','XMD-ORIGINATECALLERIDNAME':_0x35f37b?_0x35f37b[_0x2d6e9b(0x228)]:'','XMD-DESTINATION':'xcally-motion-preview'};!_[_0x2d6e9b(0x244)](_0x4c3d93[_0x2d6e9b(0x1fc)])&&(_0xf2858e[util[_0x2d6e9b(0x1dc)]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4c3d93['monitor_format'],_0xf2858e[util[_0x2d6e9b(0x1dc)]('%s',_0x2d6e9b(0x214))]=_0x24fa96);if(_0x3fd5b9&&_0x3fd5b9['Contact'])for(const _0x3864d8 in _0x3fd5b9[_0x2d6e9b(0x24a)]){typeof _0x3fd5b9[_0x2d6e9b(0x24a)][_0x3864d8]!==_0x2d6e9b(0x1c2)&&(!_[_0x2d6e9b(0x247)](_0x3fd5b9['Contact'][_0x3864d8])&&_0x3864d8!=='id'&&_0x3864d8!==_0x2d6e9b(0x212)&&_0x3864d8!==_0x2d6e9b(0x1e7)&&_0x3864d8!==_0x2d6e9b(0x1ec)&&(_0xf2858e[util[_0x2d6e9b(0x1dc)]('%s%s',_0x2d6e9b(0x1d0),_['toUpper'](_0x3864d8))]=_0x3fd5b9[_0x2d6e9b(0x24a)][_0x3864d8]));}return _0xf2858e;},exports[a1258_0x5c71d8(0x21e)]=function(_0x48e2da){const _0x4d6a61=a1258_0x5c71d8,_0x6b1242={};for(const _0x403670 in _0x48e2da){typeof _0x48e2da[_0x403670]!==_0x4d6a61(0x1c2)&&(_0x6b1242[util['format']('%s',_[_0x4d6a61(0x22f)](_0x403670))]=_0x48e2da[_0x403670]);}return{'variables':_0x6b1242};},exports[a1258_0x5c71d8(0x229)]=function(_0xae6826,_0x5ca86b){const _0x27ecff=a1258_0x5c71d8;!_[_0x27ecff(0x247)](_0xae6826)?typeof _0xae6826[_0x27ecff(0x1c7)]!=='undefined'&&(_0xae6826[_0x27ecff(0x1c7)]>0x0?_0xae6826[_0x27ecff(0x1c7)]-=0x1:logger['error'](_0x27ecff(0x236),_0x5ca86b)):logger[_0x27ecff(0x1e3)](_0x27ecff(0x1d7),_0x5ca86b);},exports[a1258_0x5c71d8(0x23b)]=function(_0xf4d04b){const _0x48367d=a1258_0x5c71d8,_0x5e55d0=moment()[_0x48367d(0x1dc)](_0x48367d(0x1c6));_0xf4d04b[_0x48367d(0x24d)]=0xd,_0xf4d04b['statedesc']=_0x48367d(0x1f9),_0xf4d04b['starttime']=_0x5e55d0,_0xf4d04b[_0x48367d(0x1d6)]=_0x5e55d0,_0xf4d04b[_0x48367d(0x1e6)]=_0x5e55d0;},exports[a1258_0x5c71d8(0x24c)]=function(_0x1c7e48,_0x54e58d,_0x5ea77d){const _0x3eea3c=a1258_0x5c71d8,_0x52dcc3=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1c7e48[_0x3eea3c(0x24d)]=_0x54e58d,_0x1c7e48[_0x3eea3c(0x243)]=_0x5ea77d,_0x1c7e48[_0x3eea3c(0x1d6)]=_0x52dcc3,_0x1c7e48['ringtime']=getSeconds(_0x1c7e48[_0x3eea3c(0x1d6)],_0x1c7e48[_0x3eea3c(0x204)]);},exports[a1258_0x5c71d8(0x1fb)]=function(_0x1065c9,_0x17ade2,_0x3b45f8){const _0x1b2372=a1258_0x5c71d8;_0x1065c9[_0x1b2372(0x1ef)]=_0x17ade2,_0x1065c9['UserId']=_0x3b45f8;},exports[a1258_0x5c71d8(0x1ca)]=function(_0x264107,_0x361311,_0x7a0bf4){const _0x4dfc98=a1258_0x5c71d8,_0x36347c=moment()[_0x4dfc98(0x1dc)](_0x4dfc98(0x1c6));_0x264107[_0x4dfc98(0x24d)]=_0x361311,_0x264107[_0x4dfc98(0x243)]=_0x7a0bf4,_0x264107[_0x4dfc98(0x1d6)]=_0x264107[_0x4dfc98(0x1d6)]?_0x264107[_0x4dfc98(0x1d6)]:_0x36347c,_0x264107[_0x4dfc98(0x1e6)]=_0x264107[_0x4dfc98(0x1e6)]?_0x264107[_0x4dfc98(0x1e6)]:_0x36347c,_0x264107['ringtime']=getSeconds(_0x264107[_0x4dfc98(0x1d6)]||0x0,_0x264107[_0x4dfc98(0x204)]||0x0),_0x264107[_0x4dfc98(0x20a)]=_0x264107[_0x4dfc98(0x1cf)]?getSeconds(_0x264107[_0x4dfc98(0x1e6)],_0x264107[_0x4dfc98(0x1cf)]):0x0;},exports[a1258_0x5c71d8(0x1de)]=function(_0x1c5803){const _0x302379=a1258_0x5c71d8;return _0x1c5803===_0x302379(0x231);},exports[a1258_0x5c71d8(0x227)]=function(_0x24d715,_0x1fe457,_0x3004c4,_0x40b955,_0x1bbd7c){const _0x1df511=a1258_0x5c71d8;let _0xc2f1fc=_0x40b955?_0x1df511(0x1dd):_0x24d715['calleridname'];return _0xc2f1fc=_0x1bbd7c?'BOOKED':_0xc2f1fc,{'actionid':_0x24d715['uniqueid'],'action':_0x1df511(0x238),'channel':_0x24d715['channelAgent'],'callerid':util[_0x1df511(0x1dc)]('\x22%s\x22\x20<%s>',_0xc2f1fc,_0x24d715[_0x1df511(0x1f1)]),'Exten':_0x1df511(0x1d2),'Context':'from-sip','Priority':'1','variable':_0x3004c4,'timeout':(_0x1fe457[_0x1df511(0x1c8)]||0x1e)*0x3e8,'async':!![],'channelid':_0x24d715[_0x1df511(0x1d5)]};},exports[a1258_0x5c71d8(0x1ff)]=function(_0x4a6bca){const _0x15a85a=a1258_0x5c71d8;return _0x4a6bca[_0x15a85a(0x207)]+_0x4a6bca[_0x15a85a(0x1f5)]+_0x4a6bca['countnoanswerretry']+_0x4a6bca[_0x15a85a(0x1da)]+_0x4a6bca[_0x15a85a(0x1ee)];},exports[a1258_0x5c71d8(0x1c9)]=function(_0x49f0a3){const _0x191511=a1258_0x5c71d8,_0x3f48a3=_[_0x191511(0x1f6)](_0x49f0a3);return _0x3f48a3[_0x191511(0x24d)]=0xf,_0x3f48a3[_0x191511(0x243)]='Global',_0x3f48a3;},exports[a1258_0x5c71d8(0x223)]=function(_0x49cc9d,_0x1d5358,_0x4e76ac){const _0x5eae45=a1258_0x5c71d8,_0x257f68={};return _0x257f68[_0x1d5358]=_0x49cc9d[_0x1d5358],_0x257f68[_0x5eae45(0x237)]=![],_0x257f68[_0x5eae45(0x209)]=moment()[_0x5eae45(0x23d)](_0x4e76ac,_0x5eae45(0x233))[_0x5eae45(0x1dc)]('YYYY-MM-DD\x20HH:mm:ss'),_0x257f68['ContactId']=_0x49cc9d['ContactId'],_0x257f68[_0x5eae45(0x1e9)]=_0x49cc9d[_0x5eae45(0x1e9)],_0x257f68['VoiceQueueId']=_0x49cc9d['VoiceQueueId']||undefined,_0x257f68;},exports[a1258_0x5c71d8(0x22b)]=function(_0x4edc64,_0x5d3347){const _0x27e951=a1258_0x5c71d8;!_[_0x27e951(0x247)](_0x4edc64)?_0x4edc64[_0x27e951(0x1d9)]>0x0?_0x4edc64['pTalking']-=0x1:logger[_0x27e951(0x1e3)](_0x5d3347,_0x27e951(0x219)):logger[_0x27e951(0x1e3)](_0x5d3347,_0x27e951(0x23c));},exports[a1258_0x5c71d8(0x1ce)]=function(_0x48a601){if(_0x48a601<=0x0)return!![];return![];},exports[a1258_0x5c71d8(0x218)]=function(_0x20ffa7,_0x1a00fe,_0x149f56){const _0x17e47a=a1258_0x5c71d8;return _0x20ffa7['lastevent']=_0x1a00fe,_0x20ffa7[_0x17e47a(0x1fa)]=_0x20ffa7[_0x17e47a(0x1cb)],_0x20ffa7['interface']=_0x20ffa7[_0x17e47a(0x201)],_0x149f56&&(_0x20ffa7[_0x17e47a(0x220)]=_0x149f56['mandatoryDisposition']),_0x20ffa7;},exports[a1258_0x5c71d8(0x213)]=function(_0x3b4650){const _0x2f2e27=a1258_0x5c71d8,_0x2551f4={};return _0x2551f4[_0x2f2e27(0x1cb)]=_0x3b4650['queue'],_0x2551f4[_0x2f2e27(0x202)]=_0x3b4650[_0x2f2e27(0x201)],_0x2551f4[_0x2f2e27(0x1d5)]=_0x3b4650[_0x2f2e27(0x1d5)],_0x2551f4;},exports[a1258_0x5c71d8(0x1e2)]=function(_0x23b232){const _0x5dfbb6=a1258_0x5c71d8,_0x910a31=[];for(const _0x5643a9 in _0x23b232){typeof _0x23b232[_0x5643a9]!==_0x5dfbb6(0x1c2)&&(!_[_0x5dfbb6(0x247)](_0x23b232[_0x5643a9])&&_0x23b232[_0x5643a9][_0x5dfbb6(0x24d)]===_0x5dfbb6(0x211)&&_0x23b232[_0x5643a9]['status']===_0x5dfbb6(0x232)&&_0x910a31[_0x5dfbb6(0x20d)](_0x23b232[_0x5643a9]['id']));}return _0x910a31;},exports['getDiff']=function(_0x236f3d){const _0x4d97e7=a1258_0x5c71d8,_0x461030=moment()[_0x4d97e7(0x215)](0x0),_0x5ac7c4=moment(_0x236f3d)['milliseconds'](0x0);return _0x461030['diff'](_0x5ac7c4,_0x4d97e7(0x210));},exports[a1258_0x5c71d8(0x224)]=function(_0x23289f){const _0x2dca89=a1258_0x5c71d8;return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x23289f[_0x2dca89(0x21d)],'ListId':_0x23289f[_0x2dca89(0x1e9)],'VoiceQueueId':_0x23289f['VoiceQueueId']||undefined,'CampaignId':_0x23289f['CampaignId']||undefined};},exports['filterKey']=function(_0x371466){const _0x14d002=a1258_0x5c71d8;if(_0x371466===_0x14d002(0x1d5)||_0x371466===_0x14d002(0x1fd)||_0x371466===_0x14d002(0x1cb)||_0x371466===_0x14d002(0x22a)||_0x371466==='campaigntype'||_0x371466==='dialAnswer'||_0x371466===_0x14d002(0x1ef)||_0x371466===_0x14d002(0x201)||_0x371466===_0x14d002(0x235)||_0x371466===_0x14d002(0x237)||_0x371466==='calleridnum'||_0x371466===_0x14d002(0x209)||_0x371466==='countbusyretry'||_0x371466===_0x14d002(0x1f5)||_0x371466===_0x14d002(0x1f7)||_0x371466===_0x14d002(0x225)||_0x371466==='callback'||_0x371466===_0x14d002(0x23e)||_0x371466==='callbackat'||_0x371466===_0x14d002(0x1f0)||_0x371466===_0x14d002(0x21d)||_0x371466===_0x14d002(0x1e9)||_0x371466===_0x14d002(0x206)||_0x371466==='VoiceQueueId'||_0x371466===_0x14d002(0x1ed)||_0x371466===_0x14d002(0x203)||_0x371466===_0x14d002(0x1d4)||_0x371466===_0x14d002(0x226)||_0x371466===_0x14d002(0x22d)||_0x371466===_0x14d002(0x221)||_0x371466===_0x14d002(0x241)||_0x371466===_0x14d002(0x21f)||_0x371466===_0x14d002(0x1e1)||_0x371466===_0x14d002(0x245)||_0x371466===_0x14d002(0x1e0)||_0x371466===_0x14d002(0x1f2)||_0x371466===_0x14d002(0x217)||_0x371466===_0x14d002(0x23f)||_0x371466===_0x14d002(0x208)||_0x371466===_0x14d002(0x22e)||_0x371466===_0x14d002(0x22c)||_0x371466===_0x14d002(0x1cc)||_0x371466===_0x14d002(0x1e5)||_0x371466===_0x14d002(0x239)||_0x371466==='rtpaudioqoslossbridged'||_0x371466===_0x14d002(0x1f3)||_0x371466===_0x14d002(0x200)||_0x371466===_0x14d002(0x22e)||_0x371466===_0x14d002(0x22c)||_0x371466===_0x14d002(0x1cc)||_0x371466===_0x14d002(0x1e5)||_0x371466==='rtpaudioqosloss'||_0x371466==='rtpaudioqoslossbridged'||_0x371466==='rtpaudioqosrtt'||_0x371466===_0x14d002(0x200)||_0x371466==='bridgepeer'||_0x371466===_0x14d002(0x1e4)||_0x371466===_0x14d002(0x24d)||_0x371466===_0x14d002(0x243))return![];return!![];},exports[a1258_0x5c71d8(0x21a)]=function(_0x1d78e6,_0x28e394){const _0x2e4cfd=a1258_0x5c71d8;_0x28e394<=0x0&&(_0x28e394=0x1);const _0x4f1d56=new RegExp(_0x2e4cfd(0x1c4)+_0x28e394+'}$'),_0x5b0ebb=Math[_0x2e4cfd(0x242)](0xa,_0x28e394-0x1),_0x1f498=Math[_0x2e4cfd(0x242)](0xa,_0x28e394)-0x1;return util[_0x2e4cfd(0x1dc)]('%s',_[_0x2e4cfd(0x1c3)](_0x1d78e6,_0x4f1d56,_['random'](_0x5b0ebb,_0x1f498)));},exports[a1258_0x5c71d8(0x1d3)]=function(_0x51d420){const _0x1a7baf=a1258_0x5c71d8,_0xdd7c65=_0x51d420[_0x1a7baf(0x246)](/"(.*?)"/);return _0xdd7c65?_0xdd7c65[0x1]:_0x51d420;},exports[a1258_0x5c71d8(0x1ea)]=function(_0x5c9b71){const _0x596228=_0x5c9b71['match'](/<(.*?)>/);return _0x596228?_0x596228[0x1]:_0x5c9b71;};
\ No newline at end of file