Built motion from commit a8c4dd89.|2.6.33
[motion2.git] / server / services / ami / model / agent.js
index f7c76b7..f1d7379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ea4=['fullname','stateTime','address','phone','mobile','interface','online','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','inuse','talking','voiceStatus','voiceStatusTime','toNumber','status','stringify','user:%s','emit','user:ami:update','omit','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode'];(function(_0x28e626,_0x56d806){var _0x1dfbe7=function(_0x5419be){while(--_0x5419be){_0x28e626['push'](_0x28e626['shift']());}};_0x1dfbe7(++_0x56d806);}(_0x0ea4,0x12b));var _0x40ea=function(_0x296e07,_0x3a0a3f){_0x296e07=_0x296e07-0x0;var _0x5410ef=_0x0ea4[_0x296e07];return _0x5410ef;};'use strict';var _=require(_0x40ea('0x0'));var util=require(_0x40ea('0x1'));var moment=require(_0x40ea('0x2'));var md5=require(_0x40ea('0x3'));var Redis=require(_0x40ea('0x4'));var config=require(_0x40ea('0x5'));config[_0x40ea('0x6')]=_[_0x40ea('0x7')](config['redis'],{'host':_0x40ea('0x8'),'port':0x18eb});var io=require(_0x40ea('0x9'))(new Redis(config[_0x40ea('0x6')]));function Agent(_0xf96257){this['id']=_0xf96257['id']||0x0;this[_0x40ea('0xa')]=_0xf96257[_0x40ea('0xa')]||'';this[_0x40ea('0xb')]=_0xf96257[_0x40ea('0xb')]||'';this[_0x40ea('0xc')]=_0xf96257[_0x40ea('0xc')]||'';this['fullname']=_0xf96257[_0x40ea('0xd')]||'';this['state']='unknown';this[_0x40ea('0xe')]=0x0;this['status']='unknown';this[_0x40ea('0xf')]='';this[_0x40ea('0x10')]='';this[_0x40ea('0x11')]='';this[_0x40ea('0x12')]='';this[_0x40ea('0x13')]=_0xf96257[_0x40ea('0x13')]||![];this['voiceStatus']='unknown';this['voiceStatusTime']=0x0;this[_0x40ea('0x14')]='';this[_0x40ea('0x15')]='';this[_0x40ea('0x16')]=![];this[_0x40ea('0x17')]=![];this[_0x40ea('0x3')]='';}Agent[_0x40ea('0x18')][_0x40ea('0x19')]=function(_0x27e693){var _0x1e2d97;if(_0x27e693&&_0x27e693[_0x40ea('0x1a')]){_0x1e2d97=_0x27e693[_0x40ea('0x1a')]['toLowerCase']();switch(_0x1e2d97){case'not_inuse':_0x1e2d97='idle';break;case _0x40ea('0x1b'):_0x1e2d97=_0x40ea('0x1c');break;}}if(_0x1e2d97&&this[_0x40ea('0x1d')]!==_0x1e2d97||_0x27e693['statePause']){this[_0x40ea('0x1e')]=_[_0x40ea('0x1f')](moment()['format']('x'));}if(_0x1e2d97){this[_0x40ea('0x1d')]=_0x1e2d97;}var _0x526718={'id':this['id'],'name':this[_0x40ea('0xa')],'email':this[_0x40ea('0xb')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x40ea('0x1a')],'stateTime':this[_0x40ea('0xe')],'status':this[_0x40ea('0x20')],'address':this[_0x40ea('0xf')],'online':this[_0x40ea('0x13')],'voiceStatus':this[_0x40ea('0x1d')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x40ea('0x15')],'interface':this[_0x40ea('0x12')],'onhold':this['onhold']};var _0x48e4a5=md5(JSON[_0x40ea('0x21')](_0x526718));if(this[_0x40ea('0x3')]!==_0x48e4a5){this['md5']=_0x48e4a5;io['to'](util['format'](_0x40ea('0x22'),_0x526718['name']))[_0x40ea('0x23')](_0x40ea('0x24'),_[_0x40ea('0x25')](_0x526718,['online']));io[_0x40ea('0x23')]('user:presence',_0x526718);}};module[_0x40ea('0x26')]=Agent;
\ No newline at end of file
+var _0x5ae4=['localhost','socket.io-emitter','name','email','accountcode','fullname','state','status','unknown','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','toLowerCase','not_inuse','idle','inuse','talking','toNumber','stateTime','address','format','user:%s','user:ami:update','omit','emit','user:presence','exports','util','moment','md5','../../../config/environment','redis','defaults'];(function(_0x4a2d48,_0x4c8529){var _0x5b30f3=function(_0x4ef8ad){while(--_0x4ef8ad){_0x4a2d48['push'](_0x4a2d48['shift']());}};_0x5b30f3(++_0x4c8529);}(_0x5ae4,0x72));var _0x45ae=function(_0x3cfe5a,_0x1466f3){_0x3cfe5a=_0x3cfe5a-0x0;var _0x2e0b64=_0x5ae4[_0x3cfe5a];return _0x2e0b64;};'use strict';var _=require('lodash');var util=require(_0x45ae('0x0'));var moment=require(_0x45ae('0x1'));var md5=require(_0x45ae('0x2'));var Redis=require('ioredis');var config=require(_0x45ae('0x3'));config[_0x45ae('0x4')]=_[_0x45ae('0x5')](config[_0x45ae('0x4')],{'host':_0x45ae('0x6'),'port':0x18eb});var io=require(_0x45ae('0x7'))(new Redis(config['redis']));function Agent(_0x528a76){this['id']=_0x528a76['id']||0x0;this[_0x45ae('0x8')]=_0x528a76['name']||'';this[_0x45ae('0x9')]=_0x528a76[_0x45ae('0x9')]||'';this[_0x45ae('0xa')]=_0x528a76[_0x45ae('0xa')]||'';this[_0x45ae('0xb')]=_0x528a76[_0x45ae('0xb')]||'';this[_0x45ae('0xc')]='unknown';this['stateTime']=0x0;this[_0x45ae('0xd')]=_0x45ae('0xe');this['address']='';this[_0x45ae('0xf')]='';this[_0x45ae('0x10')]='';this[_0x45ae('0x11')]='';this['online']=_0x528a76[_0x45ae('0x12')]||![];this[_0x45ae('0x13')]=_0x45ae('0xe');this[_0x45ae('0x14')]=0x0;this[_0x45ae('0x15')]='';this[_0x45ae('0x16')]='';this[_0x45ae('0x17')]=![];this['local']=![];this[_0x45ae('0x2')]='';}Agent[_0x45ae('0x18')]['updateStatusRealtime']=function(_0xf98e81){var _0x1ffbc9;if(_0xf98e81&&_0xf98e81['state']){_0x1ffbc9=_0xf98e81['state'][_0x45ae('0x19')]();switch(_0x1ffbc9){case _0x45ae('0x1a'):_0x1ffbc9=_0x45ae('0x1b');break;case _0x45ae('0x1c'):_0x1ffbc9=_0x45ae('0x1d');break;}}if(_0x1ffbc9&&this['voiceStatus']!==_0x1ffbc9||_0xf98e81['statePause']){this[_0x45ae('0x14')]=_[_0x45ae('0x1e')](moment()['format']('x'));}if(_0x1ffbc9){this[_0x45ae('0x13')]=_0x1ffbc9;}var _0xef7e91={'id':this['id'],'name':this[_0x45ae('0x8')],'email':this[_0x45ae('0x9')],'accountcode':this[_0x45ae('0xa')],'fullname':this[_0x45ae('0xb')],'state':this['state'],'stateTime':this[_0x45ae('0x1f')],'status':this['status'],'address':this[_0x45ae('0x20')],'online':this['online'],'voiceStatus':this[_0x45ae('0x13')],'voiceStatusTime':this[_0x45ae('0x14')],'voiceStatusCallerIdNumber':this[_0x45ae('0x15')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x45ae('0x17')]};var _0x535d69=md5(JSON['stringify'](_0xef7e91));if(this['md5']!==_0x535d69){this[_0x45ae('0x2')]=_0x535d69;io['to'](util[_0x45ae('0x21')](_0x45ae('0x22'),_0xef7e91[_0x45ae('0x8')]))['emit'](_0x45ae('0x23'),_[_0x45ae('0x24')](_0xef7e91,[_0x45ae('0x12')]));io[_0x45ae('0x25')](_0x45ae('0x26'),_0xef7e91);}};module[_0x45ae('0x27')]=Agent;
\ No newline at end of file