Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / components / realtime / queues.js
index 7980ac2..7badd96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6d1=['loggedInDb','notInUse','unavailable','unknown','pTalking','originated','statusMessage','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','concat','map','get','talking','outbound','find','merge','pick','initializeQueues','lodash','jayson/promise','client','http','available','loggedIn','paused','waiting','inUse'];(function(_0x2a2117,_0x2b02b6){var _0x1daf90=function(_0x34385a){while(--_0x34385a){_0x2a2117['push'](_0x2a2117['shift']());}};_0x1daf90(++_0x2b02b6);}(_0xa6d1,0x1a7));var _0x1a6d=function(_0x52ff0a,_0x44590f){_0x52ff0a=_0x52ff0a-0x0;var _0x3f5b6a=_0xa6d1[_0x52ff0a];return _0x3f5b6a;};'use strict';var _=require(_0x1a6d('0x0'));var jayson=require(_0x1a6d('0x1'));var util=require('util');var amiClient=jayson[_0x1a6d('0x2')][_0x1a6d('0x3')]({'port':0x232a});var routingClient=jayson[_0x1a6d('0x2')][_0x1a6d('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x1a6d('0x4'),_0x1a6d('0x5'),_0x1a6d('0x6'),_0x1a6d('0x7')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0x1a6d('0x8'),'invalid',_0x1a6d('0x9'),_0x1a6d('0xa'),'onHold','ringing','ringInUse','talking',_0x1a6d('0xb'),_0x1a6d('0xc')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x1a6d('0xd'),_0x1a6d('0xe'),'message',_0x1a6d('0xf'),_0x1a6d('0x10'),_0x1a6d('0x11'),_0x1a6d('0x12'),_0x1a6d('0x13'),_0x1a6d('0x14'),_0x1a6d('0x15'),_0x1a6d('0x16'),_0x1a6d('0x17'),_0x1a6d('0x18'),_0x1a6d('0x19'),_0x1a6d('0x1a'),_0x1a6d('0x1b'),'predictiveIntervalAvailable',_0x1a6d('0x1c'),_0x1a6d('0x1d'),_0x1a6d('0x1e'),_0x1a6d('0x1f'),_0x1a6d('0x20'),_0x1a6d('0x21')];function getRealtimeQueues(_0x38c738,_0x266062){var _0x565728=_0x266062===_0x1a6d('0x22')?amiClient:routingClient;return _0x565728[_0x1a6d('0x23')](_[_0x1a6d('0x24')](_0x266062)+_0x1a6d('0x25'),_0x38c738)[_0x1a6d('0x26')](function(_0x4ae0f2){if(_0x4ae0f2[_0x1a6d('0x27')])throw new Error(util[_0x1a6d('0x28')](_0x1a6d('0x29'),_0x266062));return _0x4ae0f2[_0x1a6d('0x2a')];})[_0x1a6d('0x2b')](function(_0x4835b7){throw _0x4835b7;});}exports[_0x1a6d('0x2c')]=getRealtimeQueues;function initializeQueues(_0x4cad87,_0x31ecf6,_0x4b0688,_0x25514b){var _0x35c847=DEFAULT_QUEUE_ATTRIBUTES;if(_0x4b0688===_0x1a6d('0x22')){if(_0x25514b==='inbound'){_0x35c847=_0x35c847[_0x1a6d('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x25514b==='outbound'){_0x35c847=_0x35c847[_0x1a6d('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4cad87[_0x1a6d('0x2e')](function(_0x29a291){var _0x1fc5f6=_0x29a291[_0x1a6d('0x2f')]({'plain':!![]});_0x1fc5f6[_0x1a6d('0x6')]=0x0;_0x1fc5f6[_0x1a6d('0x9')]=0x0;_0x1fc5f6[_0x1a6d('0x5')]=0x0;_0x1fc5f6['available']=0x0;_0x1fc5f6[_0x1a6d('0x7')]=0x0;if(_0x4b0688==='voice'){_0x1fc5f6[_0x1a6d('0x30')]=0x0;_0x1fc5f6['busy']=0x0;if(_0x25514b===_0x1a6d('0x31')){_0x1fc5f6[_0x1a6d('0xd')]=0x0;_0x1fc5f6[_0x1a6d('0xe')]=0x0;}}var _0x36e4ee=_[_0x1a6d('0x32')](_0x31ecf6,['id',_0x1fc5f6['id']]);if(_0x36e4ee){_[_0x1a6d('0x33')](_0x1fc5f6,_[_0x1a6d('0x34')](_0x36e4ee,_0x35c847));}return _0x1fc5f6;});}exports[_0x1a6d('0x35')]=initializeQueues;
\ No newline at end of file
+var _0x7d24=['find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','loggedIn','waiting','invalid','loggedInDb','notInUse','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','voice','startCase','then','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','concat','outbound','map','paused','busy'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7d24,0x184));var _0x47d2=function(_0xe944b7,_0x515d61){_0xe944b7=_0xe944b7-0x0;var _0x390063=_0x7d24[_0xe944b7];return _0x390063;};'use strict';var _=require(_0x47d2('0x0'));var jayson=require(_0x47d2('0x1'));var util=require(_0x47d2('0x2'));var amiClient=jayson[_0x47d2('0x3')][_0x47d2('0x4')]({'port':0x232a});var routingClient=jayson[_0x47d2('0x3')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x47d2('0x5'),'paused',_0x47d2('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy','inUse',_0x47d2('0x7'),_0x47d2('0x8'),_0x47d2('0x9'),'onHold',_0x47d2('0xa'),_0x47d2('0xb'),_0x47d2('0xc'),_0x47d2('0xd'),_0x47d2('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x47d2('0xf'),_0x47d2('0x10'),_0x47d2('0x11'),_0x47d2('0x12'),_0x47d2('0x13'),_0x47d2('0x14'),'Trunk',_0x47d2('0x15'),_0x47d2('0x16'),_0x47d2('0x17'),_0x47d2('0x18'),'erlangAbandonmentRate',_0x47d2('0x19'),_0x47d2('0x1a'),_0x47d2('0x1b'),_0x47d2('0x1c'),'predictiveIntervalAvailable',_0x47d2('0x1d'),'predictiveIntervalAnsweredCalls',_0x47d2('0x1e'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x47d2('0x1f')];function getRealtimeQueues(_0x150543,_0x10726b){var _0x5eb90=_0x10726b===_0x47d2('0x20')?amiClient:routingClient;return _0x5eb90['request'](_[_0x47d2('0x21')](_0x10726b)+'Queues',_0x150543)[_0x47d2('0x22')](function(_0x493934){if(_0x493934['error'])throw new Error(util['format'](_0x47d2('0x23'),_0x10726b));return _0x493934[_0x47d2('0x24')];})[_0x47d2('0x25')](function(_0x11a33c){throw _0x11a33c;});}exports[_0x47d2('0x26')]=getRealtimeQueues;function initializeQueues(_0x56cade,_0x197324,_0x517add,_0x483e54){var _0x2e6bf=DEFAULT_QUEUE_ATTRIBUTES;if(_0x517add==='voice'){if(_0x483e54==='inbound'){_0x2e6bf=_0x2e6bf[_0x47d2('0x27')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x483e54===_0x47d2('0x28')){_0x2e6bf=_0x2e6bf[_0x47d2('0x27')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x56cade[_0x47d2('0x29')](function(_0x243d53){var _0x290ac2=_0x243d53['get']({'plain':!![]});_0x290ac2[_0x47d2('0x2a')]=0x0;_0x290ac2['loggedInDb']=0x0;_0x290ac2['loggedIn']=0x0;_0x290ac2['available']=0x0;_0x290ac2['waiting']=0x0;if(_0x517add===_0x47d2('0x20')){_0x290ac2[_0x47d2('0xc')]=0x0;_0x290ac2[_0x47d2('0x2b')]=0x0;if(_0x483e54==='outbound'){_0x290ac2[_0x47d2('0xf')]=0x0;_0x290ac2[_0x47d2('0x10')]=0x0;}}var _0x1fb2d3=_[_0x47d2('0x2c')](_0x197324,['id',_0x290ac2['id']]);if(_0x1fb2d3){_[_0x47d2('0x2d')](_0x290ac2,_[_0x47d2('0x2e')](_0x1fb2d3,_0x2e6bf));}return _0x290ac2;});}exports[_0x47d2('0x2f')]=initializeQueues;
\ No newline at end of file