Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / services / ami / preview / util / util.js
index 19c096d..a1aa36b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f42=['pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','preview','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','dialQueueProject2','NONE','originatecalleridname','xcally-motion-preview','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','endtime','logAgent','ringtime','starttime','logLookAgent','UserId','logCustomer','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','interface','channelAgent','agentReadyId','not_inuse','status','getDiff','createBody','filterKey','type','campaigntype','dialAnswer','membername','callback','callbackuniqueid','callbackat','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,'];(function(_0x4b200b,_0xaec8e4){var _0x3eb184=function(_0x1fc784){while(--_0x1fc784){_0x4b200b['push'](_0x4b200b['shift']());}};_0x3eb184(++_0xaec8e4);}(_0x2f42,0x90));var _0x22f4=function(_0x540426,_0x11a968){_0x540426=_0x540426-0x0;var _0x216c3d=_0x2f42[_0x540426];return _0x216c3d;};'use strict';var util=require(_0x22f4('0x0'));var _=require(_0x22f4('0x1'));var moment=require(_0x22f4('0x2'));var logger=require('../../../../config/logger')(_0x22f4('0x3'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x22f4('0x4');function getSeconds(_0x56a457,_0x3e9104){var _0x458a9e=moment(_0x56a457)[_0x22f4('0x5')](0x0);var _0x386042=moment(_0x3e9104)[_0x22f4('0x5')](0x0);return _0x458a9e[_0x22f4('0x6')](_0x386042,_0x22f4('0x7'));}exports[_0x22f4('0x8')]=function(_0x31761f){return function(_0x5542f1){logger[_0x22f4('0x9')](_0x31761f,util[_0x22f4('0xa')](_0x5542f1,{'showHidden':![],'depth':null}));};};exports[_0x22f4('0xb')]=function(_0x7d4608,_0x3010aa){logger[_0x22f4('0xc')](_0x7d4608,util['inspect'](_0x3010aa,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x4d977f,_0x25bd88){logger[_0x22f4('0x9')](_0x4d977f,util[_0x22f4('0xa')](_0x25bd88,{'showHidden':![],'depth':null}));};exports[_0x22f4('0xd')]=function(_0x5a6972){return function(_0x2317ef){logger[_0x22f4('0xc')](_0x5a6972,util[_0x22f4('0xa')](_0x2317ef,{'showHidden':![],'depth':null}));};};exports[_0x22f4('0xe')]=function(_0x4a0c3e,_0x314f97,_0x27dc54){return{'message':_0x4a0c3e,'unlock':_0x314f97,'active':_0x27dc54};};exports[_0x22f4('0xf')]=function(_0x4fed27,_0x2f6154,_0xf78a6f){if(!_[_0x22f4('0x10')](_0xf78a6f)&&_0x22f4('0x11')===typeof _0xf78a6f&&!_[_0x22f4('0x12')](_0xf78a6f)){if(!_[_0x22f4('0x10')](_0x2f6154)&&_0x22f4('0x11')===typeof _0x2f6154&&!_[_0x22f4('0x12')](_0x2f6154)){return util[_0x22f4('0x13')]('\x22%s\x22\x20<%s>',_0x2f6154,_0xf78a6f);}return util[_0x22f4('0x13')]('\x22%s\x22\x20<%s>',_0xf78a6f,_0xf78a6f);}if(!_[_0x22f4('0x10')](_0x4fed27)&&_0x22f4('0x11')===typeof _0x4fed27&&!_[_0x22f4('0x12')](_0x4fed27)){return _0x4fed27;}return _0x22f4('0x14');};exports[_0x22f4('0x15')]=function(_0x58f285){if(_[_0x22f4('0x16')](_0x58f285)){return![];}return _0x58f285;};exports[_0x22f4('0x17')]=function(_0x1ff42c,_0x18546,_0xc34489,_0x3c8c82,_0x968736,_0x2001a3){var _0x3ad672={'XMD-QUEUE':_0x18546[_0x22f4('0x18')]?_0x18546[_0x22f4('0x18')][_0x22f4('0x19')]:'','XMD-CALLERID':_0x3c8c82,'XMD-CALLERID-PREVIEW':_0x2001a3?util['format'](_0x22f4('0x1a'),_0x2001a3[_0x22f4('0x1b')],_0x2001a3[_0x22f4('0x1c')]):_0x3c8c82,'XMD-DIALID':_0x968736,'XMD-CONTACTID':_0x18546['ContactId'],'XMD-CDRTYPE':_0x22f4('0x1d'),'CALLERID(all)':_0x3c8c82,'XMD-VOICEQUEUEID':_0x18546[_0x22f4('0x1e')],'XMD-DIALCHANNEL':_0xc34489,'XMD-DIALTIMEOUT':_0x1ff42c[_0x22f4('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x22f4('0x13')]('\x22rtTxX%s%s\x22',_0x1ff42c['dialQueueProject2']?'g':'',_['isEmpty'](_0x1ff42c[_0x22f4('0x20')])?'':_0x22f4('0x21')),'XMD-DIALURL':_0x1ff42c['dialPreviewUrl']||'','XMD-AGI':_0x1ff42c['dialQueueProject']?util[_0x22f4('0x13')](_0x22f4('0x22'),ipAgi,_0x1ff42c[_0x22f4('0x23')]):'NONE','XMD-AGIAFTER':_0x1ff42c[_0x22f4('0x24')]?util[_0x22f4('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1ff42c[_0x22f4('0x24')]):_0x22f4('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x2001a3?_0x2001a3['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x2001a3?_0x2001a3[_0x22f4('0x26')]:'','XMD-DESTINATION':_0x22f4('0x27')};if(!_[_0x22f4('0x12')](_0x1ff42c['monitor_format'])){_0x3ad672[util[_0x22f4('0x13')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x1ff42c[_0x22f4('0x20')];_0x3ad672[util[_0x22f4('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x968736;}if(_0x18546&&_0x18546[_0x22f4('0x28')]){for(var _0xd2b1cc in _0x18546[_0x22f4('0x28')]){if(_0x18546['Contact'][_0x22f4('0x29')](_0xd2b1cc)){if(!_[_0x22f4('0x16')](_0x18546['Contact'][_0xd2b1cc])&&_0xd2b1cc!=='id'&&_0xd2b1cc!==_0x22f4('0x2a')&&_0xd2b1cc!==_0x22f4('0x2b')&&_0xd2b1cc!==_0x22f4('0x2c')){_0x3ad672[util[_0x22f4('0x13')](_0x22f4('0x2d'),_0x22f4('0x2e'),_['toUpper'](_0xd2b1cc))]=_0x18546[_0x22f4('0x28')][_0xd2b1cc];}}}}return _0x3ad672;};exports[_0x22f4('0x2f')]=function(_0x237ad7){var _0x58f147={};for(var _0x2f0168 in _0x237ad7){if(_0x237ad7[_0x22f4('0x29')](_0x2f0168)){_0x58f147[util[_0x22f4('0x13')]('%s',_[_0x22f4('0x30')](_0x2f0168))]=_0x237ad7[_0x2f0168];}}return{'variables':_0x58f147};};exports[_0x22f4('0x31')]=function(_0x4ed035,_0x392dff){if(!_[_0x22f4('0x16')](_0x4ed035)){if(_0x4ed035['hasOwnProperty']('originated')){if(_0x4ed035['originated']>0x0){_0x4ed035[_0x22f4('0x32')]-=0x1;}else{logger[_0x22f4('0x9')](_0x22f4('0x33'),_0x392dff);}}}else{logger[_0x22f4('0x9')](_0x22f4('0x34'),_0x392dff);}};exports[_0x22f4('0x35')]=function(_0x16fb8b){var _0x3dd13c=moment()[_0x22f4('0x13')](_0x22f4('0x36'));_0x16fb8b[_0x22f4('0x37')]=0xd;_0x16fb8b[_0x22f4('0x38')]=_0x22f4('0x39');_0x16fb8b['starttime']=_0x3dd13c;_0x16fb8b[_0x22f4('0x3a')]=_0x3dd13c;_0x16fb8b[_0x22f4('0x3b')]=_0x3dd13c;};exports[_0x22f4('0x3c')]=function(_0x3729e5,_0x473eca,_0x22a6cc){var _0x39bb98=moment()[_0x22f4('0x13')](_0x22f4('0x36'));_0x3729e5[_0x22f4('0x37')]=_0x473eca;_0x3729e5[_0x22f4('0x38')]=_0x22a6cc;_0x3729e5[_0x22f4('0x3a')]=_0x39bb98;_0x3729e5[_0x22f4('0x3d')]=getSeconds(_0x3729e5[_0x22f4('0x3a')],_0x3729e5[_0x22f4('0x3e')]);};exports[_0x22f4('0x3f')]=function(_0x1318cf,_0x22b5ba,_0x2ae6eb){_0x1318cf['membername']=_0x22b5ba;_0x1318cf[_0x22f4('0x40')]=_0x2ae6eb;};exports[_0x22f4('0x41')]=function(_0x33c33b,_0x398a74,_0x4c54f9){var _0x4be80e=moment()[_0x22f4('0x13')](_0x22f4('0x36'));_0x33c33b[_0x22f4('0x37')]=_0x398a74;_0x33c33b['statedesc']=_0x4c54f9;_0x33c33b['responsetime']=_0x33c33b[_0x22f4('0x3a')]?_0x33c33b[_0x22f4('0x3a')]:_0x4be80e;_0x33c33b['endtime']=_0x33c33b[_0x22f4('0x3b')]?_0x33c33b[_0x22f4('0x3b')]:_0x4be80e;_0x33c33b['ringtime']=getSeconds(_0x33c33b[_0x22f4('0x3a')]||0x0,_0x33c33b[_0x22f4('0x3e')]||0x0);_0x33c33b['talktime']=_0x33c33b['answertime']?getSeconds(_0x33c33b[_0x22f4('0x3b')],_0x33c33b[_0x22f4('0x42')]):0x0;};exports[_0x22f4('0x43')]=function(_0x347f5a){return _0x347f5a===_0x22f4('0x44');};exports[_0x22f4('0x45')]=function(_0x894c9e,_0x2f5fc3,_0x1ed8bb,_0x32c957,_0x5324f1){var _0x2ab2ea=_0x32c957?_0x22f4('0x46'):_0x894c9e[_0x22f4('0x1b')];_0x2ab2ea=_0x5324f1?'BOOKED':_0x2ab2ea;return{'actionid':_0x894c9e[_0x22f4('0x47')],'action':'originate','channel':_0x894c9e['channelAgent'],'callerid':util[_0x22f4('0x13')](_0x22f4('0x1a'),_0x2ab2ea,_0x894c9e[_0x22f4('0x1c')]),'Exten':'xcally-motion-preview','Context':_0x22f4('0x48'),'Priority':'1','variable':_0x1ed8bb,'timeout':(_0x2f5fc3['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x894c9e[_0x22f4('0x47')]};};exports[_0x22f4('0x49')]=function(_0x2d8346){return _0x2d8346[_0x22f4('0x4a')]+_0x2d8346[_0x22f4('0x4b')]+_0x2d8346[_0x22f4('0x4c')];};exports[_0x22f4('0x4d')]=function(_0x52a7f4){var _0x1af610=_[_0x22f4('0x4e')](_0x52a7f4);_0x1af610[_0x22f4('0x37')]=0xf;_0x1af610[_0x22f4('0x38')]=_0x22f4('0x4f');return _0x1af610;};exports[_0x22f4('0x50')]=function(_0x215d0d,_0x2063bb,_0x3a10a5){var _0x3132ad={};_0x3132ad[_0x2063bb]=_0x215d0d[_0x2063bb];_0x3132ad[_0x22f4('0x51')]=![];_0x3132ad[_0x22f4('0x52')]=moment()[_0x22f4('0x53')](_0x3a10a5,_0x22f4('0x54'))[_0x22f4('0x13')](_0x22f4('0x36'));_0x3132ad[_0x22f4('0x55')]=_0x215d0d['ContactId'];_0x3132ad[_0x22f4('0x56')]=_0x215d0d[_0x22f4('0x56')];_0x3132ad[_0x22f4('0x1e')]=_0x215d0d[_0x22f4('0x1e')]||undefined;return _0x3132ad;};exports[_0x22f4('0x57')]=function(_0x3a8baf,_0xce1b23){if(!_[_0x22f4('0x16')](_0x3a8baf)){if(_0x3a8baf[_0x22f4('0x58')]>0x0){_0x3a8baf[_0x22f4('0x58')]-=0x1;}else{logger['error'](_0xce1b23,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x22f4('0x9')](_0xce1b23,_0x22f4('0x59'));}};exports['IsNotLoggedIn']=function(_0x4b3793){if(_0x4b3793<=0x0){return!![];}return![];};exports[_0x22f4('0x5a')]=function(_0x80e0ac,_0xaee4e4){_0x80e0ac[_0x22f4('0x5b')]=_0xaee4e4;_0x80e0ac[_0x22f4('0x19')]=_0x80e0ac[_0x22f4('0x5c')];_0x80e0ac[_0x22f4('0x5d')]=_0x80e0ac[_0x22f4('0x5e')];return _0x80e0ac;};exports['buildAcw']=function(_0x504a1e){var _0x93998d={};_0x93998d[_0x22f4('0x5c')]=_0x504a1e['queue'];_0x93998d['interface']=_0x504a1e[_0x22f4('0x5e')];_0x93998d['uniqueid']=_0x504a1e['uniqueid'];return _0x93998d;};exports[_0x22f4('0x5f')]=function(_0x4bee14){var _0x2108d6=[];for(var _0x5f4655 in _0x4bee14){if(_0x4bee14[_0x22f4('0x29')](_0x5f4655)){if(!_[_0x22f4('0x16')](_0x4bee14[_0x5f4655])&&_0x4bee14[_0x5f4655]['state']===_0x22f4('0x60')&&_0x4bee14[_0x5f4655][_0x22f4('0x61')]==='reachable'){_0x2108d6['push'](_0x4bee14[_0x5f4655]['id']);}}}return _0x2108d6;};exports[_0x22f4('0x62')]=function(_0xfe15d){var _0x15d907=moment()[_0x22f4('0x5')](0x0);var _0x58edb0=moment(_0xfe15d)[_0x22f4('0x5')](0x0);return _0x15d907[_0x22f4('0x6')](_0x58edb0,_0x22f4('0x7'));};exports[_0x22f4('0x63')]=function(_0x3c40a7){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c40a7[_0x22f4('0x55')],'ListId':_0x3c40a7[_0x22f4('0x56')],'VoiceQueueId':_0x3c40a7['VoiceQueueId']||undefined,'CampaignId':_0x3c40a7['CampaignId']||undefined};};exports[_0x22f4('0x64')]=function(_0x8d1315){if(_0x8d1315===_0x22f4('0x47')||_0x8d1315==='idContact'||_0x8d1315===_0x22f4('0x5c')||_0x8d1315===_0x22f4('0x65')||_0x8d1315===_0x22f4('0x66')||_0x8d1315===_0x22f4('0x67')||_0x8d1315===_0x22f4('0x68')||_0x8d1315==='channelAgent'||_0x8d1315===_0x22f4('0x1b')||_0x8d1315===_0x22f4('0x51')||_0x8d1315===_0x22f4('0x1c')||_0x8d1315==='scheduledat'||_0x8d1315===_0x22f4('0x4a')||_0x8d1315===_0x22f4('0x4b')||_0x8d1315===_0x22f4('0x4c')||_0x8d1315==='countglobal'||_0x8d1315===_0x22f4('0x69')||_0x8d1315===_0x22f4('0x6a')||_0x8d1315===_0x22f4('0x6b')||_0x8d1315==='recallme'||_0x8d1315==='ContactId'||_0x8d1315==='ListId'||_0x8d1315===_0x22f4('0x40')||_0x8d1315==='VoiceQueueId'||_0x8d1315==='sipcallid'||_0x8d1315==='xmd-voicequeueid'||_0x8d1315===_0x22f4('0x6c')||_0x8d1315==='xmd-phone'||_0x8d1315===_0x22f4('0x6d')||_0x8d1315===_0x22f4('0x6e')||_0x8d1315===_0x22f4('0x6f')||_0x8d1315===_0x22f4('0x70')||_0x8d1315===_0x22f4('0x71')||_0x8d1315===_0x22f4('0x72')||_0x8d1315===_0x22f4('0x73')||_0x8d1315===_0x22f4('0x74')||_0x8d1315===_0x22f4('0x75')||_0x8d1315===_0x22f4('0x76')||_0x8d1315===_0x22f4('0x77')||_0x8d1315===_0x22f4('0x78')||_0x8d1315===_0x22f4('0x79')||_0x8d1315===_0x22f4('0x7a')||_0x8d1315===_0x22f4('0x7b')||_0x8d1315===_0x22f4('0x7c')||_0x8d1315==='rtpaudioqoslossbridged'||_0x8d1315===_0x22f4('0x7d')||_0x8d1315===_0x22f4('0x7e')||_0x8d1315===_0x22f4('0x78')||_0x8d1315===_0x22f4('0x79')||_0x8d1315==='rtpaudioqosjitter'||_0x8d1315===_0x22f4('0x7b')||_0x8d1315===_0x22f4('0x7c')||_0x8d1315===_0x22f4('0x7f')||_0x8d1315===_0x22f4('0x7d')||_0x8d1315==='rtpaudioqosrttbridged'||_0x8d1315===_0x22f4('0x80')||_0x8d1315===_0x22f4('0x81')||_0x8d1315===_0x22f4('0x37')||_0x8d1315===_0x22f4('0x38')){return![];}return!![];};exports[_0x22f4('0x82')]=function(_0x480d54,_0x2b2e66){var _0x97a5c6,_0x9e1c5c,_0x463503;if(_0x2b2e66<=0x0){_0x2b2e66=0x1;}_0x97a5c6=new RegExp(_0x22f4('0x83')+_0x2b2e66+'}$');_0x9e1c5c=Math[_0x22f4('0x84')](0xa,_0x2b2e66-0x1);_0x463503=Math['pow'](0xa,_0x2b2e66)-0x1;return util['format']('%s',_[_0x22f4('0x85')](_0x480d54,_0x97a5c6,_[_0x22f4('0x86')](_0x9e1c5c,_0x463503)));};exports[_0x22f4('0x87')]=function(_0x43e2cf){var _0x5c6420=_0x43e2cf[_0x22f4('0x88')](/"(.*?)"/);return _0x5c6420?_0x5c6420[0x1]:_0x43e2cf;};exports[_0x22f4('0x89')]=function(_0xb53e29){var _0x1f5405=_0xb53e29[_0x22f4('0x88')](/<(.*?)>/);return _0x1f5405?_0x1f5405[0x1]:_0xb53e29;};
\ No newline at end of file
+var _0x2903=['rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosrtt','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','replace','random','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','Queue','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','updatedAt','%s%s','toUpper','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','talktime','answertime','Failure','variablesAction','RECALL','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','clone','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','name','channelAgent','buildAcw','queue','interface','agentReadyId','status','reachable','getDiff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','recallme','UserId','sipcallid','xmd-listid','xmd-dialurl','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x2903,0x96));var _0x3290=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x2903[_0x5c2e3e];return _0x53f64a;};'use strict';var util=require(_0x3290('0x0'));var _=require(_0x3290('0x1'));var moment=require(_0x3290('0x2'));var logger=require(_0x3290('0x3'))('preview');var ipAgi=process[_0x3290('0x4')][_0x3290('0x5')]||_0x3290('0x6');function getSeconds(_0x300e11,_0x38f415){var _0x1dc26e=moment(_0x300e11)[_0x3290('0x7')](0x0);var _0x445139=moment(_0x38f415)[_0x3290('0x7')](0x0);return _0x1dc26e[_0x3290('0x8')](_0x445139,'seconds');}exports[_0x3290('0x9')]=function(_0x2c52a5){return function(_0x533912){logger[_0x3290('0xa')](_0x2c52a5,util[_0x3290('0xb')](_0x533912,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x31a1c1,_0x3df094){logger[_0x3290('0xc')](_0x31a1c1,util[_0x3290('0xb')](_0x3df094,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x44301b,_0x124e99){logger[_0x3290('0xa')](_0x44301b,util[_0x3290('0xb')](_0x124e99,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x4a0f45){return function(_0x840a2e){logger['info'](_0x4a0f45,util[_0x3290('0xb')](_0x840a2e,{'showHidden':![],'depth':null}));};};exports[_0x3290('0xd')]=function(_0xcd05b,_0xab9426,_0x52cb0d){return{'message':_0xcd05b,'unlock':_0xab9426,'active':_0x52cb0d};};exports[_0x3290('0xe')]=function(_0x4228b9,_0xb8e1d,_0xdadd28){if(!_[_0x3290('0xf')](_0xdadd28)&&_0x3290('0x10')===typeof _0xdadd28&&!_[_0x3290('0x11')](_0xdadd28)){if(!_[_0x3290('0xf')](_0xb8e1d)&&_0x3290('0x10')===typeof _0xb8e1d&&!_[_0x3290('0x11')](_0xb8e1d)){return util[_0x3290('0x12')](_0x3290('0x13'),_0xb8e1d,_0xdadd28);}return util['format'](_0x3290('0x13'),_0xdadd28,_0xdadd28);}if(!_[_0x3290('0xf')](_0x4228b9)&&'string'===typeof _0x4228b9&&!_[_0x3290('0x11')](_0x4228b9)){return _0x4228b9;}return _0x3290('0x14');};exports[_0x3290('0x15')]=function(_0x1b6f19){if(_[_0x3290('0x16')](_0x1b6f19)){return![];}return _0x1b6f19;};exports['addVariables']=function(_0x57f99d,_0x5d0491,_0x434a39,_0x47a519,_0x4a0b3c,_0x4171c1){var _0x1c64d7={'XMD-QUEUE':_0x5d0491[_0x3290('0x17')]?_0x5d0491[_0x3290('0x17')]['name']:'','XMD-CALLERID':_0x47a519,'XMD-CALLERID-PREVIEW':_0x4171c1?util['format'](_0x3290('0x13'),_0x4171c1[_0x3290('0x18')],_0x4171c1[_0x3290('0x19')]):_0x47a519,'XMD-DIALID':_0x4a0b3c,'XMD-CONTACTID':_0x5d0491[_0x3290('0x1a')],'XMD-CDRTYPE':_0x3290('0x1b'),'CALLERID(all)':_0x47a519,'XMD-VOICEQUEUEID':_0x5d0491[_0x3290('0x1c')],'XMD-DIALCHANNEL':_0x434a39,'XMD-DIALTIMEOUT':_0x57f99d[_0x3290('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x3290('0x12')](_0x3290('0x1e'),_0x57f99d[_0x3290('0x1f')]?'g':'',_[_0x3290('0x11')](_0x57f99d['monitor_format'])?'':_0x3290('0x20')),'XMD-DIALURL':_0x57f99d[_0x3290('0x21')]||'','XMD-AGI':_0x57f99d['dialQueueProject']?util[_0x3290('0x12')](_0x3290('0x22'),ipAgi,_0x57f99d[_0x3290('0x23')]):'NONE','XMD-AGIAFTER':_0x57f99d['dialQueueProject2']?util['format'](_0x3290('0x22'),ipAgi,_0x57f99d[_0x3290('0x1f')]):_0x3290('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x4171c1?_0x4171c1[_0x3290('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x4171c1?_0x4171c1[_0x3290('0x26')]:'','XMD-DESTINATION':_0x3290('0x27')};if(!_[_0x3290('0x11')](_0x57f99d[_0x3290('0x28')])){_0x1c64d7[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x57f99d[_0x3290('0x28')];_0x1c64d7[util[_0x3290('0x12')]('%s',_0x3290('0x29'))]=_0x4a0b3c;}if(_0x5d0491&&_0x5d0491[_0x3290('0x2a')]){for(var _0x4de5b2 in _0x5d0491[_0x3290('0x2a')]){if(_0x5d0491[_0x3290('0x2a')]['hasOwnProperty'](_0x4de5b2)){if(!_[_0x3290('0x16')](_0x5d0491[_0x3290('0x2a')][_0x4de5b2])&&_0x4de5b2!=='id'&&_0x4de5b2!=='tags'&&_0x4de5b2!=='createdAt'&&_0x4de5b2!==_0x3290('0x2b')){_0x1c64d7[util[_0x3290('0x12')](_0x3290('0x2c'),'XMD-',_[_0x3290('0x2d')](_0x4de5b2))]=_0x5d0491['Contact'][_0x4de5b2];}}}}return _0x1c64d7;};exports[_0x3290('0x2e')]=function(_0x4e2f36){var _0x1fecfb={};for(var _0x359dd7 in _0x4e2f36){if(_0x4e2f36[_0x3290('0x2f')](_0x359dd7)){_0x1fecfb[util[_0x3290('0x12')]('%s',_[_0x3290('0x30')](_0x359dd7))]=_0x4e2f36[_0x359dd7];}}return{'variables':_0x1fecfb};};exports['updateOriginated']=function(_0x1b8694,_0x1e4f65){if(!_[_0x3290('0x16')](_0x1b8694)){if(_0x1b8694[_0x3290('0x2f')](_0x3290('0x31'))){if(_0x1b8694['originated']>0x0){_0x1b8694[_0x3290('0x31')]-=0x1;}else{logger['error'](_0x3290('0x32'),_0x1e4f65);}}}else{logger['error'](_0x3290('0x33'),_0x1e4f65);}};exports[_0x3290('0x34')]=function(_0x349716){var _0x5e21f0=moment()[_0x3290('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x349716[_0x3290('0x35')]=0xd;_0x349716[_0x3290('0x36')]=_0x3290('0x37');_0x349716['starttime']=_0x5e21f0;_0x349716[_0x3290('0x38')]=_0x5e21f0;_0x349716[_0x3290('0x39')]=_0x5e21f0;};exports['logAgent']=function(_0x3b11b7,_0x36d48e,_0x3496d1){var _0x41986f=moment()['format'](_0x3290('0x3a'));_0x3b11b7[_0x3290('0x35')]=_0x36d48e;_0x3b11b7[_0x3290('0x36')]=_0x3496d1;_0x3b11b7['responsetime']=_0x41986f;_0x3b11b7[_0x3290('0x3b')]=getSeconds(_0x3b11b7[_0x3290('0x38')],_0x3b11b7['starttime']);};exports[_0x3290('0x3c')]=function(_0x44bc31,_0x2723d0,_0x2dba22){_0x44bc31[_0x3290('0x3d')]=_0x2723d0;_0x44bc31['UserId']=_0x2dba22;};exports['logCustomer']=function(_0x3b40cc,_0x1c79ca,_0x1fa193){var _0x340748=moment()['format'](_0x3290('0x3a'));_0x3b40cc[_0x3290('0x35')]=_0x1c79ca;_0x3b40cc[_0x3290('0x36')]=_0x1fa193;_0x3b40cc['responsetime']=_0x3b40cc[_0x3290('0x38')]?_0x3b40cc['responsetime']:_0x340748;_0x3b40cc[_0x3290('0x39')]=_0x3b40cc[_0x3290('0x39')]?_0x3b40cc[_0x3290('0x39')]:_0x340748;_0x3b40cc[_0x3290('0x3b')]=getSeconds(_0x3b40cc[_0x3290('0x38')]||0x0,_0x3b40cc['starttime']||0x0);_0x3b40cc[_0x3290('0x3e')]=_0x3b40cc[_0x3290('0x3f')]?getSeconds(_0x3b40cc[_0x3290('0x39')],_0x3b40cc['answertime']):0x0;};exports['isFailure']=function(_0x69b46f){return _0x69b46f===_0x3290('0x40');};exports[_0x3290('0x41')]=function(_0x457251,_0x1a795d,_0x4900f9,_0x33837a,_0x3ab4da){var _0x475887=_0x33837a?_0x3290('0x42'):_0x457251[_0x3290('0x18')];_0x475887=_0x3ab4da?'BOOKED':_0x475887;return{'actionid':_0x457251[_0x3290('0x43')],'action':_0x3290('0x44'),'channel':_0x457251['channelAgent'],'callerid':util[_0x3290('0x12')](_0x3290('0x13'),_0x475887,_0x457251['calleridnum']),'Exten':_0x3290('0x27'),'Context':_0x3290('0x45'),'Priority':'1','variable':_0x4900f9,'timeout':(_0x1a795d[_0x3290('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x457251[_0x3290('0x43')]};};exports[_0x3290('0x47')]=function(_0x255f66){return _0x255f66[_0x3290('0x48')]+_0x255f66[_0x3290('0x49')]+_0x255f66[_0x3290('0x4a')]+_0x255f66[_0x3290('0x4b')]+_0x255f66[_0x3290('0x4c')];};exports['cloneAction']=function(_0x384bd1){var _0x2c0ba8=_[_0x3290('0x4d')](_0x384bd1);_0x2c0ba8['state']=0xf;_0x2c0ba8['statedesc']='Global';return _0x2c0ba8;};exports[_0x3290('0x4e')]=function(_0x3f25ad,_0x3b0e52,_0x5522b3){var _0x5cef5b={};_0x5cef5b[_0x3b0e52]=_0x3f25ad[_0x3b0e52];_0x5cef5b[_0x3290('0x4f')]=![];_0x5cef5b[_0x3290('0x50')]=moment()[_0x3290('0x51')](_0x5522b3,_0x3290('0x52'))[_0x3290('0x12')](_0x3290('0x3a'));_0x5cef5b[_0x3290('0x1a')]=_0x3f25ad[_0x3290('0x1a')];_0x5cef5b[_0x3290('0x53')]=_0x3f25ad[_0x3290('0x53')];_0x5cef5b['VoiceQueueId']=_0x3f25ad[_0x3290('0x1c')]||undefined;return _0x5cef5b;};exports[_0x3290('0x54')]=function(_0x395e1b,_0x5d51f0){if(!_['isNil'](_0x395e1b)){if(_0x395e1b[_0x3290('0x55')]>0x0){_0x395e1b['pTalking']-=0x1;}else{logger[_0x3290('0xa')](_0x5d51f0,_0x3290('0x56'));}}else{logger[_0x3290('0xa')](_0x5d51f0,_0x3290('0x57'));}};exports['IsNotLoggedIn']=function(_0xc262a9){if(_0xc262a9<=0x0){return!![];}return![];};exports[_0x3290('0x58')]=function(_0xbed987,_0x2ebf72,_0x1d7031){_0xbed987[_0x3290('0x59')]=_0x2ebf72;_0xbed987[_0x3290('0x5a')]=_0xbed987['queue'];_0xbed987['interface']=_0xbed987[_0x3290('0x5b')];if(_0x1d7031){_0xbed987['mandatoryDisposition']=_0x1d7031['mandatoryDisposition'];}return _0xbed987;};exports[_0x3290('0x5c')]=function(_0x1e4f50){var _0xe947e5={};_0xe947e5[_0x3290('0x5d')]=_0x1e4f50[_0x3290('0x5d')];_0xe947e5[_0x3290('0x5e')]=_0x1e4f50['channelAgent'];_0xe947e5[_0x3290('0x43')]=_0x1e4f50[_0x3290('0x43')];return _0xe947e5;};exports[_0x3290('0x5f')]=function(_0x28154c){var _0x4b25b4=[];for(var _0x113d07 in _0x28154c){if(_0x28154c['hasOwnProperty'](_0x113d07)){if(!_[_0x3290('0x16')](_0x28154c[_0x113d07])&&_0x28154c[_0x113d07]['state']==='not_inuse'&&_0x28154c[_0x113d07][_0x3290('0x60')]===_0x3290('0x61')){_0x4b25b4['push'](_0x28154c[_0x113d07]['id']);}}}return _0x4b25b4;};exports[_0x3290('0x62')]=function(_0x1ac204){var _0x552885=moment()[_0x3290('0x7')](0x0);var _0x45a158=moment(_0x1ac204)[_0x3290('0x7')](0x0);return _0x552885[_0x3290('0x8')](_0x45a158,_0x3290('0x63'));};exports[_0x3290('0x64')]=function(_0x351528){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x351528[_0x3290('0x1a')],'ListId':_0x351528['ListId'],'VoiceQueueId':_0x351528[_0x3290('0x1c')]||undefined,'CampaignId':_0x351528[_0x3290('0x65')]||undefined};};exports[_0x3290('0x66')]=function(_0x47ebce){if(_0x47ebce==='uniqueid'||_0x47ebce===_0x3290('0x67')||_0x47ebce===_0x3290('0x5d')||_0x47ebce===_0x3290('0x68')||_0x47ebce===_0x3290('0x69')||_0x47ebce===_0x3290('0x6a')||_0x47ebce===_0x3290('0x3d')||_0x47ebce==='channelAgent'||_0x47ebce===_0x3290('0x18')||_0x47ebce===_0x3290('0x4f')||_0x47ebce==='calleridnum'||_0x47ebce===_0x3290('0x50')||_0x47ebce===_0x3290('0x48')||_0x47ebce===_0x3290('0x49')||_0x47ebce===_0x3290('0x4a')||_0x47ebce===_0x3290('0x6b')||_0x47ebce===_0x3290('0x6c')||_0x47ebce===_0x3290('0x6d')||_0x47ebce==='callbackat'||_0x47ebce===_0x3290('0x6e')||_0x47ebce===_0x3290('0x1a')||_0x47ebce===_0x3290('0x53')||_0x47ebce===_0x3290('0x6f')||_0x47ebce===_0x3290('0x1c')||_0x47ebce===_0x3290('0x70')||_0x47ebce==='xmd-voicequeueid'||_0x47ebce==='xmd-queue'||_0x47ebce==='xmd-phone'||_0x47ebce===_0x3290('0x71')||_0x47ebce===_0x3290('0x72')||_0x47ebce==='xmd-dialtimeout'||_0x47ebce==='xmd-dialoptions'||_0x47ebce===_0x3290('0x73')||_0x47ebce===_0x3290('0x74')||_0x47ebce===_0x3290('0x75')||_0x47ebce===_0x3290('0x76')||_0x47ebce==='xmd-callerid'||_0x47ebce===_0x3290('0x77')||_0x47ebce===_0x3290('0x78')||_0x47ebce===_0x3290('0x79')||_0x47ebce===_0x3290('0x7a')||_0x47ebce==='rtpaudioqosjitter'||_0x47ebce===_0x3290('0x7b')||_0x47ebce===_0x3290('0x7c')||_0x47ebce==='rtpaudioqoslossbridged'||_0x47ebce==='rtpaudioqosrtt'||_0x47ebce===_0x3290('0x7d')||_0x47ebce===_0x3290('0x79')||_0x47ebce===_0x3290('0x7a')||_0x47ebce===_0x3290('0x7e')||_0x47ebce===_0x3290('0x7b')||_0x47ebce===_0x3290('0x7c')||_0x47ebce==='rtpaudioqoslossbridged'||_0x47ebce===_0x3290('0x7f')||_0x47ebce==='rtpaudioqosrttbridged'||_0x47ebce===_0x3290('0x80')||_0x47ebce===_0x3290('0x81')||_0x47ebce===_0x3290('0x35')||_0x47ebce===_0x3290('0x36')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x1317a3,_0x3c8a7b){var _0x10012e,_0xa85742,_0x532368;if(_0x3c8a7b<=0x0){_0x3c8a7b=0x1;}_0x10012e=new RegExp(_0x3290('0x82')+_0x3c8a7b+'}$');_0xa85742=Math['pow'](0xa,_0x3c8a7b-0x1);_0x532368=Math[_0x3290('0x83')](0xa,_0x3c8a7b)-0x1;return util[_0x3290('0x12')]('%s',_[_0x3290('0x84')](_0x1317a3,_0x10012e,_[_0x3290('0x85')](_0xa85742,_0x532368)));};exports['extractCalleridName']=function(_0x3cfc88){var _0xb94704=_0x3cfc88[_0x3290('0x86')](/"(.*?)"/);return _0xb94704?_0xb94704[0x1]:_0x3cfc88;};exports[_0x3290('0x87')]=function(_0x14abce){var _0x41bd18=_0x14abce[_0x3290('0x86')](/<(.*?)>/);return _0x41bd18?_0x41bd18[0x1]:_0x14abce;};
\ No newline at end of file