Built motion from commit 9d5c653a.|2.5.44
[motion2.git] / server / services / routing / model / faxQueue.js
index e0dec1a..c623e26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcc9=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','paused','length','online','faxPause','available','loggedIn','stringify','format','emit','exports','lodash','md5','ioredis','redis','defaults'];(function(_0x316a88,_0x451333){var _0x2d35b1=function(_0x234608){while(--_0x234608){_0x316a88['push'](_0x316a88['shift']());}};_0x2d35b1(++_0x451333);}(_0xdcc9,0x10e));var _0x9dcc=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0xdcc9[_0x18d5d7];return _0x30a9ea;};'use strict';var _=require(_0x9dcc('0x0'));var md5=require(_0x9dcc('0x1'));var util=require('util');var Redis=require(_0x9dcc('0x2'));var config=require('../../../config/environment');config[_0x9dcc('0x3')]=_[_0x9dcc('0x4')](config[_0x9dcc('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x9dcc('0x5'))(new Redis(config['redis']));function FaxQueue(_0xf34d32){this['id']=_0xf34d32['id']||0x0;this[_0x9dcc('0x6')]=_0xf34d32['name']||'';this['timeout']=_0xf34d32[_0x9dcc('0x7')]||0xa;this[_0x9dcc('0x8')]=_0xf34d32[_0x9dcc('0x8')]||_0x9dcc('0x9');this[_0x9dcc('0xa')]=_0xf34d32[_0x9dcc('0xa')];this[_0x9dcc('0xb')]={};this[_0x9dcc('0xc')]=0x0;this[_0x9dcc('0x1')]='';this[_0x9dcc('0xd')]();this['updateRealtime']();}FaxQueue[_0x9dcc('0xe')]['updateRouting']=function(){var _0x1cc4b1=this[_0x9dcc('0xb')]['_rr'];this['mapAgentsId']=_['map'](this[_0x9dcc('0xa')],'id');this[_0x9dcc('0xb')]['_rr']=_0x1cc4b1;};FaxQueue[_0x9dcc('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x9dcc('0xf')]=0x0;for(var _0x205250=0x0;_0x205250<this[_0x9dcc('0xa')][_0x9dcc('0x10')];_0x205250+=0x1){if(this[_0x9dcc('0xa')][_0x205250][_0x9dcc('0x11')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x205250][_0x9dcc('0x12')]){this[_0x9dcc('0xf')]+=0x1;}}this[_0x9dcc('0x13')]=this['loggedIn']-this[_0x9dcc('0xf')];this[_0x9dcc('0x13')]=this[_0x9dcc('0x13')]>=0x0?this['available']:0x0;var _0x14302a={'id':this['id'],'available':this[_0x9dcc('0x13')],'loggedIn':this[_0x9dcc('0x14')],'name':this[_0x9dcc('0x6')],'paused':this['paused'],'waiting':this[_0x9dcc('0xc')]};var _0xab9e52=md5(JSON[_0x9dcc('0x15')](_0x14302a));if(this['md5']!==_0xab9e52){this[_0x9dcc('0x1')]=_0xab9e52;io['to'](util[_0x9dcc('0x16')]('fax:queue:%s',_0x14302a['name']))[_0x9dcc('0x17')]('fax_queue:save',_0x14302a);}};module[_0x9dcc('0x18')]=FaxQueue;
\ No newline at end of file
+var _0xbf0e=['loggedIn','paused','online','faxPause','available','stringify','fax:queue:%s','lodash','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','Agents','waiting','md5','prototype','updateRouting','mapAgentsId','map','_rr','updateRealtime'];(function(_0x4d009c,_0x574b90){var _0x5cdf6a=function(_0x186822){while(--_0x186822){_0x4d009c['push'](_0x4d009c['shift']());}};_0x5cdf6a(++_0x574b90);}(_0xbf0e,0x133));var _0xebf0=function(_0xe4647e,_0x5711a3){_0xe4647e=_0xe4647e-0x0;var _0x5a1558=_0xbf0e[_0xe4647e];return _0x5a1558;};'use strict';var _=require(_0xebf0('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xebf0('0x1'));var config=require(_0xebf0('0x2'));config[_0xebf0('0x3')]=_[_0xebf0('0x4')](config[_0xebf0('0x3')],{'host':_0xebf0('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xebf0('0x3')]));function FaxQueue(_0x23a010){this['id']=_0x23a010['id']||0x0;this['name']=_0x23a010[_0xebf0('0x6')]||'';this[_0xebf0('0x7')]=_0x23a010[_0xebf0('0x7')]||0xa;this[_0xebf0('0x8')]=_0x23a010[_0xebf0('0x8')]||'beepall';this[_0xebf0('0x9')]=_0x23a010[_0xebf0('0x9')];this['mapAgentsId']={};this[_0xebf0('0xa')]=0x0;this[_0xebf0('0xb')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xebf0('0xc')][_0xebf0('0xd')]=function(){var _0x186436=this[_0xebf0('0xe')]['_rr'];this[_0xebf0('0xe')]=_[_0xebf0('0xf')](this[_0xebf0('0x9')],'id');this[_0xebf0('0xe')][_0xebf0('0x10')]=_0x186436;};FaxQueue[_0xebf0('0xc')][_0xebf0('0x11')]=function(){this[_0xebf0('0x12')]=0x0;this[_0xebf0('0x13')]=0x0;for(var _0x481605=0x0;_0x481605<this[_0xebf0('0x9')]['length'];_0x481605+=0x1){if(this[_0xebf0('0x9')][_0x481605][_0xebf0('0x14')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x481605][_0xebf0('0x15')]){this[_0xebf0('0x13')]+=0x1;}}this[_0xebf0('0x16')]=this[_0xebf0('0x12')]-this[_0xebf0('0x13')];this[_0xebf0('0x16')]=this['available']>=0x0?this[_0xebf0('0x16')]:0x0;var _0x3877bf={'id':this['id'],'available':this[_0xebf0('0x16')],'loggedIn':this[_0xebf0('0x12')],'name':this[_0xebf0('0x6')],'paused':this['paused'],'waiting':this[_0xebf0('0xa')]};var _0x6467c6=md5(JSON[_0xebf0('0x17')](_0x3877bf));if(this['md5']!==_0x6467c6){this[_0xebf0('0xb')]=_0x6467c6;io['to'](util['format'](_0xebf0('0x18'),_0x3877bf[_0xebf0('0x6')]))['emit']('fax_queue:save',_0x3877bf);}};module['exports']=FaxQueue;
\ No newline at end of file