Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / server / services / routing / model / smsQueue.js
index b043363..e7381a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf6e=['loggedIn','paused','online','smsPause','available','stringify','format','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','md5','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map'];(function(_0x39cd25,_0x10d989){var _0x17367e=function(_0x480812){while(--_0x480812){_0x39cd25['push'](_0x39cd25['shift']());}};_0x17367e(++_0x10d989);}(_0xbf6e,0x149));var _0xebf6=function(_0x1cd61f,_0x22e7af){_0x1cd61f=_0x1cd61f-0x0;var _0x27cee9=_0xbf6e[_0x1cd61f];return _0x27cee9;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xebf6('0x0'));var Redis=require(_0xebf6('0x1'));var config=require(_0xebf6('0x2'));config[_0xebf6('0x3')]=_[_0xebf6('0x4')](config[_0xebf6('0x3')],{'host':_0xebf6('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xebf6('0x3')]));function SmsQueue(_0x6ff2a3){this['id']=_0x6ff2a3['id']||0x0;this[_0xebf6('0x6')]=_0x6ff2a3[_0xebf6('0x6')]||'';this[_0xebf6('0x7')]=_0x6ff2a3[_0xebf6('0x7')]||0xa;this[_0xebf6('0x8')]=_0x6ff2a3['strategy']||_0xebf6('0x9');this[_0xebf6('0xa')]=_0x6ff2a3[_0xebf6('0xa')];this['mapAgentsId']={};this[_0xebf6('0xb')]=0x0;this[_0xebf6('0xc')]='';this['updateRouting']();this[_0xebf6('0xd')]();}SmsQueue[_0xebf6('0xe')][_0xebf6('0xf')]=function(){var _0x3954f4=this[_0xebf6('0x10')][_0xebf6('0x11')];this['mapAgentsId']=_[_0xebf6('0x12')](this[_0xebf6('0xa')],'id');this['mapAgentsId'][_0xebf6('0x11')]=_0x3954f4;};SmsQueue[_0xebf6('0xe')][_0xebf6('0xd')]=function(){this[_0xebf6('0x13')]=0x0;this[_0xebf6('0x14')]=0x0;for(var _0x4dbf51=0x0;_0x4dbf51<this['Agents']['length'];_0x4dbf51+=0x1){if(this[_0xebf6('0xa')][_0x4dbf51][_0xebf6('0x15')]){this['loggedIn']+=0x1;}if(this[_0xebf6('0xa')][_0x4dbf51][_0xebf6('0x16')]){this[_0xebf6('0x14')]+=0x1;}}this[_0xebf6('0x17')]=this[_0xebf6('0x13')]-this[_0xebf6('0x14')];this[_0xebf6('0x17')]=this[_0xebf6('0x17')]>=0x0?this[_0xebf6('0x17')]:0x0;var _0x308480={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xebf6('0x6')],'paused':this[_0xebf6('0x14')],'waiting':this[_0xebf6('0xb')]};var _0x410f06=md5(JSON[_0xebf6('0x18')](_0x308480));if(this[_0xebf6('0xc')]!==_0x410f06){this[_0xebf6('0xc')]=_0x410f06;io['to'](util[_0xebf6('0x19')]('sms:queue:%s',_0x308480[_0xebf6('0x6')]))[_0xebf6('0x1a')](_0xebf6('0x1b'),_0x308480);}};module[_0xebf6('0x1c')]=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