Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / components / realtime / queues.js
index 2158e8c..42589b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13e0=['waiting','talking','outbound','find','merge','pick','lodash','jayson/promise','client','http','available','paused','busy','inUse','invalid','loggedInDb','onHold','ringing','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startProgressive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','startCase','Queues','then','error','format','result','catch','getRealtimeQueues','concat','loggedIn'];(function(_0x50570c,_0x51597d){var _0x46e42a=function(_0x4edc83){while(--_0x4edc83){_0x50570c['push'](_0x50570c['shift']());}};_0x46e42a(++_0x51597d);}(_0x13e0,0x192));var _0x013e=function(_0x3c43a9,_0x50b5a5){_0x3c43a9=_0x3c43a9-0x0;var _0x24d156=_0x13e0[_0x3c43a9];return _0x24d156;};'use strict';var _=require(_0x013e('0x0'));var jayson=require(_0x013e('0x1'));var util=require('util');var amiClient=jayson[_0x013e('0x2')][_0x013e('0x3')]({'port':0x232a});var routingClient=jayson[_0x013e('0x2')][_0x013e('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x013e('0x4'),'loggedIn',_0x013e('0x5'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x013e('0x6'),_0x013e('0x7'),_0x013e('0x8'),_0x013e('0x9'),'notInUse',_0x013e('0xa'),_0x013e('0xb'),'ringInUse','talking','unavailable','unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x013e('0xc'),_0x013e('0xd'),_0x013e('0xe'),_0x013e('0xf'),_0x013e('0x10'),_0x013e('0x11'),_0x013e('0x12'),'startPredictive',_0x013e('0x13'),'erlangCalls','erlangCallToSecond',_0x013e('0x14'),_0x013e('0x15'),'dialPredictiveInterval',_0x013e('0x16'),'dialPredictiveIntervalMinThreshold',_0x013e('0x17'),'predictiveIntervalTotalCalls',_0x013e('0x18'),'predictiveIntervalDroppedCallsTimeout',_0x013e('0x19'),'predictiveIntervalAvgHoldtime',_0x013e('0x1a')];function getRealtimeQueues(_0x1f091c,_0x1986e3){var _0x3ebb72=_0x1986e3===_0x013e('0x1b')?amiClient:routingClient;return _0x3ebb72['request'](_[_0x013e('0x1c')](_0x1986e3)+_0x013e('0x1d'),_0x1f091c)[_0x013e('0x1e')](function(_0x573a01){if(_0x573a01[_0x013e('0x1f')])throw new Error(util[_0x013e('0x20')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x1986e3));return _0x573a01[_0x013e('0x21')];})[_0x013e('0x22')](function(_0x2c575f){throw _0x2c575f;});}exports[_0x013e('0x23')]=getRealtimeQueues;function initializeQueues(_0x142f74,_0x1e9296,_0x344386,_0x10b843){var _0x10d251=DEFAULT_QUEUE_ATTRIBUTES;if(_0x344386===_0x013e('0x1b')){if(_0x10b843==='inbound'){_0x10d251=_0x10d251[_0x013e('0x24')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x10b843==='outbound'){_0x10d251=_0x10d251[_0x013e('0x24')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x142f74['map'](function(_0x3bcd94){var _0x5ebe6d=_0x3bcd94['get']({'plain':!![]});_0x5ebe6d[_0x013e('0x5')]=0x0;_0x5ebe6d[_0x013e('0x9')]=0x0;_0x5ebe6d[_0x013e('0x25')]=0x0;_0x5ebe6d['available']=0x0;_0x5ebe6d[_0x013e('0x26')]=0x0;if(_0x344386===_0x013e('0x1b')){_0x5ebe6d[_0x013e('0x27')]=0x0;_0x5ebe6d['busy']=0x0;if(_0x10b843===_0x013e('0x28')){_0x5ebe6d[_0x013e('0xc')]=0x0;_0x5ebe6d['originated']=0x0;}}var _0x4df98d=_[_0x013e('0x29')](_0x1e9296,['id',_0x5ebe6d['id']]);if(_0x4df98d){_[_0x013e('0x2a')](_0x5ebe6d,_[_0x013e('0x2b')](_0x4df98d,_0x10d251));}return _0x5ebe6d;});}exports['initializeQueues']=initializeQueues;
\ No newline at end of file
+var _0xf867=['Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','outbound','concat','map','loggedIn','available','find','merge','pick','initializeQueues','jayson/promise','util','client','http','paused','waiting','busy','invalid','loggedInDb','onHold','ringing','talking','unavailable','unknown','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','startCase'];(function(_0x2168a3,_0x7bce5c){var _0x16db53=function(_0x6aaa19){while(--_0x6aaa19){_0x2168a3['push'](_0x2168a3['shift']());}};_0x16db53(++_0x7bce5c);}(_0xf867,0xaa));var _0x7f86=function(_0x552ccc,_0x15958b){_0x552ccc=_0x552ccc-0x0;var _0x30ba8e=_0xf867[_0x552ccc];return _0x30ba8e;};'use strict';var _=require('lodash');var jayson=require(_0x7f86('0x0'));var util=require(_0x7f86('0x1'));var amiClient=jayson[_0x7f86('0x2')][_0x7f86('0x3')]({'port':0x232a});var routingClient=jayson[_0x7f86('0x2')][_0x7f86('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available','loggedIn',_0x7f86('0x4'),_0x7f86('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x7f86('0x6'),'inUse',_0x7f86('0x7'),_0x7f86('0x8'),'notInUse',_0x7f86('0x9'),_0x7f86('0xa'),'ringInUse',_0x7f86('0xb'),_0x7f86('0xc'),_0x7f86('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x7f86('0xe'),_0x7f86('0xf'),_0x7f86('0x10'),'statusMessage',_0x7f86('0x11'),_0x7f86('0x12'),_0x7f86('0x13'),_0x7f86('0x14'),_0x7f86('0x15'),'erlangCalls','erlangCallToSecond',_0x7f86('0x16'),_0x7f86('0x17'),_0x7f86('0x18'),'dialPredictiveIntervalMaxThreshold',_0x7f86('0x19'),_0x7f86('0x1a'),_0x7f86('0x1b'),_0x7f86('0x1c'),_0x7f86('0x1d'),_0x7f86('0x1e'),'predictiveIntervalAvgHoldtime',_0x7f86('0x1f')];function getRealtimeQueues(_0x4a6c87,_0x23fbec){var _0x4cc9ce=_0x23fbec===_0x7f86('0x20')?amiClient:routingClient;return _0x4cc9ce['request'](_[_0x7f86('0x21')](_0x23fbec)+_0x7f86('0x22'),_0x4a6c87)['then'](function(_0x5f28d8){if(_0x5f28d8[_0x7f86('0x23')])throw new Error(util[_0x7f86('0x24')](_0x7f86('0x25'),_0x23fbec));return _0x5f28d8[_0x7f86('0x26')];})[_0x7f86('0x27')](function(_0x1dfed0){throw _0x1dfed0;});}exports[_0x7f86('0x28')]=getRealtimeQueues;function initializeQueues(_0x5937db,_0x262edf,_0x2af4df,_0x1a4867){var _0x514218=DEFAULT_QUEUE_ATTRIBUTES;if(_0x2af4df===_0x7f86('0x20')){if(_0x1a4867===_0x7f86('0x29')){_0x514218=_0x514218['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1a4867===_0x7f86('0x2a')){_0x514218=_0x514218[_0x7f86('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x5937db[_0x7f86('0x2c')](function(_0x265e5a){var _0x4df04f=_0x265e5a['get']({'plain':!![]});_0x4df04f[_0x7f86('0x4')]=0x0;_0x4df04f[_0x7f86('0x8')]=0x0;_0x4df04f[_0x7f86('0x2d')]=0x0;_0x4df04f[_0x7f86('0x2e')]=0x0;_0x4df04f[_0x7f86('0x5')]=0x0;if(_0x2af4df===_0x7f86('0x20')){_0x4df04f[_0x7f86('0xb')]=0x0;_0x4df04f['busy']=0x0;if(_0x1a4867==='outbound'){_0x4df04f['pTalking']=0x0;_0x4df04f[_0x7f86('0xf')]=0x0;}}var _0x6a1001=_[_0x7f86('0x2f')](_0x262edf,['id',_0x4df04f['id']]);if(_0x6a1001){_[_0x7f86('0x30')](_0x4df04f,_[_0x7f86('0x31')](_0x6a1001,_0x514218));}return _0x4df04f;});}exports[_0x7f86('0x32')]=initializeQueues;
\ No newline at end of file