Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / services / ami / preview / util / util.js
index e87206b..af1418e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc2f=['ContactId','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','NONE','\x22agi://%s/square,%s\x22','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','XMD-','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','logAgent','ringtime','starttime','membername','UserId','endtime','answertime','isFailure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','clone','Global','scheduledAt','active','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','buildAcw','agentReadyId','status','reachable','push','getDiff','CampaignId','filterKey','type','campaigntype','dialAnswer','scheduledat','countglobal','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosloss','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','match','extractCalleridNumber','lodash','moment','../../../../config/logger','env','milliseconds','seconds','loggerCatch','logger','info','inspect','loggerError','error','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','Queue','name','calleridname'];(function(_0x506f64,_0x395f5a){var _0x389fdb=function(_0x3cf504){while(--_0x3cf504){_0x506f64['push'](_0x506f64['shift']());}};_0x389fdb(++_0x395f5a);}(_0xfc2f,0x164));var _0xffc2=function(_0x477c09,_0x385809){_0x477c09=_0x477c09-0x0;var _0x318ed1=_0xfc2f[_0x477c09];return _0x318ed1;};'use strict';var util=require('util');var _=require(_0xffc2('0x0'));var moment=require(_0xffc2('0x1'));var logger=require(_0xffc2('0x2'))('preview');var ipAgi=process[_0xffc2('0x3')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x546318,_0x4d6cfc){var _0x55afe7=moment(_0x546318)[_0xffc2('0x4')](0x0);var _0x302291=moment(_0x4d6cfc)[_0xffc2('0x4')](0x0);return _0x55afe7['diff'](_0x302291,_0xffc2('0x5'));}exports[_0xffc2('0x6')]=function(_0x2acdc3){return function(_0x58b132){logger['error'](_0x2acdc3,util['inspect'](_0x58b132,{'showHidden':![],'depth':null}));};};exports[_0xffc2('0x7')]=function(_0x9fac05,_0x46e6a9){logger[_0xffc2('0x8')](_0x9fac05,util[_0xffc2('0x9')](_0x46e6a9,{'showHidden':![],'depth':null}));};exports[_0xffc2('0xa')]=function(_0x5e0f6a,_0x3ef4b9){logger[_0xffc2('0xb')](_0x5e0f6a,util['inspect'](_0x3ef4b9,{'showHidden':![],'depth':null}));};exports[_0xffc2('0xc')]=function(_0x427a3e){return function(_0xd5f2a0){logger['info'](_0x427a3e,util[_0xffc2('0x9')](_0xd5f2a0,{'showHidden':![],'depth':null}));};};exports[_0xffc2('0xd')]=function(_0x421170,_0x3e35f5,_0x2c0611){return{'message':_0x421170,'unlock':_0x3e35f5,'active':_0x2c0611};};exports[_0xffc2('0xe')]=function(_0xd46315,_0x2f215b,_0x178162){if(!_[_0xffc2('0xf')](_0x178162)&&_0xffc2('0x10')===typeof _0x178162&&!_[_0xffc2('0x11')](_0x178162)){if(!_['isUndefined'](_0x2f215b)&&_0xffc2('0x10')===typeof _0x2f215b&&!_[_0xffc2('0x11')](_0x2f215b)){return util[_0xffc2('0x12')](_0xffc2('0x13'),_0x2f215b,_0x178162);}return util[_0xffc2('0x12')]('\x22%s\x22\x20<%s>',_0x178162,_0x178162);}if(!_[_0xffc2('0xf')](_0xd46315)&&_0xffc2('0x10')===typeof _0xd46315&&!_['isEmpty'](_0xd46315)){return _0xd46315;}return _0xffc2('0x14');};exports['isActive']=function(_0x5b4080){if(_[_0xffc2('0x15')](_0x5b4080)){return![];}return _0x5b4080;};exports['addVariables']=function(_0xb966e8,_0x5988e8,_0x1a85ec,_0x16deec,_0xb97ad5,_0x2a8061){var _0x959b7={'XMD-QUEUE':_0x5988e8[_0xffc2('0x16')]?_0x5988e8[_0xffc2('0x16')][_0xffc2('0x17')]:'','XMD-CALLERID':_0x16deec,'XMD-CALLERID-PREVIEW':_0x2a8061?util[_0xffc2('0x12')](_0xffc2('0x13'),_0x2a8061[_0xffc2('0x18')],_0x2a8061['calleridnum']):_0x16deec,'XMD-DIALID':_0xb97ad5,'XMD-CONTACTID':_0x5988e8[_0xffc2('0x19')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x16deec,'XMD-VOICEQUEUEID':_0x5988e8[_0xffc2('0x1a')],'XMD-DIALCHANNEL':_0x1a85ec,'XMD-DIALTIMEOUT':_0xb966e8['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0xffc2('0x12')](_0xffc2('0x1b'),_0xb966e8[_0xffc2('0x1c')]?'g':'',_[_0xffc2('0x11')](_0xb966e8[_0xffc2('0x1d')])?'':_0xffc2('0x1e')),'XMD-DIALURL':_0xb966e8['dialPreviewUrl']||'','XMD-AGI':_0xb966e8['dialQueueProject']?util[_0xffc2('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0xb966e8[_0xffc2('0x1f')]):_0xffc2('0x20'),'XMD-AGIAFTER':_0xb966e8[_0xffc2('0x1c')]?util[_0xffc2('0x12')](_0xffc2('0x21'),ipAgi,_0xb966e8[_0xffc2('0x1c')]):_0xffc2('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x2a8061?_0x2a8061[_0xffc2('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x2a8061?_0x2a8061['originatecalleridname']:'','XMD-DESTINATION':_0xffc2('0x23')};if(!_[_0xffc2('0x11')](_0xb966e8[_0xffc2('0x1d')])){_0x959b7[util[_0xffc2('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xb966e8[_0xffc2('0x1d')];_0x959b7[util[_0xffc2('0x12')]('%s',_0xffc2('0x24'))]=_0xb97ad5;}if(_0x5988e8&&_0x5988e8['Contact']){for(var _0x43ef27 in _0x5988e8['Contact']){if(_0x5988e8[_0xffc2('0x25')]['hasOwnProperty'](_0x43ef27)){if(!_[_0xffc2('0x15')](_0x5988e8['Contact'][_0x43ef27])&&_0x43ef27!=='id'&&_0x43ef27!==_0xffc2('0x26')&&_0x43ef27!==_0xffc2('0x27')&&_0x43ef27!=='updatedAt'){_0x959b7[util['format']('%s%s',_0xffc2('0x28'),_[_0xffc2('0x29')](_0x43ef27))]=_0x5988e8[_0xffc2('0x25')][_0x43ef27];}}}}return _0x959b7;};exports[_0xffc2('0x2a')]=function(_0x18f6fa){var _0x258a4f={};for(var _0x19d9c8 in _0x18f6fa){if(_0x18f6fa[_0xffc2('0x2b')](_0x19d9c8)){_0x258a4f[util[_0xffc2('0x12')]('%s',_[_0xffc2('0x2c')](_0x19d9c8))]=_0x18f6fa[_0x19d9c8];}}return{'variables':_0x258a4f};};exports[_0xffc2('0x2d')]=function(_0x3595dc,_0x377d98){if(!_[_0xffc2('0x15')](_0x3595dc)){if(_0x3595dc[_0xffc2('0x2b')](_0xffc2('0x2e'))){if(_0x3595dc['originated']>0x0){_0x3595dc[_0xffc2('0x2e')]-=0x1;}else{logger[_0xffc2('0xb')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x377d98);}}}else{logger[_0xffc2('0xb')](_0xffc2('0x2f'),_0x377d98);}};exports[_0xffc2('0x30')]=function(_0x11f6db){var _0x51d1dd=moment()[_0xffc2('0x12')](_0xffc2('0x31'));_0x11f6db[_0xffc2('0x32')]=0xd;_0x11f6db[_0xffc2('0x33')]=_0xffc2('0x34');_0x11f6db['starttime']=_0x51d1dd;_0x11f6db[_0xffc2('0x35')]=_0x51d1dd;_0x11f6db['endtime']=_0x51d1dd;};exports[_0xffc2('0x36')]=function(_0x2d4112,_0x649759,_0x4b917f){var _0x2895c0=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2d4112[_0xffc2('0x32')]=_0x649759;_0x2d4112[_0xffc2('0x33')]=_0x4b917f;_0x2d4112[_0xffc2('0x35')]=_0x2895c0;_0x2d4112[_0xffc2('0x37')]=getSeconds(_0x2d4112[_0xffc2('0x35')],_0x2d4112[_0xffc2('0x38')]);};exports['logLookAgent']=function(_0x442d5f,_0x5a22b0,_0x30cf37){_0x442d5f[_0xffc2('0x39')]=_0x5a22b0;_0x442d5f[_0xffc2('0x3a')]=_0x30cf37;};exports['logCustomer']=function(_0x21e92f,_0x1b7134,_0x23b4d7){var _0x49c3be=moment()[_0xffc2('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x21e92f['state']=_0x1b7134;_0x21e92f[_0xffc2('0x33')]=_0x23b4d7;_0x21e92f[_0xffc2('0x35')]=_0x21e92f['responsetime']?_0x21e92f[_0xffc2('0x35')]:_0x49c3be;_0x21e92f[_0xffc2('0x3b')]=_0x21e92f[_0xffc2('0x3b')]?_0x21e92f[_0xffc2('0x3b')]:_0x49c3be;_0x21e92f[_0xffc2('0x37')]=getSeconds(_0x21e92f['responsetime']||0x0,_0x21e92f['starttime']||0x0);_0x21e92f['talktime']=_0x21e92f[_0xffc2('0x3c')]?getSeconds(_0x21e92f[_0xffc2('0x3b')],_0x21e92f['answertime']):0x0;};exports[_0xffc2('0x3d')]=function(_0x467d47){return _0x467d47==='Failure';};exports[_0xffc2('0x3e')]=function(_0x12a842,_0x1ae411,_0x236953,_0x303f7b,_0x3be16d){var _0x3a384e=_0x303f7b?_0xffc2('0x3f'):_0x12a842[_0xffc2('0x18')];_0x3a384e=_0x3be16d?_0xffc2('0x40'):_0x3a384e;return{'actionid':_0x12a842[_0xffc2('0x41')],'action':_0xffc2('0x42'),'channel':_0x12a842[_0xffc2('0x43')],'callerid':util['format'](_0xffc2('0x13'),_0x3a384e,_0x12a842[_0xffc2('0x44')]),'Exten':'xcally-motion-preview','Context':_0xffc2('0x45'),'Priority':'1','variable':_0x236953,'timeout':(_0x1ae411[_0xffc2('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x12a842[_0xffc2('0x41')]};};exports[_0xffc2('0x47')]=function(_0x228c05){return _0x228c05[_0xffc2('0x48')]+_0x228c05[_0xffc2('0x49')]+_0x228c05[_0xffc2('0x4a')];};exports['cloneAction']=function(_0x382019){var _0x26cf39=_[_0xffc2('0x4b')](_0x382019);_0x26cf39[_0xffc2('0x32')]=0xf;_0x26cf39[_0xffc2('0x33')]=_0xffc2('0x4c');return _0x26cf39;};exports[_0xffc2('0x4d')]=function(_0x2132cc,_0x295519,_0x305160){var _0x252436={};_0x252436[_0x295519]=_0x2132cc[_0x295519];_0x252436[_0xffc2('0x4e')]=![];_0x252436['scheduledat']=moment()[_0xffc2('0x4f')](_0x305160,'minutes')[_0xffc2('0x12')](_0xffc2('0x31'));_0x252436[_0xffc2('0x19')]=_0x2132cc[_0xffc2('0x19')];_0x252436[_0xffc2('0x50')]=_0x2132cc[_0xffc2('0x50')];_0x252436[_0xffc2('0x1a')]=_0x2132cc[_0xffc2('0x1a')]||undefined;return _0x252436;};exports[_0xffc2('0x51')]=function(_0x5945dd,_0x43baf1){if(!_['isNil'](_0x5945dd)){if(_0x5945dd[_0xffc2('0x52')]>0x0){_0x5945dd[_0xffc2('0x52')]-=0x1;}else{logger[_0xffc2('0xb')](_0x43baf1,_0xffc2('0x53'));}}else{logger['error'](_0x43baf1,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xffc2('0x54')]=function(_0x35cc84){if(_0x35cc84<=0x0){return!![];}return![];};exports['buildObj']=function(_0x10fe7d,_0x2dd859){_0x10fe7d[_0xffc2('0x55')]=_0x2dd859;_0x10fe7d['name']=_0x10fe7d[_0xffc2('0x56')];_0x10fe7d[_0xffc2('0x57')]=_0x10fe7d[_0xffc2('0x43')];return _0x10fe7d;};exports[_0xffc2('0x58')]=function(_0x229dc6){var _0x232e4a={};_0x232e4a['queue']=_0x229dc6[_0xffc2('0x56')];_0x232e4a['interface']=_0x229dc6['channelAgent'];_0x232e4a[_0xffc2('0x41')]=_0x229dc6[_0xffc2('0x41')];return _0x232e4a;};exports[_0xffc2('0x59')]=function(_0x5473a8){var _0x1a5a77=[];for(var _0x16660e in _0x5473a8){if(_0x5473a8[_0xffc2('0x2b')](_0x16660e)){if(!_[_0xffc2('0x15')](_0x5473a8[_0x16660e])&&_0x5473a8[_0x16660e][_0xffc2('0x32')]==='not_inuse'&&_0x5473a8[_0x16660e][_0xffc2('0x5a')]===_0xffc2('0x5b')){_0x1a5a77[_0xffc2('0x5c')](_0x5473a8[_0x16660e]['id']);}}}return _0x1a5a77;};exports[_0xffc2('0x5d')]=function(_0x530a45){var _0x272e31=moment()[_0xffc2('0x4')](0x0);var _0x12a7c3=moment(_0x530a45)[_0xffc2('0x4')](0x0);return _0x272e31['diff'](_0x12a7c3,'seconds');};exports['createBody']=function(_0x1897bc){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1897bc['ContactId'],'ListId':_0x1897bc[_0xffc2('0x50')],'VoiceQueueId':_0x1897bc['VoiceQueueId']||undefined,'CampaignId':_0x1897bc[_0xffc2('0x5e')]||undefined};};exports[_0xffc2('0x5f')]=function(_0x1ab553){if(_0x1ab553===_0xffc2('0x41')||_0x1ab553==='idContact'||_0x1ab553===_0xffc2('0x56')||_0x1ab553===_0xffc2('0x60')||_0x1ab553===_0xffc2('0x61')||_0x1ab553===_0xffc2('0x62')||_0x1ab553===_0xffc2('0x39')||_0x1ab553===_0xffc2('0x43')||_0x1ab553===_0xffc2('0x18')||_0x1ab553===_0xffc2('0x4e')||_0x1ab553===_0xffc2('0x44')||_0x1ab553===_0xffc2('0x63')||_0x1ab553==='countbusyretry'||_0x1ab553===_0xffc2('0x49')||_0x1ab553===_0xffc2('0x4a')||_0x1ab553===_0xffc2('0x64')||_0x1ab553==='callback'||_0x1ab553===_0xffc2('0x65')||_0x1ab553===_0xffc2('0x66')||_0x1ab553===_0xffc2('0x67')||_0x1ab553===_0xffc2('0x19')||_0x1ab553==='ListId'||_0x1ab553===_0xffc2('0x3a')||_0x1ab553==='VoiceQueueId'||_0x1ab553==='sipcallid'||_0x1ab553===_0xffc2('0x68')||_0x1ab553===_0xffc2('0x69')||_0x1ab553===_0xffc2('0x6a')||_0x1ab553===_0xffc2('0x6b')||_0x1ab553===_0xffc2('0x6c')||_0x1ab553==='xmd-dialtimeout'||_0x1ab553==='xmd-dialoptions'||_0x1ab553==='xmd-dialid'||_0x1ab553===_0xffc2('0x6d')||_0x1ab553===_0xffc2('0x6e')||_0x1ab553===_0xffc2('0x6f')||_0x1ab553==='xmd-callerid'||_0x1ab553==='xmd-agiafter'||_0x1ab553===_0xffc2('0x70')||_0x1ab553===_0xffc2('0x71')||_0x1ab553===_0xffc2('0x72')||_0x1ab553===_0xffc2('0x73')||_0x1ab553===_0xffc2('0x74')||_0x1ab553==='rtpaudioqosloss'||_0x1ab553===_0xffc2('0x75')||_0x1ab553===_0xffc2('0x76')||_0x1ab553==='rtpaudioqosrttbridged'||_0x1ab553==='rtpaudioqos'||_0x1ab553===_0xffc2('0x72')||_0x1ab553===_0xffc2('0x73')||_0x1ab553===_0xffc2('0x74')||_0x1ab553===_0xffc2('0x77')||_0x1ab553===_0xffc2('0x75')||_0x1ab553==='rtpaudioqosrtt'||_0x1ab553===_0xffc2('0x78')||_0x1ab553===_0xffc2('0x79')||_0x1ab553===_0xffc2('0x7a')||_0x1ab553==='state'||_0x1ab553===_0xffc2('0x33')){return![];}return!![];};exports[_0xffc2('0x7b')]=function(_0x2ab60b,_0x2b7191){var _0xb25c0,_0x92be3d,_0x4e3cc6;if(_0x2b7191<=0x0){_0x2b7191=0x1;}_0xb25c0=new RegExp(_0xffc2('0x7c')+_0x2b7191+'}$');_0x92be3d=Math['pow'](0xa,_0x2b7191-0x1);_0x4e3cc6=Math['pow'](0xa,_0x2b7191)-0x1;return util[_0xffc2('0x12')]('%s',_['replace'](_0x2ab60b,_0xb25c0,_['random'](_0x92be3d,_0x4e3cc6)));};exports['extractCalleridName']=function(_0x412d9b){var _0x5641e7=_0x412d9b[_0xffc2('0x7d')](/"(.*?)"/);return _0x5641e7?_0x5641e7[0x1]:_0x412d9b;};exports[_0xffc2('0x7e')]=function(_0x56daca){var _0x5f141f=_0x56daca[_0xffc2('0x7d')](/<(.*?)>/);return _0x5f141f?_0x5f141f[0x1]:_0x56daca;};
\ No newline at end of file
+var _0x97ce=['starttime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','interface','queue','not_inuse','reachable','seconds','createBody','CampaignId','idContact','type','dialAnswer','countbusyretry','countglobal','callback','callbackat','recallme','ListId','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqos','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','extractCalleridName','match','util','lodash','moment','../../../../config/logger','env','127.0.0.1','milliseconds','diff','loggerCatch','inspect','info','loggerError','logger2','message','isUndefined','string','isEmpty','format','isActive','isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','hasOwnProperty','updateOriginated','originated','error','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','membername','UserId','logCustomer','ringtime'];(function(_0x31705d,_0x4b4040){var _0x79dd49=function(_0x39ebf3){while(--_0x39ebf3){_0x31705d['push'](_0x31705d['shift']());}};_0x79dd49(++_0x4b4040);}(_0x97ce,0x151));var _0xe97c=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x97ce[_0xc67528];return _0x38e26d;};'use strict';var util=require(_0xe97c('0x0'));var _=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var logger=require(_0xe97c('0x3'))('preview');var ipAgi=process[_0xe97c('0x4')]['XCALLY_IP_AGI']||_0xe97c('0x5');function getSeconds(_0x49df42,_0x443ea2){var _0x259e69=moment(_0x49df42)[_0xe97c('0x6')](0x0);var _0x447030=moment(_0x443ea2)[_0xe97c('0x6')](0x0);return _0x259e69[_0xe97c('0x7')](_0x447030,'seconds');}exports[_0xe97c('0x8')]=function(_0x9c1b00){return function(_0x9ce6d){logger['error'](_0x9c1b00,util[_0xe97c('0x9')](_0x9ce6d,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x40ef69,_0x2e732d){logger[_0xe97c('0xa')](_0x40ef69,util[_0xe97c('0x9')](_0x2e732d,{'showHidden':![],'depth':null}));};exports[_0xe97c('0xb')]=function(_0x3aa2a5,_0xcb42d6){logger['error'](_0x3aa2a5,util[_0xe97c('0x9')](_0xcb42d6,{'showHidden':![],'depth':null}));};exports[_0xe97c('0xc')]=function(_0x3f8ad3){return function(_0x15ab00){logger[_0xe97c('0xa')](_0x3f8ad3,util[_0xe97c('0x9')](_0x15ab00,{'showHidden':![],'depth':null}));};};exports[_0xe97c('0xd')]=function(_0x8fb84d,_0x2665c0,_0x578ffc){return{'message':_0x8fb84d,'unlock':_0x2665c0,'active':_0x578ffc};};exports['getCallerId']=function(_0x115559,_0x530351,_0x3d4dd2){if(!_[_0xe97c('0xe')](_0x3d4dd2)&&'string'===typeof _0x3d4dd2&&!_['isEmpty'](_0x3d4dd2)){if(!_[_0xe97c('0xe')](_0x530351)&&_0xe97c('0xf')===typeof _0x530351&&!_[_0xe97c('0x10')](_0x530351)){return util[_0xe97c('0x11')]('\x22%s\x22\x20<%s>',_0x530351,_0x3d4dd2);}return util['format']('\x22%s\x22\x20<%s>',_0x3d4dd2,_0x3d4dd2);}if(!_[_0xe97c('0xe')](_0x115559)&&_0xe97c('0xf')===typeof _0x115559&&!_[_0xe97c('0x10')](_0x115559)){return _0x115559;}return'\x22\x22\x20<>';};exports[_0xe97c('0x12')]=function(_0x1ea420){if(_[_0xe97c('0x13')](_0x1ea420)){return![];}return _0x1ea420;};exports[_0xe97c('0x14')]=function(_0x3ad7c8,_0x5a7c4b,_0x3683ac,_0xdaf874,_0x24a54d,_0x1ce8cb){var _0x32eb7a={'XMD-QUEUE':_0x5a7c4b[_0xe97c('0x15')]?_0x5a7c4b[_0xe97c('0x15')][_0xe97c('0x16')]:'','XMD-CALLERID':_0xdaf874,'XMD-CALLERID-PREVIEW':_0x1ce8cb?util[_0xe97c('0x11')](_0xe97c('0x17'),_0x1ce8cb[_0xe97c('0x18')],_0x1ce8cb[_0xe97c('0x19')]):_0xdaf874,'XMD-DIALID':_0x24a54d,'XMD-CONTACTID':_0x5a7c4b[_0xe97c('0x1a')],'XMD-CDRTYPE':_0xe97c('0x1b'),'CALLERID(all)':_0xdaf874,'XMD-VOICEQUEUEID':_0x5a7c4b[_0xe97c('0x1c')],'XMD-DIALCHANNEL':_0x3683ac,'XMD-DIALTIMEOUT':_0x3ad7c8[_0xe97c('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xe97c('0x11')](_0xe97c('0x1e'),_0x3ad7c8[_0xe97c('0x1f')]?'g':'',_['isEmpty'](_0x3ad7c8[_0xe97c('0x20')])?'':_0xe97c('0x21')),'XMD-DIALURL':_0x3ad7c8[_0xe97c('0x22')]||'','XMD-AGI':_0x3ad7c8[_0xe97c('0x23')]?util[_0xe97c('0x11')](_0xe97c('0x24'),ipAgi,_0x3ad7c8[_0xe97c('0x23')]):_0xe97c('0x25'),'XMD-AGIAFTER':_0x3ad7c8[_0xe97c('0x1f')]?util[_0xe97c('0x11')](_0xe97c('0x24'),ipAgi,_0x3ad7c8[_0xe97c('0x1f')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x1ce8cb?_0x1ce8cb['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x1ce8cb?_0x1ce8cb[_0xe97c('0x26')]:'','XMD-DESTINATION':_0xe97c('0x27')};if(!_[_0xe97c('0x10')](_0x3ad7c8[_0xe97c('0x20')])){_0x32eb7a[util[_0xe97c('0x11')]('%s',_0xe97c('0x28'))]=_0x3ad7c8[_0xe97c('0x20')];_0x32eb7a[util['format']('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x24a54d;}if(_0x5a7c4b&&_0x5a7c4b[_0xe97c('0x29')]){for(var _0x36536c in _0x5a7c4b[_0xe97c('0x29')]){if(_0x5a7c4b[_0xe97c('0x29')]['hasOwnProperty'](_0x36536c)){if(!_['isNil'](_0x5a7c4b[_0xe97c('0x29')][_0x36536c])&&_0x36536c!=='id'&&_0x36536c!==_0xe97c('0x2a')&&_0x36536c!==_0xe97c('0x2b')&&_0x36536c!=='updatedAt'){_0x32eb7a[util['format'](_0xe97c('0x2c'),_0xe97c('0x2d'),_[_0xe97c('0x2e')](_0x36536c))]=_0x5a7c4b[_0xe97c('0x29')][_0x36536c];}}}}return _0x32eb7a;};exports[_0xe97c('0x2f')]=function(_0x433858){var _0x36e0dc={};for(var _0x5177d3 in _0x433858){if(_0x433858[_0xe97c('0x30')](_0x5177d3)){_0x36e0dc[util[_0xe97c('0x11')]('%s',_['toLower'](_0x5177d3))]=_0x433858[_0x5177d3];}}return{'variables':_0x36e0dc};};exports[_0xe97c('0x31')]=function(_0x1a69c,_0x142e2c){if(!_[_0xe97c('0x13')](_0x1a69c)){if(_0x1a69c[_0xe97c('0x30')](_0xe97c('0x32'))){if(_0x1a69c[_0xe97c('0x32')]>0x0){_0x1a69c[_0xe97c('0x32')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x142e2c);}}}else{logger[_0xe97c('0x33')](_0xe97c('0x34'),_0x142e2c);}};exports[_0xe97c('0x35')]=function(_0x34e6f7){var _0x4eb2a0=moment()[_0xe97c('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x34e6f7[_0xe97c('0x36')]=0xd;_0x34e6f7[_0xe97c('0x37')]=_0xe97c('0x38');_0x34e6f7['starttime']=_0x4eb2a0;_0x34e6f7[_0xe97c('0x39')]=_0x4eb2a0;_0x34e6f7[_0xe97c('0x3a')]=_0x4eb2a0;};exports[_0xe97c('0x3b')]=function(_0xc206e,_0x2c287c,_0x5e54f5){var _0x2aa954=moment()[_0xe97c('0x11')](_0xe97c('0x3c'));_0xc206e['state']=_0x2c287c;_0xc206e['statedesc']=_0x5e54f5;_0xc206e[_0xe97c('0x39')]=_0x2aa954;_0xc206e['ringtime']=getSeconds(_0xc206e[_0xe97c('0x39')],_0xc206e['starttime']);};exports['logLookAgent']=function(_0x5e2c11,_0x112ae7,_0x463d32){_0x5e2c11[_0xe97c('0x3d')]=_0x112ae7;_0x5e2c11[_0xe97c('0x3e')]=_0x463d32;};exports[_0xe97c('0x3f')]=function(_0x4ff87e,_0x2935dc,_0x5eb5cf){var _0x341fb8=moment()[_0xe97c('0x11')](_0xe97c('0x3c'));_0x4ff87e[_0xe97c('0x36')]=_0x2935dc;_0x4ff87e[_0xe97c('0x37')]=_0x5eb5cf;_0x4ff87e[_0xe97c('0x39')]=_0x4ff87e[_0xe97c('0x39')]?_0x4ff87e[_0xe97c('0x39')]:_0x341fb8;_0x4ff87e['endtime']=_0x4ff87e[_0xe97c('0x3a')]?_0x4ff87e[_0xe97c('0x3a')]:_0x341fb8;_0x4ff87e[_0xe97c('0x40')]=getSeconds(_0x4ff87e[_0xe97c('0x39')]||0x0,_0x4ff87e[_0xe97c('0x41')]||0x0);_0x4ff87e[_0xe97c('0x42')]=_0x4ff87e[_0xe97c('0x43')]?getSeconds(_0x4ff87e[_0xe97c('0x3a')],_0x4ff87e[_0xe97c('0x43')]):0x0;};exports[_0xe97c('0x44')]=function(_0x516605){return _0x516605===_0xe97c('0x45');};exports[_0xe97c('0x46')]=function(_0x4b04b0,_0x367f16,_0xaac554,_0x1bde24,_0x5b2b44){var _0x5bdc93=_0x1bde24?_0xe97c('0x47'):_0x4b04b0['calleridname'];_0x5bdc93=_0x5b2b44?_0xe97c('0x48'):_0x5bdc93;return{'actionid':_0x4b04b0[_0xe97c('0x49')],'action':_0xe97c('0x4a'),'channel':_0x4b04b0[_0xe97c('0x4b')],'callerid':util[_0xe97c('0x11')]('\x22%s\x22\x20<%s>',_0x5bdc93,_0x4b04b0[_0xe97c('0x19')]),'Exten':_0xe97c('0x27'),'Context':_0xe97c('0x4c'),'Priority':'1','variable':_0xaac554,'timeout':(_0x367f16[_0xe97c('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x4b04b0['uniqueid']};};exports[_0xe97c('0x4e')]=function(_0x3299d2){return _0x3299d2['countbusyretry']+_0x3299d2[_0xe97c('0x4f')]+_0x3299d2[_0xe97c('0x50')]+_0x3299d2['countagentrejectretry']+_0x3299d2['countnosuchnumberretry'];};exports[_0xe97c('0x51')]=function(_0x560fda){var _0x383ec6=_[_0xe97c('0x52')](_0x560fda);_0x383ec6[_0xe97c('0x36')]=0xf;_0x383ec6[_0xe97c('0x37')]=_0xe97c('0x53');return _0x383ec6;};exports[_0xe97c('0x54')]=function(_0x1fefe3,_0x4f7616,_0x44b3b8){var _0x2fd534={};_0x2fd534[_0x4f7616]=_0x1fefe3[_0x4f7616];_0x2fd534[_0xe97c('0x55')]=![];_0x2fd534[_0xe97c('0x56')]=moment()['add'](_0x44b3b8,'minutes')[_0xe97c('0x11')](_0xe97c('0x3c'));_0x2fd534[_0xe97c('0x1a')]=_0x1fefe3[_0xe97c('0x1a')];_0x2fd534['ListId']=_0x1fefe3['ListId'];_0x2fd534['VoiceQueueId']=_0x1fefe3[_0xe97c('0x1c')]||undefined;return _0x2fd534;};exports[_0xe97c('0x57')]=function(_0x6927f0,_0x35fcdf){if(!_[_0xe97c('0x13')](_0x6927f0)){if(_0x6927f0[_0xe97c('0x58')]>0x0){_0x6927f0[_0xe97c('0x58')]-=0x1;}else{logger[_0xe97c('0x33')](_0x35fcdf,_0xe97c('0x59'));}}else{logger[_0xe97c('0x33')](_0x35fcdf,_0xe97c('0x5a'));}};exports[_0xe97c('0x5b')]=function(_0x736858){if(_0x736858<=0x0){return!![];}return![];};exports[_0xe97c('0x5c')]=function(_0x4d8060,_0x7d60f9){_0x4d8060[_0xe97c('0x5d')]=_0x7d60f9;_0x4d8060[_0xe97c('0x16')]=_0x4d8060['queue'];_0x4d8060[_0xe97c('0x5e')]=_0x4d8060['channelAgent'];return _0x4d8060;};exports['buildAcw']=function(_0x3e0332){var _0xe51b3c={};_0xe51b3c[_0xe97c('0x5f')]=_0x3e0332['queue'];_0xe51b3c[_0xe97c('0x5e')]=_0x3e0332[_0xe97c('0x4b')];_0xe51b3c[_0xe97c('0x49')]=_0x3e0332[_0xe97c('0x49')];return _0xe51b3c;};exports['agentReadyId']=function(_0x5b83e8){var _0x476756=[];for(var _0x4e709f in _0x5b83e8){if(_0x5b83e8['hasOwnProperty'](_0x4e709f)){if(!_[_0xe97c('0x13')](_0x5b83e8[_0x4e709f])&&_0x5b83e8[_0x4e709f][_0xe97c('0x36')]===_0xe97c('0x60')&&_0x5b83e8[_0x4e709f]['status']===_0xe97c('0x61')){_0x476756['push'](_0x5b83e8[_0x4e709f]['id']);}}}return _0x476756;};exports['getDiff']=function(_0x57d1fb){var _0x4b7b2b=moment()[_0xe97c('0x6')](0x0);var _0xe1d605=moment(_0x57d1fb)[_0xe97c('0x6')](0x0);return _0x4b7b2b[_0xe97c('0x7')](_0xe1d605,_0xe97c('0x62'));};exports[_0xe97c('0x63')]=function(_0x38c4af){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x38c4af['ContactId'],'ListId':_0x38c4af['ListId'],'VoiceQueueId':_0x38c4af[_0xe97c('0x1c')]||undefined,'CampaignId':_0x38c4af[_0xe97c('0x64')]||undefined};};exports['filterKey']=function(_0x24fa64){if(_0x24fa64==='uniqueid'||_0x24fa64===_0xe97c('0x65')||_0x24fa64==='queue'||_0x24fa64===_0xe97c('0x66')||_0x24fa64==='campaigntype'||_0x24fa64===_0xe97c('0x67')||_0x24fa64===_0xe97c('0x3d')||_0x24fa64==='channelAgent'||_0x24fa64===_0xe97c('0x18')||_0x24fa64===_0xe97c('0x55')||_0x24fa64===_0xe97c('0x19')||_0x24fa64===_0xe97c('0x56')||_0x24fa64===_0xe97c('0x68')||_0x24fa64==='countcongestionretry'||_0x24fa64===_0xe97c('0x50')||_0x24fa64===_0xe97c('0x69')||_0x24fa64===_0xe97c('0x6a')||_0x24fa64==='callbackuniqueid'||_0x24fa64===_0xe97c('0x6b')||_0x24fa64===_0xe97c('0x6c')||_0x24fa64==='ContactId'||_0x24fa64===_0xe97c('0x6d')||_0x24fa64===_0xe97c('0x3e')||_0x24fa64===_0xe97c('0x1c')||_0x24fa64==='sipcallid'||_0x24fa64===_0xe97c('0x6e')||_0x24fa64===_0xe97c('0x6f')||_0x24fa64===_0xe97c('0x70')||_0x24fa64===_0xe97c('0x71')||_0x24fa64===_0xe97c('0x72')||_0x24fa64===_0xe97c('0x73')||_0x24fa64===_0xe97c('0x74')||_0x24fa64===_0xe97c('0x75')||_0x24fa64===_0xe97c('0x76')||_0x24fa64===_0xe97c('0x77')||_0x24fa64===_0xe97c('0x78')||_0x24fa64===_0xe97c('0x79')||_0x24fa64==='xmd-agiafter'||_0x24fa64==='xmd-agi'||_0x24fa64==='rtpaudioqos'||_0x24fa64===_0xe97c('0x7a')||_0x24fa64===_0xe97c('0x7b')||_0x24fa64===_0xe97c('0x7c')||_0x24fa64===_0xe97c('0x7d')||_0x24fa64==='rtpaudioqoslossbridged'||_0x24fa64==='rtpaudioqosrtt'||_0x24fa64===_0xe97c('0x7e')||_0x24fa64===_0xe97c('0x7f')||_0x24fa64===_0xe97c('0x7a')||_0x24fa64==='rtpaudioqosjitter'||_0x24fa64==='rtpaudioqosjitterbridged'||_0x24fa64===_0xe97c('0x7d')||_0x24fa64==='rtpaudioqoslossbridged'||_0x24fa64==='rtpaudioqosrtt'||_0x24fa64===_0xe97c('0x7e')||_0x24fa64===_0xe97c('0x80')||_0x24fa64===_0xe97c('0x81')||_0x24fa64===_0xe97c('0x36')||_0x24fa64===_0xe97c('0x37')){return![];}return!![];};exports[_0xe97c('0x82')]=function(_0x1b5f96,_0x125e57){var _0x489285,_0x565216,_0x4a4655;if(_0x125e57<=0x0){_0x125e57=0x1;}_0x489285=new RegExp('\x5cw{0,'+_0x125e57+'}$');_0x565216=Math[_0xe97c('0x83')](0xa,_0x125e57-0x1);_0x4a4655=Math[_0xe97c('0x83')](0xa,_0x125e57)-0x1;return util[_0xe97c('0x11')]('%s',_['replace'](_0x1b5f96,_0x489285,_['random'](_0x565216,_0x4a4655)));};exports[_0xe97c('0x84')]=function(_0x365b4e){var _0x31f2fa=_0x365b4e[_0xe97c('0x85')](/"(.*?)"/);return _0x31f2fa?_0x31f2fa[0x1]:_0x365b4e;};exports['extractCalleridNumber']=function(_0x226b5c){var _0x5b80a3=_0x226b5c['match'](/<(.*?)>/);return _0x5b80a3?_0x5b80a3[0x1]:_0x226b5c;};
\ No newline at end of file