Built motion from commit 4c281f94.|2.6.31
[motion2.git] / server / services / ami / model / agent.js
index 7d95294..16c96c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf941=['accountcode','fullname','state','unknown','status','address','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','updateStatusRealtime','not_inuse','idle','inuse','talking','format','stateTime','interface','onhold','stringify','md5','user:%s','emit','user:ami:update','omit','user:presence','exports','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf941,0x135));var _0x1f94=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xf941[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x1f94('0x0'));var util=require(_0x1f94('0x1'));var moment=require(_0x1f94('0x2'));var md5=require('md5');var Redis=require(_0x1f94('0x3'));var config=require(_0x1f94('0x4'));config[_0x1f94('0x5')]=_[_0x1f94('0x6')](config[_0x1f94('0x5')],{'host':_0x1f94('0x7'),'port':0x18eb});var io=require(_0x1f94('0x8'))(new Redis(config[_0x1f94('0x5')]));function Agent(_0x43e69d){this['id']=_0x43e69d['id']||0x0;this[_0x1f94('0x9')]=_0x43e69d['name']||'';this['email']=_0x43e69d[_0x1f94('0xa')]||'';this[_0x1f94('0xb')]=_0x43e69d['accountcode']||'';this[_0x1f94('0xc')]=_0x43e69d[_0x1f94('0xc')]||'';this[_0x1f94('0xd')]=_0x1f94('0xe');this['stateTime']=0x0;this[_0x1f94('0xf')]=_0x1f94('0xe');this[_0x1f94('0x10')]='';this['phone']='';this[_0x1f94('0x11')]='';this['interface']='';this[_0x1f94('0x12')]=_0x43e69d[_0x1f94('0x12')]||![];this[_0x1f94('0x13')]='unknown';this[_0x1f94('0x14')]=0x0;this[_0x1f94('0x15')]='';this[_0x1f94('0x16')]='';this['onhold']=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x1f94('0x17')]=function(_0x45776f){var _0x56be03;if(_0x45776f&&_0x45776f['state']){_0x56be03=_0x45776f['state']['toLowerCase']();switch(_0x56be03){case _0x1f94('0x18'):_0x56be03=_0x1f94('0x19');break;case _0x1f94('0x1a'):_0x56be03=_0x1f94('0x1b');break;}}if(_0x56be03&&this[_0x1f94('0x13')]!==_0x56be03||_0x45776f['statePause']){this[_0x1f94('0x14')]=_['toNumber'](moment()[_0x1f94('0x1c')]('x'));}if(_0x56be03){this['voiceStatus']=_0x56be03;}var _0x10cf05={'id':this['id'],'name':this['name'],'email':this[_0x1f94('0xa')],'accountcode':this[_0x1f94('0xb')],'fullname':this['fullname'],'state':this[_0x1f94('0xd')],'stateTime':this[_0x1f94('0x1d')],'status':this[_0x1f94('0xf')],'address':this[_0x1f94('0x10')],'online':this['online'],'voiceStatus':this[_0x1f94('0x13')],'voiceStatusTime':this[_0x1f94('0x14')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x1f94('0x16')],'interface':this[_0x1f94('0x1e')],'onhold':this[_0x1f94('0x1f')]};var _0x1b7088=md5(JSON[_0x1f94('0x20')](_0x10cf05));if(this['md5']!==_0x1b7088){this[_0x1f94('0x21')]=_0x1b7088;io['to'](util[_0x1f94('0x1c')](_0x1f94('0x22'),_0x10cf05[_0x1f94('0x9')]))[_0x1f94('0x23')](_0x1f94('0x24'),_[_0x1f94('0x25')](_0x10cf05,[_0x1f94('0x12')]));io[_0x1f94('0x23')](_0x1f94('0x26'),_0x10cf05);}};module[_0x1f94('0x27')]=Agent;
\ No newline at end of file
+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