Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / services / routing / model / smsQueue.js
index 1779e61..e7381a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6fb=['redis','defaults','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','_rr','map','updateRealtime','loggedIn','paused','online','smsPause','available','sms:queue:%s','emit','exports','util','ioredis'];(function(_0x3bf586,_0x4b8779){var _0x4c23b8=function(_0x2bf355){while(--_0x2bf355){_0x3bf586['push'](_0x3bf586['shift']());}};_0x4c23b8(++_0x4b8779);}(_0xf6fb,0x111));var _0xbf6f=function(_0x2673bc,_0x7ff44e){_0x2673bc=_0x2673bc-0x0;var _0x5f0d90=_0xf6fb[_0x2673bc];return _0x5f0d90;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xbf6f('0x0'));var Redis=require(_0xbf6f('0x1'));var config=require('../../../config/environment');config[_0xbf6f('0x2')]=_[_0xbf6f('0x3')](config['redis'],{'host':_0xbf6f('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbf6f('0x2')]));function SmsQueue(_0x41f22f){this['id']=_0x41f22f['id']||0x0;this[_0xbf6f('0x5')]=_0x41f22f[_0xbf6f('0x5')]||'';this[_0xbf6f('0x6')]=_0x41f22f[_0xbf6f('0x6')]||0xa;this[_0xbf6f('0x7')]=_0x41f22f[_0xbf6f('0x7')]||'beepall';this[_0xbf6f('0x8')]=_0x41f22f[_0xbf6f('0x8')];this[_0xbf6f('0x9')]={};this[_0xbf6f('0xa')]=0x0;this[_0xbf6f('0xb')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0xbf6f('0xc')][_0xbf6f('0xd')]=function(){var _0x256f0a=this['mapAgentsId'][_0xbf6f('0xe')];this['mapAgentsId']=_[_0xbf6f('0xf')](this[_0xbf6f('0x8')],'id');this[_0xbf6f('0x9')]['_rr']=_0x256f0a;};SmsQueue[_0xbf6f('0xc')][_0xbf6f('0x10')]=function(){this[_0xbf6f('0x11')]=0x0;this[_0xbf6f('0x12')]=0x0;for(var _0xce557a=0x0;_0xce557a<this[_0xbf6f('0x8')]['length'];_0xce557a+=0x1){if(this[_0xbf6f('0x8')][_0xce557a][_0xbf6f('0x13')]){this[_0xbf6f('0x11')]+=0x1;}if(this[_0xbf6f('0x8')][_0xce557a][_0xbf6f('0x14')]){this[_0xbf6f('0x12')]+=0x1;}}this[_0xbf6f('0x15')]=this['loggedIn']-this['paused'];this[_0xbf6f('0x15')]=this[_0xbf6f('0x15')]>=0x0?this[_0xbf6f('0x15')]:0x0;var _0x4b3c33={'id':this['id'],'available':this['available'],'loggedIn':this[_0xbf6f('0x11')],'name':this[_0xbf6f('0x5')],'paused':this[_0xbf6f('0x12')],'waiting':this[_0xbf6f('0xa')]};var _0x18fc9d=md5(JSON['stringify'](_0x4b3c33));if(this['md5']!==_0x18fc9d){this[_0xbf6f('0xb')]=_0x18fc9d;io['to'](util['format'](_0xbf6f('0x16'),_0x4b3c33[_0xbf6f('0x5')]))[_0xbf6f('0x17')]('sms_queue:save',_0x4b3c33);}};module[_0xbf6f('0x18')]=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