Built motion from commit (unavailable).|2.5.25
[motion2.git] / server / services / ami / preview / util / util.js
index a66bb43..2a17b5a 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 _0x8bbd=['scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','interface','channelAgent','mandatoryDisposition','queue','uniqueid','agentReadyId','reachable','push','getDiff','diff','createBody','CampaignId','filterKey','idContact','type','dialAnswer','countnoanswerretry','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','extractCalleridName','match','extractCalleridNumber','util','moment','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','logger','logger2','info','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','hasOwnProperty','createdAt','%s%s','XMD-','toUpper','Contact','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','originate','timeout','totalGlobal','countcongestionretry','clone','Global'];(function(_0x126db9,_0xb8ef99){var _0x21f274=function(_0x1d3ac7){while(--_0x1d3ac7){_0x126db9['push'](_0x126db9['shift']());}};_0x21f274(++_0xb8ef99);}(_0x8bbd,0x1d0));var _0xd8bb=function(_0x59c7dd,_0x5af8ab){_0x59c7dd=_0x59c7dd-0x0;var _0x4864b4=_0x8bbd[_0x59c7dd];return _0x4864b4;};'use strict';var util=require(_0xd8bb('0x0'));var _=require('lodash');var moment=require(_0xd8bb('0x1'));var logger=require(_0xd8bb('0x2'))('preview');var ipAgi=process['env'][_0xd8bb('0x3')]||_0xd8bb('0x4');function getSeconds(_0x5d6e45,_0x40eae9){var _0x42a11f=moment(_0x5d6e45)[_0xd8bb('0x5')](0x0);var _0x24ab1f=moment(_0x40eae9)['milliseconds'](0x0);return _0x42a11f['diff'](_0x24ab1f,_0xd8bb('0x6'));}exports[_0xd8bb('0x7')]=function(_0xa9aa22){return function(_0x267758){logger[_0xd8bb('0x8')](_0xa9aa22,util[_0xd8bb('0x9')](_0x267758,{'showHidden':![],'depth':null}));};};exports[_0xd8bb('0xa')]=function(_0x36c3a5,_0x5accf6){logger['info'](_0x36c3a5,util['inspect'](_0x5accf6,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x99379d,_0x2aa269){logger[_0xd8bb('0x8')](_0x99379d,util['inspect'](_0x2aa269,{'showHidden':![],'depth':null}));};exports[_0xd8bb('0xb')]=function(_0x2246c9){return function(_0xe8f687){logger[_0xd8bb('0xc')](_0x2246c9,util[_0xd8bb('0x9')](_0xe8f687,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2067d7,_0xfcca8b,_0x3271ca){return{'message':_0x2067d7,'unlock':_0xfcca8b,'active':_0x3271ca};};exports['getCallerId']=function(_0x22d9f5,_0x4b780a,_0x384ff0){if(!_[_0xd8bb('0xd')](_0x384ff0)&&'string'===typeof _0x384ff0&&!_[_0xd8bb('0xe')](_0x384ff0)){if(!_[_0xd8bb('0xd')](_0x4b780a)&&_0xd8bb('0xf')===typeof _0x4b780a&&!_[_0xd8bb('0xe')](_0x4b780a)){return util[_0xd8bb('0x10')](_0xd8bb('0x11'),_0x4b780a,_0x384ff0);}return util['format']('\x22%s\x22\x20<%s>',_0x384ff0,_0x384ff0);}if(!_['isUndefined'](_0x22d9f5)&&_0xd8bb('0xf')===typeof _0x22d9f5&&!_[_0xd8bb('0xe')](_0x22d9f5)){return _0x22d9f5;}return _0xd8bb('0x12');};exports[_0xd8bb('0x13')]=function(_0x14b101){if(_[_0xd8bb('0x14')](_0x14b101)){return![];}return _0x14b101;};exports[_0xd8bb('0x15')]=function(_0x154a18,_0x1cf5a9,_0x5a5649,_0x525eee,_0x5ea0f5,_0x92477b){var _0x3bbf38={'XMD-QUEUE':_0x1cf5a9[_0xd8bb('0x16')]?_0x1cf5a9[_0xd8bb('0x16')][_0xd8bb('0x17')]:'','XMD-CALLERID':_0x525eee,'XMD-CALLERID-PREVIEW':_0x92477b?util[_0xd8bb('0x10')](_0xd8bb('0x11'),_0x92477b['calleridname'],_0x92477b[_0xd8bb('0x18')]):_0x525eee,'XMD-DIALID':_0x5ea0f5,'XMD-CONTACTID':_0x1cf5a9[_0xd8bb('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x525eee,'XMD-VOICEQUEUEID':_0x1cf5a9[_0xd8bb('0x1a')],'XMD-DIALCHANNEL':_0x5a5649,'XMD-DIALTIMEOUT':_0x154a18['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xd8bb('0x10')](_0xd8bb('0x1b'),_0x154a18[_0xd8bb('0x1c')]?'g':'',_[_0xd8bb('0xe')](_0x154a18[_0xd8bb('0x1d')])?'':_0xd8bb('0x1e')),'XMD-DIALURL':_0x154a18['dialPreviewUrl']||'','XMD-AGI':_0x154a18[_0xd8bb('0x1f')]?util[_0xd8bb('0x10')](_0xd8bb('0x20'),ipAgi,_0x154a18[_0xd8bb('0x1f')]):_0xd8bb('0x21'),'XMD-AGIAFTER':_0x154a18[_0xd8bb('0x1c')]?util[_0xd8bb('0x10')](_0xd8bb('0x20'),ipAgi,_0x154a18[_0xd8bb('0x1c')]):_0xd8bb('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x92477b?_0x92477b[_0xd8bb('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x92477b?_0x92477b[_0xd8bb('0x23')]:'','XMD-DESTINATION':_0xd8bb('0x24')};if(!_[_0xd8bb('0xe')](_0x154a18[_0xd8bb('0x1d')])){_0x3bbf38[util[_0xd8bb('0x10')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x154a18[_0xd8bb('0x1d')];_0x3bbf38[util[_0xd8bb('0x10')]('%s',_0xd8bb('0x25'))]=_0x5ea0f5;}if(_0x1cf5a9&&_0x1cf5a9['Contact']){for(var _0x5345d2 in _0x1cf5a9['Contact']){if(_0x1cf5a9['Contact'][_0xd8bb('0x26')](_0x5345d2)){if(!_[_0xd8bb('0x14')](_0x1cf5a9['Contact'][_0x5345d2])&&_0x5345d2!=='id'&&_0x5345d2!=='tags'&&_0x5345d2!==_0xd8bb('0x27')&&_0x5345d2!=='updatedAt'){_0x3bbf38[util[_0xd8bb('0x10')](_0xd8bb('0x28'),_0xd8bb('0x29'),_[_0xd8bb('0x2a')](_0x5345d2))]=_0x1cf5a9[_0xd8bb('0x2b')][_0x5345d2];}}}}return _0x3bbf38;};exports['toLowerVariables']=function(_0x2a7bdb){var _0x482b22={};for(var _0x824184 in _0x2a7bdb){if(_0x2a7bdb[_0xd8bb('0x26')](_0x824184)){_0x482b22[util['format']('%s',_[_0xd8bb('0x2c')](_0x824184))]=_0x2a7bdb[_0x824184];}}return{'variables':_0x482b22};};exports[_0xd8bb('0x2d')]=function(_0x329690,_0x9c6b0d){if(!_[_0xd8bb('0x14')](_0x329690)){if(_0x329690['hasOwnProperty'](_0xd8bb('0x2e'))){if(_0x329690[_0xd8bb('0x2e')]>0x0){_0x329690[_0xd8bb('0x2e')]-=0x1;}else{logger[_0xd8bb('0x8')](_0xd8bb('0x2f'),_0x9c6b0d);}}}else{logger[_0xd8bb('0x8')](_0xd8bb('0x30'),_0x9c6b0d);}};exports[_0xd8bb('0x31')]=function(_0x2e3494){var _0x5113a1=moment()['format'](_0xd8bb('0x32'));_0x2e3494[_0xd8bb('0x33')]=0xd;_0x2e3494[_0xd8bb('0x34')]=_0xd8bb('0x35');_0x2e3494[_0xd8bb('0x36')]=_0x5113a1;_0x2e3494['responsetime']=_0x5113a1;_0x2e3494[_0xd8bb('0x37')]=_0x5113a1;};exports[_0xd8bb('0x38')]=function(_0x4d8ec8,_0x54e3bb,_0x309736){var _0x163b18=moment()['format'](_0xd8bb('0x32'));_0x4d8ec8[_0xd8bb('0x33')]=_0x54e3bb;_0x4d8ec8['statedesc']=_0x309736;_0x4d8ec8[_0xd8bb('0x39')]=_0x163b18;_0x4d8ec8[_0xd8bb('0x3a')]=getSeconds(_0x4d8ec8['responsetime'],_0x4d8ec8[_0xd8bb('0x36')]);};exports[_0xd8bb('0x3b')]=function(_0x2e0d21,_0xb77894,_0x43ec75){_0x2e0d21[_0xd8bb('0x3c')]=_0xb77894;_0x2e0d21[_0xd8bb('0x3d')]=_0x43ec75;};exports[_0xd8bb('0x3e')]=function(_0x571694,_0x45130f,_0x43463c){var _0x2d4795=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x571694[_0xd8bb('0x33')]=_0x45130f;_0x571694[_0xd8bb('0x34')]=_0x43463c;_0x571694['responsetime']=_0x571694['responsetime']?_0x571694['responsetime']:_0x2d4795;_0x571694[_0xd8bb('0x37')]=_0x571694['endtime']?_0x571694[_0xd8bb('0x37')]:_0x2d4795;_0x571694[_0xd8bb('0x3a')]=getSeconds(_0x571694['responsetime']||0x0,_0x571694[_0xd8bb('0x36')]||0x0);_0x571694[_0xd8bb('0x3f')]=_0x571694['answertime']?getSeconds(_0x571694[_0xd8bb('0x37')],_0x571694[_0xd8bb('0x40')]):0x0;};exports[_0xd8bb('0x41')]=function(_0x35c1e6){return _0x35c1e6===_0xd8bb('0x42');};exports[_0xd8bb('0x43')]=function(_0x25633f,_0x402576,_0x9dae46,_0x608442,_0x1633a0){var _0xa68f27=_0x608442?'RECALL':_0x25633f[_0xd8bb('0x44')];_0xa68f27=_0x1633a0?_0xd8bb('0x45'):_0xa68f27;return{'actionid':_0x25633f['uniqueid'],'action':_0xd8bb('0x46'),'channel':_0x25633f['channelAgent'],'callerid':util['format'](_0xd8bb('0x11'),_0xa68f27,_0x25633f[_0xd8bb('0x18')]),'Exten':_0xd8bb('0x24'),'Context':'from-sip','Priority':'1','variable':_0x9dae46,'timeout':(_0x402576[_0xd8bb('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x25633f['uniqueid']};};exports[_0xd8bb('0x48')]=function(_0x6cf57f){return _0x6cf57f['countbusyretry']+_0x6cf57f[_0xd8bb('0x49')]+_0x6cf57f['countnoanswerretry']+_0x6cf57f['countagentrejectretry']+_0x6cf57f['countnosuchnumberretry'];};exports['cloneAction']=function(_0x12676d){var _0xe02e83=_[_0xd8bb('0x4a')](_0x12676d);_0xe02e83[_0xd8bb('0x33')]=0xf;_0xe02e83[_0xd8bb('0x34')]=_0xd8bb('0x4b');return _0xe02e83;};exports[_0xd8bb('0x4c')]=function(_0x34c319,_0x564fb7,_0x3cee60){var _0x110548={};_0x110548[_0x564fb7]=_0x34c319[_0x564fb7];_0x110548[_0xd8bb('0x4d')]=![];_0x110548[_0xd8bb('0x4e')]=moment()[_0xd8bb('0x4f')](_0x3cee60,_0xd8bb('0x50'))[_0xd8bb('0x10')](_0xd8bb('0x32'));_0x110548['ContactId']=_0x34c319['ContactId'];_0x110548[_0xd8bb('0x51')]=_0x34c319[_0xd8bb('0x51')];_0x110548[_0xd8bb('0x1a')]=_0x34c319[_0xd8bb('0x1a')]||undefined;return _0x110548;};exports[_0xd8bb('0x52')]=function(_0x3a307e,_0x141ce0){if(!_[_0xd8bb('0x14')](_0x3a307e)){if(_0x3a307e['pTalking']>0x0){_0x3a307e[_0xd8bb('0x53')]-=0x1;}else{logger[_0xd8bb('0x8')](_0x141ce0,_0xd8bb('0x54'));}}else{logger['error'](_0x141ce0,_0xd8bb('0x55'));}};exports[_0xd8bb('0x56')]=function(_0x1f04b6){if(_0x1f04b6<=0x0){return!![];}return![];};exports[_0xd8bb('0x57')]=function(_0x4a8efa,_0x19819f,_0x296f57){_0x4a8efa['lastevent']=_0x19819f;_0x4a8efa['name']=_0x4a8efa['queue'];_0x4a8efa[_0xd8bb('0x58')]=_0x4a8efa[_0xd8bb('0x59')];if(_0x296f57){_0x4a8efa[_0xd8bb('0x5a')]=_0x296f57['mandatoryDisposition'];}return _0x4a8efa;};exports['buildAcw']=function(_0x197a53){var _0x4566ae={};_0x4566ae['queue']=_0x197a53[_0xd8bb('0x5b')];_0x4566ae[_0xd8bb('0x58')]=_0x197a53['channelAgent'];_0x4566ae[_0xd8bb('0x5c')]=_0x197a53[_0xd8bb('0x5c')];return _0x4566ae;};exports[_0xd8bb('0x5d')]=function(_0x3b109d){var _0x4f8f8c=[];for(var _0x51bffa in _0x3b109d){if(_0x3b109d[_0xd8bb('0x26')](_0x51bffa)){if(!_[_0xd8bb('0x14')](_0x3b109d[_0x51bffa])&&_0x3b109d[_0x51bffa]['state']==='not_inuse'&&_0x3b109d[_0x51bffa]['status']===_0xd8bb('0x5e')){_0x4f8f8c[_0xd8bb('0x5f')](_0x3b109d[_0x51bffa]['id']);}}}return _0x4f8f8c;};exports[_0xd8bb('0x60')]=function(_0x31f3ae){var _0x28d03a=moment()[_0xd8bb('0x5')](0x0);var _0x1787f9=moment(_0x31f3ae)[_0xd8bb('0x5')](0x0);return _0x28d03a[_0xd8bb('0x61')](_0x1787f9,_0xd8bb('0x6'));};exports[_0xd8bb('0x62')]=function(_0x38ccbd){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x38ccbd[_0xd8bb('0x19')],'ListId':_0x38ccbd['ListId'],'VoiceQueueId':_0x38ccbd[_0xd8bb('0x1a')]||undefined,'CampaignId':_0x38ccbd[_0xd8bb('0x63')]||undefined};};exports[_0xd8bb('0x64')]=function(_0xa70ad0){if(_0xa70ad0===_0xd8bb('0x5c')||_0xa70ad0===_0xd8bb('0x65')||_0xa70ad0==='queue'||_0xa70ad0===_0xd8bb('0x66')||_0xa70ad0==='campaigntype'||_0xa70ad0===_0xd8bb('0x67')||_0xa70ad0===_0xd8bb('0x3c')||_0xa70ad0===_0xd8bb('0x59')||_0xa70ad0===_0xd8bb('0x44')||_0xa70ad0===_0xd8bb('0x4d')||_0xa70ad0===_0xd8bb('0x18')||_0xa70ad0===_0xd8bb('0x4e')||_0xa70ad0==='countbusyretry'||_0xa70ad0===_0xd8bb('0x49')||_0xa70ad0===_0xd8bb('0x68')||_0xa70ad0===_0xd8bb('0x69')||_0xa70ad0==='callback'||_0xa70ad0===_0xd8bb('0x6a')||_0xa70ad0===_0xd8bb('0x6b')||_0xa70ad0===_0xd8bb('0x6c')||_0xa70ad0===_0xd8bb('0x19')||_0xa70ad0===_0xd8bb('0x51')||_0xa70ad0===_0xd8bb('0x3d')||_0xa70ad0===_0xd8bb('0x1a')||_0xa70ad0===_0xd8bb('0x6d')||_0xa70ad0===_0xd8bb('0x6e')||_0xa70ad0==='xmd-queue'||_0xa70ad0===_0xd8bb('0x6f')||_0xa70ad0==='xmd-listid'||_0xa70ad0==='xmd-dialurl'||_0xa70ad0===_0xd8bb('0x70')||_0xa70ad0===_0xd8bb('0x71')||_0xa70ad0===_0xd8bb('0x72')||_0xa70ad0===_0xd8bb('0x73')||_0xa70ad0==='xmd-contactid'||_0xa70ad0===_0xd8bb('0x74')||_0xa70ad0===_0xd8bb('0x75')||_0xa70ad0===_0xd8bb('0x76')||_0xa70ad0===_0xd8bb('0x77')||_0xa70ad0===_0xd8bb('0x78')||_0xa70ad0===_0xd8bb('0x79')||_0xa70ad0===_0xd8bb('0x7a')||_0xa70ad0===_0xd8bb('0x7b')||_0xa70ad0===_0xd8bb('0x7c')||_0xa70ad0==='rtpaudioqoslossbridged'||_0xa70ad0===_0xd8bb('0x7d')||_0xa70ad0===_0xd8bb('0x7e')||_0xa70ad0==='rtpaudioqos'||_0xa70ad0==='rtpaudioqosbridged'||_0xa70ad0===_0xd8bb('0x7a')||_0xa70ad0===_0xd8bb('0x7b')||_0xa70ad0===_0xd8bb('0x7c')||_0xa70ad0==='rtpaudioqoslossbridged'||_0xa70ad0===_0xd8bb('0x7d')||_0xa70ad0===_0xd8bb('0x7e')||_0xa70ad0===_0xd8bb('0x7f')||_0xa70ad0===_0xd8bb('0x80')||_0xa70ad0===_0xd8bb('0x33')||_0xa70ad0==='statedesc'){return![];}return!![];};exports[_0xd8bb('0x81')]=function(_0x23f52e,_0x1bf571){var _0x33ece5,_0x2a642b,_0x40866d;if(_0x1bf571<=0x0){_0x1bf571=0x1;}_0x33ece5=new RegExp('\x5cw{0,'+_0x1bf571+'}$');_0x2a642b=Math[_0xd8bb('0x82')](0xa,_0x1bf571-0x1);_0x40866d=Math[_0xd8bb('0x82')](0xa,_0x1bf571)-0x1;return util[_0xd8bb('0x10')]('%s',_['replace'](_0x23f52e,_0x33ece5,_[_0xd8bb('0x83')](_0x2a642b,_0x40866d)));};exports[_0xd8bb('0x84')]=function(_0x2ad2d6){var _0x334cfb=_0x2ad2d6[_0xd8bb('0x85')](/"(.*?)"/);return _0x334cfb?_0x334cfb[0x1]:_0x2ad2d6;};exports[_0xd8bb('0x86')]=function(_0x5eb3eb){var _0x4b8c91=_0x5eb3eb[_0xd8bb('0x85')](/<(.*?)>/);return _0x4b8c91?_0x4b8c91[0x1]:_0x5eb3eb;};
\ No newline at end of file