Built motion from commit 97f2f211.|2.6.31
[motion2.git] / server / services / routing / model / faxQueue.js
index 0ceffa5..e645bbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed29=['paused','online','faxPause','available','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn'];(function(_0x121f82,_0x32dd3b){var _0x39ae3e=function(_0x4f3f3e){while(--_0x4f3f3e){_0x121f82['push'](_0x121f82['shift']());}};_0x39ae3e(++_0x32dd3b);}(_0xed29,0xf1));var _0x9ed2=function(_0x396e83,_0x2d51e2){_0x396e83=_0x396e83-0x0;var _0x4a42cc=_0xed29[_0x396e83];return _0x4a42cc;};'use strict';var _=require(_0x9ed2('0x0'));var md5=require(_0x9ed2('0x1'));var util=require(_0x9ed2('0x2'));var Redis=require(_0x9ed2('0x3'));var config=require(_0x9ed2('0x4'));config[_0x9ed2('0x5')]=_[_0x9ed2('0x6')](config['redis'],{'host':_0x9ed2('0x7'),'port':0x18eb});var io=require(_0x9ed2('0x8'))(new Redis(config[_0x9ed2('0x5')]));function FaxQueue(_0x479783){this['id']=_0x479783['id']||0x0;this[_0x9ed2('0x9')]=_0x479783[_0x9ed2('0x9')]||'';this['timeout']=_0x479783['timeout']||0xa;this['strategy']=_0x479783['strategy']||_0x9ed2('0xa');this[_0x9ed2('0xb')]=_0x479783[_0x9ed2('0xb')];this[_0x9ed2('0xc')]={};this[_0x9ed2('0xd')]=0x0;this['md5']='';this[_0x9ed2('0xe')]();this[_0x9ed2('0xf')]();}FaxQueue['prototype'][_0x9ed2('0xe')]=function(){var _0x5ab37d=this[_0x9ed2('0xc')][_0x9ed2('0x10')];this['mapAgentsId']=_[_0x9ed2('0x11')](this[_0x9ed2('0xb')],'id');this[_0x9ed2('0xc')][_0x9ed2('0x10')]=_0x5ab37d;};FaxQueue[_0x9ed2('0x12')][_0x9ed2('0xf')]=function(){this[_0x9ed2('0x13')]=0x0;this[_0x9ed2('0x14')]=0x0;for(var _0x3f199f=0x0;_0x3f199f<this[_0x9ed2('0xb')]['length'];_0x3f199f+=0x1){if(this[_0x9ed2('0xb')][_0x3f199f][_0x9ed2('0x15')]){this[_0x9ed2('0x13')]+=0x1;}if(this[_0x9ed2('0xb')][_0x3f199f][_0x9ed2('0x16')]){this[_0x9ed2('0x14')]+=0x1;}}this[_0x9ed2('0x17')]=this[_0x9ed2('0x13')]-this[_0x9ed2('0x14')];this['available']=this['available']>=0x0?this[_0x9ed2('0x17')]:0x0;var _0x2ffecd={'id':this['id'],'available':this[_0x9ed2('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x9ed2('0x9')],'paused':this[_0x9ed2('0x14')],'waiting':this['waiting']};var _0x21c5fd=md5(JSON['stringify'](_0x2ffecd));if(this['md5']!==_0x21c5fd){this['md5']=_0x21c5fd;io['to'](util[_0x9ed2('0x18')](_0x9ed2('0x19'),_0x2ffecd[_0x9ed2('0x9')]))[_0x9ed2('0x1a')](_0x9ed2('0x1b'),_0x2ffecd);}};module[_0x9ed2('0x1c')]=FaxQueue;
\ No newline at end of file
+var _0xe4d0=['online','faxPause','available','emit','fax_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','length'];(function(_0x5340f8,_0x4eda59){var _0x406e27=function(_0x39e57a){while(--_0x39e57a){_0x5340f8['push'](_0x5340f8['shift']());}};_0x406e27(++_0x4eda59);}(_0xe4d0,0x10b));var _0x0e4d=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0xe4d0[_0x566bdf];return _0x331215;};'use strict';var _=require(_0x0e4d('0x0'));var md5=require('md5');var util=require(_0x0e4d('0x1'));var Redis=require(_0x0e4d('0x2'));var config=require(_0x0e4d('0x3'));config[_0x0e4d('0x4')]=_[_0x0e4d('0x5')](config[_0x0e4d('0x4')],{'host':_0x0e4d('0x6'),'port':0x18eb});var io=require(_0x0e4d('0x7'))(new Redis(config[_0x0e4d('0x4')]));function FaxQueue(_0x429a09){this['id']=_0x429a09['id']||0x0;this[_0x0e4d('0x8')]=_0x429a09[_0x0e4d('0x8')]||'';this['timeout']=_0x429a09[_0x0e4d('0x9')]||0xa;this[_0x0e4d('0xa')]=_0x429a09[_0x0e4d('0xa')]||_0x0e4d('0xb');this[_0x0e4d('0xc')]=_0x429a09[_0x0e4d('0xc')];this[_0x0e4d('0xd')]={};this[_0x0e4d('0xe')]=0x0;this[_0x0e4d('0xf')]='';this[_0x0e4d('0x10')]();this[_0x0e4d('0x11')]();}FaxQueue['prototype'][_0x0e4d('0x10')]=function(){var _0x20e785=this[_0x0e4d('0xd')]['_rr'];this[_0x0e4d('0xd')]=_['map'](this[_0x0e4d('0xc')],'id');this[_0x0e4d('0xd')][_0x0e4d('0x12')]=_0x20e785;};FaxQueue[_0x0e4d('0x13')][_0x0e4d('0x11')]=function(){this[_0x0e4d('0x14')]=0x0;this[_0x0e4d('0x15')]=0x0;for(var _0x331f33=0x0;_0x331f33<this[_0x0e4d('0xc')][_0x0e4d('0x16')];_0x331f33+=0x1){if(this[_0x0e4d('0xc')][_0x331f33][_0x0e4d('0x17')]){this[_0x0e4d('0x14')]+=0x1;}if(this[_0x0e4d('0xc')][_0x331f33][_0x0e4d('0x18')]){this[_0x0e4d('0x15')]+=0x1;}}this[_0x0e4d('0x19')]=this['loggedIn']-this[_0x0e4d('0x15')];this[_0x0e4d('0x19')]=this[_0x0e4d('0x19')]>=0x0?this['available']:0x0;var _0x2adebd={'id':this['id'],'available':this[_0x0e4d('0x19')],'loggedIn':this[_0x0e4d('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this['waiting']};var _0x22ca39=md5(JSON['stringify'](_0x2adebd));if(this[_0x0e4d('0xf')]!==_0x22ca39){this[_0x0e4d('0xf')]=_0x22ca39;io['to'](util['format']('fax:queue:%s',_0x2adebd['name']))[_0x0e4d('0x1a')](_0x0e4d('0x1b'),_0x2adebd);}};module[_0x0e4d('0x1c')]=FaxQueue;
\ No newline at end of file