Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / services / routing / model / smsQueue.js
index 27bee7f..e7381a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['prototype','_rr','map','online','loggedIn','smsPause','available','paused','stringify','format','sms:queue:%s','emit','exports','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x381f7f,_0x1321a9){var _0xd2ae6d=function(_0x44229a){while(--_0x44229a){_0x381f7f['push'](_0x381f7f['shift']());}};_0xd2ae6d(++_0x1321a9);}(_0xe706,0xa3));var _0x6e70=function(_0x1aeb39,_0x2e8404){_0x1aeb39=_0x1aeb39-0x0;var _0x439790=_0xe706[_0x1aeb39];return _0x439790;};'use strict';var _=require(_0x6e70('0x0'));var md5=require(_0x6e70('0x1'));var util=require(_0x6e70('0x2'));var Redis=require('ioredis');var config=require(_0x6e70('0x3'));config[_0x6e70('0x4')]=_[_0x6e70('0x5')](config[_0x6e70('0x4')],{'host':_0x6e70('0x6'),'port':0x18eb});var io=require(_0x6e70('0x7'))(new Redis(config[_0x6e70('0x4')]));function SmsQueue(_0x506db9){this['id']=_0x506db9['id']||0x0;this[_0x6e70('0x8')]=_0x506db9[_0x6e70('0x8')]||'';this[_0x6e70('0x9')]=_0x506db9[_0x6e70('0x9')]||0xa;this[_0x6e70('0xa')]=_0x506db9[_0x6e70('0xa')]||_0x6e70('0xb');this[_0x6e70('0xc')]=_0x506db9[_0x6e70('0xc')];this[_0x6e70('0xd')]={};this[_0x6e70('0xe')]=0x0;this[_0x6e70('0x1')]='';this[_0x6e70('0xf')]();this[_0x6e70('0x10')]();}SmsQueue[_0x6e70('0x11')][_0x6e70('0xf')]=function(){var _0x5b3d07=this['mapAgentsId'][_0x6e70('0x12')];this[_0x6e70('0xd')]=_[_0x6e70('0x13')](this[_0x6e70('0xc')],'id');this[_0x6e70('0xd')][_0x6e70('0x12')]=_0x5b3d07;};SmsQueue[_0x6e70('0x11')][_0x6e70('0x10')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x48bc72=0x0;_0x48bc72<this[_0x6e70('0xc')]['length'];_0x48bc72+=0x1){if(this['Agents'][_0x48bc72][_0x6e70('0x14')]){this[_0x6e70('0x15')]+=0x1;}if(this['Agents'][_0x48bc72][_0x6e70('0x16')]){this['paused']+=0x1;}}this[_0x6e70('0x17')]=this[_0x6e70('0x15')]-this['paused'];this['available']=this[_0x6e70('0x17')]>=0x0?this['available']:0x0;var _0x28a21f={'id':this['id'],'available':this[_0x6e70('0x17')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x6e70('0x18')],'waiting':this[_0x6e70('0xe')]};var _0x2368eb=md5(JSON[_0x6e70('0x19')](_0x28a21f));if(this[_0x6e70('0x1')]!==_0x2368eb){this[_0x6e70('0x1')]=_0x2368eb;io['to'](util[_0x6e70('0x1a')](_0x6e70('0x1b'),_0x28a21f[_0x6e70('0x8')]))[_0x6e70('0x1c')]('sms_queue:save',_0x28a21f);}};module[_0x6e70('0x1d')]=SmsQueue;
\ No newline at end of file
+var _0x5ad3=['sms_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','prototype','_rr','mapAgentsId','updateRealtime','loggedIn','paused','length','online','smsPause','available','stringify','format','sms:queue:%s','emit'];(function(_0x594bdb,_0x5b42a9){var _0x7f732a=function(_0x125461){while(--_0x125461){_0x594bdb['push'](_0x594bdb['shift']());}};_0x7f732a(++_0x5b42a9);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x14a4d0,_0x4c7068){_0x14a4d0=_0x14a4d0-0x0;var _0x18c8ab=_0x5ad3[_0x14a4d0];return _0x18c8ab;};'use strict';var _=require(_0x35ad('0x0'));var md5=require(_0x35ad('0x1'));var util=require(_0x35ad('0x2'));var Redis=require(_0x35ad('0x3'));var config=require('../../../config/environment');config[_0x35ad('0x4')]=_[_0x35ad('0x5')](config[_0x35ad('0x4')],{'host':_0x35ad('0x6'),'port':0x18eb});var io=require(_0x35ad('0x7'))(new Redis(config[_0x35ad('0x4')]));function SmsQueue(_0x729a01){this['id']=_0x729a01['id']||0x0;this[_0x35ad('0x8')]=_0x729a01[_0x35ad('0x8')]||'';this[_0x35ad('0x9')]=_0x729a01['timeout']||0xa;this[_0x35ad('0xa')]=_0x729a01[_0x35ad('0xa')]||_0x35ad('0xb');this['Agents']=_0x729a01[_0x35ad('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x35ad('0x1')]='';this[_0x35ad('0xd')]();this['updateRealtime']();}SmsQueue[_0x35ad('0xe')][_0x35ad('0xd')]=function(){var _0x4ad760=this['mapAgentsId'][_0x35ad('0xf')];this[_0x35ad('0x10')]=_['map'](this[_0x35ad('0xc')],'id');this[_0x35ad('0x10')]['_rr']=_0x4ad760;};SmsQueue['prototype'][_0x35ad('0x11')]=function(){this[_0x35ad('0x12')]=0x0;this[_0x35ad('0x13')]=0x0;for(var _0x4b7ad9=0x0;_0x4b7ad9<this[_0x35ad('0xc')][_0x35ad('0x14')];_0x4b7ad9+=0x1){if(this['Agents'][_0x4b7ad9][_0x35ad('0x15')]){this['loggedIn']+=0x1;}if(this['Agents'][_0x4b7ad9][_0x35ad('0x16')]){this[_0x35ad('0x13')]+=0x1;}}this[_0x35ad('0x17')]=this['loggedIn']-this[_0x35ad('0x13')];this[_0x35ad('0x17')]=this[_0x35ad('0x17')]>=0x0?this[_0x35ad('0x17')]:0x0;var _0x3a73c8={'id':this['id'],'available':this[_0x35ad('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x35ad('0x8')],'paused':this[_0x35ad('0x13')],'waiting':this['waiting']};var _0x53b8e3=md5(JSON[_0x35ad('0x18')](_0x3a73c8));if(this[_0x35ad('0x1')]!==_0x53b8e3){this['md5']=_0x53b8e3;io['to'](util[_0x35ad('0x19')](_0x35ad('0x1a'),_0x3a73c8['name']))[_0x35ad('0x1b')](_0x35ad('0x1c'),_0x3a73c8);}};module[_0x35ad('0x1d')]=SmsQueue;
\ No newline at end of file