Built motion from commit (unavailable).|2.5.0
[motion2.git] / server / services / ami / index.js
index 0ebd311..331ce73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf617=['getTriggers','initTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','sync','log','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues'];(function(_0x1f04d9,_0x3dd325){var _0x5eeff8=function(_0x3af932){while(--_0x3af932){_0x1f04d9['push'](_0x1f04d9['shift']());}};_0x5eeff8(++_0x3dd325);}(_0xf617,0xe6));var _0x7f61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf617[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x7f61('0x0'));var util=require(_0x7f61('0x1'));var moment=require(_0x7f61('0x2'));var server=require(_0x7f61('0x3'));var Realtime=require(_0x7f61('0x4'));var Report=require(_0x7f61('0x5'));var Acw=require(_0x7f61('0x6'));var Trigger=require(_0x7f61('0x7'));var Dialer=require(_0x7f61('0x8'));var Preview=require(_0x7f61('0x9'));var Fax=require(_0x7f61('0xa'));var user=require('./rpc/user');var voiceQueue=require(_0x7f61('0xb'));var voiceQueueReport=require(_0x7f61('0xc'));var voiceCallReport=require(_0x7f61('0xd'));var trunk=require(_0x7f61('0xe'));var trigger=require(_0x7f61('0xf'));var template=require('./rpc/template');var cmHopperHistory=require(_0x7f61('0x10'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x7f61('0x11'));var faxAccount=require(_0x7f61('0x12'));var zendesk=require(_0x7f61('0x13'));var salesforce=require(_0x7f61('0x14'));var sugarcrm=require(_0x7f61('0x15'));var freshdesk=require(_0x7f61('0x16'));var desk=require(_0x7f61('0x17'));var zoho=require(_0x7f61('0x18'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x7f61('0x19'));var servicenow=require(_0x7f61('0x1a'));var dynamics365=require(_0x7f61('0x1b'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7f61('0x1c')](_0x7f61('0x1d'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7f61('0x1c')](_0x7f61('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x7f61('0x1e')]()[_0x7f61('0x1f')](user['getAgents']())[_0x7f61('0x1f')](realtime[_0x7f61('0x20')]())[_0x7f61('0x1f')](user[_0x7f61('0x21')]())[_0x7f61('0x1f')](realtime[_0x7f61('0x22')]())[_0x7f61('0x1f')](trunk[_0x7f61('0x23')]())['then'](realtime['initTrunks']())[_0x7f61('0x1f')](voiceQueue[_0x7f61('0x24')]())[_0x7f61('0x1f')](realtime[_0x7f61('0x25')]())[_0x7f61('0x1f')](trigger[_0x7f61('0x26')]())['then'](realtime[_0x7f61('0x27')]())[_0x7f61('0x1f')](template['getTemplates']())['then'](realtime[_0x7f61('0x28')]())[_0x7f61('0x1f')](zendesk['getZendeskAccounts']())[_0x7f61('0x1f')](realtime[_0x7f61('0x29')]())[_0x7f61('0x1f')](salesforce[_0x7f61('0x2a')]())[_0x7f61('0x1f')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x7f61('0x2b')]())[_0x7f61('0x1f')](realtime[_0x7f61('0x2c')]())[_0x7f61('0x1f')](freshdesk[_0x7f61('0x2d')]())[_0x7f61('0x1f')](realtime['initFreshdeskAccounts']())[_0x7f61('0x1f')](desk[_0x7f61('0x2e')]())[_0x7f61('0x1f')](realtime['initDeskAccounts']())[_0x7f61('0x1f')](zoho['getZohoAccounts']())[_0x7f61('0x1f')](realtime['initZohoAccounts']())[_0x7f61('0x1f')](vtiger['getVtigerAccounts']())['then'](realtime['initVtigerAccounts']())[_0x7f61('0x1f')](freshsales[_0x7f61('0x2f')]())['then'](realtime[_0x7f61('0x30')]())[_0x7f61('0x1f')](servicenow['getServicenowAccounts']())[_0x7f61('0x1f')](realtime[_0x7f61('0x31')]())['then'](dynamics365['getDynamics365Accounts']())['then'](realtime['initDynamics365Accounts']())['then'](campaign[_0x7f61('0x32')]())['then'](realtime[_0x7f61('0x33')]())['then'](voiceExtension[_0x7f61('0x34')]())['then'](realtime[_0x7f61('0x35')]())[_0x7f61('0x1f')](faxAccount[_0x7f61('0x36')]())['then'](realtime[_0x7f61('0x37')]())[_0x7f61('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0x7f61('0x1e')]()['then'](voiceQueueReport['getVoiceQueueReports']())[_0x7f61('0x1f')](realtime[_0x7f61('0x38')]())['then'](cmHopperHistory[_0x7f61('0x39')]())['then'](realtime[_0x7f61('0x3a')]())[_0x7f61('0x1f')](cmHopperHistory[_0x7f61('0x3b')]())['then'](realtime[_0x7f61('0x3c')]())[_0x7f61('0x1f')](voiceCallReport[_0x7f61('0x3d')]())['then'](realtime[_0x7f61('0x3e')]())[_0x7f61('0x1f')](function(_0x3bb5e7){})[_0x7f61('0x3f')](function(_0x37b4ff){console['log'](_0x37b4ff);});}function main(){return server[_0x7f61('0x40')](realtime,preview,fax)['then'](function(_0x1d47de){return initRealtime();})[_0x7f61('0x1f')](function(){return initParams();})[_0x7f61('0x1f')](function(){report[_0x7f61('0x41')]();setInterval(initRealtime,0x1388);})[_0x7f61('0x3f')](function(_0x1d77d1){console[_0x7f61('0x42')](_0x1d77d1);});}main();
\ No newline at end of file
+var _0x1e47=['initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initVoiceQueueReports','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','sync','bluebird','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','hour','get','resolve','getAgents','then','getTelephones','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns'];(function(_0x56928f,_0x229473){var _0x159b5d=function(_0x8ef81){while(--_0x8ef81){_0x56928f['push'](_0x56928f['shift']());}};_0x159b5d(++_0x229473);}(_0x1e47,0x104));var _0x71e4=function(_0x60f412,_0x36afc2){_0x60f412=_0x60f412-0x0;var _0x121456=_0x1e47[_0x60f412];return _0x121456;};'use strict';var BPromise=require(_0x71e4('0x0'));var util=require('util');var moment=require(_0x71e4('0x1'));var server=require(_0x71e4('0x2'));var Realtime=require(_0x71e4('0x3'));var Report=require(_0x71e4('0x4'));var Acw=require(_0x71e4('0x5'));var Trigger=require(_0x71e4('0x6'));var Dialer=require(_0x71e4('0x7'));var Preview=require('./preview');var Fax=require(_0x71e4('0x8'));var user=require(_0x71e4('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x71e4('0xa'));var voiceCallReport=require(_0x71e4('0xb'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x71e4('0xc'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x71e4('0xd'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x71e4('0xe'));var sugarcrm=require(_0x71e4('0xf'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x71e4('0x10'));var vtiger=require(_0x71e4('0x11'));var freshsales=require(_0x71e4('0x12'));var servicenow=require(_0x71e4('0x13'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x71e4('0x14'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x71e4('0x15')](_0x71e4('0x14'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x71e4('0x16')]()['then'](user[_0x71e4('0x17')]())[_0x71e4('0x18')](realtime['initAgents']())[_0x71e4('0x18')](user[_0x71e4('0x19')]())['then'](realtime[_0x71e4('0x1a')]())[_0x71e4('0x18')](trunk['getTrunks']())[_0x71e4('0x18')](realtime[_0x71e4('0x1b')]())[_0x71e4('0x18')](voiceQueue[_0x71e4('0x1c')]())[_0x71e4('0x18')](realtime[_0x71e4('0x1d')]())[_0x71e4('0x18')](trigger[_0x71e4('0x1e')]())['then'](realtime[_0x71e4('0x1f')]())['then'](template[_0x71e4('0x20')]())[_0x71e4('0x18')](realtime[_0x71e4('0x21')]())[_0x71e4('0x18')](zendesk[_0x71e4('0x22')]())['then'](realtime[_0x71e4('0x23')]())['then'](salesforce[_0x71e4('0x24')]())['then'](realtime['initSalesforceAccounts']())[_0x71e4('0x18')](sugarcrm[_0x71e4('0x25')]())[_0x71e4('0x18')](realtime['initSugarcrmAccounts']())[_0x71e4('0x18')](freshdesk[_0x71e4('0x26')]())[_0x71e4('0x18')](realtime[_0x71e4('0x27')]())[_0x71e4('0x18')](desk['getDeskAccounts']())[_0x71e4('0x18')](realtime[_0x71e4('0x28')]())[_0x71e4('0x18')](zoho[_0x71e4('0x29')]())[_0x71e4('0x18')](realtime[_0x71e4('0x2a')]())[_0x71e4('0x18')](vtiger['getVtigerAccounts']())[_0x71e4('0x18')](realtime[_0x71e4('0x2b')]())[_0x71e4('0x18')](freshsales[_0x71e4('0x2c')]())[_0x71e4('0x18')](realtime[_0x71e4('0x2d')]())[_0x71e4('0x18')](servicenow[_0x71e4('0x2e')]())['then'](realtime['initServicenowAccounts']())[_0x71e4('0x18')](dynamics365[_0x71e4('0x2f')]())[_0x71e4('0x18')](realtime[_0x71e4('0x30')]())[_0x71e4('0x18')](campaign[_0x71e4('0x31')]())[_0x71e4('0x18')](realtime[_0x71e4('0x32')]())['then'](voiceExtension[_0x71e4('0x33')]())[_0x71e4('0x18')](realtime[_0x71e4('0x34')]())[_0x71e4('0x18')](faxAccount[_0x71e4('0x35')]())['then'](realtime['initFaxAccounts']())[_0x71e4('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0x71e4('0x16')]()[_0x71e4('0x18')](voiceQueueReport['getVoiceQueueReports']())[_0x71e4('0x18')](realtime[_0x71e4('0x36')]())[_0x71e4('0x18')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x71e4('0x18')](realtime['initVoiceQueueHopperHistory']())[_0x71e4('0x18')](cmHopperHistory[_0x71e4('0x37')]())[_0x71e4('0x18')](realtime[_0x71e4('0x38')]())[_0x71e4('0x18')](voiceCallReport[_0x71e4('0x39')]())['then'](realtime[_0x71e4('0x3a')]())[_0x71e4('0x18')](function(_0xce125e){})[_0x71e4('0x3b')](function(_0x1d4e44){console[_0x71e4('0x3c')](_0x1d4e44);});}function main(){return server['listen'](realtime,preview,fax)[_0x71e4('0x18')](function(_0x2af31e){return initRealtime();})[_0x71e4('0x18')](function(){return initParams();})[_0x71e4('0x18')](function(){report[_0x71e4('0x3d')]();setInterval(initRealtime,0x1388);})[_0x71e4('0x3b')](function(_0x452ffd){console[_0x71e4('0x3c')](_0x452ffd);});}main();
\ No newline at end of file