Built motion from commit f25620e4.|2.6.30
[motion2.git] / server / components / realtime / queues.js
index 9eada8e..16bdc80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7557=['dialMethod','Trunk','startPredictive','erlangCalls','erlangAbandonmentRate','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','Queues','format','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','paused','originated','find','merge','pick','initializeQueues','lodash','util','http','client','available','loggedIn','waiting','busy','inUse','invalid','loggedInDb','ringing','ringInUse','talking','unavailable','unknown','pTalking','message','statusMessage','dialActive'];(function(_0x46bca3,_0x800469){var _0x24d603=function(_0xeaf3fc){while(--_0xeaf3fc){_0x46bca3['push'](_0x46bca3['shift']());}};_0x24d603(++_0x800469);}(_0x7557,0xe6));var _0x7755=function(_0x565ba4,_0x47ca03){_0x565ba4=_0x565ba4-0x0;var _0x5ddf0e=_0x7557[_0x565ba4];return _0x5ddf0e;};'use strict';var _=require(_0x7755('0x0'));var jayson=require('jayson/promise');var util=require(_0x7755('0x1'));var amiClient=jayson['client'][_0x7755('0x2')]({'port':0x232a});var routingClient=jayson[_0x7755('0x3')][_0x7755('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x7755('0x4'),_0x7755('0x5'),'paused',_0x7755('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x7755('0x7'),_0x7755('0x8'),_0x7755('0x9'),_0x7755('0xa'),'notInUse','onHold',_0x7755('0xb'),_0x7755('0xc'),_0x7755('0xd'),_0x7755('0xe'),_0x7755('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x7755('0x10'),'originated',_0x7755('0x11'),_0x7755('0x12'),_0x7755('0x13'),_0x7755('0x14'),_0x7755('0x15'),_0x7755('0x16'),'startProgressive',_0x7755('0x17'),'erlangCallToSecond',_0x7755('0x18'),'erlangBusyFactor','dialPredictiveInterval',_0x7755('0x19'),_0x7755('0x1a'),_0x7755('0x1b'),_0x7755('0x1c'),_0x7755('0x1d'),'predictiveIntervalDroppedCallsTimeout',_0x7755('0x1e'),_0x7755('0x1f'),_0x7755('0x20')];function getRealtimeQueues(_0x1f1c5a,_0x223b93){var _0x4955f7=_0x223b93===_0x7755('0x21')?amiClient:routingClient;return _0x4955f7['request'](_['startCase'](_0x223b93)+_0x7755('0x22'),_0x1f1c5a)['then'](function(_0x3398d0){if(_0x3398d0['error'])throw new Error(util[_0x7755('0x23')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x223b93));return _0x3398d0[_0x7755('0x24')];})[_0x7755('0x25')](function(_0x1c7e6c){throw _0x1c7e6c;});}exports[_0x7755('0x26')]=getRealtimeQueues;function initializeQueues(_0x12353f,_0x3323d0,_0x76b192,_0x306f37){var _0x464337=DEFAULT_QUEUE_ATTRIBUTES;if(_0x76b192===_0x7755('0x21')){if(_0x306f37===_0x7755('0x27')){_0x464337=_0x464337[_0x7755('0x28')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x306f37===_0x7755('0x29')){_0x464337=_0x464337['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x12353f[_0x7755('0x2a')](function(_0x8c28cf){var _0x102dcc=_0x8c28cf[_0x7755('0x2b')]({'plain':!![]});_0x102dcc[_0x7755('0x2c')]=0x0;_0x102dcc[_0x7755('0xa')]=0x0;_0x102dcc[_0x7755('0x5')]=0x0;_0x102dcc[_0x7755('0x4')]=0x0;_0x102dcc[_0x7755('0x6')]=0x0;if(_0x76b192===_0x7755('0x21')){_0x102dcc[_0x7755('0xd')]=0x0;_0x102dcc['busy']=0x0;if(_0x306f37==='outbound'){_0x102dcc[_0x7755('0x10')]=0x0;_0x102dcc[_0x7755('0x2d')]=0x0;}}var _0x2d0182=_[_0x7755('0x2e')](_0x3323d0,['id',_0x102dcc['id']]);if(_0x2d0182){_[_0x7755('0x2f')](_0x102dcc,_[_0x7755('0x30')](_0x2d0182,_0x464337));}return _0x102dcc;});}exports[_0x7755('0x31')]=initializeQueues;
\ No newline at end of file
+var _0x8f61=['erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','getRealtimeQueues','concat','outbound','get','loggedInDb','loggedIn','voice','talking','find','merge','pick','initializeQueues','lodash','jayson/promise','util','client','http','available','paused','waiting','busy','inUse','invalid','notInUse','onHold','ringInUse','unavailable','unknown','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate'];(function(_0x12b893,_0x1ba772){var _0x69e8f7=function(_0x6fcd49){while(--_0x6fcd49){_0x12b893['push'](_0x12b893['shift']());}};_0x69e8f7(++_0x1ba772);}(_0x8f61,0x8d));var _0x18f6=function(_0x2aed8e,_0x108d6c){_0x2aed8e=_0x2aed8e-0x0;var _0x5914b3=_0x8f61[_0x2aed8e];return _0x5914b3;};'use strict';var _=require(_0x18f6('0x0'));var jayson=require(_0x18f6('0x1'));var util=require(_0x18f6('0x2'));var amiClient=jayson[_0x18f6('0x3')][_0x18f6('0x4')]({'port':0x232a});var routingClient=jayson[_0x18f6('0x3')][_0x18f6('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x18f6('0x5'),'loggedIn',_0x18f6('0x6'),_0x18f6('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x18f6('0x8'),_0x18f6('0x9'),_0x18f6('0xa'),'loggedInDb',_0x18f6('0xb'),_0x18f6('0xc'),'ringing',_0x18f6('0xd'),'talking',_0x18f6('0xe'),_0x18f6('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x18f6('0x10'),_0x18f6('0x11'),_0x18f6('0x12'),'statusMessage',_0x18f6('0x13'),_0x18f6('0x14'),_0x18f6('0x15'),_0x18f6('0x16'),_0x18f6('0x17'),_0x18f6('0x18'),_0x18f6('0x19'),_0x18f6('0x1a'),_0x18f6('0x1b'),_0x18f6('0x1c'),_0x18f6('0x1d'),_0x18f6('0x1e'),_0x18f6('0x1f'),_0x18f6('0x20'),'predictiveIntervalAnsweredCalls',_0x18f6('0x21'),_0x18f6('0x22'),_0x18f6('0x23'),_0x18f6('0x24')];function getRealtimeQueues(_0x461f77,_0x5093c9){var _0x1fea97=_0x5093c9==='voice'?amiClient:routingClient;return _0x1fea97[_0x18f6('0x25')](_[_0x18f6('0x26')](_0x5093c9)+_0x18f6('0x27'),_0x461f77)[_0x18f6('0x28')](function(_0x2cda97){if(_0x2cda97[_0x18f6('0x29')])throw new Error(util[_0x18f6('0x2a')](_0x18f6('0x2b'),_0x5093c9));return _0x2cda97['result'];})['catch'](function(_0x66cf7){throw _0x66cf7;});}exports[_0x18f6('0x2c')]=getRealtimeQueues;function initializeQueues(_0x20e4ad,_0x566125,_0x5e35aa,_0x592c09){var _0x21ff50=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5e35aa==='voice'){if(_0x592c09==='inbound'){_0x21ff50=_0x21ff50[_0x18f6('0x2d')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x592c09===_0x18f6('0x2e')){_0x21ff50=_0x21ff50[_0x18f6('0x2d')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x20e4ad['map'](function(_0x3eaa4f){var _0x300b56=_0x3eaa4f[_0x18f6('0x2f')]({'plain':!![]});_0x300b56[_0x18f6('0x6')]=0x0;_0x300b56[_0x18f6('0x30')]=0x0;_0x300b56[_0x18f6('0x31')]=0x0;_0x300b56[_0x18f6('0x5')]=0x0;_0x300b56[_0x18f6('0x7')]=0x0;if(_0x5e35aa===_0x18f6('0x32')){_0x300b56[_0x18f6('0x33')]=0x0;_0x300b56[_0x18f6('0x8')]=0x0;if(_0x592c09===_0x18f6('0x2e')){_0x300b56[_0x18f6('0x10')]=0x0;_0x300b56[_0x18f6('0x11')]=0x0;}}var _0x34986a=_[_0x18f6('0x34')](_0x566125,['id',_0x300b56['id']]);if(_0x34986a){_[_0x18f6('0x35')](_0x300b56,_[_0x18f6('0x36')](_0x34986a,_0x21ff50));}return _0x300b56;});}exports[_0x18f6('0x37')]=initializeQueues;
\ No newline at end of file