Built motion from commit b0a9a629.|2.6.33
[motion2.git] / server / services / routing / model / smsQueue.js
index 675eabc..4ffb33c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe43c=['available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','prototype','_rr','map','Agents','updateRealtime','loggedIn','length','smsPause','paused'];(function(_0x16daee,_0x54a221){var _0x577a36=function(_0x5ede24){while(--_0x5ede24){_0x16daee['push'](_0x16daee['shift']());}};_0x577a36(++_0x54a221);}(_0xe43c,0x180));var _0xce43=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe43c[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xce43('0x0'));var md5=require(_0xce43('0x1'));var util=require(_0xce43('0x2'));var Redis=require(_0xce43('0x3'));var config=require(_0xce43('0x4'));config[_0xce43('0x5')]=_['defaults'](config[_0xce43('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xce43('0x6'))(new Redis(config[_0xce43('0x5')]));function SmsQueue(_0xcec0ef){this['id']=_0xcec0ef['id']||0x0;this[_0xce43('0x7')]=_0xcec0ef['name']||'';this[_0xce43('0x8')]=_0xcec0ef['timeout']||0xa;this[_0xce43('0x9')]=_0xcec0ef['strategy']||_0xce43('0xa');this['Agents']=_0xcec0ef['Agents'];this[_0xce43('0xb')]={};this[_0xce43('0xc')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0xce43('0xd')]['updateRouting']=function(){var _0x2f1926=this['mapAgentsId'][_0xce43('0xe')];this['mapAgentsId']=_[_0xce43('0xf')](this[_0xce43('0x10')],'id');this[_0xce43('0xb')][_0xce43('0xe')]=_0x2f1926;};SmsQueue[_0xce43('0xd')][_0xce43('0x11')]=function(){this[_0xce43('0x12')]=0x0;this['paused']=0x0;for(var _0x3034c7=0x0;_0x3034c7<this[_0xce43('0x10')][_0xce43('0x13')];_0x3034c7+=0x1){if(this[_0xce43('0x10')][_0x3034c7]['online']){this['loggedIn']+=0x1;}if(this[_0xce43('0x10')][_0x3034c7][_0xce43('0x14')]){this[_0xce43('0x15')]+=0x1;}}this[_0xce43('0x16')]=this[_0xce43('0x12')]-this[_0xce43('0x15')];this['available']=this[_0xce43('0x16')]>=0x0?this[_0xce43('0x16')]:0x0;var _0xbc38f0={'id':this['id'],'available':this[_0xce43('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xce43('0x7')],'paused':this[_0xce43('0x15')],'waiting':this[_0xce43('0xc')]};var _0x2506de=md5(JSON[_0xce43('0x17')](_0xbc38f0));if(this[_0xce43('0x1')]!==_0x2506de){this['md5']=_0x2506de;io['to'](util[_0xce43('0x18')](_0xce43('0x19'),_0xbc38f0['name']))[_0xce43('0x1a')](_0xce43('0x1b'),_0xbc38f0);}};module[_0xce43('0x1c')]=SmsQueue;
\ No newline at end of file
+var _0x6737=['Agents','mapAgentsId','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','beepall'];(function(_0x2fc0f4,_0x5713f9){var _0x196627=function(_0x30121c){while(--_0x30121c){_0x2fc0f4['push'](_0x2fc0f4['shift']());}};_0x196627(++_0x5713f9);}(_0x6737,0xe2));var _0x7673=function(_0x41199b,_0x276cde){_0x41199b=_0x41199b-0x0;var _0x2f3d86=_0x6737[_0x41199b];return _0x2f3d86;};'use strict';var _=require('lodash');var md5=require(_0x7673('0x0'));var util=require(_0x7673('0x1'));var Redis=require('ioredis');var config=require(_0x7673('0x2'));config[_0x7673('0x3')]=_[_0x7673('0x4')](config[_0x7673('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x7673('0x5'))(new Redis(config[_0x7673('0x3')]));function SmsQueue(_0x543b61){this['id']=_0x543b61['id']||0x0;this[_0x7673('0x6')]=_0x543b61[_0x7673('0x6')]||'';this['timeout']=_0x543b61['timeout']||0xa;this['strategy']=_0x543b61['strategy']||_0x7673('0x7');this['Agents']=_0x543b61[_0x7673('0x8')];this[_0x7673('0x9')]={};this['waiting']=0x0;this[_0x7673('0x0')]='';this[_0x7673('0xa')]();this[_0x7673('0xb')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x3ca258=this['mapAgentsId'][_0x7673('0xc')];this[_0x7673('0x9')]=_[_0x7673('0xd')](this[_0x7673('0x8')],'id');this[_0x7673('0x9')][_0x7673('0xc')]=_0x3ca258;};SmsQueue[_0x7673('0xe')][_0x7673('0xb')]=function(){this[_0x7673('0xf')]=0x0;this[_0x7673('0x10')]=0x0;for(var _0x5c8626=0x0;_0x5c8626<this[_0x7673('0x8')][_0x7673('0x11')];_0x5c8626+=0x1){if(this[_0x7673('0x8')][_0x5c8626][_0x7673('0x12')]){this[_0x7673('0xf')]+=0x1;}if(this[_0x7673('0x8')][_0x5c8626][_0x7673('0x13')]){this['paused']+=0x1;}}this['available']=this[_0x7673('0xf')]-this[_0x7673('0x10')];this['available']=this[_0x7673('0x14')]>=0x0?this[_0x7673('0x14')]:0x0;var _0x58a821={'id':this['id'],'available':this[_0x7673('0x14')],'loggedIn':this[_0x7673('0xf')],'name':this[_0x7673('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x249fe3=md5(JSON[_0x7673('0x15')](_0x58a821));if(this['md5']!==_0x249fe3){this[_0x7673('0x0')]=_0x249fe3;io['to'](util[_0x7673('0x16')](_0x7673('0x17'),_0x58a821[_0x7673('0x6')]))[_0x7673('0x18')](_0x7673('0x19'),_0x58a821);}};module['exports']=SmsQueue;
\ No newline at end of file