Built motion from commit 43538d75.|2.5.35
[motion2.git] / server / services / ami / preview / util / util.js
index ad00186..1f320a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2ab=['membername','scheduledat','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','replace','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','logger','info','inspect','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','format','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','UserId','ringtime','talktime','answertime','isFailure','variablesAction','BOOKED','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','name','queue','channelAgent','interface','uniqueid','agentReadyId','status','reachable','push','createBody','CampaignId','filterKey','type','campaigntype'];(function(_0x4c2bfb,_0x4eb60d){var _0xa0931c=function(_0xf062e0){while(--_0xf062e0){_0x4c2bfb['push'](_0x4c2bfb['shift']());}};_0xa0931c(++_0x4eb60d);}(_0xa2ab,0xa7));var _0xba2a=function(_0x308c6a,_0xe04d64){_0x308c6a=_0x308c6a-0x0;var _0x257b4d=_0xa2ab[_0x308c6a];return _0x257b4d;};'use strict';var util=require(_0xba2a('0x0'));var _=require(_0xba2a('0x1'));var moment=require(_0xba2a('0x2'));var logger=require('../../../../config/logger')(_0xba2a('0x3'));var ipAgi=process[_0xba2a('0x4')][_0xba2a('0x5')]||_0xba2a('0x6');function getSeconds(_0x24423b,_0x1b27f8){var _0x7206ca=moment(_0x24423b)['milliseconds'](0x0);var _0x12f994=moment(_0x1b27f8)[_0xba2a('0x7')](0x0);return _0x7206ca[_0xba2a('0x8')](_0x12f994,'seconds');}exports[_0xba2a('0x9')]=function(_0xf818d1){return function(_0x2a40c6){logger[_0xba2a('0xa')](_0xf818d1,util['inspect'](_0x2a40c6,{'showHidden':![],'depth':null}));};};exports[_0xba2a('0xb')]=function(_0x43fa56,_0x2f4d3d){logger[_0xba2a('0xc')](_0x43fa56,util[_0xba2a('0xd')](_0x2f4d3d,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x463cb9,_0x114fb5){logger[_0xba2a('0xa')](_0x463cb9,util[_0xba2a('0xd')](_0x114fb5,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x93f663){return function(_0x10bf76){logger[_0xba2a('0xc')](_0x93f663,util[_0xba2a('0xd')](_0x10bf76,{'showHidden':![],'depth':null}));};};exports[_0xba2a('0xe')]=function(_0x4d4448,_0x8c98d,_0x44759c){return{'message':_0x4d4448,'unlock':_0x8c98d,'active':_0x44759c};};exports[_0xba2a('0xf')]=function(_0x127c42,_0x5352fa,_0x26ea93){if(!_[_0xba2a('0x10')](_0x26ea93)&&_0xba2a('0x11')===typeof _0x26ea93&&!_[_0xba2a('0x12')](_0x26ea93)){if(!_['isUndefined'](_0x5352fa)&&_0xba2a('0x11')===typeof _0x5352fa&&!_[_0xba2a('0x12')](_0x5352fa)){return util['format'](_0xba2a('0x13'),_0x5352fa,_0x26ea93);}return util['format']('\x22%s\x22\x20<%s>',_0x26ea93,_0x26ea93);}if(!_[_0xba2a('0x10')](_0x127c42)&&_0xba2a('0x11')===typeof _0x127c42&&!_[_0xba2a('0x12')](_0x127c42)){return _0x127c42;}return _0xba2a('0x14');};exports[_0xba2a('0x15')]=function(_0x5b4aa5){if(_[_0xba2a('0x16')](_0x5b4aa5)){return![];}return _0x5b4aa5;};exports[_0xba2a('0x17')]=function(_0x4d572d,_0x200e32,_0x5c9fb4,_0x3b3924,_0x2ad68,_0x3e7afa){var _0x1d4ba9={'XMD-QUEUE':_0x200e32[_0xba2a('0x18')]?_0x200e32[_0xba2a('0x18')]['name']:'','XMD-CALLERID':_0x3b3924,'XMD-CALLERID-PREVIEW':_0x3e7afa?util[_0xba2a('0x19')](_0xba2a('0x13'),_0x3e7afa[_0xba2a('0x1a')],_0x3e7afa[_0xba2a('0x1b')]):_0x3b3924,'XMD-DIALID':_0x2ad68,'XMD-CONTACTID':_0x200e32[_0xba2a('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3b3924,'XMD-VOICEQUEUEID':_0x200e32[_0xba2a('0x1d')],'XMD-DIALCHANNEL':_0x5c9fb4,'XMD-DIALTIMEOUT':_0x4d572d[_0xba2a('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xba2a('0x19')](_0xba2a('0x1f'),_0x4d572d[_0xba2a('0x20')]?'g':'',_[_0xba2a('0x12')](_0x4d572d[_0xba2a('0x21')])?'':_0xba2a('0x22')),'XMD-DIALURL':_0x4d572d['dialPreviewUrl']||'','XMD-AGI':_0x4d572d[_0xba2a('0x23')]?util[_0xba2a('0x19')](_0xba2a('0x24'),ipAgi,_0x4d572d[_0xba2a('0x23')]):'NONE','XMD-AGIAFTER':_0x4d572d[_0xba2a('0x20')]?util[_0xba2a('0x19')](_0xba2a('0x24'),ipAgi,_0x4d572d['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3e7afa?_0x3e7afa[_0xba2a('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x3e7afa?_0x3e7afa[_0xba2a('0x26')]:'','XMD-DESTINATION':_0xba2a('0x27')};if(!_[_0xba2a('0x12')](_0x4d572d[_0xba2a('0x21')])){_0x1d4ba9[util[_0xba2a('0x19')]('%s',_0xba2a('0x28'))]=_0x4d572d[_0xba2a('0x21')];_0x1d4ba9[util[_0xba2a('0x19')]('%s',_0xba2a('0x29'))]=_0x2ad68;}if(_0x200e32&&_0x200e32['Contact']){for(var _0x1bf866 in _0x200e32[_0xba2a('0x2a')]){if(_0x200e32[_0xba2a('0x2a')][_0xba2a('0x2b')](_0x1bf866)){if(!_['isNil'](_0x200e32[_0xba2a('0x2a')][_0x1bf866])&&_0x1bf866!=='id'&&_0x1bf866!==_0xba2a('0x2c')&&_0x1bf866!==_0xba2a('0x2d')&&_0x1bf866!=='updatedAt'){_0x1d4ba9[util[_0xba2a('0x19')](_0xba2a('0x2e'),_0xba2a('0x2f'),_[_0xba2a('0x30')](_0x1bf866))]=_0x200e32[_0xba2a('0x2a')][_0x1bf866];}}}}return _0x1d4ba9;};exports[_0xba2a('0x31')]=function(_0x1f4cb3){var _0x35f5d8={};for(var _0x52e0ef in _0x1f4cb3){if(_0x1f4cb3[_0xba2a('0x2b')](_0x52e0ef)){_0x35f5d8[util[_0xba2a('0x19')]('%s',_[_0xba2a('0x32')](_0x52e0ef))]=_0x1f4cb3[_0x52e0ef];}}return{'variables':_0x35f5d8};};exports[_0xba2a('0x33')]=function(_0x43b42c,_0x5afca4){if(!_[_0xba2a('0x16')](_0x43b42c)){if(_0x43b42c[_0xba2a('0x2b')](_0xba2a('0x34'))){if(_0x43b42c[_0xba2a('0x34')]>0x0){_0x43b42c['originated']-=0x1;}else{logger[_0xba2a('0xa')](_0xba2a('0x35'),_0x5afca4);}}}else{logger[_0xba2a('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5afca4);}};exports[_0xba2a('0x36')]=function(_0x100d83){var _0x1c59e3=moment()['format'](_0xba2a('0x37'));_0x100d83[_0xba2a('0x38')]=0xd;_0x100d83[_0xba2a('0x39')]=_0xba2a('0x3a');_0x100d83[_0xba2a('0x3b')]=_0x1c59e3;_0x100d83[_0xba2a('0x3c')]=_0x1c59e3;_0x100d83[_0xba2a('0x3d')]=_0x1c59e3;};exports['logAgent']=function(_0x37e9fe,_0x4a5e29,_0x1c4c2a){var _0x380f30=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x37e9fe['state']=_0x4a5e29;_0x37e9fe['statedesc']=_0x1c4c2a;_0x37e9fe[_0xba2a('0x3c')]=_0x380f30;_0x37e9fe['ringtime']=getSeconds(_0x37e9fe[_0xba2a('0x3c')],_0x37e9fe[_0xba2a('0x3b')]);};exports['logLookAgent']=function(_0x3f0fb7,_0x35a9c1,_0x17e3b8){_0x3f0fb7['membername']=_0x35a9c1;_0x3f0fb7[_0xba2a('0x3e')]=_0x17e3b8;};exports['logCustomer']=function(_0x34fbfb,_0x34f7bb,_0x111fd5){var _0x5092c1=moment()[_0xba2a('0x19')](_0xba2a('0x37'));_0x34fbfb[_0xba2a('0x38')]=_0x34f7bb;_0x34fbfb['statedesc']=_0x111fd5;_0x34fbfb[_0xba2a('0x3c')]=_0x34fbfb[_0xba2a('0x3c')]?_0x34fbfb['responsetime']:_0x5092c1;_0x34fbfb[_0xba2a('0x3d')]=_0x34fbfb[_0xba2a('0x3d')]?_0x34fbfb[_0xba2a('0x3d')]:_0x5092c1;_0x34fbfb[_0xba2a('0x3f')]=getSeconds(_0x34fbfb[_0xba2a('0x3c')]||0x0,_0x34fbfb[_0xba2a('0x3b')]||0x0);_0x34fbfb[_0xba2a('0x40')]=_0x34fbfb[_0xba2a('0x41')]?getSeconds(_0x34fbfb[_0xba2a('0x3d')],_0x34fbfb['answertime']):0x0;};exports[_0xba2a('0x42')]=function(_0x2f1f82){return _0x2f1f82==='Failure';};exports[_0xba2a('0x43')]=function(_0x2ef089,_0x168b20,_0x403c1c,_0x51ff70,_0x5339f6){var _0x569ba6=_0x51ff70?'RECALL':_0x2ef089[_0xba2a('0x1a')];_0x569ba6=_0x5339f6?_0xba2a('0x44'):_0x569ba6;return{'actionid':_0x2ef089['uniqueid'],'action':'originate','channel':_0x2ef089['channelAgent'],'callerid':util[_0xba2a('0x19')](_0xba2a('0x13'),_0x569ba6,_0x2ef089['calleridnum']),'Exten':'xcally-motion-preview','Context':_0xba2a('0x45'),'Priority':'1','variable':_0x403c1c,'timeout':(_0x168b20[_0xba2a('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2ef089['uniqueid']};};exports[_0xba2a('0x47')]=function(_0x18879d){return _0x18879d[_0xba2a('0x48')]+_0x18879d['countcongestionretry']+_0x18879d[_0xba2a('0x49')];};exports['cloneAction']=function(_0x13ce56){var _0x574075=_[_0xba2a('0x4a')](_0x13ce56);_0x574075[_0xba2a('0x38')]=0xf;_0x574075[_0xba2a('0x39')]=_0xba2a('0x4b');return _0x574075;};exports[_0xba2a('0x4c')]=function(_0x1c06df,_0x5805a0,_0x46d4f8){var _0x5e7dbc={};_0x5e7dbc[_0x5805a0]=_0x1c06df[_0x5805a0];_0x5e7dbc[_0xba2a('0x4d')]=![];_0x5e7dbc['scheduledat']=moment()[_0xba2a('0x4e')](_0x46d4f8,_0xba2a('0x4f'))[_0xba2a('0x19')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e7dbc[_0xba2a('0x1c')]=_0x1c06df['ContactId'];_0x5e7dbc['ListId']=_0x1c06df[_0xba2a('0x50')];_0x5e7dbc['VoiceQueueId']=_0x1c06df['VoiceQueueId']||undefined;return _0x5e7dbc;};exports[_0xba2a('0x51')]=function(_0x4260a3,_0x4ed0a6){if(!_[_0xba2a('0x16')](_0x4260a3)){if(_0x4260a3[_0xba2a('0x52')]>0x0){_0x4260a3[_0xba2a('0x52')]-=0x1;}else{logger['error'](_0x4ed0a6,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xba2a('0xa')](_0x4ed0a6,_0xba2a('0x53'));}};exports[_0xba2a('0x54')]=function(_0x2e38a3){if(_0x2e38a3<=0x0){return!![];}return![];};exports[_0xba2a('0x55')]=function(_0x2c51d1,_0x88c057){_0x2c51d1[_0xba2a('0x56')]=_0x88c057;_0x2c51d1[_0xba2a('0x57')]=_0x2c51d1[_0xba2a('0x58')];_0x2c51d1['interface']=_0x2c51d1[_0xba2a('0x59')];return _0x2c51d1;};exports['buildAcw']=function(_0x3101fd){var _0x2f6f70={};_0x2f6f70['queue']=_0x3101fd[_0xba2a('0x58')];_0x2f6f70[_0xba2a('0x5a')]=_0x3101fd[_0xba2a('0x59')];_0x2f6f70[_0xba2a('0x5b')]=_0x3101fd[_0xba2a('0x5b')];return _0x2f6f70;};exports[_0xba2a('0x5c')]=function(_0x58a823){var _0x367c38=[];for(var _0x50afed in _0x58a823){if(_0x58a823[_0xba2a('0x2b')](_0x50afed)){if(!_[_0xba2a('0x16')](_0x58a823[_0x50afed])&&_0x58a823[_0x50afed][_0xba2a('0x38')]==='not_inuse'&&_0x58a823[_0x50afed][_0xba2a('0x5d')]===_0xba2a('0x5e')){_0x367c38[_0xba2a('0x5f')](_0x58a823[_0x50afed]['id']);}}}return _0x367c38;};exports['getDiff']=function(_0x5b9e4a){var _0x347d81=moment()[_0xba2a('0x7')](0x0);var _0x20c1ce=moment(_0x5b9e4a)[_0xba2a('0x7')](0x0);return _0x347d81[_0xba2a('0x8')](_0x20c1ce,'seconds');};exports[_0xba2a('0x60')]=function(_0x34324f){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x34324f[_0xba2a('0x1c')],'ListId':_0x34324f[_0xba2a('0x50')],'VoiceQueueId':_0x34324f['VoiceQueueId']||undefined,'CampaignId':_0x34324f[_0xba2a('0x61')]||undefined};};exports[_0xba2a('0x62')]=function(_0xabccb9){if(_0xabccb9===_0xba2a('0x5b')||_0xabccb9==='idContact'||_0xabccb9===_0xba2a('0x58')||_0xabccb9===_0xba2a('0x63')||_0xabccb9===_0xba2a('0x64')||_0xabccb9==='dialAnswer'||_0xabccb9===_0xba2a('0x65')||_0xabccb9===_0xba2a('0x59')||_0xabccb9===_0xba2a('0x1a')||_0xabccb9==='active'||_0xabccb9==='calleridnum'||_0xabccb9===_0xba2a('0x66')||_0xabccb9===_0xba2a('0x48')||_0xabccb9==='countcongestionretry'||_0xabccb9==='countnoanswerretry'||_0xabccb9===_0xba2a('0x67')||_0xabccb9===_0xba2a('0x68')||_0xabccb9===_0xba2a('0x69')||_0xabccb9==='callbackat'||_0xabccb9===_0xba2a('0x6a')||_0xabccb9===_0xba2a('0x1c')||_0xabccb9==='ListId'||_0xabccb9===_0xba2a('0x3e')||_0xabccb9==='VoiceQueueId'||_0xabccb9===_0xba2a('0x6b')||_0xabccb9===_0xba2a('0x6c')||_0xabccb9==='xmd-queue'||_0xabccb9===_0xba2a('0x6d')||_0xabccb9===_0xba2a('0x6e')||_0xabccb9===_0xba2a('0x6f')||_0xabccb9===_0xba2a('0x70')||_0xabccb9===_0xba2a('0x71')||_0xabccb9===_0xba2a('0x72')||_0xabccb9==='xmd-dialchannel'||_0xabccb9===_0xba2a('0x73')||_0xabccb9===_0xba2a('0x74')||_0xabccb9===_0xba2a('0x75')||_0xabccb9===_0xba2a('0x76')||_0xabccb9===_0xba2a('0x77')||_0xabccb9===_0xba2a('0x78')||_0xabccb9==='rtpaudioqosbridged'||_0xabccb9===_0xba2a('0x79')||_0xabccb9===_0xba2a('0x7a')||_0xabccb9===_0xba2a('0x7b')||_0xabccb9==='rtpaudioqoslossbridged'||_0xabccb9==='rtpaudioqosrtt'||_0xabccb9===_0xba2a('0x7c')||_0xabccb9===_0xba2a('0x78')||_0xabccb9==='rtpaudioqosbridged'||_0xabccb9===_0xba2a('0x79')||_0xabccb9===_0xba2a('0x7a')||_0xabccb9==='rtpaudioqosloss'||_0xabccb9===_0xba2a('0x7d')||_0xabccb9==='rtpaudioqosrtt'||_0xabccb9==='rtpaudioqosrttbridged'||_0xabccb9===_0xba2a('0x7e')||_0xabccb9===_0xba2a('0x7f')||_0xabccb9===_0xba2a('0x38')||_0xabccb9===_0xba2a('0x39')){return![];}return!![];};exports[_0xba2a('0x80')]=function(_0xd5d70b,_0xb6ae48){var _0x5e4617,_0x49384b,_0x346189;if(_0xb6ae48<=0x0){_0xb6ae48=0x1;}_0x5e4617=new RegExp(_0xba2a('0x81')+_0xb6ae48+'}$');_0x49384b=Math['pow'](0xa,_0xb6ae48-0x1);_0x346189=Math['pow'](0xa,_0xb6ae48)-0x1;return util['format']('%s',_[_0xba2a('0x82')](_0xd5d70b,_0x5e4617,_['random'](_0x49384b,_0x346189)));};exports[_0xba2a('0x83')]=function(_0x1e9a7f){var _0x2c2b21=_0x1e9a7f[_0xba2a('0x84')](/"(.*?)"/);return _0x2c2b21?_0x2c2b21[0x1]:_0x1e9a7f;};exports[_0xba2a('0x85')]=function(_0x42f43b){var _0x3de4c1=_0x42f43b['match'](/<(.*?)>/);return _0x3de4c1?_0x3de4c1[0x1]:_0x42f43b;};
\ No newline at end of file
+var _0xbc11=['IsNotLoggedIn','buildObj','lastevent','interface','motionChannel','voice','mandatoryDisposition','queue','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','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','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','addVariables','Queue','name','calleridname','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','tags','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','logAgent','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','endtime','answertime','isFailure','Failure','uniqueid','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined'];(function(_0x567ac4,_0x232a9f){var _0x3e2c29=function(_0x235658){while(--_0x235658){_0x567ac4['push'](_0x567ac4['shift']());}};_0x3e2c29(++_0x232a9f);}(_0xbc11,0x159));var _0x1bc1=function(_0x401732,_0x3b6b35){_0x401732=_0x401732-0x0;var _0x30f777=_0xbc11[_0x401732];return _0x30f777;};'use strict';var util=require(_0x1bc1('0x0'));var _=require(_0x1bc1('0x1'));var moment=require('moment');var logger=require(_0x1bc1('0x2'))(_0x1bc1('0x3'));var ipAgi=process['env'][_0x1bc1('0x4')]||_0x1bc1('0x5');function getSeconds(_0x55bcd3,_0x57447e){var _0x355c21=moment(_0x55bcd3)['milliseconds'](0x0);var _0x526f9a=moment(_0x57447e)[_0x1bc1('0x6')](0x0);return _0x355c21[_0x1bc1('0x7')](_0x526f9a,_0x1bc1('0x8'));}exports[_0x1bc1('0x9')]=function(_0x42529f){return function(_0x131dcc){logger[_0x1bc1('0xa')](_0x42529f,util[_0x1bc1('0xb')](_0x131dcc,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x4c6c6c,_0xdc4392){logger[_0x1bc1('0xc')](_0x4c6c6c,util[_0x1bc1('0xb')](_0xdc4392,{'showHidden':![],'depth':null}));};exports[_0x1bc1('0xd')]=function(_0x40cbff,_0x43f354){logger[_0x1bc1('0xa')](_0x40cbff,util[_0x1bc1('0xb')](_0x43f354,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x5ef4c3){return function(_0x54709){logger[_0x1bc1('0xc')](_0x5ef4c3,util[_0x1bc1('0xb')](_0x54709,{'showHidden':![],'depth':null}));};};exports[_0x1bc1('0xe')]=function(_0x19b1f5,_0x5065e8,_0x10e752){return{'message':_0x19b1f5,'unlock':_0x5065e8,'active':_0x10e752};};exports[_0x1bc1('0xf')]=function(_0x3b1bfc,_0x46c80a,_0x5bf3d1){if(!_[_0x1bc1('0x10')](_0x5bf3d1)&&_0x1bc1('0x11')===typeof _0x5bf3d1&&!_[_0x1bc1('0x12')](_0x5bf3d1)){if(!_[_0x1bc1('0x10')](_0x46c80a)&&_0x1bc1('0x11')===typeof _0x46c80a&&!_[_0x1bc1('0x12')](_0x46c80a)){return util[_0x1bc1('0x13')](_0x1bc1('0x14'),_0x46c80a,_0x5bf3d1);}return util['format'](_0x1bc1('0x14'),_0x5bf3d1,_0x5bf3d1);}if(!_[_0x1bc1('0x10')](_0x3b1bfc)&&_0x1bc1('0x11')===typeof _0x3b1bfc&&!_[_0x1bc1('0x12')](_0x3b1bfc)){return _0x3b1bfc;}return _0x1bc1('0x15');};exports['isActive']=function(_0x26395b){if(_['isNil'](_0x26395b)){return![];}return _0x26395b;};exports[_0x1bc1('0x16')]=function(_0x3cf791,_0x44c217,_0x2b4168,_0x750bba,_0x47e286,_0x569d20){var _0x221a35={'XMD-QUEUE':_0x44c217[_0x1bc1('0x17')]?_0x44c217[_0x1bc1('0x17')][_0x1bc1('0x18')]:'','XMD-CALLERID':_0x750bba,'XMD-CALLERID-PREVIEW':_0x569d20?util[_0x1bc1('0x13')]('\x22%s\x22\x20<%s>',_0x569d20[_0x1bc1('0x19')],_0x569d20['calleridnum']):_0x750bba,'XMD-DIALID':_0x47e286,'XMD-CONTACTID':_0x44c217[_0x1bc1('0x1a')],'XMD-CDRTYPE':_0x1bc1('0x1b'),'CALLERID(all)':_0x750bba,'XMD-VOICEQUEUEID':_0x44c217[_0x1bc1('0x1c')],'XMD-DIALCHANNEL':_0x2b4168,'XMD-DIALTIMEOUT':_0x3cf791['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x1bc1('0x13')](_0x1bc1('0x1d'),_0x3cf791[_0x1bc1('0x1e')]?'g':'',_[_0x1bc1('0x12')](_0x3cf791['monitor_format'])?'':_0x1bc1('0x1f')),'XMD-DIALURL':_0x3cf791['dialPreviewUrl']||'','XMD-AGI':_0x3cf791['dialQueueProject']?util['format'](_0x1bc1('0x20'),ipAgi,_0x3cf791['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x3cf791['dialQueueProject2']?util[_0x1bc1('0x13')](_0x1bc1('0x20'),ipAgi,_0x3cf791[_0x1bc1('0x1e')]):_0x1bc1('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x569d20?_0x569d20[_0x1bc1('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x569d20?_0x569d20['originatecalleridname']:'','XMD-DESTINATION':_0x1bc1('0x23')};if(!_['isEmpty'](_0x3cf791[_0x1bc1('0x24')])){_0x221a35[util[_0x1bc1('0x13')]('%s',_0x1bc1('0x25'))]=_0x3cf791[_0x1bc1('0x24')];_0x221a35[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x47e286;}if(_0x44c217&&_0x44c217[_0x1bc1('0x26')]){for(var _0x24e7f4 in _0x44c217[_0x1bc1('0x26')]){if(_0x44c217['Contact'][_0x1bc1('0x27')](_0x24e7f4)){if(!_[_0x1bc1('0x28')](_0x44c217[_0x1bc1('0x26')][_0x24e7f4])&&_0x24e7f4!=='id'&&_0x24e7f4!==_0x1bc1('0x29')&&_0x24e7f4!==_0x1bc1('0x2a')&&_0x24e7f4!==_0x1bc1('0x2b')){_0x221a35[util['format']('%s%s',_0x1bc1('0x2c'),_[_0x1bc1('0x2d')](_0x24e7f4))]=_0x44c217['Contact'][_0x24e7f4];}}}}return _0x221a35;};exports[_0x1bc1('0x2e')]=function(_0x3d485d){var _0x367f46={};for(var _0x2b175d in _0x3d485d){if(_0x3d485d['hasOwnProperty'](_0x2b175d)){_0x367f46[util['format']('%s',_[_0x1bc1('0x2f')](_0x2b175d))]=_0x3d485d[_0x2b175d];}}return{'variables':_0x367f46};};exports[_0x1bc1('0x30')]=function(_0x41f9ac,_0x53a8a5){if(!_[_0x1bc1('0x28')](_0x41f9ac)){if(_0x41f9ac[_0x1bc1('0x27')](_0x1bc1('0x31'))){if(_0x41f9ac['originated']>0x0){_0x41f9ac[_0x1bc1('0x31')]-=0x1;}else{logger[_0x1bc1('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x53a8a5);}}}else{logger[_0x1bc1('0xa')](_0x1bc1('0x32'),_0x53a8a5);}};exports[_0x1bc1('0x33')]=function(_0x5d708f){var _0x4c1035=moment()[_0x1bc1('0x13')](_0x1bc1('0x34'));_0x5d708f[_0x1bc1('0x35')]=0xd;_0x5d708f[_0x1bc1('0x36')]=_0x1bc1('0x37');_0x5d708f['starttime']=_0x4c1035;_0x5d708f[_0x1bc1('0x38')]=_0x4c1035;_0x5d708f['endtime']=_0x4c1035;};exports[_0x1bc1('0x39')]=function(_0x510c16,_0x12e9c5,_0x28066d){var _0x3c9a7a=moment()[_0x1bc1('0x13')](_0x1bc1('0x34'));_0x510c16['state']=_0x12e9c5;_0x510c16['statedesc']=_0x28066d;_0x510c16['responsetime']=_0x3c9a7a;_0x510c16[_0x1bc1('0x3a')]=getSeconds(_0x510c16[_0x1bc1('0x38')],_0x510c16[_0x1bc1('0x3b')]);};exports[_0x1bc1('0x3c')]=function(_0x5f1b24,_0x4ab306,_0x4d8235){_0x5f1b24[_0x1bc1('0x3d')]=_0x4ab306;_0x5f1b24[_0x1bc1('0x3e')]=_0x4d8235;};exports[_0x1bc1('0x3f')]=function(_0x1f0e45,_0x58c491,_0x2aefb2){var _0x117e02=moment()[_0x1bc1('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f0e45[_0x1bc1('0x35')]=_0x58c491;_0x1f0e45[_0x1bc1('0x36')]=_0x2aefb2;_0x1f0e45[_0x1bc1('0x38')]=_0x1f0e45['responsetime']?_0x1f0e45[_0x1bc1('0x38')]:_0x117e02;_0x1f0e45[_0x1bc1('0x40')]=_0x1f0e45[_0x1bc1('0x40')]?_0x1f0e45[_0x1bc1('0x40')]:_0x117e02;_0x1f0e45[_0x1bc1('0x3a')]=getSeconds(_0x1f0e45[_0x1bc1('0x38')]||0x0,_0x1f0e45[_0x1bc1('0x3b')]||0x0);_0x1f0e45['talktime']=_0x1f0e45[_0x1bc1('0x41')]?getSeconds(_0x1f0e45[_0x1bc1('0x40')],_0x1f0e45[_0x1bc1('0x41')]):0x0;};exports[_0x1bc1('0x42')]=function(_0x1804c6){return _0x1804c6===_0x1bc1('0x43');};exports['variablesAction']=function(_0x4e7c54,_0x128f62,_0x51382e,_0x10eda4,_0x490a47){var _0x14ce73=_0x10eda4?'RECALL':_0x4e7c54[_0x1bc1('0x19')];_0x14ce73=_0x490a47?'BOOKED':_0x14ce73;return{'actionid':_0x4e7c54[_0x1bc1('0x44')],'action':'originate','channel':_0x4e7c54[_0x1bc1('0x45')],'callerid':util[_0x1bc1('0x13')](_0x1bc1('0x14'),_0x14ce73,_0x4e7c54[_0x1bc1('0x46')]),'Exten':_0x1bc1('0x23'),'Context':_0x1bc1('0x47'),'Priority':'1','variable':_0x51382e,'timeout':(_0x128f62[_0x1bc1('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4e7c54[_0x1bc1('0x44')]};};exports[_0x1bc1('0x49')]=function(_0x44f466){return _0x44f466['countbusyretry']+_0x44f466['countcongestionretry']+_0x44f466['countnoanswerretry']+_0x44f466[_0x1bc1('0x4a')]+_0x44f466['countnosuchnumberretry'];};exports[_0x1bc1('0x4b')]=function(_0x26655b){var _0x3788c9=_[_0x1bc1('0x4c')](_0x26655b);_0x3788c9[_0x1bc1('0x35')]=0xf;_0x3788c9['statedesc']=_0x1bc1('0x4d');return _0x3788c9;};exports[_0x1bc1('0x4e')]=function(_0x3e46f6,_0xa45044,_0x1bd04f){var _0x517ded={};_0x517ded[_0xa45044]=_0x3e46f6[_0xa45044];_0x517ded[_0x1bc1('0x4f')]=![];_0x517ded['scheduledat']=moment()[_0x1bc1('0x50')](_0x1bd04f,_0x1bc1('0x51'))[_0x1bc1('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x517ded[_0x1bc1('0x1a')]=_0x3e46f6[_0x1bc1('0x1a')];_0x517ded[_0x1bc1('0x52')]=_0x3e46f6['ListId'];_0x517ded['VoiceQueueId']=_0x3e46f6['VoiceQueueId']||undefined;return _0x517ded;};exports[_0x1bc1('0x53')]=function(_0x299c7b,_0x3d7191){if(!_[_0x1bc1('0x28')](_0x299c7b)){if(_0x299c7b[_0x1bc1('0x54')]>0x0){_0x299c7b[_0x1bc1('0x54')]-=0x1;}else{logger[_0x1bc1('0xa')](_0x3d7191,_0x1bc1('0x55'));}}else{logger['error'](_0x3d7191,_0x1bc1('0x56'));}};exports[_0x1bc1('0x57')]=function(_0x5a9589){if(_0x5a9589<=0x0){return!![];}return![];};exports[_0x1bc1('0x58')]=function(_0x3a81c9,_0x2a5803,_0x2b1ed8){_0x3a81c9[_0x1bc1('0x59')]=_0x2a5803;_0x3a81c9[_0x1bc1('0x18')]=_0x3a81c9['queue'];_0x3a81c9[_0x1bc1('0x5a')]=_0x3a81c9[_0x1bc1('0x45')];_0x3a81c9[_0x1bc1('0x5b')]=_0x1bc1('0x5c');if(_0x2b1ed8){_0x3a81c9[_0x1bc1('0x5d')]=_0x2b1ed8[_0x1bc1('0x5d')];}return _0x3a81c9;};exports['buildAcw']=function(_0x4cec59){var _0x4d25f9={};_0x4d25f9[_0x1bc1('0x5e')]=_0x4cec59[_0x1bc1('0x5e')];_0x4d25f9['interface']=_0x4cec59['channelAgent'];_0x4d25f9[_0x1bc1('0x44')]=_0x4cec59[_0x1bc1('0x44')];return _0x4d25f9;};exports[_0x1bc1('0x5f')]=function(_0x35c8b3){var _0x47363f=[];for(var _0x4cb4d5 in _0x35c8b3){if(_0x35c8b3[_0x1bc1('0x27')](_0x4cb4d5)){if(!_[_0x1bc1('0x28')](_0x35c8b3[_0x4cb4d5])&&_0x35c8b3[_0x4cb4d5][_0x1bc1('0x35')]===_0x1bc1('0x60')&&_0x35c8b3[_0x4cb4d5][_0x1bc1('0x61')]===_0x1bc1('0x62')){_0x47363f[_0x1bc1('0x63')](_0x35c8b3[_0x4cb4d5]['id']);}}}return _0x47363f;};exports[_0x1bc1('0x64')]=function(_0x55b5c3){var _0x2425c2=moment()[_0x1bc1('0x6')](0x0);var _0xfdccc6=moment(_0x55b5c3)[_0x1bc1('0x6')](0x0);return _0x2425c2[_0x1bc1('0x7')](_0xfdccc6,_0x1bc1('0x8'));};exports[_0x1bc1('0x65')]=function(_0x33b8bd){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x33b8bd['ContactId'],'ListId':_0x33b8bd['ListId'],'VoiceQueueId':_0x33b8bd['VoiceQueueId']||undefined,'CampaignId':_0x33b8bd[_0x1bc1('0x66')]||undefined};};exports[_0x1bc1('0x67')]=function(_0x478a80){if(_0x478a80===_0x1bc1('0x44')||_0x478a80===_0x1bc1('0x68')||_0x478a80===_0x1bc1('0x5e')||_0x478a80===_0x1bc1('0x69')||_0x478a80===_0x1bc1('0x6a')||_0x478a80===_0x1bc1('0x6b')||_0x478a80===_0x1bc1('0x3d')||_0x478a80==='channelAgent'||_0x478a80===_0x1bc1('0x19')||_0x478a80===_0x1bc1('0x4f')||_0x478a80===_0x1bc1('0x46')||_0x478a80==='scheduledat'||_0x478a80===_0x1bc1('0x6c')||_0x478a80===_0x1bc1('0x6d')||_0x478a80===_0x1bc1('0x6e')||_0x478a80===_0x1bc1('0x6f')||_0x478a80===_0x1bc1('0x70')||_0x478a80===_0x1bc1('0x71')||_0x478a80==='callbackat'||_0x478a80===_0x1bc1('0x72')||_0x478a80===_0x1bc1('0x1a')||_0x478a80===_0x1bc1('0x52')||_0x478a80===_0x1bc1('0x3e')||_0x478a80===_0x1bc1('0x1c')||_0x478a80==='sipcallid'||_0x478a80===_0x1bc1('0x73')||_0x478a80==='xmd-queue'||_0x478a80===_0x1bc1('0x74')||_0x478a80===_0x1bc1('0x75')||_0x478a80==='xmd-dialurl'||_0x478a80===_0x1bc1('0x76')||_0x478a80===_0x1bc1('0x77')||_0x478a80===_0x1bc1('0x78')||_0x478a80===_0x1bc1('0x79')||_0x478a80===_0x1bc1('0x7a')||_0x478a80===_0x1bc1('0x7b')||_0x478a80===_0x1bc1('0x7c')||_0x478a80===_0x1bc1('0x7d')||_0x478a80===_0x1bc1('0x7e')||_0x478a80===_0x1bc1('0x7f')||_0x478a80===_0x1bc1('0x80')||_0x478a80===_0x1bc1('0x81')||_0x478a80===_0x1bc1('0x82')||_0x478a80===_0x1bc1('0x83')||_0x478a80===_0x1bc1('0x84')||_0x478a80===_0x1bc1('0x85')||_0x478a80==='rtpaudioqosrttbridged'||_0x478a80===_0x1bc1('0x7f')||_0x478a80===_0x1bc1('0x80')||_0x478a80===_0x1bc1('0x81')||_0x478a80===_0x1bc1('0x82')||_0x478a80===_0x1bc1('0x83')||_0x478a80===_0x1bc1('0x84')||_0x478a80===_0x1bc1('0x85')||_0x478a80===_0x1bc1('0x86')||_0x478a80===_0x1bc1('0x87')||_0x478a80===_0x1bc1('0x88')||_0x478a80===_0x1bc1('0x35')||_0x478a80==='statedesc'){return![];}return!![];};exports[_0x1bc1('0x89')]=function(_0x5d4502,_0x2fed49){var _0x7105b4,_0x511250,_0x1f74e2;if(_0x2fed49<=0x0){_0x2fed49=0x1;}_0x7105b4=new RegExp(_0x1bc1('0x8a')+_0x2fed49+'}$');_0x511250=Math[_0x1bc1('0x8b')](0xa,_0x2fed49-0x1);_0x1f74e2=Math['pow'](0xa,_0x2fed49)-0x1;return util[_0x1bc1('0x13')]('%s',_[_0x1bc1('0x8c')](_0x5d4502,_0x7105b4,_[_0x1bc1('0x8d')](_0x511250,_0x1f74e2)));};exports[_0x1bc1('0x8e')]=function(_0x13722b){var _0x28c288=_0x13722b[_0x1bc1('0x8f')](/"(.*?)"/);return _0x28c288?_0x28c288[0x1]:_0x13722b;};exports['extractCalleridNumber']=function(_0x126643){var _0x45e389=_0x126643[_0x1bc1('0x8f')](/<(.*?)>/);return _0x45e389?_0x45e389[0x1]:_0x126643;};
\ No newline at end of file