Built motion from commit (unavailable).|2.5.22
[motion2.git] / server / services / ami / preview / util / util.js
index a66bb43..2f5ffc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c66=['isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','UserId','logCustomer','YYYY-MM-DD\x20HH:mm:ss','answertime','isFailure','Failure','RECALL','uniqueid','channelAgent','from-sip','totalGlobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','cloneAction','state','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','mandatoryDisposition','buildAcw','agentReadyId','createBody','filterKey','idContact','type','campaigntype','dialAnswer','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','loggerError','logger2','info','message','getCallerId','isUndefined','string','isEmpty','format','isActive'];(function(_0x47a9a9,_0x302893){var _0x9f92d3=function(_0x4a56fa){while(--_0x4a56fa){_0x47a9a9['push'](_0x47a9a9['shift']());}};_0x9f92d3(++_0x302893);}(_0x7c66,0x102));var _0x67c6=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7c66[_0x5ddb1c];return _0x354adc;};'use strict';var util=require('util');var _=require(_0x67c6('0x0'));var moment=require(_0x67c6('0x1'));var logger=require('../../../../config/logger')(_0x67c6('0x2'));var ipAgi=process[_0x67c6('0x3')][_0x67c6('0x4')]||_0x67c6('0x5');function getSeconds(_0x302653,_0x18140e){var _0x4b971a=moment(_0x302653)[_0x67c6('0x6')](0x0);var _0x8a646f=moment(_0x18140e)[_0x67c6('0x6')](0x0);return _0x4b971a[_0x67c6('0x7')](_0x8a646f,_0x67c6('0x8'));}exports[_0x67c6('0x9')]=function(_0x4632ed){return function(_0x23c0c0){logger[_0x67c6('0xa')](_0x4632ed,util[_0x67c6('0xb')](_0x23c0c0,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x2736fc,_0x261596){logger['info'](_0x2736fc,util[_0x67c6('0xb')](_0x261596,{'showHidden':![],'depth':null}));};exports[_0x67c6('0xc')]=function(_0x306792,_0xf9691b){logger[_0x67c6('0xa')](_0x306792,util[_0x67c6('0xb')](_0xf9691b,{'showHidden':![],'depth':null}));};exports[_0x67c6('0xd')]=function(_0x2c34d2){return function(_0x217445){logger[_0x67c6('0xe')](_0x2c34d2,util[_0x67c6('0xb')](_0x217445,{'showHidden':![],'depth':null}));};};exports[_0x67c6('0xf')]=function(_0xf2c987,_0x595dc0,_0xa1ede9){return{'message':_0xf2c987,'unlock':_0x595dc0,'active':_0xa1ede9};};exports[_0x67c6('0x10')]=function(_0x54d208,_0x291096,_0x18c05b){if(!_[_0x67c6('0x11')](_0x18c05b)&&_0x67c6('0x12')===typeof _0x18c05b&&!_[_0x67c6('0x13')](_0x18c05b)){if(!_[_0x67c6('0x11')](_0x291096)&&'string'===typeof _0x291096&&!_[_0x67c6('0x13')](_0x291096)){return util['format']('\x22%s\x22\x20<%s>',_0x291096,_0x18c05b);}return util[_0x67c6('0x14')]('\x22%s\x22\x20<%s>',_0x18c05b,_0x18c05b);}if(!_['isUndefined'](_0x54d208)&&_0x67c6('0x12')===typeof _0x54d208&&!_['isEmpty'](_0x54d208)){return _0x54d208;}return'\x22\x22\x20<>';};exports[_0x67c6('0x15')]=function(_0x1adff6){if(_[_0x67c6('0x16')](_0x1adff6)){return![];}return _0x1adff6;};exports[_0x67c6('0x17')]=function(_0x353e00,_0x8c2df8,_0x11664c,_0x1bb99f,_0x99132,_0x39e410){var _0x34b3c5={'XMD-QUEUE':_0x8c2df8[_0x67c6('0x18')]?_0x8c2df8['Queue'][_0x67c6('0x19')]:'','XMD-CALLERID':_0x1bb99f,'XMD-CALLERID-PREVIEW':_0x39e410?util[_0x67c6('0x14')](_0x67c6('0x1a'),_0x39e410[_0x67c6('0x1b')],_0x39e410[_0x67c6('0x1c')]):_0x1bb99f,'XMD-DIALID':_0x99132,'XMD-CONTACTID':_0x8c2df8[_0x67c6('0x1d')],'XMD-CDRTYPE':_0x67c6('0x1e'),'CALLERID(all)':_0x1bb99f,'XMD-VOICEQUEUEID':_0x8c2df8[_0x67c6('0x1f')],'XMD-DIALCHANNEL':_0x11664c,'XMD-DIALTIMEOUT':_0x353e00['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0x67c6('0x20'),_0x353e00[_0x67c6('0x21')]?'g':'',_[_0x67c6('0x13')](_0x353e00[_0x67c6('0x22')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x353e00[_0x67c6('0x23')]||'','XMD-AGI':_0x353e00[_0x67c6('0x24')]?util[_0x67c6('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x353e00[_0x67c6('0x24')]):_0x67c6('0x25'),'XMD-AGIAFTER':_0x353e00['dialQueueProject2']?util[_0x67c6('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x353e00[_0x67c6('0x21')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x39e410?_0x39e410[_0x67c6('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x39e410?_0x39e410[_0x67c6('0x27')]:'','XMD-DESTINATION':_0x67c6('0x28')};if(!_[_0x67c6('0x13')](_0x353e00['monitor_format'])){_0x34b3c5[util['format']('%s',_0x67c6('0x29'))]=_0x353e00[_0x67c6('0x22')];_0x34b3c5[util[_0x67c6('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x99132;}if(_0x8c2df8&&_0x8c2df8[_0x67c6('0x2a')]){for(var _0x313798 in _0x8c2df8[_0x67c6('0x2a')]){if(_0x8c2df8[_0x67c6('0x2a')][_0x67c6('0x2b')](_0x313798)){if(!_[_0x67c6('0x16')](_0x8c2df8[_0x67c6('0x2a')][_0x313798])&&_0x313798!=='id'&&_0x313798!==_0x67c6('0x2c')&&_0x313798!==_0x67c6('0x2d')&&_0x313798!==_0x67c6('0x2e')){_0x34b3c5[util[_0x67c6('0x14')](_0x67c6('0x2f'),'XMD-',_[_0x67c6('0x30')](_0x313798))]=_0x8c2df8[_0x67c6('0x2a')][_0x313798];}}}}return _0x34b3c5;};exports[_0x67c6('0x31')]=function(_0x207b42){var _0x207a12={};for(var _0x16249c in _0x207b42){if(_0x207b42[_0x67c6('0x2b')](_0x16249c)){_0x207a12[util[_0x67c6('0x14')]('%s',_[_0x67c6('0x32')](_0x16249c))]=_0x207b42[_0x16249c];}}return{'variables':_0x207a12};};exports[_0x67c6('0x33')]=function(_0x5d108e,_0x1383e8){if(!_[_0x67c6('0x16')](_0x5d108e)){if(_0x5d108e[_0x67c6('0x2b')](_0x67c6('0x34'))){if(_0x5d108e[_0x67c6('0x34')]>0x0){_0x5d108e[_0x67c6('0x34')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x1383e8);}}}else{logger['error'](_0x67c6('0x35'),_0x1383e8);}};exports[_0x67c6('0x36')]=function(_0x2457c8){var _0x4f9797=moment()[_0x67c6('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x2457c8['state']=0xd;_0x2457c8[_0x67c6('0x37')]='Blacklist';_0x2457c8[_0x67c6('0x38')]=_0x4f9797;_0x2457c8[_0x67c6('0x39')]=_0x4f9797;_0x2457c8[_0x67c6('0x3a')]=_0x4f9797;};exports[_0x67c6('0x3b')]=function(_0x5e7d73,_0x159abd,_0x3cb794){var _0x443aae=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5e7d73['state']=_0x159abd;_0x5e7d73[_0x67c6('0x37')]=_0x3cb794;_0x5e7d73[_0x67c6('0x39')]=_0x443aae;_0x5e7d73[_0x67c6('0x3c')]=getSeconds(_0x5e7d73[_0x67c6('0x39')],_0x5e7d73[_0x67c6('0x38')]);};exports[_0x67c6('0x3d')]=function(_0x114524,_0x57a573,_0x426b42){_0x114524['membername']=_0x57a573;_0x114524[_0x67c6('0x3e')]=_0x426b42;};exports[_0x67c6('0x3f')]=function(_0xb0e09d,_0x147242,_0x38fb04){var _0x2381e4=moment()[_0x67c6('0x14')](_0x67c6('0x40'));_0xb0e09d['state']=_0x147242;_0xb0e09d[_0x67c6('0x37')]=_0x38fb04;_0xb0e09d[_0x67c6('0x39')]=_0xb0e09d['responsetime']?_0xb0e09d[_0x67c6('0x39')]:_0x2381e4;_0xb0e09d['endtime']=_0xb0e09d['endtime']?_0xb0e09d[_0x67c6('0x3a')]:_0x2381e4;_0xb0e09d[_0x67c6('0x3c')]=getSeconds(_0xb0e09d[_0x67c6('0x39')]||0x0,_0xb0e09d['starttime']||0x0);_0xb0e09d['talktime']=_0xb0e09d['answertime']?getSeconds(_0xb0e09d[_0x67c6('0x3a')],_0xb0e09d[_0x67c6('0x41')]):0x0;};exports[_0x67c6('0x42')]=function(_0x55cef5){return _0x55cef5===_0x67c6('0x43');};exports['variablesAction']=function(_0x40b35d,_0x1aa3ce,_0x199c0d,_0x48f8f6,_0x551aa8){var _0x863bf7=_0x48f8f6?_0x67c6('0x44'):_0x40b35d[_0x67c6('0x1b')];_0x863bf7=_0x551aa8?'BOOKED':_0x863bf7;return{'actionid':_0x40b35d[_0x67c6('0x45')],'action':'originate','channel':_0x40b35d[_0x67c6('0x46')],'callerid':util[_0x67c6('0x14')](_0x67c6('0x1a'),_0x863bf7,_0x40b35d[_0x67c6('0x1c')]),'Exten':'xcally-motion-preview','Context':_0x67c6('0x47'),'Priority':'1','variable':_0x199c0d,'timeout':(_0x1aa3ce['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x40b35d[_0x67c6('0x45')]};};exports[_0x67c6('0x48')]=function(_0x3b2104){return _0x3b2104[_0x67c6('0x49')]+_0x3b2104['countcongestionretry']+_0x3b2104[_0x67c6('0x4a')]+_0x3b2104['countagentrejectretry']+_0x3b2104[_0x67c6('0x4b')];};exports[_0x67c6('0x4c')]=function(_0x1e02f7){var _0x4e4954=_['clone'](_0x1e02f7);_0x4e4954[_0x67c6('0x4d')]=0xf;_0x4e4954['statedesc']=_0x67c6('0x4e');return _0x4e4954;};exports[_0x67c6('0x4f')]=function(_0x3639b1,_0x147f9b,_0x1eb25e){var _0x11e391={};_0x11e391[_0x147f9b]=_0x3639b1[_0x147f9b];_0x11e391[_0x67c6('0x50')]=![];_0x11e391['scheduledat']=moment()[_0x67c6('0x51')](_0x1eb25e,_0x67c6('0x52'))[_0x67c6('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x11e391[_0x67c6('0x1d')]=_0x3639b1[_0x67c6('0x1d')];_0x11e391['ListId']=_0x3639b1[_0x67c6('0x53')];_0x11e391[_0x67c6('0x1f')]=_0x3639b1['VoiceQueueId']||undefined;return _0x11e391;};exports[_0x67c6('0x54')]=function(_0x699396,_0x18e409){if(!_[_0x67c6('0x16')](_0x699396)){if(_0x699396[_0x67c6('0x55')]>0x0){_0x699396[_0x67c6('0x55')]-=0x1;}else{logger['error'](_0x18e409,_0x67c6('0x56'));}}else{logger['error'](_0x18e409,_0x67c6('0x57'));}};exports[_0x67c6('0x58')]=function(_0x4ede8d){if(_0x4ede8d<=0x0){return!![];}return![];};exports[_0x67c6('0x59')]=function(_0x33b493,_0x47117c,_0x5c80d0){_0x33b493[_0x67c6('0x5a')]=_0x47117c;_0x33b493[_0x67c6('0x19')]=_0x33b493[_0x67c6('0x5b')];_0x33b493[_0x67c6('0x5c')]=_0x33b493[_0x67c6('0x46')];if(_0x5c80d0){_0x33b493[_0x67c6('0x5d')]=_0x5c80d0[_0x67c6('0x5d')];}return _0x33b493;};exports[_0x67c6('0x5e')]=function(_0x24c7b2){var _0x105d7b={};_0x105d7b[_0x67c6('0x5b')]=_0x24c7b2['queue'];_0x105d7b['interface']=_0x24c7b2[_0x67c6('0x46')];_0x105d7b[_0x67c6('0x45')]=_0x24c7b2[_0x67c6('0x45')];return _0x105d7b;};exports[_0x67c6('0x5f')]=function(_0x497034){var _0x4efa31=[];for(var _0x8f0905 in _0x497034){if(_0x497034['hasOwnProperty'](_0x8f0905)){if(!_[_0x67c6('0x16')](_0x497034[_0x8f0905])&&_0x497034[_0x8f0905][_0x67c6('0x4d')]==='not_inuse'&&_0x497034[_0x8f0905]['status']==='reachable'){_0x4efa31['push'](_0x497034[_0x8f0905]['id']);}}}return _0x4efa31;};exports['getDiff']=function(_0x362cf3){var _0x3fe7a3=moment()[_0x67c6('0x6')](0x0);var _0x1d9c63=moment(_0x362cf3)[_0x67c6('0x6')](0x0);return _0x3fe7a3[_0x67c6('0x7')](_0x1d9c63,_0x67c6('0x8'));};exports[_0x67c6('0x60')]=function(_0x11d29b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x11d29b[_0x67c6('0x1d')],'ListId':_0x11d29b['ListId'],'VoiceQueueId':_0x11d29b[_0x67c6('0x1f')]||undefined,'CampaignId':_0x11d29b['CampaignId']||undefined};};exports[_0x67c6('0x61')]=function(_0xfcae17){if(_0xfcae17==='uniqueid'||_0xfcae17===_0x67c6('0x62')||_0xfcae17==='queue'||_0xfcae17===_0x67c6('0x63')||_0xfcae17===_0x67c6('0x64')||_0xfcae17===_0x67c6('0x65')||_0xfcae17==='membername'||_0xfcae17===_0x67c6('0x46')||_0xfcae17===_0x67c6('0x1b')||_0xfcae17===_0x67c6('0x50')||_0xfcae17===_0x67c6('0x1c')||_0xfcae17==='scheduledat'||_0xfcae17===_0x67c6('0x49')||_0xfcae17===_0x67c6('0x66')||_0xfcae17===_0x67c6('0x4a')||_0xfcae17===_0x67c6('0x67')||_0xfcae17===_0x67c6('0x68')||_0xfcae17===_0x67c6('0x69')||_0xfcae17===_0x67c6('0x6a')||_0xfcae17===_0x67c6('0x6b')||_0xfcae17===_0x67c6('0x1d')||_0xfcae17==='ListId'||_0xfcae17===_0x67c6('0x3e')||_0xfcae17===_0x67c6('0x1f')||_0xfcae17===_0x67c6('0x6c')||_0xfcae17===_0x67c6('0x6d')||_0xfcae17===_0x67c6('0x6e')||_0xfcae17==='xmd-phone'||_0xfcae17===_0x67c6('0x6f')||_0xfcae17===_0x67c6('0x70')||_0xfcae17===_0x67c6('0x71')||_0xfcae17===_0x67c6('0x72')||_0xfcae17===_0x67c6('0x73')||_0xfcae17===_0x67c6('0x74')||_0xfcae17===_0x67c6('0x75')||_0xfcae17===_0x67c6('0x76')||_0xfcae17===_0x67c6('0x77')||_0xfcae17===_0x67c6('0x78')||_0xfcae17===_0x67c6('0x79')||_0xfcae17==='rtpaudioqos'||_0xfcae17==='rtpaudioqosbridged'||_0xfcae17===_0x67c6('0x7a')||_0xfcae17===_0x67c6('0x7b')||_0xfcae17===_0x67c6('0x7c')||_0xfcae17===_0x67c6('0x7d')||_0xfcae17===_0x67c6('0x7e')||_0xfcae17===_0x67c6('0x7f')||_0xfcae17===_0x67c6('0x80')||_0xfcae17===_0x67c6('0x81')||_0xfcae17===_0x67c6('0x7a')||_0xfcae17===_0x67c6('0x7b')||_0xfcae17===_0x67c6('0x7c')||_0xfcae17===_0x67c6('0x7d')||_0xfcae17==='rtpaudioqosrtt'||_0xfcae17==='rtpaudioqosrttbridged'||_0xfcae17===_0x67c6('0x82')||_0xfcae17===_0x67c6('0x83')||_0xfcae17===_0x67c6('0x4d')||_0xfcae17===_0x67c6('0x37')){return![];}return!![];};exports[_0x67c6('0x84')]=function(_0x262c41,_0x59876f){var _0x230221,_0x6794cf,_0x1881b9;if(_0x59876f<=0x0){_0x59876f=0x1;}_0x230221=new RegExp(_0x67c6('0x85')+_0x59876f+'}$');_0x6794cf=Math[_0x67c6('0x86')](0xa,_0x59876f-0x1);_0x1881b9=Math[_0x67c6('0x86')](0xa,_0x59876f)-0x1;return util[_0x67c6('0x14')]('%s',_[_0x67c6('0x87')](_0x262c41,_0x230221,_[_0x67c6('0x88')](_0x6794cf,_0x1881b9)));};exports[_0x67c6('0x89')]=function(_0x59957c){var _0x4ccc3a=_0x59957c['match'](/"(.*?)"/);return _0x4ccc3a?_0x4ccc3a[0x1]:_0x59957c;};exports[_0x67c6('0x8a')]=function(_0x2f3b94){var _0x1ccbac=_0x2f3b94[_0x67c6('0x8b')](/<(.*?)>/);return _0x1ccbac?_0x1ccbac[0x1]:_0x2f3b94;};
\ No newline at end of file
+var _0x6ec6=['%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','starttime','responsetime','endtime','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','channelAgent','mandatoryDisposition','not_inuse','reachable','push','ListId','CampaignId','idContact','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','logger','inspect','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','name','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt'];(function(_0x263aa2,_0x7795b2){var _0x4ed9a1=function(_0x55b340){while(--_0x55b340){_0x263aa2['push'](_0x263aa2['shift']());}};_0x4ed9a1(++_0x7795b2);}(_0x6ec6,0xd5));var _0x66ec=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x6ec6[_0x556bb1];return _0x45455f;};'use strict';var util=require(_0x66ec('0x0'));var _=require(_0x66ec('0x1'));var moment=require('moment');var logger=require(_0x66ec('0x2'))(_0x66ec('0x3'));var ipAgi=process['env'][_0x66ec('0x4')]||_0x66ec('0x5');function getSeconds(_0x9dac14,_0xc4addd){var _0x4d5c68=moment(_0x9dac14)[_0x66ec('0x6')](0x0);var _0x283d7a=moment(_0xc4addd)[_0x66ec('0x6')](0x0);return _0x4d5c68[_0x66ec('0x7')](_0x283d7a,_0x66ec('0x8'));}exports['loggerCatch']=function(_0x438802){return function(_0x15805d){logger[_0x66ec('0x9')](_0x438802,util['inspect'](_0x15805d,{'showHidden':![],'depth':null}));};};exports[_0x66ec('0xa')]=function(_0x35c982,_0x268a4c){logger['info'](_0x35c982,util[_0x66ec('0xb')](_0x268a4c,{'showHidden':![],'depth':null}));};exports[_0x66ec('0xc')]=function(_0x28f1de,_0x2fd5e0){logger[_0x66ec('0x9')](_0x28f1de,util[_0x66ec('0xb')](_0x2fd5e0,{'showHidden':![],'depth':null}));};exports[_0x66ec('0xd')]=function(_0x490d93){return function(_0x3fb48f){logger['info'](_0x490d93,util[_0x66ec('0xb')](_0x3fb48f,{'showHidden':![],'depth':null}));};};exports[_0x66ec('0xe')]=function(_0x26da34,_0x36cf85,_0x56e827){return{'message':_0x26da34,'unlock':_0x36cf85,'active':_0x56e827};};exports[_0x66ec('0xf')]=function(_0x1c8c82,_0x3c91ac,_0x22ac8c){if(!_[_0x66ec('0x10')](_0x22ac8c)&&_0x66ec('0x11')===typeof _0x22ac8c&&!_[_0x66ec('0x12')](_0x22ac8c)){if(!_[_0x66ec('0x10')](_0x3c91ac)&&_0x66ec('0x11')===typeof _0x3c91ac&&!_['isEmpty'](_0x3c91ac)){return util['format'](_0x66ec('0x13'),_0x3c91ac,_0x22ac8c);}return util[_0x66ec('0x14')](_0x66ec('0x13'),_0x22ac8c,_0x22ac8c);}if(!_[_0x66ec('0x10')](_0x1c8c82)&&_0x66ec('0x11')===typeof _0x1c8c82&&!_[_0x66ec('0x12')](_0x1c8c82)){return _0x1c8c82;}return _0x66ec('0x15');};exports[_0x66ec('0x16')]=function(_0x347eac){if(_[_0x66ec('0x17')](_0x347eac)){return![];}return _0x347eac;};exports['addVariables']=function(_0x1f7fbf,_0x134b01,_0xf14ca7,_0x17c3ed,_0x3e57da,_0x2930b2){var _0x1b1bc6={'XMD-QUEUE':_0x134b01['Queue']?_0x134b01['Queue'][_0x66ec('0x18')]:'','XMD-CALLERID':_0x17c3ed,'XMD-CALLERID-PREVIEW':_0x2930b2?util[_0x66ec('0x14')](_0x66ec('0x13'),_0x2930b2[_0x66ec('0x19')],_0x2930b2[_0x66ec('0x1a')]):_0x17c3ed,'XMD-DIALID':_0x3e57da,'XMD-CONTACTID':_0x134b01[_0x66ec('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x17c3ed,'XMD-VOICEQUEUEID':_0x134b01[_0x66ec('0x1c')],'XMD-DIALCHANNEL':_0xf14ca7,'XMD-DIALTIMEOUT':_0x1f7fbf[_0x66ec('0x1d')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x66ec('0x1e'),_0x1f7fbf[_0x66ec('0x1f')]?'g':'',_['isEmpty'](_0x1f7fbf[_0x66ec('0x20')])?'':_0x66ec('0x21')),'XMD-DIALURL':_0x1f7fbf[_0x66ec('0x22')]||'','XMD-AGI':_0x1f7fbf[_0x66ec('0x23')]?util[_0x66ec('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1f7fbf['dialQueueProject']):_0x66ec('0x24'),'XMD-AGIAFTER':_0x1f7fbf[_0x66ec('0x1f')]?util[_0x66ec('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1f7fbf[_0x66ec('0x1f')]):_0x66ec('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x2930b2?_0x2930b2['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x2930b2?_0x2930b2[_0x66ec('0x25')]:'','XMD-DESTINATION':_0x66ec('0x26')};if(!_[_0x66ec('0x12')](_0x1f7fbf['monitor_format'])){_0x1b1bc6[util[_0x66ec('0x14')]('%s',_0x66ec('0x27'))]=_0x1f7fbf[_0x66ec('0x20')];_0x1b1bc6[util[_0x66ec('0x14')]('%s',_0x66ec('0x28'))]=_0x3e57da;}if(_0x134b01&&_0x134b01[_0x66ec('0x29')]){for(var _0x311b1e in _0x134b01[_0x66ec('0x29')]){if(_0x134b01['Contact'][_0x66ec('0x2a')](_0x311b1e)){if(!_[_0x66ec('0x17')](_0x134b01[_0x66ec('0x29')][_0x311b1e])&&_0x311b1e!=='id'&&_0x311b1e!==_0x66ec('0x2b')&&_0x311b1e!==_0x66ec('0x2c')&&_0x311b1e!=='updatedAt'){_0x1b1bc6[util[_0x66ec('0x14')](_0x66ec('0x2d'),_0x66ec('0x2e'),_['toUpper'](_0x311b1e))]=_0x134b01['Contact'][_0x311b1e];}}}}return _0x1b1bc6;};exports[_0x66ec('0x2f')]=function(_0x12c11d){var _0x4cd46e={};for(var _0x3f2640 in _0x12c11d){if(_0x12c11d[_0x66ec('0x2a')](_0x3f2640)){_0x4cd46e[util[_0x66ec('0x14')]('%s',_[_0x66ec('0x30')](_0x3f2640))]=_0x12c11d[_0x3f2640];}}return{'variables':_0x4cd46e};};exports[_0x66ec('0x31')]=function(_0x57f1eb,_0x5044fe){if(!_[_0x66ec('0x17')](_0x57f1eb)){if(_0x57f1eb[_0x66ec('0x2a')](_0x66ec('0x32'))){if(_0x57f1eb[_0x66ec('0x32')]>0x0){_0x57f1eb[_0x66ec('0x32')]-=0x1;}else{logger[_0x66ec('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x5044fe);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x5044fe);}};exports['logBlacklist']=function(_0x505a85){var _0x4b4bf1=moment()[_0x66ec('0x14')](_0x66ec('0x33'));_0x505a85[_0x66ec('0x34')]=0xd;_0x505a85['statedesc']=_0x66ec('0x35');_0x505a85[_0x66ec('0x36')]=_0x4b4bf1;_0x505a85[_0x66ec('0x37')]=_0x4b4bf1;_0x505a85[_0x66ec('0x38')]=_0x4b4bf1;};exports['logAgent']=function(_0x54ee1e,_0x12c372,_0x39c96c){var _0x4fc1bb=moment()[_0x66ec('0x14')](_0x66ec('0x33'));_0x54ee1e[_0x66ec('0x34')]=_0x12c372;_0x54ee1e[_0x66ec('0x39')]=_0x39c96c;_0x54ee1e[_0x66ec('0x37')]=_0x4fc1bb;_0x54ee1e[_0x66ec('0x3a')]=getSeconds(_0x54ee1e[_0x66ec('0x37')],_0x54ee1e[_0x66ec('0x36')]);};exports[_0x66ec('0x3b')]=function(_0x3274b0,_0x1aee92,_0x58e069){_0x3274b0[_0x66ec('0x3c')]=_0x1aee92;_0x3274b0[_0x66ec('0x3d')]=_0x58e069;};exports[_0x66ec('0x3e')]=function(_0x1ef975,_0x173803,_0x5567db){var _0x388417=moment()[_0x66ec('0x14')](_0x66ec('0x33'));_0x1ef975[_0x66ec('0x34')]=_0x173803;_0x1ef975[_0x66ec('0x39')]=_0x5567db;_0x1ef975[_0x66ec('0x37')]=_0x1ef975[_0x66ec('0x37')]?_0x1ef975[_0x66ec('0x37')]:_0x388417;_0x1ef975['endtime']=_0x1ef975[_0x66ec('0x38')]?_0x1ef975[_0x66ec('0x38')]:_0x388417;_0x1ef975[_0x66ec('0x3a')]=getSeconds(_0x1ef975[_0x66ec('0x37')]||0x0,_0x1ef975[_0x66ec('0x36')]||0x0);_0x1ef975[_0x66ec('0x3f')]=_0x1ef975[_0x66ec('0x40')]?getSeconds(_0x1ef975[_0x66ec('0x38')],_0x1ef975['answertime']):0x0;};exports[_0x66ec('0x41')]=function(_0x396288){return _0x396288===_0x66ec('0x42');};exports[_0x66ec('0x43')]=function(_0x1bc0ea,_0x2b4a0d,_0x39a366,_0x23f1d3,_0x36d3c6){var _0xff4cfd=_0x23f1d3?_0x66ec('0x44'):_0x1bc0ea[_0x66ec('0x19')];_0xff4cfd=_0x36d3c6?_0x66ec('0x45'):_0xff4cfd;return{'actionid':_0x1bc0ea[_0x66ec('0x46')],'action':_0x66ec('0x47'),'channel':_0x1bc0ea['channelAgent'],'callerid':util[_0x66ec('0x14')](_0x66ec('0x13'),_0xff4cfd,_0x1bc0ea[_0x66ec('0x1a')]),'Exten':_0x66ec('0x26'),'Context':_0x66ec('0x48'),'Priority':'1','variable':_0x39a366,'timeout':(_0x2b4a0d[_0x66ec('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1bc0ea['uniqueid']};};exports[_0x66ec('0x4a')]=function(_0x4c0016){return _0x4c0016[_0x66ec('0x4b')]+_0x4c0016[_0x66ec('0x4c')]+_0x4c0016[_0x66ec('0x4d')]+_0x4c0016[_0x66ec('0x4e')]+_0x4c0016[_0x66ec('0x4f')];};exports[_0x66ec('0x50')]=function(_0x375bb8){var _0x356b7e=_['clone'](_0x375bb8);_0x356b7e[_0x66ec('0x34')]=0xf;_0x356b7e[_0x66ec('0x39')]=_0x66ec('0x51');return _0x356b7e;};exports[_0x66ec('0x52')]=function(_0xabed9b,_0x4b05d5,_0x179f59){var _0xf8f982={};_0xf8f982[_0x4b05d5]=_0xabed9b[_0x4b05d5];_0xf8f982[_0x66ec('0x53')]=![];_0xf8f982[_0x66ec('0x54')]=moment()[_0x66ec('0x55')](_0x179f59,_0x66ec('0x56'))[_0x66ec('0x14')](_0x66ec('0x33'));_0xf8f982[_0x66ec('0x1b')]=_0xabed9b[_0x66ec('0x1b')];_0xf8f982['ListId']=_0xabed9b['ListId'];_0xf8f982['VoiceQueueId']=_0xabed9b['VoiceQueueId']||undefined;return _0xf8f982;};exports['decrementTalkink']=function(_0x13ff36,_0x41f0dc){if(!_[_0x66ec('0x17')](_0x13ff36)){if(_0x13ff36[_0x66ec('0x57')]>0x0){_0x13ff36['pTalking']-=0x1;}else{logger['error'](_0x41f0dc,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x66ec('0x9')](_0x41f0dc,_0x66ec('0x58'));}};exports['IsNotLoggedIn']=function(_0x48528b){if(_0x48528b<=0x0){return!![];}return![];};exports[_0x66ec('0x59')]=function(_0x20e380,_0x5cd24a,_0x4f768a){_0x20e380[_0x66ec('0x5a')]=_0x5cd24a;_0x20e380[_0x66ec('0x18')]=_0x20e380[_0x66ec('0x5b')];_0x20e380[_0x66ec('0x5c')]=_0x20e380[_0x66ec('0x5d')];if(_0x4f768a){_0x20e380['mandatoryDisposition']=_0x4f768a[_0x66ec('0x5e')];}return _0x20e380;};exports['buildAcw']=function(_0x23c772){var _0x5878a7={};_0x5878a7[_0x66ec('0x5b')]=_0x23c772[_0x66ec('0x5b')];_0x5878a7[_0x66ec('0x5c')]=_0x23c772[_0x66ec('0x5d')];_0x5878a7['uniqueid']=_0x23c772[_0x66ec('0x46')];return _0x5878a7;};exports['agentReadyId']=function(_0x17fba5){var _0x3b76d7=[];for(var _0x354d89 in _0x17fba5){if(_0x17fba5[_0x66ec('0x2a')](_0x354d89)){if(!_[_0x66ec('0x17')](_0x17fba5[_0x354d89])&&_0x17fba5[_0x354d89][_0x66ec('0x34')]===_0x66ec('0x5f')&&_0x17fba5[_0x354d89]['status']===_0x66ec('0x60')){_0x3b76d7[_0x66ec('0x61')](_0x17fba5[_0x354d89]['id']);}}}return _0x3b76d7;};exports['getDiff']=function(_0x5d7b82){var _0x49e10f=moment()[_0x66ec('0x6')](0x0);var _0x1fd68e=moment(_0x5d7b82)[_0x66ec('0x6')](0x0);return _0x49e10f[_0x66ec('0x7')](_0x1fd68e,_0x66ec('0x8'));};exports['createBody']=function(_0x3054b5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3054b5[_0x66ec('0x1b')],'ListId':_0x3054b5[_0x66ec('0x62')],'VoiceQueueId':_0x3054b5[_0x66ec('0x1c')]||undefined,'CampaignId':_0x3054b5[_0x66ec('0x63')]||undefined};};exports['filterKey']=function(_0xf8c356){if(_0xf8c356===_0x66ec('0x46')||_0xf8c356===_0x66ec('0x64')||_0xf8c356===_0x66ec('0x5b')||_0xf8c356==='type'||_0xf8c356==='campaigntype'||_0xf8c356==='dialAnswer'||_0xf8c356===_0x66ec('0x3c')||_0xf8c356===_0x66ec('0x5d')||_0xf8c356==='calleridname'||_0xf8c356===_0x66ec('0x53')||_0xf8c356===_0x66ec('0x1a')||_0xf8c356==='scheduledat'||_0xf8c356===_0x66ec('0x4b')||_0xf8c356===_0x66ec('0x4c')||_0xf8c356===_0x66ec('0x4d')||_0xf8c356===_0x66ec('0x65')||_0xf8c356===_0x66ec('0x66')||_0xf8c356===_0x66ec('0x67')||_0xf8c356===_0x66ec('0x68')||_0xf8c356==='recallme'||_0xf8c356===_0x66ec('0x1b')||_0xf8c356===_0x66ec('0x62')||_0xf8c356===_0x66ec('0x3d')||_0xf8c356===_0x66ec('0x1c')||_0xf8c356===_0x66ec('0x69')||_0xf8c356==='xmd-voicequeueid'||_0xf8c356===_0x66ec('0x6a')||_0xf8c356==='xmd-phone'||_0xf8c356==='xmd-listid'||_0xf8c356==='xmd-dialurl'||_0xf8c356==='xmd-dialtimeout'||_0xf8c356===_0x66ec('0x6b')||_0xf8c356===_0x66ec('0x6c')||_0xf8c356===_0x66ec('0x6d')||_0xf8c356===_0x66ec('0x6e')||_0xf8c356===_0x66ec('0x6f')||_0xf8c356===_0x66ec('0x70')||_0xf8c356===_0x66ec('0x71')||_0xf8c356===_0x66ec('0x72')||_0xf8c356===_0x66ec('0x73')||_0xf8c356==='rtpaudioqosbridged'||_0xf8c356===_0x66ec('0x74')||_0xf8c356===_0x66ec('0x75')||_0xf8c356==='rtpaudioqosloss'||_0xf8c356===_0x66ec('0x76')||_0xf8c356===_0x66ec('0x77')||_0xf8c356==='rtpaudioqosrttbridged'||_0xf8c356===_0x66ec('0x73')||_0xf8c356===_0x66ec('0x78')||_0xf8c356==='rtpaudioqosjitter'||_0xf8c356==='rtpaudioqosjitterbridged'||_0xf8c356==='rtpaudioqosloss'||_0xf8c356===_0x66ec('0x76')||_0xf8c356===_0x66ec('0x77')||_0xf8c356===_0x66ec('0x79')||_0xf8c356===_0x66ec('0x7a')||_0xf8c356===_0x66ec('0x7b')||_0xf8c356===_0x66ec('0x34')||_0xf8c356==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x107e23,_0x29d525){var _0x3a02f,_0x25e307,_0x5afb36;if(_0x29d525<=0x0){_0x29d525=0x1;}_0x3a02f=new RegExp(_0x66ec('0x7c')+_0x29d525+'}$');_0x25e307=Math['pow'](0xa,_0x29d525-0x1);_0x5afb36=Math[_0x66ec('0x7d')](0xa,_0x29d525)-0x1;return util[_0x66ec('0x14')]('%s',_[_0x66ec('0x7e')](_0x107e23,_0x3a02f,_['random'](_0x25e307,_0x5afb36)));};exports['extractCalleridName']=function(_0x4d1dc2){var _0x477d09=_0x4d1dc2[_0x66ec('0x7f')](/"(.*?)"/);return _0x477d09?_0x477d09[0x1]:_0x4d1dc2;};exports[_0x66ec('0x80')]=function(_0x1b13d4){var _0x26f931=_0x1b13d4[_0x66ec('0x7f')](/<(.*?)>/);return _0x26f931?_0x26f931[0x1]:_0x1b13d4;};
\ No newline at end of file