Built motion from commit (unavailable).|2.5.5
[motion2.git] / server / services / ami / preview / util / util.js
index e87206b..874032c 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 _0xa467=['pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','queue','interface','buildAcw','agentReadyId','not_inuse','status','getDiff','filterKey','idContact','type','campaigntype','dialAnswer','countcongestionretry','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqos','rtpaudioqoslossbridged','bridgepeer','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','isActive','addVariables','Queue','name','calleridnum','ContactId','VoiceQueueId','format','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','isNil','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','membername','UserId','talktime','answertime','isFailure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','countbusyretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink'];(function(_0x2d40e5,_0x45ada9){var _0x2736e6=function(_0x120a02){while(--_0x120a02){_0x2d40e5['push'](_0x2d40e5['shift']());}};_0x2736e6(++_0x45ada9);}(_0xa467,0x143));var _0x7a46=function(_0x17e818,_0x4728d6){_0x17e818=_0x17e818-0x0;var _0x2aad51=_0xa467[_0x17e818];return _0x2aad51;};'use strict';var util=require(_0x7a46('0x0'));var _=require(_0x7a46('0x1'));var moment=require(_0x7a46('0x2'));var logger=require(_0x7a46('0x3'))(_0x7a46('0x4'));var ipAgi=process[_0x7a46('0x5')][_0x7a46('0x6')]||_0x7a46('0x7');function getSeconds(_0x119b5b,_0x48b9d9){var _0x4e2693=moment(_0x119b5b)[_0x7a46('0x8')](0x0);var _0x1940e6=moment(_0x48b9d9)[_0x7a46('0x8')](0x0);return _0x4e2693[_0x7a46('0x9')](_0x1940e6,_0x7a46('0xa'));}exports['loggerCatch']=function(_0x341d9e){return function(_0x1f8b07){logger[_0x7a46('0xb')](_0x341d9e,util[_0x7a46('0xc')](_0x1f8b07,{'showHidden':![],'depth':null}));};};exports[_0x7a46('0xd')]=function(_0x334af5,_0x594627){logger[_0x7a46('0xe')](_0x334af5,util['inspect'](_0x594627,{'showHidden':![],'depth':null}));};exports[_0x7a46('0xf')]=function(_0x555f7a,_0x612ed3){logger[_0x7a46('0xb')](_0x555f7a,util[_0x7a46('0xc')](_0x612ed3,{'showHidden':![],'depth':null}));};exports[_0x7a46('0x10')]=function(_0x4372d4){return function(_0x5da2d3){logger[_0x7a46('0xe')](_0x4372d4,util[_0x7a46('0xc')](_0x5da2d3,{'showHidden':![],'depth':null}));};};exports[_0x7a46('0x11')]=function(_0x32f9a3,_0x22d3c1,_0x571a46){return{'message':_0x32f9a3,'unlock':_0x22d3c1,'active':_0x571a46};};exports[_0x7a46('0x12')]=function(_0x53fd6a,_0x5a50df,_0x46c5a3){if(!_[_0x7a46('0x13')](_0x46c5a3)&&'string'===typeof _0x46c5a3&&!_[_0x7a46('0x14')](_0x46c5a3)){if(!_['isUndefined'](_0x5a50df)&&_0x7a46('0x15')===typeof _0x5a50df&&!_[_0x7a46('0x14')](_0x5a50df)){return util['format'](_0x7a46('0x16'),_0x5a50df,_0x46c5a3);}return util['format'](_0x7a46('0x16'),_0x46c5a3,_0x46c5a3);}if(!_[_0x7a46('0x13')](_0x53fd6a)&&_0x7a46('0x15')===typeof _0x53fd6a&&!_[_0x7a46('0x14')](_0x53fd6a)){return _0x53fd6a;}return'\x22\x22\x20<>';};exports[_0x7a46('0x17')]=function(_0x1c3dae){if(_['isNil'](_0x1c3dae)){return![];}return _0x1c3dae;};exports[_0x7a46('0x18')]=function(_0x1e6887,_0x4a301b,_0x5c2c60,_0x2cb5b3,_0x1d5766,_0x234db3){var _0x23d54e={'XMD-QUEUE':_0x4a301b['Queue']?_0x4a301b[_0x7a46('0x19')][_0x7a46('0x1a')]:'','XMD-CALLERID':_0x2cb5b3,'XMD-CALLERID-PREVIEW':_0x234db3?util['format']('\x22%s\x22\x20<%s>',_0x234db3['calleridname'],_0x234db3[_0x7a46('0x1b')]):_0x2cb5b3,'XMD-DIALID':_0x1d5766,'XMD-CONTACTID':_0x4a301b[_0x7a46('0x1c')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2cb5b3,'XMD-VOICEQUEUEID':_0x4a301b[_0x7a46('0x1d')],'XMD-DIALCHANNEL':_0x5c2c60,'XMD-DIALTIMEOUT':_0x1e6887['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x7a46('0x1e')](_0x7a46('0x1f'),_0x1e6887['dialQueueProject2']?'g':'',_[_0x7a46('0x14')](_0x1e6887[_0x7a46('0x20')])?'':_0x7a46('0x21')),'XMD-DIALURL':_0x1e6887[_0x7a46('0x22')]||'','XMD-AGI':_0x1e6887[_0x7a46('0x23')]?util[_0x7a46('0x1e')](_0x7a46('0x24'),ipAgi,_0x1e6887['dialQueueProject']):_0x7a46('0x25'),'XMD-AGIAFTER':_0x1e6887[_0x7a46('0x26')]?util[_0x7a46('0x1e')](_0x7a46('0x24'),ipAgi,_0x1e6887[_0x7a46('0x26')]):_0x7a46('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x234db3?_0x234db3[_0x7a46('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x234db3?_0x234db3['originatecalleridname']:'','XMD-DESTINATION':_0x7a46('0x28')};if(!_[_0x7a46('0x14')](_0x1e6887[_0x7a46('0x20')])){_0x23d54e[util[_0x7a46('0x1e')]('%s',_0x7a46('0x29'))]=_0x1e6887['monitor_format'];_0x23d54e[util[_0x7a46('0x1e')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1d5766;}if(_0x4a301b&&_0x4a301b['Contact']){for(var _0x29ac6a in _0x4a301b[_0x7a46('0x2a')]){if(_0x4a301b[_0x7a46('0x2a')][_0x7a46('0x2b')](_0x29ac6a)){if(!_[_0x7a46('0x2c')](_0x4a301b['Contact'][_0x29ac6a])&&_0x29ac6a!=='id'&&_0x29ac6a!=='tags'&&_0x29ac6a!==_0x7a46('0x2d')&&_0x29ac6a!==_0x7a46('0x2e')){_0x23d54e[util[_0x7a46('0x1e')]('%s%s',_0x7a46('0x2f'),_[_0x7a46('0x30')](_0x29ac6a))]=_0x4a301b[_0x7a46('0x2a')][_0x29ac6a];}}}}return _0x23d54e;};exports[_0x7a46('0x31')]=function(_0x21cea7){var _0x1fbf36={};for(var _0x321e18 in _0x21cea7){if(_0x21cea7[_0x7a46('0x2b')](_0x321e18)){_0x1fbf36[util[_0x7a46('0x1e')]('%s',_[_0x7a46('0x32')](_0x321e18))]=_0x21cea7[_0x321e18];}}return{'variables':_0x1fbf36};};exports[_0x7a46('0x33')]=function(_0x208ea0,_0x7c2014){if(!_[_0x7a46('0x2c')](_0x208ea0)){if(_0x208ea0[_0x7a46('0x2b')](_0x7a46('0x34'))){if(_0x208ea0['originated']>0x0){_0x208ea0['originated']-=0x1;}else{logger[_0x7a46('0xb')](_0x7a46('0x35'),_0x7c2014);}}}else{logger[_0x7a46('0xb')](_0x7a46('0x36'),_0x7c2014);}};exports['logBlacklist']=function(_0x1a0d6a){var _0x3e2a2f=moment()['format'](_0x7a46('0x37'));_0x1a0d6a[_0x7a46('0x38')]=0xd;_0x1a0d6a[_0x7a46('0x39')]='Blacklist';_0x1a0d6a['starttime']=_0x3e2a2f;_0x1a0d6a[_0x7a46('0x3a')]=_0x3e2a2f;_0x1a0d6a[_0x7a46('0x3b')]=_0x3e2a2f;};exports[_0x7a46('0x3c')]=function(_0x2d29c6,_0x1f034e,_0x3c5e23){var _0x3cfbb7=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2d29c6[_0x7a46('0x38')]=_0x1f034e;_0x2d29c6[_0x7a46('0x39')]=_0x3c5e23;_0x2d29c6['responsetime']=_0x3cfbb7;_0x2d29c6[_0x7a46('0x3d')]=getSeconds(_0x2d29c6[_0x7a46('0x3a')],_0x2d29c6[_0x7a46('0x3e')]);};exports[_0x7a46('0x3f')]=function(_0x20500a,_0x3630a2,_0x7b67da){_0x20500a[_0x7a46('0x40')]=_0x3630a2;_0x20500a[_0x7a46('0x41')]=_0x7b67da;};exports['logCustomer']=function(_0x332ba0,_0x34c63e,_0x365867){var _0x21ba36=moment()[_0x7a46('0x1e')](_0x7a46('0x37'));_0x332ba0['state']=_0x34c63e;_0x332ba0[_0x7a46('0x39')]=_0x365867;_0x332ba0[_0x7a46('0x3a')]=_0x332ba0['responsetime']?_0x332ba0[_0x7a46('0x3a')]:_0x21ba36;_0x332ba0['endtime']=_0x332ba0[_0x7a46('0x3b')]?_0x332ba0[_0x7a46('0x3b')]:_0x21ba36;_0x332ba0[_0x7a46('0x3d')]=getSeconds(_0x332ba0[_0x7a46('0x3a')]||0x0,_0x332ba0[_0x7a46('0x3e')]||0x0);_0x332ba0[_0x7a46('0x42')]=_0x332ba0[_0x7a46('0x43')]?getSeconds(_0x332ba0['endtime'],_0x332ba0[_0x7a46('0x43')]):0x0;};exports[_0x7a46('0x44')]=function(_0x3b1206){return _0x3b1206==='Failure';};exports[_0x7a46('0x45')]=function(_0x21759c,_0xc563d8,_0x49faa4,_0x1b9dc0,_0x2a0bac){var _0x4719c0=_0x1b9dc0?_0x7a46('0x46'):_0x21759c['calleridname'];_0x4719c0=_0x2a0bac?'BOOKED':_0x4719c0;return{'actionid':_0x21759c[_0x7a46('0x47')],'action':_0x7a46('0x48'),'channel':_0x21759c[_0x7a46('0x49')],'callerid':util[_0x7a46('0x1e')]('\x22%s\x22\x20<%s>',_0x4719c0,_0x21759c[_0x7a46('0x1b')]),'Exten':_0x7a46('0x28'),'Context':_0x7a46('0x4a'),'Priority':'1','variable':_0x49faa4,'timeout':(_0xc563d8[_0x7a46('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x21759c[_0x7a46('0x47')]};};exports['totalGlobal']=function(_0x3b8bc7){return _0x3b8bc7[_0x7a46('0x4c')]+_0x3b8bc7['countcongestionretry']+_0x3b8bc7[_0x7a46('0x4d')]+_0x3b8bc7['countagentrejectretry']+_0x3b8bc7['countnosuchnumberretry'];};exports[_0x7a46('0x4e')]=function(_0x54f129){var _0x586eaa=_[_0x7a46('0x4f')](_0x54f129);_0x586eaa[_0x7a46('0x38')]=0xf;_0x586eaa[_0x7a46('0x39')]=_0x7a46('0x50');return _0x586eaa;};exports[_0x7a46('0x51')]=function(_0x1bb3cb,_0xafef25,_0x31d265){var _0x596fbe={};_0x596fbe[_0xafef25]=_0x1bb3cb[_0xafef25];_0x596fbe[_0x7a46('0x52')]=![];_0x596fbe[_0x7a46('0x53')]=moment()[_0x7a46('0x54')](_0x31d265,_0x7a46('0x55'))[_0x7a46('0x1e')](_0x7a46('0x37'));_0x596fbe['ContactId']=_0x1bb3cb[_0x7a46('0x1c')];_0x596fbe[_0x7a46('0x56')]=_0x1bb3cb['ListId'];_0x596fbe['VoiceQueueId']=_0x1bb3cb[_0x7a46('0x1d')]||undefined;return _0x596fbe;};exports[_0x7a46('0x57')]=function(_0x5c0012,_0x21e263){if(!_[_0x7a46('0x2c')](_0x5c0012)){if(_0x5c0012[_0x7a46('0x58')]>0x0){_0x5c0012[_0x7a46('0x58')]-=0x1;}else{logger[_0x7a46('0xb')](_0x21e263,_0x7a46('0x59'));}}else{logger[_0x7a46('0xb')](_0x21e263,_0x7a46('0x5a'));}};exports[_0x7a46('0x5b')]=function(_0x135076){if(_0x135076<=0x0){return!![];}return![];};exports[_0x7a46('0x5c')]=function(_0x199ddd,_0x278315){_0x199ddd['lastevent']=_0x278315;_0x199ddd[_0x7a46('0x1a')]=_0x199ddd[_0x7a46('0x5d')];_0x199ddd[_0x7a46('0x5e')]=_0x199ddd[_0x7a46('0x49')];return _0x199ddd;};exports[_0x7a46('0x5f')]=function(_0x553869){var _0x266cb6={};_0x266cb6[_0x7a46('0x5d')]=_0x553869[_0x7a46('0x5d')];_0x266cb6['interface']=_0x553869[_0x7a46('0x49')];_0x266cb6[_0x7a46('0x47')]=_0x553869['uniqueid'];return _0x266cb6;};exports[_0x7a46('0x60')]=function(_0x10607a){var _0x2a2f66=[];for(var _0x39c878 in _0x10607a){if(_0x10607a[_0x7a46('0x2b')](_0x39c878)){if(!_['isNil'](_0x10607a[_0x39c878])&&_0x10607a[_0x39c878][_0x7a46('0x38')]===_0x7a46('0x61')&&_0x10607a[_0x39c878][_0x7a46('0x62')]==='reachable'){_0x2a2f66['push'](_0x10607a[_0x39c878]['id']);}}}return _0x2a2f66;};exports[_0x7a46('0x63')]=function(_0x1546c1){var _0x33b0ea=moment()[_0x7a46('0x8')](0x0);var _0x1eebc8=moment(_0x1546c1)[_0x7a46('0x8')](0x0);return _0x33b0ea[_0x7a46('0x9')](_0x1eebc8,_0x7a46('0xa'));};exports['createBody']=function(_0x20225b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x20225b['ContactId'],'ListId':_0x20225b['ListId'],'VoiceQueueId':_0x20225b['VoiceQueueId']||undefined,'CampaignId':_0x20225b['CampaignId']||undefined};};exports[_0x7a46('0x64')]=function(_0x385da9){if(_0x385da9===_0x7a46('0x47')||_0x385da9===_0x7a46('0x65')||_0x385da9==='queue'||_0x385da9===_0x7a46('0x66')||_0x385da9===_0x7a46('0x67')||_0x385da9===_0x7a46('0x68')||_0x385da9===_0x7a46('0x40')||_0x385da9===_0x7a46('0x49')||_0x385da9==='calleridname'||_0x385da9===_0x7a46('0x52')||_0x385da9===_0x7a46('0x1b')||_0x385da9===_0x7a46('0x53')||_0x385da9===_0x7a46('0x4c')||_0x385da9===_0x7a46('0x69')||_0x385da9===_0x7a46('0x4d')||_0x385da9==='countglobal'||_0x385da9==='callback'||_0x385da9===_0x7a46('0x6a')||_0x385da9===_0x7a46('0x6b')||_0x385da9===_0x7a46('0x6c')||_0x385da9===_0x7a46('0x1c')||_0x385da9===_0x7a46('0x56')||_0x385da9===_0x7a46('0x41')||_0x385da9==='VoiceQueueId'||_0x385da9===_0x7a46('0x6d')||_0x385da9==='xmd-voicequeueid'||_0x385da9===_0x7a46('0x6e')||_0x385da9===_0x7a46('0x6f')||_0x385da9===_0x7a46('0x70')||_0x385da9==='xmd-dialurl'||_0x385da9===_0x7a46('0x71')||_0x385da9===_0x7a46('0x72')||_0x385da9===_0x7a46('0x73')||_0x385da9===_0x7a46('0x74')||_0x385da9===_0x7a46('0x75')||_0x385da9===_0x7a46('0x76')||_0x385da9===_0x7a46('0x77')||_0x385da9===_0x7a46('0x78')||_0x385da9===_0x7a46('0x79')||_0x385da9==='rtpaudioqos'||_0x385da9===_0x7a46('0x7a')||_0x385da9===_0x7a46('0x7b')||_0x385da9===_0x7a46('0x7c')||_0x385da9===_0x7a46('0x7d')||_0x385da9==='rtpaudioqoslossbridged'||_0x385da9===_0x7a46('0x7e')||_0x385da9==='rtpaudioqosrttbridged'||_0x385da9===_0x7a46('0x7f')||_0x385da9===_0x7a46('0x7a')||_0x385da9===_0x7a46('0x7b')||_0x385da9===_0x7a46('0x7c')||_0x385da9===_0x7a46('0x7d')||_0x385da9===_0x7a46('0x80')||_0x385da9===_0x7a46('0x7e')||_0x385da9==='rtpaudioqosrttbridged'||_0x385da9===_0x7a46('0x81')||_0x385da9==='bridgepvtcallid'||_0x385da9===_0x7a46('0x38')||_0x385da9===_0x7a46('0x39')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x50a2fd,_0x1ede39){var _0x5488fb,_0x1df69d,_0x4c4460;if(_0x1ede39<=0x0){_0x1ede39=0x1;}_0x5488fb=new RegExp(_0x7a46('0x82')+_0x1ede39+'}$');_0x1df69d=Math[_0x7a46('0x83')](0xa,_0x1ede39-0x1);_0x4c4460=Math[_0x7a46('0x83')](0xa,_0x1ede39)-0x1;return util['format']('%s',_[_0x7a46('0x84')](_0x50a2fd,_0x5488fb,_[_0x7a46('0x85')](_0x1df69d,_0x4c4460)));};exports[_0x7a46('0x86')]=function(_0x41f386){var _0x336bee=_0x41f386['match'](/"(.*?)"/);return _0x336bee?_0x336bee[0x1]:_0x41f386;};exports[_0x7a46('0x87')]=function(_0x3b5676){var _0x2fe218=_0x3b5676[_0x7a46('0x88')](/<(.*?)>/);return _0x2fe218?_0x2fe218[0x1]:_0x3b5676;};
\ No newline at end of file