Built motion from commit 4c281f94.|2.6.31
[motion2.git] / server / services / ami / model / agent.js
index 16c96c5..fb844ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3e1=['user:presence','lodash','util','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','toLowerCase','not_inuse','talking','voiceStatus','toNumber','format','user:%s','emit','omit'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0xd3e1,0x198));var _0x1d3e=function(_0x4fe43c,_0x10735a){_0x4fe43c=_0x4fe43c-0x0;var _0x13000b=_0xd3e1[_0x4fe43c];return _0x13000b;};'use strict';var _=require(_0x1d3e('0x0'));var util=require(_0x1d3e('0x1'));var moment=require('moment');var md5=require(_0x1d3e('0x2'));var Redis=require(_0x1d3e('0x3'));var config=require(_0x1d3e('0x4'));config[_0x1d3e('0x5')]=_[_0x1d3e('0x6')](config[_0x1d3e('0x5')],{'host':_0x1d3e('0x7'),'port':0x18eb});var io=require(_0x1d3e('0x8'))(new Redis(config[_0x1d3e('0x5')]));function Agent(_0x562b29){this['id']=_0x562b29['id']||0x0;this[_0x1d3e('0x9')]=_0x562b29[_0x1d3e('0x9')]||'';this[_0x1d3e('0xa')]=_0x562b29[_0x1d3e('0xa')]||'';this[_0x1d3e('0xb')]=_0x562b29[_0x1d3e('0xb')]||'';this[_0x1d3e('0xc')]=_0x562b29[_0x1d3e('0xc')]||'';this[_0x1d3e('0xd')]=_0x1d3e('0xe');this[_0x1d3e('0xf')]=0x0;this[_0x1d3e('0x10')]='unknown';this[_0x1d3e('0x11')]='';this[_0x1d3e('0x12')]='';this[_0x1d3e('0x13')]='';this[_0x1d3e('0x14')]='';this[_0x1d3e('0x15')]=_0x562b29[_0x1d3e('0x15')]||![];this['voiceStatus']='unknown';this[_0x1d3e('0x16')]=0x0;this[_0x1d3e('0x17')]='';this[_0x1d3e('0x18')]='';this[_0x1d3e('0x19')]=![];this[_0x1d3e('0x1a')]=![];this[_0x1d3e('0x2')]='';}Agent['prototype']['updateStatusRealtime']=function(_0x3b8809){var _0x4897a3;if(_0x3b8809&&_0x3b8809[_0x1d3e('0xd')]){_0x4897a3=_0x3b8809[_0x1d3e('0xd')][_0x1d3e('0x1b')]();switch(_0x4897a3){case _0x1d3e('0x1c'):_0x4897a3='idle';break;case'inuse':_0x4897a3=_0x1d3e('0x1d');break;}}if(_0x4897a3&&this[_0x1d3e('0x1e')]!==_0x4897a3||_0x3b8809['statePause']){this[_0x1d3e('0x16')]=_[_0x1d3e('0x1f')](moment()['format']('x'));}if(_0x4897a3){this[_0x1d3e('0x1e')]=_0x4897a3;}var _0x1eb616={'id':this['id'],'name':this['name'],'email':this[_0x1d3e('0xa')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x1d3e('0xd')],'stateTime':this['stateTime'],'status':this['status'],'address':this[_0x1d3e('0x11')],'online':this[_0x1d3e('0x15')],'voiceStatus':this[_0x1d3e('0x1e')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x1d3e('0x18')],'interface':this[_0x1d3e('0x14')],'onhold':this[_0x1d3e('0x19')]};var _0x1d33df=md5(JSON['stringify'](_0x1eb616));if(this['md5']!==_0x1d33df){this[_0x1d3e('0x2')]=_0x1d33df;io['to'](util[_0x1d3e('0x20')](_0x1d3e('0x21'),_0x1eb616['name']))[_0x1d3e('0x22')]('user:ami:update',_[_0x1d3e('0x23')](_0x1eb616,[_0x1d3e('0x15')]));io[_0x1d3e('0x22')](_0x1d3e('0x24'),_0x1eb616);}};module['exports']=Agent;
\ No newline at end of file
+var _0x77ba=['md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','statePause','voiceStatusTime','format','stringify','user:%s','emit','omit','lodash','util','moment','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','status','address','phone','mobile','interface','online','voiceStatus','unknown','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local'];(function(_0x25e873,_0x1cfc69){var _0x354dd7=function(_0x778167){while(--_0x778167){_0x25e873['push'](_0x25e873['shift']());}};_0x354dd7(++_0x1cfc69);}(_0x77ba,0xd6));var _0xa77b=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0x77ba[_0x10852d];return _0x13a8d6;};'use strict';var _=require(_0xa77b('0x0'));var util=require(_0xa77b('0x1'));var moment=require(_0xa77b('0x2'));var md5=require('md5');var Redis=require(_0xa77b('0x3'));var config=require('../../../config/environment');config[_0xa77b('0x4')]=_[_0xa77b('0x5')](config[_0xa77b('0x4')],{'host':_0xa77b('0x6'),'port':0x18eb});var io=require(_0xa77b('0x7'))(new Redis(config[_0xa77b('0x4')]));function Agent(_0x1530c3){this['id']=_0x1530c3['id']||0x0;this[_0xa77b('0x8')]=_0x1530c3[_0xa77b('0x8')]||'';this[_0xa77b('0x9')]=_0x1530c3[_0xa77b('0x9')]||'';this[_0xa77b('0xa')]=_0x1530c3[_0xa77b('0xa')]||'';this[_0xa77b('0xb')]=_0x1530c3[_0xa77b('0xb')]||'';this[_0xa77b('0xc')]='unknown';this[_0xa77b('0xd')]=0x0;this[_0xa77b('0xe')]='unknown';this[_0xa77b('0xf')]='';this[_0xa77b('0x10')]='';this[_0xa77b('0x11')]='';this[_0xa77b('0x12')]='';this[_0xa77b('0x13')]=_0x1530c3[_0xa77b('0x13')]||![];this[_0xa77b('0x14')]=_0xa77b('0x15');this['voiceStatusTime']=0x0;this[_0xa77b('0x16')]='';this[_0xa77b('0x17')]='';this[_0xa77b('0x18')]=![];this[_0xa77b('0x19')]=![];this[_0xa77b('0x1a')]='';}Agent[_0xa77b('0x1b')][_0xa77b('0x1c')]=function(_0x1360fc){var _0x23b1ee;if(_0x1360fc&&_0x1360fc[_0xa77b('0xc')]){_0x23b1ee=_0x1360fc[_0xa77b('0xc')][_0xa77b('0x1d')]();switch(_0x23b1ee){case _0xa77b('0x1e'):_0x23b1ee='idle';break;case _0xa77b('0x1f'):_0x23b1ee=_0xa77b('0x20');break;}}if(_0x23b1ee&&this[_0xa77b('0x14')]!==_0x23b1ee||_0x1360fc[_0xa77b('0x21')]){this[_0xa77b('0x22')]=_['toNumber'](moment()[_0xa77b('0x23')]('x'));}if(_0x23b1ee){this[_0xa77b('0x14')]=_0x23b1ee;}var _0x4c2304={'id':this['id'],'name':this['name'],'email':this[_0xa77b('0x9')],'accountcode':this[_0xa77b('0xa')],'fullname':this['fullname'],'state':this[_0xa77b('0xc')],'stateTime':this[_0xa77b('0xd')],'status':this[_0xa77b('0xe')],'address':this[_0xa77b('0xf')],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0xa77b('0x22')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xa77b('0x17')],'interface':this[_0xa77b('0x12')],'onhold':this['onhold']};var _0x1885e0=md5(JSON[_0xa77b('0x24')](_0x4c2304));if(this[_0xa77b('0x1a')]!==_0x1885e0){this[_0xa77b('0x1a')]=_0x1885e0;io['to'](util[_0xa77b('0x23')](_0xa77b('0x25'),_0x4c2304[_0xa77b('0x8')]))[_0xa77b('0x26')]('user:ami:update',_[_0xa77b('0x27')](_0x4c2304,[_0xa77b('0x13')]));io[_0xa77b('0x26')]('user:presence',_0x4c2304);}};module['exports']=Agent;
\ No newline at end of file