Built motion from commit ae138b72.|2.6.28
[motion2.git] / server / services / ami / model / agent.js
index 5ac86a1..9f59651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4e8=['omit','emit','user:presence','lodash','util','moment','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','stateTime','status','address','phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','interface','stringify','format','user:%s','user:ami:update'];(function(_0x161f8c,_0x3b7a8f){var _0x2a9180=function(_0x1b04d0){while(--_0x1b04d0){_0x161f8c['push'](_0x161f8c['shift']());}};_0x2a9180(++_0x3b7a8f);}(_0xd4e8,0xe7));var _0x8d4e=function(_0x206338,_0x2d800b){_0x206338=_0x206338-0x0;var _0x2b87f2=_0xd4e8[_0x206338];return _0x2b87f2;};'use strict';var _=require(_0x8d4e('0x0'));var util=require(_0x8d4e('0x1'));var moment=require(_0x8d4e('0x2'));var md5=require(_0x8d4e('0x3'));var Redis=require('ioredis');var config=require(_0x8d4e('0x4'));config[_0x8d4e('0x5')]=_[_0x8d4e('0x6')](config[_0x8d4e('0x5')],{'host':_0x8d4e('0x7'),'port':0x18eb});var io=require(_0x8d4e('0x8'))(new Redis(config[_0x8d4e('0x5')]));function Agent(_0x5a2bbc){this['id']=_0x5a2bbc['id']||0x0;this[_0x8d4e('0x9')]=_0x5a2bbc[_0x8d4e('0x9')]||'';this['email']=_0x5a2bbc[_0x8d4e('0xa')]||'';this[_0x8d4e('0xb')]=_0x5a2bbc['accountcode']||'';this[_0x8d4e('0xc')]=_0x5a2bbc[_0x8d4e('0xc')]||'';this['state']='unknown';this[_0x8d4e('0xd')]=0x0;this[_0x8d4e('0xe')]='unknown';this[_0x8d4e('0xf')]='';this[_0x8d4e('0x10')]='';this[_0x8d4e('0x11')]='';this['interface']='';this[_0x8d4e('0x12')]=_0x5a2bbc[_0x8d4e('0x12')]||![];this[_0x8d4e('0x13')]='unknown';this[_0x8d4e('0x14')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x8d4e('0x15')]='';this[_0x8d4e('0x16')]=![];this['local']=![];this[_0x8d4e('0x3')]='';}Agent[_0x8d4e('0x17')][_0x8d4e('0x18')]=function(_0x3f1ee2){var _0x42a517;if(_0x3f1ee2&&_0x3f1ee2[_0x8d4e('0x19')]){_0x42a517=_0x3f1ee2[_0x8d4e('0x19')][_0x8d4e('0x1a')]();switch(_0x42a517){case'not_inuse':_0x42a517=_0x8d4e('0x1b');break;case _0x8d4e('0x1c'):_0x42a517=_0x8d4e('0x1d');break;}}if(_0x42a517&&this[_0x8d4e('0x13')]!==_0x42a517||_0x3f1ee2['statePause']){this[_0x8d4e('0x14')]=_['toNumber'](moment()['format']('x'));}if(_0x42a517){this[_0x8d4e('0x13')]=_0x42a517;}var _0x4d0aaf={'id':this['id'],'name':this[_0x8d4e('0x9')],'email':this[_0x8d4e('0xa')],'accountcode':this['accountcode'],'fullname':this[_0x8d4e('0xc')],'state':this[_0x8d4e('0x19')],'stateTime':this[_0x8d4e('0xd')],'status':this[_0x8d4e('0xe')],'address':this['address'],'online':this[_0x8d4e('0x12')],'voiceStatus':this[_0x8d4e('0x13')],'voiceStatusTime':this[_0x8d4e('0x14')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x8d4e('0x15')],'interface':this[_0x8d4e('0x1e')],'onhold':this[_0x8d4e('0x16')]};var _0x4fcacc=md5(JSON[_0x8d4e('0x1f')](_0x4d0aaf));if(this['md5']!==_0x4fcacc){this[_0x8d4e('0x3')]=_0x4fcacc;io['to'](util[_0x8d4e('0x20')](_0x8d4e('0x21'),_0x4d0aaf['name']))['emit'](_0x8d4e('0x22'),_[_0x8d4e('0x23')](_0x4d0aaf,[_0x8d4e('0x12')]));io[_0x8d4e('0x24')](_0x8d4e('0x25'),_0x4d0aaf);}};module['exports']=Agent;
\ No newline at end of file
+var _0xb229=['name','email','accountcode','state','stateTime','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','local','prototype','toLowerCase','inuse','statePause','format','fullname','status','voiceStatusQueue','stringify','user:%s','emit','omit','user:presence','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter'];(function(_0x5d8114,_0x10c635){var _0x2de21b=function(_0x3c3a94){while(--_0x3c3a94){_0x5d8114['push'](_0x5d8114['shift']());}};_0x2de21b(++_0x10c635);}(_0xb229,0x93));var _0x9b22=function(_0x1f4867,_0x165779){_0x1f4867=_0x1f4867-0x0;var _0x3094af=_0xb229[_0x1f4867];return _0x3094af;};'use strict';var _=require(_0x9b22('0x0'));var util=require(_0x9b22('0x1'));var moment=require(_0x9b22('0x2'));var md5=require(_0x9b22('0x3'));var Redis=require(_0x9b22('0x4'));var config=require(_0x9b22('0x5'));config[_0x9b22('0x6')]=_['defaults'](config[_0x9b22('0x6')],{'host':_0x9b22('0x7'),'port':0x18eb});var io=require(_0x9b22('0x8'))(new Redis(config['redis']));function Agent(_0x386fe9){this['id']=_0x386fe9['id']||0x0;this[_0x9b22('0x9')]=_0x386fe9[_0x9b22('0x9')]||'';this['email']=_0x386fe9[_0x9b22('0xa')]||'';this[_0x9b22('0xb')]=_0x386fe9['accountcode']||'';this['fullname']=_0x386fe9['fullname']||'';this[_0x9b22('0xc')]='unknown';this[_0x9b22('0xd')]=0x0;this['status']=_0x9b22('0xe');this[_0x9b22('0xf')]='';this[_0x9b22('0x10')]='';this[_0x9b22('0x11')]='';this[_0x9b22('0x12')]='';this[_0x9b22('0x13')]=_0x386fe9[_0x9b22('0x13')]||![];this[_0x9b22('0x14')]=_0x9b22('0xe');this[_0x9b22('0x15')]=0x0;this[_0x9b22('0x16')]='';this['voiceStatusQueue']='';this[_0x9b22('0x17')]=![];this[_0x9b22('0x18')]=![];this[_0x9b22('0x3')]='';}Agent[_0x9b22('0x19')]['updateStatusRealtime']=function(_0x1604b0){var _0x57a989;if(_0x1604b0&&_0x1604b0[_0x9b22('0xc')]){_0x57a989=_0x1604b0[_0x9b22('0xc')][_0x9b22('0x1a')]();switch(_0x57a989){case'not_inuse':_0x57a989='idle';break;case _0x9b22('0x1b'):_0x57a989='talking';break;}}if(_0x57a989&&this[_0x9b22('0x14')]!==_0x57a989||_0x1604b0[_0x9b22('0x1c')]){this[_0x9b22('0x15')]=_['toNumber'](moment()[_0x9b22('0x1d')]('x'));}if(_0x57a989){this[_0x9b22('0x14')]=_0x57a989;}var _0xebe73={'id':this['id'],'name':this[_0x9b22('0x9')],'email':this['email'],'accountcode':this[_0x9b22('0xb')],'fullname':this[_0x9b22('0x1e')],'state':this[_0x9b22('0xc')],'stateTime':this[_0x9b22('0xd')],'status':this[_0x9b22('0x1f')],'address':this[_0x9b22('0xf')],'online':this[_0x9b22('0x13')],'voiceStatus':this[_0x9b22('0x14')],'voiceStatusTime':this[_0x9b22('0x15')],'voiceStatusCallerIdNumber':this[_0x9b22('0x16')],'voiceStatusQueue':this[_0x9b22('0x20')],'interface':this['interface'],'onhold':this[_0x9b22('0x17')]};var _0x212468=md5(JSON[_0x9b22('0x21')](_0xebe73));if(this['md5']!==_0x212468){this['md5']=_0x212468;io['to'](util[_0x9b22('0x1d')](_0x9b22('0x22'),_0xebe73[_0x9b22('0x9')]))[_0x9b22('0x23')]('user:ami:update',_[_0x9b22('0x24')](_0xebe73,[_0x9b22('0x13')]));io[_0x9b22('0x23')](_0x9b22('0x25'),_0xebe73);}};module[_0x9b22('0x26')]=Agent;
\ No newline at end of file