Built motion from commit (unavailable).|2.5.21
[motion2.git] / server / services / routing / model / openchannelQueue.js
index c3bd904..295d457 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0be=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','openchannelPause','available','stringify','openchannel:queue:%s','emit','exports','lodash','md5','util','ioredis','redis'];(function(_0x54db14,_0x5a3cee){var _0x587884=function(_0x941121){while(--_0x941121){_0x54db14['push'](_0x54db14['shift']());}};_0x587884(++_0x5a3cee);}(_0xd0be,0x6f));var _0xed0b=function(_0x5a4935,_0x9a0cee){_0x5a4935=_0x5a4935-0x0;var _0x116100=_0xd0be[_0x5a4935];return _0x116100;};'use strict';var _=require(_0xed0b('0x0'));var md5=require(_0xed0b('0x1'));var util=require(_0xed0b('0x2'));var Redis=require(_0xed0b('0x3'));var config=require('../../../config/environment');config[_0xed0b('0x4')]=_[_0xed0b('0x5')](config[_0xed0b('0x4')],{'host':_0xed0b('0x6'),'port':0x18eb});var io=require(_0xed0b('0x7'))(new Redis(config[_0xed0b('0x4')]));function OpenchannelQueue(_0x355a31){this['id']=_0x355a31['id']||0x0;this[_0xed0b('0x8')]=_0x355a31[_0xed0b('0x8')]||'';this[_0xed0b('0x9')]=_0x355a31[_0xed0b('0x9')]||0xa;this[_0xed0b('0xa')]=_0x355a31[_0xed0b('0xa')]||_0xed0b('0xb');this[_0xed0b('0xc')]=_0x355a31['Agents'];this[_0xed0b('0xd')]={};this[_0xed0b('0xe')]=0x0;this[_0xed0b('0x1')]='';this[_0xed0b('0xf')]();this[_0xed0b('0x10')]();}OpenchannelQueue[_0xed0b('0x11')]['updateRouting']=function(){var _0x415cc5=this[_0xed0b('0xd')][_0xed0b('0x12')];this[_0xed0b('0xd')]=_['map'](this[_0xed0b('0xc')],'id');this[_0xed0b('0xd')]['_rr']=_0x415cc5;};OpenchannelQueue[_0xed0b('0x11')][_0xed0b('0x10')]=function(){this[_0xed0b('0x13')]=0x0;this[_0xed0b('0x14')]=0x0;for(var _0x1f5627=0x0;_0x1f5627<this[_0xed0b('0xc')][_0xed0b('0x15')];_0x1f5627+=0x1){if(this[_0xed0b('0xc')][_0x1f5627][_0xed0b('0x16')]){this[_0xed0b('0x13')]+=0x1;}if(this[_0xed0b('0xc')][_0x1f5627][_0xed0b('0x17')]){this['paused']+=0x1;}}this[_0xed0b('0x18')]=this[_0xed0b('0x13')]-this[_0xed0b('0x14')];this['available']=this['available']>=0x0?this[_0xed0b('0x18')]:0x0;var _0x5efc18={'id':this['id'],'available':this[_0xed0b('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xed0b('0x8')],'paused':this['paused'],'waiting':this[_0xed0b('0xe')]};var _0x822cfe=md5(JSON[_0xed0b('0x19')](_0x5efc18));if(this['md5']!==_0x822cfe){this[_0xed0b('0x1')]=_0x822cfe;io['to'](util['format'](_0xed0b('0x1a'),_0x5efc18[_0xed0b('0x8')]))[_0xed0b('0x1b')]('openchannel_queue:save',_0x5efc18);}};module[_0xed0b('0x1c')]=OpenchannelQueue;
\ No newline at end of file
+var _0x36ce=['format','openchannel:queue:%s','emit','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','length','online','openchannelPause','paused','available'];(function(_0x11270e,_0x3f7c7e){var _0x561007=function(_0x3ed1c8){while(--_0x3ed1c8){_0x11270e['push'](_0x11270e['shift']());}};_0x561007(++_0x3f7c7e);}(_0x36ce,0x15a));var _0xe36c=function(_0x4c17c3,_0x1b13c3){_0x4c17c3=_0x4c17c3-0x0;var _0x1275ca=_0x36ce[_0x4c17c3];return _0x1275ca;};'use strict';var _=require('lodash');var md5=require(_0xe36c('0x0'));var util=require(_0xe36c('0x1'));var Redis=require(_0xe36c('0x2'));var config=require(_0xe36c('0x3'));config[_0xe36c('0x4')]=_[_0xe36c('0x5')](config['redis'],{'host':_0xe36c('0x6'),'port':0x18eb});var io=require(_0xe36c('0x7'))(new Redis(config[_0xe36c('0x4')]));function OpenchannelQueue(_0x7c584a){this['id']=_0x7c584a['id']||0x0;this['name']=_0x7c584a[_0xe36c('0x8')]||'';this[_0xe36c('0x9')]=_0x7c584a[_0xe36c('0x9')]||0xa;this[_0xe36c('0xa')]=_0x7c584a[_0xe36c('0xa')]||_0xe36c('0xb');this['Agents']=_0x7c584a[_0xe36c('0xc')];this['mapAgentsId']={};this[_0xe36c('0xd')]=0x0;this[_0xe36c('0x0')]='';this[_0xe36c('0xe')]();this[_0xe36c('0xf')]();}OpenchannelQueue[_0xe36c('0x10')][_0xe36c('0xe')]=function(){var _0xbe0e90=this[_0xe36c('0x11')]['_rr'];this[_0xe36c('0x11')]=_[_0xe36c('0x12')](this[_0xe36c('0xc')],'id');this[_0xe36c('0x11')][_0xe36c('0x13')]=_0xbe0e90;};OpenchannelQueue[_0xe36c('0x10')][_0xe36c('0xf')]=function(){this[_0xe36c('0x14')]=0x0;this['paused']=0x0;for(var _0x538052=0x0;_0x538052<this[_0xe36c('0xc')][_0xe36c('0x15')];_0x538052+=0x1){if(this['Agents'][_0x538052][_0xe36c('0x16')]){this[_0xe36c('0x14')]+=0x1;}if(this[_0xe36c('0xc')][_0x538052][_0xe36c('0x17')]){this[_0xe36c('0x18')]+=0x1;}}this[_0xe36c('0x19')]=this[_0xe36c('0x14')]-this[_0xe36c('0x18')];this[_0xe36c('0x19')]=this[_0xe36c('0x19')]>=0x0?this[_0xe36c('0x19')]:0x0;var _0x36b460={'id':this['id'],'available':this[_0xe36c('0x19')],'loggedIn':this[_0xe36c('0x14')],'name':this[_0xe36c('0x8')],'paused':this['paused'],'waiting':this[_0xe36c('0xd')]};var _0x1ea3a9=md5(JSON['stringify'](_0x36b460));if(this[_0xe36c('0x0')]!==_0x1ea3a9){this['md5']=_0x1ea3a9;io['to'](util[_0xe36c('0x1a')](_0xe36c('0x1b'),_0x36b460[_0xe36c('0x8')]))[_0xe36c('0x1c')](_0xe36c('0x1d'),_0x36b460);}};module[_0xe36c('0x1e')]=OpenchannelQueue;
\ No newline at end of file