Built motion from commit ab870f9e.|2.5.44
[motion2.git] / server / services / ami / preview / util / util.js
index 5b8c18f..aace609 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6946=['isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','isActive','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','dialQueueProject2','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','isNil','tags','updatedAt','%s%s','XMD-','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','membername','UserId','logCustomer','endtime','answertime','Failure','variablesAction','BOOKED','uniqueid','originate','from-sip','timeout','totalGlobal','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','channelAgent','mandatoryDisposition','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message'];(function(_0x3ee55a,_0x19aeea){var _0x581800=function(_0x636cb7){while(--_0x636cb7){_0x3ee55a['push'](_0x3ee55a['shift']());}};_0x581800(++_0x19aeea);}(_0x6946,0x10a));var _0x6694=function(_0x586a0e,_0x2b6eac){_0x586a0e=_0x586a0e-0x0;var _0x484c02=_0x6946[_0x586a0e];return _0x484c02;};'use strict';var util=require(_0x6694('0x0'));var _=require(_0x6694('0x1'));var moment=require(_0x6694('0x2'));var logger=require(_0x6694('0x3'))('preview');var ipAgi=process[_0x6694('0x4')][_0x6694('0x5')]||_0x6694('0x6');function getSeconds(_0x2ecd26,_0x572f97){var _0x438964=moment(_0x2ecd26)['milliseconds'](0x0);var _0x360f15=moment(_0x572f97)[_0x6694('0x7')](0x0);return _0x438964[_0x6694('0x8')](_0x360f15,_0x6694('0x9'));}exports[_0x6694('0xa')]=function(_0x19fa04){return function(_0x4cf188){logger[_0x6694('0xb')](_0x19fa04,util[_0x6694('0xc')](_0x4cf188,{'showHidden':![],'depth':null}));};};exports[_0x6694('0xd')]=function(_0x2863e8,_0x174100){logger[_0x6694('0xe')](_0x2863e8,util[_0x6694('0xc')](_0x174100,{'showHidden':![],'depth':null}));};exports[_0x6694('0xf')]=function(_0x5cd4c2,_0x330316){logger[_0x6694('0xb')](_0x5cd4c2,util[_0x6694('0xc')](_0x330316,{'showHidden':![],'depth':null}));};exports[_0x6694('0x10')]=function(_0x41fb58){return function(_0x305275){logger[_0x6694('0xe')](_0x41fb58,util['inspect'](_0x305275,{'showHidden':![],'depth':null}));};};exports[_0x6694('0x11')]=function(_0x1b1e1c,_0x3ef3f4,_0x440d34){return{'message':_0x1b1e1c,'unlock':_0x3ef3f4,'active':_0x440d34};};exports['getCallerId']=function(_0x489514,_0x2277c4,_0x1e655e){if(!_[_0x6694('0x12')](_0x1e655e)&&'string'===typeof _0x1e655e&&!_['isEmpty'](_0x1e655e)){if(!_['isUndefined'](_0x2277c4)&&'string'===typeof _0x2277c4&&!_[_0x6694('0x13')](_0x2277c4)){return util[_0x6694('0x14')](_0x6694('0x15'),_0x2277c4,_0x1e655e);}return util[_0x6694('0x14')](_0x6694('0x15'),_0x1e655e,_0x1e655e);}if(!_[_0x6694('0x12')](_0x489514)&&_0x6694('0x16')===typeof _0x489514&&!_[_0x6694('0x13')](_0x489514)){return _0x489514;}return _0x6694('0x17');};exports[_0x6694('0x18')]=function(_0x467ab6){if(_['isNil'](_0x467ab6)){return![];}return _0x467ab6;};exports[_0x6694('0x19')]=function(_0x37e385,_0x44c35c,_0x2452c0,_0x39ee76,_0x1f2e3c,_0x26ea6c){var _0x2db772={'XMD-QUEUE':_0x44c35c[_0x6694('0x1a')]?_0x44c35c[_0x6694('0x1a')][_0x6694('0x1b')]:'','XMD-CALLERID':_0x39ee76,'XMD-CALLERID-PREVIEW':_0x26ea6c?util[_0x6694('0x14')](_0x6694('0x15'),_0x26ea6c[_0x6694('0x1c')],_0x26ea6c[_0x6694('0x1d')]):_0x39ee76,'XMD-DIALID':_0x1f2e3c,'XMD-CONTACTID':_0x44c35c[_0x6694('0x1e')],'XMD-CDRTYPE':_0x6694('0x1f'),'CALLERID(all)':_0x39ee76,'XMD-VOICEQUEUEID':_0x44c35c['VoiceQueueId'],'XMD-DIALCHANNEL':_0x2452c0,'XMD-DIALTIMEOUT':_0x37e385[_0x6694('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x6694('0x14')]('\x22rtTxX%s%s\x22',_0x37e385[_0x6694('0x21')]?'g':'',_[_0x6694('0x13')](_0x37e385['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x37e385[_0x6694('0x22')]||'','XMD-AGI':_0x37e385[_0x6694('0x23')]?util[_0x6694('0x14')](_0x6694('0x24'),ipAgi,_0x37e385[_0x6694('0x23')]):_0x6694('0x25'),'XMD-AGIAFTER':_0x37e385[_0x6694('0x21')]?util['format'](_0x6694('0x24'),ipAgi,_0x37e385['dialQueueProject2']):_0x6694('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x26ea6c?_0x26ea6c[_0x6694('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x26ea6c?_0x26ea6c[_0x6694('0x27')]:'','XMD-DESTINATION':_0x6694('0x28')};if(!_[_0x6694('0x13')](_0x37e385[_0x6694('0x29')])){_0x2db772[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x37e385[_0x6694('0x29')];_0x2db772[util['format']('%s',_0x6694('0x2a'))]=_0x1f2e3c;}if(_0x44c35c&&_0x44c35c[_0x6694('0x2b')]){for(var _0x4633fa in _0x44c35c[_0x6694('0x2b')]){if(_0x44c35c[_0x6694('0x2b')]['hasOwnProperty'](_0x4633fa)){if(!_[_0x6694('0x2c')](_0x44c35c[_0x6694('0x2b')][_0x4633fa])&&_0x4633fa!=='id'&&_0x4633fa!==_0x6694('0x2d')&&_0x4633fa!=='createdAt'&&_0x4633fa!==_0x6694('0x2e')){_0x2db772[util['format'](_0x6694('0x2f'),_0x6694('0x30'),_['toUpper'](_0x4633fa))]=_0x44c35c['Contact'][_0x4633fa];}}}}return _0x2db772;};exports[_0x6694('0x31')]=function(_0x3bd3ea){var _0x15dadb={};for(var _0x5268b9 in _0x3bd3ea){if(_0x3bd3ea[_0x6694('0x32')](_0x5268b9)){_0x15dadb[util['format']('%s',_[_0x6694('0x33')](_0x5268b9))]=_0x3bd3ea[_0x5268b9];}}return{'variables':_0x15dadb};};exports[_0x6694('0x34')]=function(_0x5d0c60,_0x4becab){if(!_[_0x6694('0x2c')](_0x5d0c60)){if(_0x5d0c60['hasOwnProperty'](_0x6694('0x35'))){if(_0x5d0c60[_0x6694('0x35')]>0x0){_0x5d0c60[_0x6694('0x35')]-=0x1;}else{logger['error'](_0x6694('0x36'),_0x4becab);}}}else{logger[_0x6694('0xb')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x4becab);}};exports[_0x6694('0x37')]=function(_0x3d0d1e){var _0x2e3161=moment()[_0x6694('0x14')](_0x6694('0x38'));_0x3d0d1e[_0x6694('0x39')]=0xd;_0x3d0d1e[_0x6694('0x3a')]=_0x6694('0x3b');_0x3d0d1e[_0x6694('0x3c')]=_0x2e3161;_0x3d0d1e[_0x6694('0x3d')]=_0x2e3161;_0x3d0d1e['endtime']=_0x2e3161;};exports[_0x6694('0x3e')]=function(_0x257896,_0x90ac41,_0xa3a4a1){var _0x480d8e=moment()[_0x6694('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x257896[_0x6694('0x39')]=_0x90ac41;_0x257896[_0x6694('0x3a')]=_0xa3a4a1;_0x257896[_0x6694('0x3d')]=_0x480d8e;_0x257896[_0x6694('0x3f')]=getSeconds(_0x257896[_0x6694('0x3d')],_0x257896[_0x6694('0x3c')]);};exports['logLookAgent']=function(_0x642db0,_0x6bf429,_0x32850b){_0x642db0[_0x6694('0x40')]=_0x6bf429;_0x642db0[_0x6694('0x41')]=_0x32850b;};exports[_0x6694('0x42')]=function(_0x4bbcee,_0x2fab97,_0x15549e){var _0xe8cad2=moment()[_0x6694('0x14')](_0x6694('0x38'));_0x4bbcee[_0x6694('0x39')]=_0x2fab97;_0x4bbcee[_0x6694('0x3a')]=_0x15549e;_0x4bbcee['responsetime']=_0x4bbcee[_0x6694('0x3d')]?_0x4bbcee[_0x6694('0x3d')]:_0xe8cad2;_0x4bbcee[_0x6694('0x43')]=_0x4bbcee[_0x6694('0x43')]?_0x4bbcee[_0x6694('0x43')]:_0xe8cad2;_0x4bbcee[_0x6694('0x3f')]=getSeconds(_0x4bbcee[_0x6694('0x3d')]||0x0,_0x4bbcee[_0x6694('0x3c')]||0x0);_0x4bbcee['talktime']=_0x4bbcee[_0x6694('0x44')]?getSeconds(_0x4bbcee[_0x6694('0x43')],_0x4bbcee[_0x6694('0x44')]):0x0;};exports['isFailure']=function(_0x1e2dc9){return _0x1e2dc9===_0x6694('0x45');};exports[_0x6694('0x46')]=function(_0x252ed7,_0x281420,_0x33779a,_0x2310bc,_0x3a444f){var _0x2a6c8f=_0x2310bc?'RECALL':_0x252ed7[_0x6694('0x1c')];_0x2a6c8f=_0x3a444f?_0x6694('0x47'):_0x2a6c8f;return{'actionid':_0x252ed7[_0x6694('0x48')],'action':_0x6694('0x49'),'channel':_0x252ed7['channelAgent'],'callerid':util[_0x6694('0x14')](_0x6694('0x15'),_0x2a6c8f,_0x252ed7[_0x6694('0x1d')]),'Exten':'xcally-motion-preview','Context':_0x6694('0x4a'),'Priority':'1','variable':_0x33779a,'timeout':(_0x281420[_0x6694('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x252ed7['uniqueid']};};exports[_0x6694('0x4c')]=function(_0x598d39){return _0x598d39['countbusyretry']+_0x598d39['countcongestionretry']+_0x598d39[_0x6694('0x4d')]+_0x598d39[_0x6694('0x4e')]+_0x598d39[_0x6694('0x4f')];};exports[_0x6694('0x50')]=function(_0x4a0933){var _0x5ed3de=_['clone'](_0x4a0933);_0x5ed3de[_0x6694('0x39')]=0xf;_0x5ed3de[_0x6694('0x3a')]=_0x6694('0x51');return _0x5ed3de;};exports[_0x6694('0x52')]=function(_0x1d4aa1,_0x393ad6,_0x378ac8){var _0x4e44b2={};_0x4e44b2[_0x393ad6]=_0x1d4aa1[_0x393ad6];_0x4e44b2[_0x6694('0x53')]=![];_0x4e44b2[_0x6694('0x54')]=moment()[_0x6694('0x55')](_0x378ac8,_0x6694('0x56'))[_0x6694('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x4e44b2[_0x6694('0x1e')]=_0x1d4aa1['ContactId'];_0x4e44b2[_0x6694('0x57')]=_0x1d4aa1['ListId'];_0x4e44b2[_0x6694('0x58')]=_0x1d4aa1[_0x6694('0x58')]||undefined;return _0x4e44b2;};exports[_0x6694('0x59')]=function(_0x5ee1f1,_0xd89a54){if(!_[_0x6694('0x2c')](_0x5ee1f1)){if(_0x5ee1f1[_0x6694('0x5a')]>0x0){_0x5ee1f1[_0x6694('0x5a')]-=0x1;}else{logger[_0x6694('0xb')](_0xd89a54,_0x6694('0x5b'));}}else{logger[_0x6694('0xb')](_0xd89a54,_0x6694('0x5c'));}};exports[_0x6694('0x5d')]=function(_0x1c4cb7){if(_0x1c4cb7<=0x0){return!![];}return![];};exports['buildObj']=function(_0x35fe87,_0x7065f9,_0x274458){_0x35fe87[_0x6694('0x5e')]=_0x7065f9;_0x35fe87[_0x6694('0x1b')]=_0x35fe87[_0x6694('0x5f')];_0x35fe87[_0x6694('0x60')]=_0x35fe87[_0x6694('0x61')];if(_0x274458){_0x35fe87['mandatoryDisposition']=_0x274458[_0x6694('0x62')];}return _0x35fe87;};exports['buildAcw']=function(_0x5acadb){var _0x166432={};_0x166432['queue']=_0x5acadb[_0x6694('0x5f')];_0x166432[_0x6694('0x60')]=_0x5acadb['channelAgent'];_0x166432[_0x6694('0x48')]=_0x5acadb[_0x6694('0x48')];return _0x166432;};exports['agentReadyId']=function(_0x25f30a){var _0x511b02=[];for(var _0xa0e1be in _0x25f30a){if(_0x25f30a[_0x6694('0x32')](_0xa0e1be)){if(!_['isNil'](_0x25f30a[_0xa0e1be])&&_0x25f30a[_0xa0e1be][_0x6694('0x39')]===_0x6694('0x63')&&_0x25f30a[_0xa0e1be][_0x6694('0x64')]===_0x6694('0x65')){_0x511b02[_0x6694('0x66')](_0x25f30a[_0xa0e1be]['id']);}}}return _0x511b02;};exports[_0x6694('0x67')]=function(_0x5e2eb5){var _0x25d969=moment()[_0x6694('0x7')](0x0);var _0x1d7221=moment(_0x5e2eb5)[_0x6694('0x7')](0x0);return _0x25d969['diff'](_0x1d7221,_0x6694('0x9'));};exports[_0x6694('0x68')]=function(_0x59071b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x59071b[_0x6694('0x1e')],'ListId':_0x59071b[_0x6694('0x57')],'VoiceQueueId':_0x59071b['VoiceQueueId']||undefined,'CampaignId':_0x59071b[_0x6694('0x69')]||undefined};};exports[_0x6694('0x6a')]=function(_0x21b390){if(_0x21b390===_0x6694('0x48')||_0x21b390===_0x6694('0x6b')||_0x21b390===_0x6694('0x5f')||_0x21b390===_0x6694('0x6c')||_0x21b390===_0x6694('0x6d')||_0x21b390===_0x6694('0x6e')||_0x21b390===_0x6694('0x40')||_0x21b390===_0x6694('0x61')||_0x21b390===_0x6694('0x1c')||_0x21b390===_0x6694('0x53')||_0x21b390===_0x6694('0x1d')||_0x21b390===_0x6694('0x54')||_0x21b390===_0x6694('0x6f')||_0x21b390==='countcongestionretry'||_0x21b390===_0x6694('0x4d')||_0x21b390===_0x6694('0x70')||_0x21b390===_0x6694('0x71')||_0x21b390===_0x6694('0x72')||_0x21b390===_0x6694('0x73')||_0x21b390===_0x6694('0x74')||_0x21b390===_0x6694('0x1e')||_0x21b390==='ListId'||_0x21b390===_0x6694('0x41')||_0x21b390===_0x6694('0x58')||_0x21b390==='sipcallid'||_0x21b390===_0x6694('0x75')||_0x21b390==='xmd-queue'||_0x21b390==='xmd-phone'||_0x21b390==='xmd-listid'||_0x21b390===_0x6694('0x76')||_0x21b390===_0x6694('0x77')||_0x21b390===_0x6694('0x78')||_0x21b390===_0x6694('0x79')||_0x21b390===_0x6694('0x7a')||_0x21b390==='xmd-contactid'||_0x21b390==='xmd-cdrtype'||_0x21b390===_0x6694('0x7b')||_0x21b390===_0x6694('0x7c')||_0x21b390==='xmd-agi'||_0x21b390===_0x6694('0x7d')||_0x21b390===_0x6694('0x7e')||_0x21b390==='rtpaudioqosjitter'||_0x21b390===_0x6694('0x7f')||_0x21b390===_0x6694('0x80')||_0x21b390===_0x6694('0x81')||_0x21b390===_0x6694('0x82')||_0x21b390===_0x6694('0x83')||_0x21b390==='rtpaudioqos'||_0x21b390===_0x6694('0x7e')||_0x21b390===_0x6694('0x84')||_0x21b390==='rtpaudioqosjitterbridged'||_0x21b390===_0x6694('0x80')||_0x21b390==='rtpaudioqoslossbridged'||_0x21b390==='rtpaudioqosrtt'||_0x21b390===_0x6694('0x83')||_0x21b390===_0x6694('0x85')||_0x21b390===_0x6694('0x86')||_0x21b390==='state'||_0x21b390==='statedesc'){return![];}return!![];};exports[_0x6694('0x87')]=function(_0xa281ad,_0xb299a8){var _0x344449,_0x1a2957,_0x2977f6;if(_0xb299a8<=0x0){_0xb299a8=0x1;}_0x344449=new RegExp(_0x6694('0x88')+_0xb299a8+'}$');_0x1a2957=Math[_0x6694('0x89')](0xa,_0xb299a8-0x1);_0x2977f6=Math[_0x6694('0x89')](0xa,_0xb299a8)-0x1;return util[_0x6694('0x14')]('%s',_['replace'](_0xa281ad,_0x344449,_[_0x6694('0x8a')](_0x1a2957,_0x2977f6)));};exports[_0x6694('0x8b')]=function(_0x558680){var _0x483bfd=_0x558680[_0x6694('0x8c')](/"(.*?)"/);return _0x483bfd?_0x483bfd[0x1]:_0x558680;};exports[_0x6694('0x8d')]=function(_0x18707e){var _0x305248=_0x18707e[_0x6694('0x8c')](/<(.*?)>/);return _0x305248?_0x305248[0x1]:_0x18707e;};
\ No newline at end of file
+var _0x491c=['channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','voice','mandatoryDisposition','buildAcw','agentReadyId','status','reachable','push','CampaignId','filterKey','idContact','type','campaigntype','scheduledat','countglobal','callback','callbackuniqueid','recallme','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','bridgepeer','getCallerIdRandom','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridname','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','logLookAgent','UserId','logCustomer','answertime','RECALL','BOOKED','uniqueid','originate'];(function(_0x17e696,_0xad1c39){var _0x1a9e33=function(_0x28d22a){while(--_0x28d22a){_0x17e696['push'](_0x17e696['shift']());}};_0x1a9e33(++_0xad1c39);}(_0x491c,0xcb));var _0xc491=function(_0x2200ec,_0x13b192){_0x2200ec=_0x2200ec-0x0;var _0x2954c2=_0x491c[_0x2200ec];return _0x2954c2;};'use strict';var util=require(_0xc491('0x0'));var _=require(_0xc491('0x1'));var moment=require('moment');var logger=require(_0xc491('0x2'))('preview');var ipAgi=process[_0xc491('0x3')][_0xc491('0x4')]||_0xc491('0x5');function getSeconds(_0x1dc95f,_0x3f6a68){var _0x4274ee=moment(_0x1dc95f)[_0xc491('0x6')](0x0);var _0x23631b=moment(_0x3f6a68)[_0xc491('0x6')](0x0);return _0x4274ee[_0xc491('0x7')](_0x23631b,_0xc491('0x8'));}exports[_0xc491('0x9')]=function(_0x3d638f){return function(_0x5a3fc0){logger[_0xc491('0xa')](_0x3d638f,util[_0xc491('0xb')](_0x5a3fc0,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3aa82a,_0x382be4){logger[_0xc491('0xc')](_0x3aa82a,util[_0xc491('0xb')](_0x382be4,{'showHidden':![],'depth':null}));};exports[_0xc491('0xd')]=function(_0x50122e,_0x23061f){logger[_0xc491('0xa')](_0x50122e,util[_0xc491('0xb')](_0x23061f,{'showHidden':![],'depth':null}));};exports[_0xc491('0xe')]=function(_0x422580){return function(_0x5d2ca0){logger[_0xc491('0xc')](_0x422580,util[_0xc491('0xb')](_0x5d2ca0,{'showHidden':![],'depth':null}));};};exports[_0xc491('0xf')]=function(_0x2728e8,_0x4f076b,_0x3a4f14){return{'message':_0x2728e8,'unlock':_0x4f076b,'active':_0x3a4f14};};exports[_0xc491('0x10')]=function(_0x1f6a85,_0x43448b,_0x490e66){if(!_[_0xc491('0x11')](_0x490e66)&&_0xc491('0x12')===typeof _0x490e66&&!_[_0xc491('0x13')](_0x490e66)){if(!_['isUndefined'](_0x43448b)&&_0xc491('0x12')===typeof _0x43448b&&!_[_0xc491('0x13')](_0x43448b)){return util[_0xc491('0x14')](_0xc491('0x15'),_0x43448b,_0x490e66);}return util[_0xc491('0x14')](_0xc491('0x15'),_0x490e66,_0x490e66);}if(!_[_0xc491('0x11')](_0x1f6a85)&&'string'===typeof _0x1f6a85&&!_[_0xc491('0x13')](_0x1f6a85)){return _0x1f6a85;}return _0xc491('0x16');};exports['isActive']=function(_0x320751){if(_[_0xc491('0x17')](_0x320751)){return![];}return _0x320751;};exports[_0xc491('0x18')]=function(_0x2fccd9,_0x3a5200,_0x11fd2,_0x4b9184,_0x56e85a,_0x45483f){var _0x46a411={'XMD-QUEUE':_0x3a5200[_0xc491('0x19')]?_0x3a5200[_0xc491('0x19')]['name']:'','XMD-CALLERID':_0x4b9184,'XMD-CALLERID-PREVIEW':_0x45483f?util[_0xc491('0x14')]('\x22%s\x22\x20<%s>',_0x45483f[_0xc491('0x1a')],_0x45483f[_0xc491('0x1b')]):_0x4b9184,'XMD-DIALID':_0x56e85a,'XMD-CONTACTID':_0x3a5200[_0xc491('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4b9184,'XMD-VOICEQUEUEID':_0x3a5200[_0xc491('0x1d')],'XMD-DIALCHANNEL':_0x11fd2,'XMD-DIALTIMEOUT':_0x2fccd9[_0xc491('0x1e')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xc491('0x1f'),_0x2fccd9[_0xc491('0x20')]?'g':'',_[_0xc491('0x13')](_0x2fccd9[_0xc491('0x21')])?'':_0xc491('0x22')),'XMD-DIALURL':_0x2fccd9[_0xc491('0x23')]||'','XMD-AGI':_0x2fccd9['dialQueueProject']?util[_0xc491('0x14')](_0xc491('0x24'),ipAgi,_0x2fccd9['dialQueueProject']):_0xc491('0x25'),'XMD-AGIAFTER':_0x2fccd9[_0xc491('0x20')]?util[_0xc491('0x14')]('\x22agi://%s/square,%s\x22',ipAgi,_0x2fccd9[_0xc491('0x20')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x45483f?_0x45483f[_0xc491('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x45483f?_0x45483f[_0xc491('0x27')]:'','XMD-DESTINATION':_0xc491('0x28'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_['isEmpty'](_0x2fccd9[_0xc491('0x21')])){_0x46a411[util[_0xc491('0x14')]('%s',_0xc491('0x29'))]=_0x2fccd9[_0xc491('0x21')];_0x46a411[util[_0xc491('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x56e85a;}if(_0x3a5200&&_0x3a5200[_0xc491('0x2a')]){for(var _0x5ea4e1 in _0x3a5200['Contact']){if(_0x3a5200['Contact'][_0xc491('0x2b')](_0x5ea4e1)){if(!_[_0xc491('0x17')](_0x3a5200[_0xc491('0x2a')][_0x5ea4e1])&&_0x5ea4e1!=='id'&&_0x5ea4e1!==_0xc491('0x2c')&&_0x5ea4e1!==_0xc491('0x2d')&&_0x5ea4e1!=='updatedAt'){_0x46a411[util['format'](_0xc491('0x2e'),_0xc491('0x2f'),_[_0xc491('0x30')](_0x5ea4e1))]=_0x3a5200[_0xc491('0x2a')][_0x5ea4e1];}}}}return _0x46a411;};exports[_0xc491('0x31')]=function(_0x5ed212){var _0x167d7e={};for(var _0x22d4c2 in _0x5ed212){if(_0x5ed212[_0xc491('0x2b')](_0x22d4c2)){_0x167d7e[util[_0xc491('0x14')]('%s',_['toLower'](_0x22d4c2))]=_0x5ed212[_0x22d4c2];}}return{'variables':_0x167d7e};};exports[_0xc491('0x32')]=function(_0x4c074f,_0x12a4f3){if(!_[_0xc491('0x17')](_0x4c074f)){if(_0x4c074f['hasOwnProperty']('originated')){if(_0x4c074f[_0xc491('0x33')]>0x0){_0x4c074f['originated']-=0x1;}else{logger[_0xc491('0xa')](_0xc491('0x34'),_0x12a4f3);}}}else{logger[_0xc491('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x12a4f3);}};exports[_0xc491('0x35')]=function(_0x3cced6){var _0x21f849=moment()[_0xc491('0x14')](_0xc491('0x36'));_0x3cced6['state']=0xd;_0x3cced6[_0xc491('0x37')]=_0xc491('0x38');_0x3cced6[_0xc491('0x39')]=_0x21f849;_0x3cced6[_0xc491('0x3a')]=_0x21f849;_0x3cced6[_0xc491('0x3b')]=_0x21f849;};exports[_0xc491('0x3c')]=function(_0x3b3e66,_0x5a5475,_0x36d487){var _0x1ddfa2=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3b3e66[_0xc491('0x3d')]=_0x5a5475;_0x3b3e66[_0xc491('0x37')]=_0x36d487;_0x3b3e66[_0xc491('0x3a')]=_0x1ddfa2;_0x3b3e66[_0xc491('0x3e')]=getSeconds(_0x3b3e66[_0xc491('0x3a')],_0x3b3e66[_0xc491('0x39')]);};exports[_0xc491('0x3f')]=function(_0x19c41c,_0x1b2a95,_0x5b5ea1){_0x19c41c['membername']=_0x1b2a95;_0x19c41c[_0xc491('0x40')]=_0x5b5ea1;};exports[_0xc491('0x41')]=function(_0x39decc,_0x55259e,_0x508ac9){var _0x1e627a=moment()[_0xc491('0x14')](_0xc491('0x36'));_0x39decc[_0xc491('0x3d')]=_0x55259e;_0x39decc[_0xc491('0x37')]=_0x508ac9;_0x39decc['responsetime']=_0x39decc[_0xc491('0x3a')]?_0x39decc[_0xc491('0x3a')]:_0x1e627a;_0x39decc[_0xc491('0x3b')]=_0x39decc[_0xc491('0x3b')]?_0x39decc[_0xc491('0x3b')]:_0x1e627a;_0x39decc['ringtime']=getSeconds(_0x39decc[_0xc491('0x3a')]||0x0,_0x39decc[_0xc491('0x39')]||0x0);_0x39decc['talktime']=_0x39decc[_0xc491('0x42')]?getSeconds(_0x39decc['endtime'],_0x39decc[_0xc491('0x42')]):0x0;};exports['isFailure']=function(_0x18019d){return _0x18019d==='Failure';};exports['variablesAction']=function(_0x3cc05f,_0x32a0c1,_0x3a6031,_0x180f87,_0x53dd80){var _0x16e379=_0x180f87?_0xc491('0x43'):_0x3cc05f['calleridname'];_0x16e379=_0x53dd80?_0xc491('0x44'):_0x16e379;return{'actionid':_0x3cc05f[_0xc491('0x45')],'action':_0xc491('0x46'),'channel':_0x3cc05f[_0xc491('0x47')],'callerid':util[_0xc491('0x14')](_0xc491('0x15'),_0x16e379,_0x3cc05f[_0xc491('0x1b')]),'Exten':_0xc491('0x28'),'Context':_0xc491('0x48'),'Priority':'1','variable':_0x3a6031,'timeout':(_0x32a0c1['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3cc05f['uniqueid']};};exports[_0xc491('0x49')]=function(_0x1c8f40){return _0x1c8f40[_0xc491('0x4a')]+_0x1c8f40[_0xc491('0x4b')]+_0x1c8f40[_0xc491('0x4c')]+_0x1c8f40[_0xc491('0x4d')]+_0x1c8f40[_0xc491('0x4e')];};exports[_0xc491('0x4f')]=function(_0x4b3fe2){var _0x5257a9=_[_0xc491('0x50')](_0x4b3fe2);_0x5257a9[_0xc491('0x3d')]=0xf;_0x5257a9['statedesc']=_0xc491('0x51');return _0x5257a9;};exports[_0xc491('0x52')]=function(_0x6e643a,_0x19b672,_0x227661){var _0x4f432f={};_0x4f432f[_0x19b672]=_0x6e643a[_0x19b672];_0x4f432f[_0xc491('0x53')]=![];_0x4f432f['scheduledat']=moment()[_0xc491('0x54')](_0x227661,_0xc491('0x55'))[_0xc491('0x14')](_0xc491('0x36'));_0x4f432f[_0xc491('0x1c')]=_0x6e643a['ContactId'];_0x4f432f[_0xc491('0x56')]=_0x6e643a[_0xc491('0x56')];_0x4f432f['VoiceQueueId']=_0x6e643a[_0xc491('0x1d')]||undefined;return _0x4f432f;};exports[_0xc491('0x57')]=function(_0x27f827,_0x68d33f){if(!_[_0xc491('0x17')](_0x27f827)){if(_0x27f827[_0xc491('0x58')]>0x0){_0x27f827[_0xc491('0x58')]-=0x1;}else{logger['error'](_0x68d33f,_0xc491('0x59'));}}else{logger[_0xc491('0xa')](_0x68d33f,_0xc491('0x5a'));}};exports[_0xc491('0x5b')]=function(_0x18a762){if(_0x18a762<=0x0){return!![];}return![];};exports['buildObj']=function(_0x162b1c,_0x52aebe,_0x29649b){_0x162b1c[_0xc491('0x5c')]=_0x52aebe;_0x162b1c['name']=_0x162b1c[_0xc491('0x5d')];_0x162b1c[_0xc491('0x5e')]=_0x162b1c['channelAgent'];_0x162b1c['motionChannel']=_0xc491('0x5f');if(_0x29649b){_0x162b1c[_0xc491('0x60')]=_0x29649b[_0xc491('0x60')];}return _0x162b1c;};exports[_0xc491('0x61')]=function(_0x5352d4){var _0x4a25b8={};_0x4a25b8[_0xc491('0x5d')]=_0x5352d4['queue'];_0x4a25b8[_0xc491('0x5e')]=_0x5352d4[_0xc491('0x47')];_0x4a25b8[_0xc491('0x45')]=_0x5352d4[_0xc491('0x45')];return _0x4a25b8;};exports[_0xc491('0x62')]=function(_0xdd07e3){var _0x4d3133=[];for(var _0x2b218b in _0xdd07e3){if(_0xdd07e3['hasOwnProperty'](_0x2b218b)){if(!_[_0xc491('0x17')](_0xdd07e3[_0x2b218b])&&_0xdd07e3[_0x2b218b][_0xc491('0x3d')]==='not_inuse'&&_0xdd07e3[_0x2b218b][_0xc491('0x63')]===_0xc491('0x64')){_0x4d3133[_0xc491('0x65')](_0xdd07e3[_0x2b218b]['id']);}}}return _0x4d3133;};exports['getDiff']=function(_0x1232ed){var _0x79fda2=moment()[_0xc491('0x6')](0x0);var _0x4d272f=moment(_0x1232ed)['milliseconds'](0x0);return _0x79fda2[_0xc491('0x7')](_0x4d272f,'seconds');};exports['createBody']=function(_0x2c08b6){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2c08b6[_0xc491('0x1c')],'ListId':_0x2c08b6['ListId'],'VoiceQueueId':_0x2c08b6[_0xc491('0x1d')]||undefined,'CampaignId':_0x2c08b6[_0xc491('0x66')]||undefined};};exports[_0xc491('0x67')]=function(_0x2f85b5){if(_0x2f85b5===_0xc491('0x45')||_0x2f85b5===_0xc491('0x68')||_0x2f85b5===_0xc491('0x5d')||_0x2f85b5===_0xc491('0x69')||_0x2f85b5===_0xc491('0x6a')||_0x2f85b5==='dialAnswer'||_0x2f85b5==='membername'||_0x2f85b5===_0xc491('0x47')||_0x2f85b5===_0xc491('0x1a')||_0x2f85b5===_0xc491('0x53')||_0x2f85b5===_0xc491('0x1b')||_0x2f85b5===_0xc491('0x6b')||_0x2f85b5===_0xc491('0x4a')||_0x2f85b5==='countcongestionretry'||_0x2f85b5==='countnoanswerretry'||_0x2f85b5===_0xc491('0x6c')||_0x2f85b5===_0xc491('0x6d')||_0x2f85b5===_0xc491('0x6e')||_0x2f85b5==='callbackat'||_0x2f85b5===_0xc491('0x6f')||_0x2f85b5===_0xc491('0x1c')||_0x2f85b5===_0xc491('0x56')||_0x2f85b5===_0xc491('0x40')||_0x2f85b5===_0xc491('0x1d')||_0x2f85b5==='sipcallid'||_0x2f85b5==='xmd-voicequeueid'||_0x2f85b5==='xmd-queue'||_0x2f85b5==='xmd-phone'||_0x2f85b5===_0xc491('0x70')||_0x2f85b5==='xmd-dialurl'||_0x2f85b5===_0xc491('0x71')||_0x2f85b5===_0xc491('0x72')||_0x2f85b5===_0xc491('0x73')||_0x2f85b5===_0xc491('0x74')||_0x2f85b5===_0xc491('0x75')||_0x2f85b5===_0xc491('0x76')||_0x2f85b5===_0xc491('0x77')||_0x2f85b5==='xmd-agiafter'||_0x2f85b5===_0xc491('0x78')||_0x2f85b5==='rtpaudioqos'||_0x2f85b5===_0xc491('0x79')||_0x2f85b5===_0xc491('0x7a')||_0x2f85b5==='rtpaudioqosjitterbridged'||_0x2f85b5===_0xc491('0x7b')||_0x2f85b5===_0xc491('0x7c')||_0x2f85b5===_0xc491('0x7d')||_0x2f85b5===_0xc491('0x7e')||_0x2f85b5===_0xc491('0x7f')||_0x2f85b5===_0xc491('0x79')||_0x2f85b5===_0xc491('0x7a')||_0x2f85b5===_0xc491('0x80')||_0x2f85b5===_0xc491('0x7b')||_0x2f85b5===_0xc491('0x7c')||_0x2f85b5==='rtpaudioqosrtt'||_0x2f85b5===_0xc491('0x7e')||_0x2f85b5===_0xc491('0x81')||_0x2f85b5==='bridgepvtcallid'||_0x2f85b5===_0xc491('0x3d')||_0x2f85b5===_0xc491('0x37')){return![];}return!![];};exports[_0xc491('0x82')]=function(_0x16f49a,_0x11c13b){var _0x106b43,_0x5c20d8,_0x4a56c8;if(_0x11c13b<=0x0){_0x11c13b=0x1;}_0x106b43=new RegExp('\x5cw{0,'+_0x11c13b+'}$');_0x5c20d8=Math['pow'](0xa,_0x11c13b-0x1);_0x4a56c8=Math[_0xc491('0x83')](0xa,_0x11c13b)-0x1;return util['format']('%s',_[_0xc491('0x84')](_0x16f49a,_0x106b43,_[_0xc491('0x85')](_0x5c20d8,_0x4a56c8)));};exports[_0xc491('0x86')]=function(_0xbdf963){var _0x42a267=_0xbdf963[_0xc491('0x87')](/"(.*?)"/);return _0x42a267?_0x42a267[0x1]:_0xbdf963;};exports[_0xc491('0x88')]=function(_0x35123d){var _0x23ac36=_0x35123d[_0xc491('0x87')](/<(.*?)>/);return _0x23ac36?_0x23ac36[0x1]:_0x35123d;};
\ No newline at end of file