Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / components / realtime / queues.js
index 929ad12..7e5c67d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ce6=['waiting','busy','inUse','invalid','loggedInDb','ringing','unavailable','pTalking','originated','message','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','error','result','catch','getRealtimeQueues','concat','outbound','paused','merge','pick','lodash','jayson/promise','util','client','http','available','loggedIn'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8ce6,0xb1));var _0x68ce=function(_0xd89753,_0x1073cd){_0xd89753=_0xd89753-0x0;var _0xf347d=_0x8ce6[_0xd89753];return _0xf347d;};'use strict';var _=require(_0x68ce('0x0'));var jayson=require(_0x68ce('0x1'));var util=require(_0x68ce('0x2'));var amiClient=jayson[_0x68ce('0x3')][_0x68ce('0x4')]({'port':0x232a});var routingClient=jayson['client'][_0x68ce('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x68ce('0x5'),_0x68ce('0x6'),'paused',_0x68ce('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x68ce('0x8'),_0x68ce('0x9'),_0x68ce('0xa'),_0x68ce('0xb'),'notInUse','onHold',_0x68ce('0xc'),'ringInUse','talking',_0x68ce('0xd'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x68ce('0xe'),_0x68ce('0xf'),_0x68ce('0x10'),_0x68ce('0x11'),_0x68ce('0x12'),_0x68ce('0x13'),_0x68ce('0x14'),_0x68ce('0x15'),_0x68ce('0x16'),'erlangCalls',_0x68ce('0x17'),'erlangAbandonmentRate',_0x68ce('0x18'),_0x68ce('0x19'),_0x68ce('0x1a'),_0x68ce('0x1b'),'predictiveIntervalAvailable',_0x68ce('0x1c'),_0x68ce('0x1d'),_0x68ce('0x1e'),_0x68ce('0x1f'),'predictiveIntervalAvgHoldtime',_0x68ce('0x20')];function getRealtimeQueues(_0x1d8922,_0x282d6d){var _0x215306=_0x282d6d===_0x68ce('0x21')?amiClient:routingClient;return _0x215306[_0x68ce('0x22')](_[_0x68ce('0x23')](_0x282d6d)+_0x68ce('0x24'),_0x1d8922)['then'](function(_0x25ea4b){if(_0x25ea4b[_0x68ce('0x25')])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x282d6d));return _0x25ea4b[_0x68ce('0x26')];})[_0x68ce('0x27')](function(_0x57d0dc){throw _0x57d0dc;});}exports[_0x68ce('0x28')]=getRealtimeQueues;function initializeQueues(_0x4b34f5,_0x373824,_0x53f913,_0x122490){var _0x524d75=DEFAULT_QUEUE_ATTRIBUTES;if(_0x53f913==='voice'){if(_0x122490==='inbound'){_0x524d75=_0x524d75[_0x68ce('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x122490===_0x68ce('0x2a')){_0x524d75=_0x524d75[_0x68ce('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4b34f5['map'](function(_0x46aab1){var _0x48aec0=_0x46aab1['get']({'plain':!![]});_0x48aec0[_0x68ce('0x2b')]=0x0;_0x48aec0['loggedInDb']=0x0;_0x48aec0[_0x68ce('0x6')]=0x0;_0x48aec0[_0x68ce('0x5')]=0x0;_0x48aec0[_0x68ce('0x7')]=0x0;if(_0x53f913===_0x68ce('0x21')){_0x48aec0['talking']=0x0;_0x48aec0[_0x68ce('0x8')]=0x0;if(_0x122490===_0x68ce('0x2a')){_0x48aec0['pTalking']=0x0;_0x48aec0[_0x68ce('0xf')]=0x0;}}var _0x39e693=_['find'](_0x373824,['id',_0x48aec0['id']]);if(_0x39e693){_[_0x68ce('0x2c')](_0x48aec0,_[_0x68ce('0x2d')](_0x39e693,_0x524d75));}return _0x48aec0;});}exports['initializeQueues']=initializeQueues;
\ No newline at end of file
+var _0xd6df=['error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','get','originated','find','merge','initializeQueues','jayson/promise','util','client','http','available','loggedIn','paused','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringInUse','talking','unavailable','unknown','pTalking','message','statusMessage','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then'];(function(_0x48686a,_0x4bbd26){var _0x45824b=function(_0x4b6ab8){while(--_0x4b6ab8){_0x48686a['push'](_0x48686a['shift']());}};_0x45824b(++_0x4bbd26);}(_0xd6df,0x181));var _0xfd6d=function(_0x5856c0,_0x4d2167){_0x5856c0=_0x5856c0-0x0;var _0x3a4627=_0xd6df[_0x5856c0];return _0x3a4627;};'use strict';var _=require('lodash');var jayson=require(_0xfd6d('0x0'));var util=require(_0xfd6d('0x1'));var amiClient=jayson[_0xfd6d('0x2')][_0xfd6d('0x3')]({'port':0x232a});var routingClient=jayson[_0xfd6d('0x2')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xfd6d('0x4'),_0xfd6d('0x5'),_0xfd6d('0x6'),_0xfd6d('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0xfd6d('0x8'),_0xfd6d('0x9'),_0xfd6d('0xa'),_0xfd6d('0xb'),_0xfd6d('0xc'),_0xfd6d('0xd'),'ringing',_0xfd6d('0xe'),_0xfd6d('0xf'),_0xfd6d('0x10'),_0xfd6d('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xfd6d('0x12'),'originated',_0xfd6d('0x13'),_0xfd6d('0x14'),'dialActive','dialMethod',_0xfd6d('0x15'),_0xfd6d('0x16'),_0xfd6d('0x17'),_0xfd6d('0x18'),_0xfd6d('0x19'),_0xfd6d('0x1a'),_0xfd6d('0x1b'),_0xfd6d('0x1c'),_0xfd6d('0x1d'),'dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0xfd6d('0x1e'),'predictiveIntervalAnsweredCalls',_0xfd6d('0x1f'),'predictiveIntervalDroppedCallsCallersExit',_0xfd6d('0x20'),_0xfd6d('0x21')];function getRealtimeQueues(_0x114582,_0x2b398b){var _0x35762f=_0x2b398b===_0xfd6d('0x22')?amiClient:routingClient;return _0x35762f[_0xfd6d('0x23')](_[_0xfd6d('0x24')](_0x2b398b)+_0xfd6d('0x25'),_0x114582)[_0xfd6d('0x26')](function(_0x313016){if(_0x313016[_0xfd6d('0x27')])throw new Error(util[_0xfd6d('0x28')](_0xfd6d('0x29'),_0x2b398b));return _0x313016[_0xfd6d('0x2a')];})[_0xfd6d('0x2b')](function(_0x2afcab){throw _0x2afcab;});}exports[_0xfd6d('0x2c')]=getRealtimeQueues;function initializeQueues(_0x446b75,_0x17f4a5,_0x1e37bd,_0x402f42){var _0x4738cb=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1e37bd===_0xfd6d('0x22')){if(_0x402f42===_0xfd6d('0x2d')){_0x4738cb=_0x4738cb[_0xfd6d('0x2e')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x402f42===_0xfd6d('0x2f')){_0x4738cb=_0x4738cb[_0xfd6d('0x2e')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x446b75['map'](function(_0x3cdb90){var _0xb2a9c8=_0x3cdb90[_0xfd6d('0x30')]({'plain':!![]});_0xb2a9c8[_0xfd6d('0x6')]=0x0;_0xb2a9c8[_0xfd6d('0xb')]=0x0;_0xb2a9c8[_0xfd6d('0x5')]=0x0;_0xb2a9c8[_0xfd6d('0x4')]=0x0;_0xb2a9c8['waiting']=0x0;if(_0x1e37bd===_0xfd6d('0x22')){_0xb2a9c8['talking']=0x0;_0xb2a9c8['busy']=0x0;if(_0x402f42===_0xfd6d('0x2f')){_0xb2a9c8['pTalking']=0x0;_0xb2a9c8[_0xfd6d('0x31')]=0x0;}}var _0x47fff2=_[_0xfd6d('0x32')](_0x17f4a5,['id',_0xb2a9c8['id']]);if(_0x47fff2){_[_0xfd6d('0x33')](_0xb2a9c8,_['pick'](_0x47fff2,_0x4738cb));}return _0xb2a9c8;});}exports[_0xfd6d('0x34')]=initializeQueues;
\ No newline at end of file