Built motion from commit (unavailable).|2.5.26
[motion2.git] / server / services / ami / preview / util / util.js
index 9975a7f..b6c1753 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34d3=['campaigntype','membername','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','bridgepeer','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','logger','inspect','info','message','getCallerId','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','XMD-','toUpper','toLowerVariables','toLower','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','state','ringtime','logLookAgent','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','mandatoryDisposition','buildAcw','interface','agentReadyId','not_inuse','status','reachable','push','filterKey','idContact','type'];(function(_0x369a19,_0x1bfc40){var _0x47fae6=function(_0x4ae4a7){while(--_0x4ae4a7){_0x369a19['push'](_0x369a19['shift']());}};_0x47fae6(++_0x1bfc40);}(_0x34d3,0xae));var _0x334d=function(_0xdd56f0,_0x469515){_0xdd56f0=_0xdd56f0-0x0;var _0x236550=_0x34d3[_0xdd56f0];return _0x236550;};'use strict';var util=require(_0x334d('0x0'));var _=require(_0x334d('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x334d('0x2'));var ipAgi=process[_0x334d('0x3')][_0x334d('0x4')]||_0x334d('0x5');function getSeconds(_0x287993,_0x19b409){var _0x5d7272=moment(_0x287993)[_0x334d('0x6')](0x0);var _0x4653dc=moment(_0x19b409)[_0x334d('0x6')](0x0);return _0x5d7272[_0x334d('0x7')](_0x4653dc,_0x334d('0x8'));}exports['loggerCatch']=function(_0x13abeb){return function(_0x2b6f58){logger[_0x334d('0x9')](_0x13abeb,util['inspect'](_0x2b6f58,{'showHidden':![],'depth':null}));};};exports[_0x334d('0xa')]=function(_0x3804b7,_0x4cc137){logger['info'](_0x3804b7,util['inspect'](_0x4cc137,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x3cefd1,_0x45085b){logger[_0x334d('0x9')](_0x3cefd1,util[_0x334d('0xb')](_0x45085b,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x3d39db){return function(_0x45c661){logger[_0x334d('0xc')](_0x3d39db,util[_0x334d('0xb')](_0x45c661,{'showHidden':![],'depth':null}));};};exports[_0x334d('0xd')]=function(_0x5e5638,_0x2cd277,_0x2f3530){return{'message':_0x5e5638,'unlock':_0x2cd277,'active':_0x2f3530};};exports[_0x334d('0xe')]=function(_0x3dcb69,_0x29d43a,_0x53e5c9){if(!_['isUndefined'](_0x53e5c9)&&_0x334d('0xf')===typeof _0x53e5c9&&!_[_0x334d('0x10')](_0x53e5c9)){if(!_['isUndefined'](_0x29d43a)&&_0x334d('0xf')===typeof _0x29d43a&&!_[_0x334d('0x10')](_0x29d43a)){return util['format'](_0x334d('0x11'),_0x29d43a,_0x53e5c9);}return util[_0x334d('0x12')]('\x22%s\x22\x20<%s>',_0x53e5c9,_0x53e5c9);}if(!_['isUndefined'](_0x3dcb69)&&_0x334d('0xf')===typeof _0x3dcb69&&!_[_0x334d('0x10')](_0x3dcb69)){return _0x3dcb69;}return _0x334d('0x13');};exports['isActive']=function(_0x497fa0){if(_['isNil'](_0x497fa0)){return![];}return _0x497fa0;};exports['addVariables']=function(_0x57a91e,_0x5ffab8,_0x51c13a,_0x2ada05,_0x4450f7,_0x37192a){var _0x368282={'XMD-QUEUE':_0x5ffab8[_0x334d('0x14')]?_0x5ffab8[_0x334d('0x14')][_0x334d('0x15')]:'','XMD-CALLERID':_0x2ada05,'XMD-CALLERID-PREVIEW':_0x37192a?util[_0x334d('0x12')](_0x334d('0x11'),_0x37192a[_0x334d('0x16')],_0x37192a[_0x334d('0x17')]):_0x2ada05,'XMD-DIALID':_0x4450f7,'XMD-CONTACTID':_0x5ffab8[_0x334d('0x18')],'XMD-CDRTYPE':_0x334d('0x19'),'CALLERID(all)':_0x2ada05,'XMD-VOICEQUEUEID':_0x5ffab8['VoiceQueueId'],'XMD-DIALCHANNEL':_0x51c13a,'XMD-DIALTIMEOUT':_0x57a91e[_0x334d('0x1a')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x334d('0x1b'),_0x57a91e['dialQueueProject2']?'g':'',_[_0x334d('0x10')](_0x57a91e[_0x334d('0x1c')])?'':_0x334d('0x1d')),'XMD-DIALURL':_0x57a91e[_0x334d('0x1e')]||'','XMD-AGI':_0x57a91e[_0x334d('0x1f')]?util[_0x334d('0x12')](_0x334d('0x20'),ipAgi,_0x57a91e['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x57a91e[_0x334d('0x21')]?util[_0x334d('0x12')](_0x334d('0x20'),ipAgi,_0x57a91e[_0x334d('0x21')]):_0x334d('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x37192a?_0x37192a[_0x334d('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x37192a?_0x37192a[_0x334d('0x24')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x334d('0x10')](_0x57a91e[_0x334d('0x1c')])){_0x368282[util['format']('%s',_0x334d('0x25'))]=_0x57a91e['monitor_format'];_0x368282[util[_0x334d('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x4450f7;}if(_0x5ffab8&&_0x5ffab8[_0x334d('0x26')]){for(var _0x5f1744 in _0x5ffab8[_0x334d('0x26')]){if(_0x5ffab8[_0x334d('0x26')][_0x334d('0x27')](_0x5f1744)){if(!_['isNil'](_0x5ffab8[_0x334d('0x26')][_0x5f1744])&&_0x5f1744!=='id'&&_0x5f1744!=='tags'&&_0x5f1744!==_0x334d('0x28')&&_0x5f1744!==_0x334d('0x29')){_0x368282[util['format']('%s%s',_0x334d('0x2a'),_[_0x334d('0x2b')](_0x5f1744))]=_0x5ffab8[_0x334d('0x26')][_0x5f1744];}}}}return _0x368282;};exports[_0x334d('0x2c')]=function(_0x3194bb){var _0x41fd2e={};for(var _0x155c0c in _0x3194bb){if(_0x3194bb[_0x334d('0x27')](_0x155c0c)){_0x41fd2e[util[_0x334d('0x12')]('%s',_[_0x334d('0x2d')](_0x155c0c))]=_0x3194bb[_0x155c0c];}}return{'variables':_0x41fd2e};};exports['updateOriginated']=function(_0x30f6bf,_0x476685){if(!_[_0x334d('0x2e')](_0x30f6bf)){if(_0x30f6bf[_0x334d('0x27')](_0x334d('0x2f'))){if(_0x30f6bf[_0x334d('0x2f')]>0x0){_0x30f6bf[_0x334d('0x2f')]-=0x1;}else{logger[_0x334d('0x9')](_0x334d('0x30'),_0x476685);}}}else{logger[_0x334d('0x9')](_0x334d('0x31'),_0x476685);}};exports[_0x334d('0x32')]=function(_0x59c848){var _0x243b61=moment()['format'](_0x334d('0x33'));_0x59c848['state']=0xd;_0x59c848[_0x334d('0x34')]=_0x334d('0x35');_0x59c848[_0x334d('0x36')]=_0x243b61;_0x59c848[_0x334d('0x37')]=_0x243b61;_0x59c848[_0x334d('0x38')]=_0x243b61;};exports[_0x334d('0x39')]=function(_0x158738,_0x4d98f0,_0x243278){var _0x5e6f9a=moment()[_0x334d('0x12')](_0x334d('0x33'));_0x158738[_0x334d('0x3a')]=_0x4d98f0;_0x158738['statedesc']=_0x243278;_0x158738[_0x334d('0x37')]=_0x5e6f9a;_0x158738[_0x334d('0x3b')]=getSeconds(_0x158738[_0x334d('0x37')],_0x158738['starttime']);};exports[_0x334d('0x3c')]=function(_0x2ad47c,_0x5a941e,_0x12a205){_0x2ad47c['membername']=_0x5a941e;_0x2ad47c[_0x334d('0x3d')]=_0x12a205;};exports[_0x334d('0x3e')]=function(_0x8dae,_0x2e4f98,_0x549123){var _0xeffe7=moment()[_0x334d('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x8dae[_0x334d('0x3a')]=_0x2e4f98;_0x8dae[_0x334d('0x34')]=_0x549123;_0x8dae[_0x334d('0x37')]=_0x8dae[_0x334d('0x37')]?_0x8dae[_0x334d('0x37')]:_0xeffe7;_0x8dae[_0x334d('0x38')]=_0x8dae[_0x334d('0x38')]?_0x8dae[_0x334d('0x38')]:_0xeffe7;_0x8dae[_0x334d('0x3b')]=getSeconds(_0x8dae[_0x334d('0x37')]||0x0,_0x8dae['starttime']||0x0);_0x8dae[_0x334d('0x3f')]=_0x8dae[_0x334d('0x40')]?getSeconds(_0x8dae[_0x334d('0x38')],_0x8dae[_0x334d('0x40')]):0x0;};exports[_0x334d('0x41')]=function(_0x6375b2){return _0x6375b2===_0x334d('0x42');};exports[_0x334d('0x43')]=function(_0x3c43eb,_0x379734,_0x134c2e,_0x198ff4,_0x5df86c){var _0x65ec98=_0x198ff4?'RECALL':_0x3c43eb[_0x334d('0x16')];_0x65ec98=_0x5df86c?'BOOKED':_0x65ec98;return{'actionid':_0x3c43eb[_0x334d('0x44')],'action':_0x334d('0x45'),'channel':_0x3c43eb[_0x334d('0x46')],'callerid':util[_0x334d('0x12')](_0x334d('0x11'),_0x65ec98,_0x3c43eb[_0x334d('0x17')]),'Exten':_0x334d('0x47'),'Context':_0x334d('0x48'),'Priority':'1','variable':_0x134c2e,'timeout':(_0x379734['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3c43eb[_0x334d('0x44')]};};exports['totalGlobal']=function(_0x28e46a){return _0x28e46a[_0x334d('0x49')]+_0x28e46a[_0x334d('0x4a')]+_0x28e46a[_0x334d('0x4b')]+_0x28e46a[_0x334d('0x4c')]+_0x28e46a[_0x334d('0x4d')];};exports[_0x334d('0x4e')]=function(_0x17ed38){var _0x3515c0=_[_0x334d('0x4f')](_0x17ed38);_0x3515c0[_0x334d('0x3a')]=0xf;_0x3515c0[_0x334d('0x34')]=_0x334d('0x50');return _0x3515c0;};exports[_0x334d('0x51')]=function(_0x33d1cb,_0x173c74,_0x4ff294){var _0x3ba2d9={};_0x3ba2d9[_0x173c74]=_0x33d1cb[_0x173c74];_0x3ba2d9[_0x334d('0x52')]=![];_0x3ba2d9[_0x334d('0x53')]=moment()[_0x334d('0x54')](_0x4ff294,_0x334d('0x55'))['format'](_0x334d('0x33'));_0x3ba2d9['ContactId']=_0x33d1cb[_0x334d('0x18')];_0x3ba2d9[_0x334d('0x56')]=_0x33d1cb['ListId'];_0x3ba2d9[_0x334d('0x57')]=_0x33d1cb['VoiceQueueId']||undefined;return _0x3ba2d9;};exports[_0x334d('0x58')]=function(_0x38f51a,_0x29354f){if(!_[_0x334d('0x2e')](_0x38f51a)){if(_0x38f51a[_0x334d('0x59')]>0x0){_0x38f51a[_0x334d('0x59')]-=0x1;}else{logger[_0x334d('0x9')](_0x29354f,_0x334d('0x5a'));}}else{logger[_0x334d('0x9')](_0x29354f,_0x334d('0x5b'));}};exports['IsNotLoggedIn']=function(_0x46600e){if(_0x46600e<=0x0){return!![];}return![];};exports[_0x334d('0x5c')]=function(_0x2c7939,_0x199c98,_0x50a7e0){_0x2c7939[_0x334d('0x5d')]=_0x199c98;_0x2c7939['name']=_0x2c7939[_0x334d('0x5e')];_0x2c7939['interface']=_0x2c7939[_0x334d('0x46')];if(_0x50a7e0){_0x2c7939[_0x334d('0x5f')]=_0x50a7e0['mandatoryDisposition'];}return _0x2c7939;};exports[_0x334d('0x60')]=function(_0x4e9d73){var _0x1a1832={};_0x1a1832['queue']=_0x4e9d73[_0x334d('0x5e')];_0x1a1832[_0x334d('0x61')]=_0x4e9d73[_0x334d('0x46')];_0x1a1832[_0x334d('0x44')]=_0x4e9d73['uniqueid'];return _0x1a1832;};exports[_0x334d('0x62')]=function(_0x1c3ca3){var _0x2100ef=[];for(var _0x586608 in _0x1c3ca3){if(_0x1c3ca3[_0x334d('0x27')](_0x586608)){if(!_[_0x334d('0x2e')](_0x1c3ca3[_0x586608])&&_0x1c3ca3[_0x586608][_0x334d('0x3a')]===_0x334d('0x63')&&_0x1c3ca3[_0x586608][_0x334d('0x64')]===_0x334d('0x65')){_0x2100ef[_0x334d('0x66')](_0x1c3ca3[_0x586608]['id']);}}}return _0x2100ef;};exports['getDiff']=function(_0x263bb5){var _0x5dfac9=moment()['milliseconds'](0x0);var _0x35d47b=moment(_0x263bb5)['milliseconds'](0x0);return _0x5dfac9[_0x334d('0x7')](_0x35d47b,_0x334d('0x8'));};exports['createBody']=function(_0x2b22c5){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2b22c5[_0x334d('0x18')],'ListId':_0x2b22c5[_0x334d('0x56')],'VoiceQueueId':_0x2b22c5[_0x334d('0x57')]||undefined,'CampaignId':_0x2b22c5['CampaignId']||undefined};};exports[_0x334d('0x67')]=function(_0xcb17ed){if(_0xcb17ed===_0x334d('0x44')||_0xcb17ed===_0x334d('0x68')||_0xcb17ed===_0x334d('0x5e')||_0xcb17ed===_0x334d('0x69')||_0xcb17ed===_0x334d('0x6a')||_0xcb17ed==='dialAnswer'||_0xcb17ed===_0x334d('0x6b')||_0xcb17ed==='channelAgent'||_0xcb17ed===_0x334d('0x16')||_0xcb17ed==='active'||_0xcb17ed==='calleridnum'||_0xcb17ed===_0x334d('0x53')||_0xcb17ed===_0x334d('0x49')||_0xcb17ed===_0x334d('0x4a')||_0xcb17ed===_0x334d('0x4b')||_0xcb17ed===_0x334d('0x6c')||_0xcb17ed===_0x334d('0x6d')||_0xcb17ed==='callbackuniqueid'||_0xcb17ed===_0x334d('0x6e')||_0xcb17ed===_0x334d('0x6f')||_0xcb17ed==='ContactId'||_0xcb17ed===_0x334d('0x56')||_0xcb17ed===_0x334d('0x3d')||_0xcb17ed==='VoiceQueueId'||_0xcb17ed===_0x334d('0x70')||_0xcb17ed===_0x334d('0x71')||_0xcb17ed===_0x334d('0x72')||_0xcb17ed==='xmd-phone'||_0xcb17ed===_0x334d('0x73')||_0xcb17ed===_0x334d('0x74')||_0xcb17ed===_0x334d('0x75')||_0xcb17ed===_0x334d('0x76')||_0xcb17ed===_0x334d('0x77')||_0xcb17ed===_0x334d('0x78')||_0xcb17ed==='xmd-contactid'||_0xcb17ed===_0x334d('0x79')||_0xcb17ed===_0x334d('0x7a')||_0xcb17ed===_0x334d('0x7b')||_0xcb17ed===_0x334d('0x7c')||_0xcb17ed===_0x334d('0x7d')||_0xcb17ed===_0x334d('0x7e')||_0xcb17ed===_0x334d('0x7f')||_0xcb17ed==='rtpaudioqosjitterbridged'||_0xcb17ed===_0x334d('0x80')||_0xcb17ed===_0x334d('0x81')||_0xcb17ed===_0x334d('0x82')||_0xcb17ed===_0x334d('0x83')||_0xcb17ed===_0x334d('0x7d')||_0xcb17ed==='rtpaudioqosbridged'||_0xcb17ed===_0x334d('0x7f')||_0xcb17ed===_0x334d('0x84')||_0xcb17ed==='rtpaudioqosloss'||_0xcb17ed===_0x334d('0x81')||_0xcb17ed===_0x334d('0x82')||_0xcb17ed===_0x334d('0x83')||_0xcb17ed===_0x334d('0x85')||_0xcb17ed==='bridgepvtcallid'||_0xcb17ed===_0x334d('0x3a')||_0xcb17ed===_0x334d('0x34')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x315a40,_0x51586e){var _0x55605a,_0x20be96,_0x245c90;if(_0x51586e<=0x0){_0x51586e=0x1;}_0x55605a=new RegExp('\x5cw{0,'+_0x51586e+'}$');_0x20be96=Math['pow'](0xa,_0x51586e-0x1);_0x245c90=Math[_0x334d('0x86')](0xa,_0x51586e)-0x1;return util[_0x334d('0x12')]('%s',_[_0x334d('0x87')](_0x315a40,_0x55605a,_[_0x334d('0x88')](_0x20be96,_0x245c90)));};exports[_0x334d('0x89')]=function(_0x335196){var _0x32d20f=_0x335196[_0x334d('0x8a')](/"(.*?)"/);return _0x32d20f?_0x32d20f[0x1]:_0x335196;};exports[_0x334d('0x8b')]=function(_0xd471d8){var _0x5e30c0=_0xd471d8[_0x334d('0x8a')](/<(.*?)>/);return _0x5e30c0?_0x5e30c0[0x1]:_0xd471d8;};
\ No newline at end of file
+var _0x5de5=['logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','endtime','responsetime','starttime','logLookAgent','membername','UserId','logCustomer','state','ringtime','talktime','answertime','isFailure','Failure','uniqueid','channelAgent','from-sip','timeout','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','add','minutes','ContactId','ListId','decrementTalkink','pTalking','IsNotLoggedIn','queue','interface','mandatoryDisposition','buildAcw','agentReadyId','status','push','getDiff','diff','createBody','CampaignId','filterKey','type','campaigntype','dialAnswer','scheduledat','countcongestionretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqoslossbridged','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','match','moment','../../../../config/logger','env','milliseconds','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','string','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined'];(function(_0x52dde9,_0x36ef43){var _0x198fe3=function(_0x622fa8){while(--_0x622fa8){_0x52dde9['push'](_0x52dde9['shift']());}};_0x198fe3(++_0x36ef43);}(_0x5de5,0x158));var _0x55de=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5de5[_0x1facfa];return _0x9ec701;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x55de('0x0'));var logger=require(_0x55de('0x1'))('preview');var ipAgi=process[_0x55de('0x2')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0x537fdf,_0x12e157){var _0x2ba092=moment(_0x537fdf)[_0x55de('0x3')](0x0);var _0x47c0a4=moment(_0x12e157)[_0x55de('0x3')](0x0);return _0x2ba092['diff'](_0x47c0a4,_0x55de('0x4'));}exports[_0x55de('0x5')]=function(_0x25c679){return function(_0x2e6971){logger[_0x55de('0x6')](_0x25c679,util[_0x55de('0x7')](_0x2e6971,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1c6686,_0x2d26e9){logger[_0x55de('0x8')](_0x1c6686,util[_0x55de('0x7')](_0x2d26e9,{'showHidden':![],'depth':null}));};exports[_0x55de('0x9')]=function(_0x424f83,_0x452fe6){logger[_0x55de('0x6')](_0x424f83,util[_0x55de('0x7')](_0x452fe6,{'showHidden':![],'depth':null}));};exports[_0x55de('0xa')]=function(_0x1ff67e){return function(_0x1de428){logger[_0x55de('0x8')](_0x1ff67e,util['inspect'](_0x1de428,{'showHidden':![],'depth':null}));};};exports[_0x55de('0xb')]=function(_0x25ed02,_0x43723d,_0x334d79){return{'message':_0x25ed02,'unlock':_0x43723d,'active':_0x334d79};};exports[_0x55de('0xc')]=function(_0x3b9877,_0x56b0b6,_0x14df84){if(!_['isUndefined'](_0x14df84)&&_0x55de('0xd')===typeof _0x14df84&&!_[_0x55de('0xe')](_0x14df84)){if(!_['isUndefined'](_0x56b0b6)&&'string'===typeof _0x56b0b6&&!_[_0x55de('0xe')](_0x56b0b6)){return util[_0x55de('0xf')](_0x55de('0x10'),_0x56b0b6,_0x14df84);}return util[_0x55de('0xf')](_0x55de('0x10'),_0x14df84,_0x14df84);}if(!_[_0x55de('0x11')](_0x3b9877)&&_0x55de('0xd')===typeof _0x3b9877&&!_[_0x55de('0xe')](_0x3b9877)){return _0x3b9877;}return _0x55de('0x12');};exports[_0x55de('0x13')]=function(_0x4dbb61){if(_[_0x55de('0x14')](_0x4dbb61)){return![];}return _0x4dbb61;};exports[_0x55de('0x15')]=function(_0x19ed99,_0x2261ab,_0x543b7f,_0x56cf2b,_0x4baa9d,_0x496d31){var _0x587925={'XMD-QUEUE':_0x2261ab['Queue']?_0x2261ab[_0x55de('0x16')][_0x55de('0x17')]:'','XMD-CALLERID':_0x56cf2b,'XMD-CALLERID-PREVIEW':_0x496d31?util['format'](_0x55de('0x10'),_0x496d31[_0x55de('0x18')],_0x496d31[_0x55de('0x19')]):_0x56cf2b,'XMD-DIALID':_0x4baa9d,'XMD-CONTACTID':_0x2261ab['ContactId'],'XMD-CDRTYPE':_0x55de('0x1a'),'CALLERID(all)':_0x56cf2b,'XMD-VOICEQUEUEID':_0x2261ab[_0x55de('0x1b')],'XMD-DIALCHANNEL':_0x543b7f,'XMD-DIALTIMEOUT':_0x19ed99[_0x55de('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x55de('0xf')]('\x22rtTxX%s%s\x22',_0x19ed99[_0x55de('0x1d')]?'g':'',_['isEmpty'](_0x19ed99['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x19ed99[_0x55de('0x1e')]||'','XMD-AGI':_0x19ed99[_0x55de('0x1f')]?util[_0x55de('0xf')](_0x55de('0x20'),ipAgi,_0x19ed99[_0x55de('0x1f')]):_0x55de('0x21'),'XMD-AGIAFTER':_0x19ed99[_0x55de('0x1d')]?util[_0x55de('0xf')]('\x22agi://%s/square,%s\x22',ipAgi,_0x19ed99[_0x55de('0x1d')]):_0x55de('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x496d31?_0x496d31[_0x55de('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x496d31?_0x496d31[_0x55de('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x55de('0xe')](_0x19ed99[_0x55de('0x24')])){_0x587925[util[_0x55de('0xf')]('%s',_0x55de('0x25'))]=_0x19ed99[_0x55de('0x24')];_0x587925[util[_0x55de('0xf')]('%s',_0x55de('0x26'))]=_0x4baa9d;}if(_0x2261ab&&_0x2261ab['Contact']){for(var _0x500758 in _0x2261ab[_0x55de('0x27')]){if(_0x2261ab[_0x55de('0x27')][_0x55de('0x28')](_0x500758)){if(!_[_0x55de('0x14')](_0x2261ab['Contact'][_0x500758])&&_0x500758!=='id'&&_0x500758!==_0x55de('0x29')&&_0x500758!==_0x55de('0x2a')&&_0x500758!==_0x55de('0x2b')){_0x587925[util[_0x55de('0xf')](_0x55de('0x2c'),_0x55de('0x2d'),_[_0x55de('0x2e')](_0x500758))]=_0x2261ab[_0x55de('0x27')][_0x500758];}}}}return _0x587925;};exports['toLowerVariables']=function(_0x5b4aa7){var _0x255e97={};for(var _0x45b039 in _0x5b4aa7){if(_0x5b4aa7[_0x55de('0x28')](_0x45b039)){_0x255e97[util[_0x55de('0xf')]('%s',_[_0x55de('0x2f')](_0x45b039))]=_0x5b4aa7[_0x45b039];}}return{'variables':_0x255e97};};exports[_0x55de('0x30')]=function(_0x36ecfe,_0x56d966){if(!_[_0x55de('0x14')](_0x36ecfe)){if(_0x36ecfe[_0x55de('0x28')](_0x55de('0x31'))){if(_0x36ecfe[_0x55de('0x31')]>0x0){_0x36ecfe['originated']-=0x1;}else{logger[_0x55de('0x6')](_0x55de('0x32'),_0x56d966);}}}else{logger[_0x55de('0x6')](_0x55de('0x33'),_0x56d966);}};exports[_0x55de('0x34')]=function(_0x372685){var _0x1086f1=moment()[_0x55de('0xf')](_0x55de('0x35'));_0x372685['state']=0xd;_0x372685[_0x55de('0x36')]=_0x55de('0x37');_0x372685['starttime']=_0x1086f1;_0x372685['responsetime']=_0x1086f1;_0x372685[_0x55de('0x38')]=_0x1086f1;};exports['logAgent']=function(_0xcd5ad8,_0x34bded,_0x560e38){var _0xb35e34=moment()['format'](_0x55de('0x35'));_0xcd5ad8['state']=_0x34bded;_0xcd5ad8[_0x55de('0x36')]=_0x560e38;_0xcd5ad8[_0x55de('0x39')]=_0xb35e34;_0xcd5ad8['ringtime']=getSeconds(_0xcd5ad8[_0x55de('0x39')],_0xcd5ad8[_0x55de('0x3a')]);};exports[_0x55de('0x3b')]=function(_0x25f5f7,_0x487fb6,_0x2175b0){_0x25f5f7[_0x55de('0x3c')]=_0x487fb6;_0x25f5f7[_0x55de('0x3d')]=_0x2175b0;};exports[_0x55de('0x3e')]=function(_0x27bba7,_0x5b13ab,_0x11c400){var _0x3711be=moment()[_0x55de('0xf')]('YYYY-MM-DD\x20HH:mm:ss');_0x27bba7[_0x55de('0x3f')]=_0x5b13ab;_0x27bba7['statedesc']=_0x11c400;_0x27bba7[_0x55de('0x39')]=_0x27bba7[_0x55de('0x39')]?_0x27bba7['responsetime']:_0x3711be;_0x27bba7[_0x55de('0x38')]=_0x27bba7[_0x55de('0x38')]?_0x27bba7[_0x55de('0x38')]:_0x3711be;_0x27bba7[_0x55de('0x40')]=getSeconds(_0x27bba7['responsetime']||0x0,_0x27bba7[_0x55de('0x3a')]||0x0);_0x27bba7[_0x55de('0x41')]=_0x27bba7['answertime']?getSeconds(_0x27bba7['endtime'],_0x27bba7[_0x55de('0x42')]):0x0;};exports[_0x55de('0x43')]=function(_0x17319e){return _0x17319e===_0x55de('0x44');};exports['variablesAction']=function(_0x5b745e,_0x37c271,_0x4478b7,_0x3564a3,_0x145f56){var _0x3948a9=_0x3564a3?'RECALL':_0x5b745e[_0x55de('0x18')];_0x3948a9=_0x145f56?'BOOKED':_0x3948a9;return{'actionid':_0x5b745e[_0x55de('0x45')],'action':'originate','channel':_0x5b745e[_0x55de('0x46')],'callerid':util[_0x55de('0xf')](_0x55de('0x10'),_0x3948a9,_0x5b745e['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x55de('0x47'),'Priority':'1','variable':_0x4478b7,'timeout':(_0x37c271[_0x55de('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5b745e[_0x55de('0x45')]};};exports['totalGlobal']=function(_0x329e7a){return _0x329e7a[_0x55de('0x49')]+_0x329e7a['countcongestionretry']+_0x329e7a[_0x55de('0x4a')]+_0x329e7a[_0x55de('0x4b')]+_0x329e7a[_0x55de('0x4c')];};exports[_0x55de('0x4d')]=function(_0x5f5c50){var _0x2c0df6=_[_0x55de('0x4e')](_0x5f5c50);_0x2c0df6['state']=0xf;_0x2c0df6['statedesc']=_0x55de('0x4f');return _0x2c0df6;};exports[_0x55de('0x50')]=function(_0x4d4663,_0x5211b0,_0x4cdc05){var _0x4b0b05={};_0x4b0b05[_0x5211b0]=_0x4d4663[_0x5211b0];_0x4b0b05['active']=![];_0x4b0b05['scheduledat']=moment()[_0x55de('0x51')](_0x4cdc05,_0x55de('0x52'))[_0x55de('0xf')](_0x55de('0x35'));_0x4b0b05['ContactId']=_0x4d4663[_0x55de('0x53')];_0x4b0b05[_0x55de('0x54')]=_0x4d4663[_0x55de('0x54')];_0x4b0b05['VoiceQueueId']=_0x4d4663[_0x55de('0x1b')]||undefined;return _0x4b0b05;};exports[_0x55de('0x55')]=function(_0x570113,_0x41fee3){if(!_['isNil'](_0x570113)){if(_0x570113[_0x55de('0x56')]>0x0){_0x570113[_0x55de('0x56')]-=0x1;}else{logger[_0x55de('0x6')](_0x41fee3,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x55de('0x6')](_0x41fee3,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x55de('0x57')]=function(_0x48ef00){if(_0x48ef00<=0x0){return!![];}return![];};exports['buildObj']=function(_0x55ed41,_0x59f00f,_0x254dd5){_0x55ed41['lastevent']=_0x59f00f;_0x55ed41[_0x55de('0x17')]=_0x55ed41[_0x55de('0x58')];_0x55ed41[_0x55de('0x59')]=_0x55ed41[_0x55de('0x46')];if(_0x254dd5){_0x55ed41[_0x55de('0x5a')]=_0x254dd5[_0x55de('0x5a')];}return _0x55ed41;};exports[_0x55de('0x5b')]=function(_0x4105ef){var _0x1a7b03={};_0x1a7b03[_0x55de('0x58')]=_0x4105ef[_0x55de('0x58')];_0x1a7b03['interface']=_0x4105ef[_0x55de('0x46')];_0x1a7b03[_0x55de('0x45')]=_0x4105ef[_0x55de('0x45')];return _0x1a7b03;};exports[_0x55de('0x5c')]=function(_0x377873){var _0x4177d5=[];for(var _0x1ec1b3 in _0x377873){if(_0x377873['hasOwnProperty'](_0x1ec1b3)){if(!_[_0x55de('0x14')](_0x377873[_0x1ec1b3])&&_0x377873[_0x1ec1b3]['state']==='not_inuse'&&_0x377873[_0x1ec1b3][_0x55de('0x5d')]==='reachable'){_0x4177d5[_0x55de('0x5e')](_0x377873[_0x1ec1b3]['id']);}}}return _0x4177d5;};exports[_0x55de('0x5f')]=function(_0x406092){var _0x30268b=moment()[_0x55de('0x3')](0x0);var _0x22add8=moment(_0x406092)[_0x55de('0x3')](0x0);return _0x30268b[_0x55de('0x60')](_0x22add8,'seconds');};exports[_0x55de('0x61')]=function(_0x2e02ff){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2e02ff[_0x55de('0x53')],'ListId':_0x2e02ff[_0x55de('0x54')],'VoiceQueueId':_0x2e02ff['VoiceQueueId']||undefined,'CampaignId':_0x2e02ff[_0x55de('0x62')]||undefined};};exports[_0x55de('0x63')]=function(_0x15407a){if(_0x15407a==='uniqueid'||_0x15407a==='idContact'||_0x15407a===_0x55de('0x58')||_0x15407a===_0x55de('0x64')||_0x15407a===_0x55de('0x65')||_0x15407a===_0x55de('0x66')||_0x15407a===_0x55de('0x3c')||_0x15407a===_0x55de('0x46')||_0x15407a===_0x55de('0x18')||_0x15407a==='active'||_0x15407a===_0x55de('0x19')||_0x15407a===_0x55de('0x67')||_0x15407a===_0x55de('0x49')||_0x15407a===_0x55de('0x68')||_0x15407a===_0x55de('0x4a')||_0x15407a===_0x55de('0x69')||_0x15407a===_0x55de('0x6a')||_0x15407a===_0x55de('0x6b')||_0x15407a===_0x55de('0x6c')||_0x15407a===_0x55de('0x6d')||_0x15407a===_0x55de('0x53')||_0x15407a==='ListId'||_0x15407a===_0x55de('0x3d')||_0x15407a===_0x55de('0x1b')||_0x15407a===_0x55de('0x6e')||_0x15407a===_0x55de('0x6f')||_0x15407a===_0x55de('0x70')||_0x15407a===_0x55de('0x71')||_0x15407a==='xmd-listid'||_0x15407a===_0x55de('0x72')||_0x15407a===_0x55de('0x73')||_0x15407a==='xmd-dialoptions'||_0x15407a===_0x55de('0x74')||_0x15407a==='xmd-dialchannel'||_0x15407a===_0x55de('0x75')||_0x15407a==='xmd-cdrtype'||_0x15407a===_0x55de('0x76')||_0x15407a==='xmd-agiafter'||_0x15407a===_0x55de('0x77')||_0x15407a==='rtpaudioqos'||_0x15407a==='rtpaudioqosbridged'||_0x15407a===_0x55de('0x78')||_0x15407a===_0x55de('0x79')||_0x15407a===_0x55de('0x7a')||_0x15407a==='rtpaudioqoslossbridged'||_0x15407a===_0x55de('0x7b')||_0x15407a==='rtpaudioqosrttbridged'||_0x15407a==='rtpaudioqos'||_0x15407a===_0x55de('0x7c')||_0x15407a===_0x55de('0x78')||_0x15407a==='rtpaudioqosjitterbridged'||_0x15407a===_0x55de('0x7a')||_0x15407a===_0x55de('0x7d')||_0x15407a===_0x55de('0x7b')||_0x15407a==='rtpaudioqosrttbridged'||_0x15407a==='bridgepeer'||_0x15407a===_0x55de('0x7e')||_0x15407a==='state'||_0x15407a==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x5e4c32,_0x1cbb82){var _0xfad500,_0x2cd659,_0x16bc69;if(_0x1cbb82<=0x0){_0x1cbb82=0x1;}_0xfad500=new RegExp(_0x55de('0x7f')+_0x1cbb82+'}$');_0x2cd659=Math[_0x55de('0x80')](0xa,_0x1cbb82-0x1);_0x16bc69=Math['pow'](0xa,_0x1cbb82)-0x1;return util['format']('%s',_[_0x55de('0x81')](_0x5e4c32,_0xfad500,_['random'](_0x2cd659,_0x16bc69)));};exports[_0x55de('0x82')]=function(_0x43f91a){var _0x5d30e5=_0x43f91a['match'](/"(.*?)"/);return _0x5d30e5?_0x5d30e5[0x1]:_0x43f91a;};exports['extractCalleridNumber']=function(_0x9ed2c7){var _0x20803a=_0x9ed2c7[_0x55de('0x83')](/<(.*?)>/);return _0x20803a?_0x20803a[0x1]:_0x9ed2c7;};
\ No newline at end of file