Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / components / realtime / queues.js
index c300fda..de8744d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2049=['loggedInDb','notInUse','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','dialActive','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','catch','getRealtimeQueues','voice','inbound','outbound','concat','map','get','paused','waiting','merge','pick','initializeQueues','jayson/promise','client','http','available','loggedIn','busy','inUse','invalid'];(function(_0x4cd80f,_0x3dd6c0){var _0x57b7a4=function(_0x467938){while(--_0x467938){_0x4cd80f['push'](_0x4cd80f['shift']());}};_0x57b7a4(++_0x3dd6c0);}(_0x2049,0x180));var _0x9204=function(_0x30bba0,_0x2f9580){_0x30bba0=_0x30bba0-0x0;var _0x507c27=_0x2049[_0x30bba0];return _0x507c27;};'use strict';var _=require('lodash');var jayson=require(_0x9204('0x0'));var util=require('util');var amiClient=jayson[_0x9204('0x1')]['http']({'port':0x232a});var routingClient=jayson[_0x9204('0x1')][_0x9204('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x9204('0x3'),_0x9204('0x4'),'paused','waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x9204('0x5'),_0x9204('0x6'),_0x9204('0x7'),_0x9204('0x8'),_0x9204('0x9'),'onHold',_0x9204('0xa'),_0x9204('0xb'),_0x9204('0xc'),_0x9204('0xd'),_0x9204('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x9204('0xf'),_0x9204('0x10'),'message','statusMessage',_0x9204('0x11'),'dialMethod','Trunk',_0x9204('0x12'),_0x9204('0x13'),_0x9204('0x14'),_0x9204('0x15'),'erlangAbandonmentRate',_0x9204('0x16'),_0x9204('0x17'),_0x9204('0x18'),_0x9204('0x19'),'predictiveIntervalAvailable',_0x9204('0x1a'),'predictiveIntervalAnsweredCalls',_0x9204('0x1b'),'predictiveIntervalDroppedCallsCallersExit',_0x9204('0x1c'),_0x9204('0x1d')];function getRealtimeQueues(_0x28e73d,_0x57ca5f){var _0x2785cd=_0x57ca5f==='voice'?amiClient:routingClient;return _0x2785cd[_0x9204('0x1e')](_[_0x9204('0x1f')](_0x57ca5f)+_0x9204('0x20'),_0x28e73d)['then'](function(_0x9e7549){if(_0x9e7549[_0x9204('0x21')])throw new Error(util[_0x9204('0x22')](_0x9204('0x23'),_0x57ca5f));return _0x9e7549['result'];})[_0x9204('0x24')](function(_0x2a885f){throw _0x2a885f;});}exports[_0x9204('0x25')]=getRealtimeQueues;function initializeQueues(_0x4a31b8,_0x1b1578,_0x412063,_0x29e389){var _0x3b6995=DEFAULT_QUEUE_ATTRIBUTES;if(_0x412063===_0x9204('0x26')){if(_0x29e389===_0x9204('0x27')){_0x3b6995=_0x3b6995['concat'](VOICE_QUEUE_ATTRIBUTES);}else if(_0x29e389===_0x9204('0x28')){_0x3b6995=_0x3b6995[_0x9204('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x4a31b8[_0x9204('0x2a')](function(_0x100b61){var _0x37f1fc=_0x100b61[_0x9204('0x2b')]({'plain':!![]});_0x37f1fc[_0x9204('0x2c')]=0x0;_0x37f1fc['loggedInDb']=0x0;_0x37f1fc[_0x9204('0x4')]=0x0;_0x37f1fc[_0x9204('0x3')]=0x0;_0x37f1fc[_0x9204('0x2d')]=0x0;if(_0x412063===_0x9204('0x26')){_0x37f1fc[_0x9204('0xc')]=0x0;_0x37f1fc[_0x9204('0x5')]=0x0;if(_0x29e389==='outbound'){_0x37f1fc[_0x9204('0xf')]=0x0;_0x37f1fc[_0x9204('0x10')]=0x0;}}var _0x494411=_['find'](_0x1b1578,['id',_0x37f1fc['id']]);if(_0x494411){_[_0x9204('0x2e')](_0x37f1fc,_[_0x9204('0x2f')](_0x494411,_0x3b6995));}return _0x37f1fc;});}exports[_0x9204('0x30')]=initializeQueues;
\ No newline at end of file
+var _0xad0b=['pTalking','originated','message','statusMessage','dialActive','dialMethod','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','then','error','format','result','catch','getRealtimeQueues','concat','map','get','waiting','merge','pick','initializeQueues','lodash','util','client','http','loggedIn','paused','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringInUse','talking','unknown'];(function(_0x5c2da4,_0xf4a329){var _0x708e40=function(_0x1cedf2){while(--_0x1cedf2){_0x5c2da4['push'](_0x5c2da4['shift']());}};_0x708e40(++_0xf4a329);}(_0xad0b,0xa9));var _0xbad0=function(_0x4736c9,_0x3ac90c){_0x4736c9=_0x4736c9-0x0;var _0x2c2e80=_0xad0b[_0x4736c9];return _0x2c2e80;};'use strict';var _=require(_0xbad0('0x0'));var jayson=require('jayson/promise');var util=require(_0xbad0('0x1'));var amiClient=jayson[_0xbad0('0x2')][_0xbad0('0x3')]({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0xbad0('0x4'),_0xbad0('0x5'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0xbad0('0x6'),_0xbad0('0x7'),_0xbad0('0x8'),_0xbad0('0x9'),_0xbad0('0xa'),_0xbad0('0xb'),'ringing',_0xbad0('0xc'),_0xbad0('0xd'),'unavailable',_0xbad0('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xbad0('0xf'),_0xbad0('0x10'),_0xbad0('0x11'),_0xbad0('0x12'),_0xbad0('0x13'),_0xbad0('0x14'),'Trunk','startPredictive','startProgressive',_0xbad0('0x15'),_0xbad0('0x16'),_0xbad0('0x17'),'erlangBusyFactor',_0xbad0('0x18'),_0xbad0('0x19'),_0xbad0('0x1a'),'predictiveIntervalAvailable',_0xbad0('0x1b'),'predictiveIntervalAnsweredCalls',_0xbad0('0x1c'),'predictiveIntervalDroppedCallsCallersExit',_0xbad0('0x1d'),_0xbad0('0x1e')];function getRealtimeQueues(_0x5ac50e,_0x18b07a){var _0x3fcbca=_0x18b07a===_0xbad0('0x1f')?amiClient:routingClient;return _0x3fcbca[_0xbad0('0x20')](_['startCase'](_0x18b07a)+'Queues',_0x5ac50e)[_0xbad0('0x21')](function(_0x382450){if(_0x382450[_0xbad0('0x22')])throw new Error(util[_0xbad0('0x23')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x18b07a));return _0x382450[_0xbad0('0x24')];})[_0xbad0('0x25')](function(_0x4ab611){throw _0x4ab611;});}exports[_0xbad0('0x26')]=getRealtimeQueues;function initializeQueues(_0x16f0f4,_0x39b7b6,_0x6a9603,_0x1b130f){var _0x587e20=DEFAULT_QUEUE_ATTRIBUTES;if(_0x6a9603==='voice'){if(_0x1b130f==='inbound'){_0x587e20=_0x587e20[_0xbad0('0x27')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x1b130f==='outbound'){_0x587e20=_0x587e20[_0xbad0('0x27')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x16f0f4[_0xbad0('0x28')](function(_0x5917ed){var _0x808c4c=_0x5917ed[_0xbad0('0x29')]({'plain':!![]});_0x808c4c[_0xbad0('0x5')]=0x0;_0x808c4c[_0xbad0('0x9')]=0x0;_0x808c4c['loggedIn']=0x0;_0x808c4c['available']=0x0;_0x808c4c[_0xbad0('0x2a')]=0x0;if(_0x6a9603===_0xbad0('0x1f')){_0x808c4c['talking']=0x0;_0x808c4c['busy']=0x0;if(_0x1b130f==='outbound'){_0x808c4c['pTalking']=0x0;_0x808c4c[_0xbad0('0x10')]=0x0;}}var _0x34065d=_['find'](_0x39b7b6,['id',_0x808c4c['id']]);if(_0x34065d){_[_0xbad0('0x2b')](_0x808c4c,_[_0xbad0('0x2c')](_0x34065d,_0x587e20));}return _0x808c4c;});}exports[_0xbad0('0x2d')]=initializeQueues;
\ No newline at end of file