Built motion from commit 97153652.|2.6.26
[motion2.git] / server / components / realtime / queues.js
index b6ec85c..c4fccd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcb9=['available','loggedIn','paused','waiting','busy','inUse','invalid','notInUse','onHold','ringing','talking','unavailable','unknown','originated','message','dialMethod','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','Queues','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','inbound','concat','map','get','loggedInDb','outbound','pTalking','find','pick','initializeQueues','lodash','jayson/promise','util','client','http'];(function(_0x3a75fb,_0x4f7628){var _0x38b356=function(_0x59557a){while(--_0x59557a){_0x3a75fb['push'](_0x3a75fb['shift']());}};_0x38b356(++_0x4f7628);}(_0xbcb9,0x88));var _0x9bcb=function(_0x3641cd,_0x475f36){_0x3641cd=_0x3641cd-0x0;var _0x1c475=_0xbcb9[_0x3641cd];return _0x1c475;};'use strict';var _=require(_0x9bcb('0x0'));var jayson=require(_0x9bcb('0x1'));var util=require(_0x9bcb('0x2'));var amiClient=jayson[_0x9bcb('0x3')][_0x9bcb('0x4')]({'port':0x232a});var routingClient=jayson[_0x9bcb('0x3')][_0x9bcb('0x4')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x9bcb('0x5'),_0x9bcb('0x6'),_0x9bcb('0x7'),_0x9bcb('0x8')];var VOICE_QUEUE_ATTRIBUTES=[_0x9bcb('0x9'),_0x9bcb('0xa'),_0x9bcb('0xb'),'loggedInDb',_0x9bcb('0xc'),_0x9bcb('0xd'),_0x9bcb('0xe'),'ringInUse',_0x9bcb('0xf'),_0x9bcb('0x10'),_0x9bcb('0x11')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x9bcb('0x12'),_0x9bcb('0x13'),'statusMessage','dialActive',_0x9bcb('0x14'),'Trunk','startPredictive',_0x9bcb('0x15'),'erlangCalls',_0x9bcb('0x16'),_0x9bcb('0x17'),_0x9bcb('0x18'),_0x9bcb('0x19'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable',_0x9bcb('0x1a'),'predictiveIntervalAnsweredCalls',_0x9bcb('0x1b'),_0x9bcb('0x1c'),_0x9bcb('0x1d'),_0x9bcb('0x1e')];function getRealtimeQueues(_0x54301b,_0x56780c){var _0x419c8a=_0x56780c===_0x9bcb('0x1f')?amiClient:routingClient;return _0x419c8a['request'](_['startCase'](_0x56780c)+_0x9bcb('0x20'),_0x54301b)['then'](function(_0x12864b){if(_0x12864b[_0x9bcb('0x21')])throw new Error(util[_0x9bcb('0x22')](_0x9bcb('0x23'),_0x56780c));return _0x12864b[_0x9bcb('0x24')];})['catch'](function(_0x3b04a6){throw _0x3b04a6;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x1bc20b,_0x34fb7a,_0x1eacf6,_0x27b15e){var _0x3fd84a=DEFAULT_QUEUE_ATTRIBUTES;if(_0x1eacf6===_0x9bcb('0x1f')){if(_0x27b15e===_0x9bcb('0x25')){_0x3fd84a=_0x3fd84a[_0x9bcb('0x26')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x27b15e==='outbound'){_0x3fd84a=_0x3fd84a['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1bc20b[_0x9bcb('0x27')](function(_0x4c14eb){var _0xdbcf11=_0x4c14eb[_0x9bcb('0x28')]({'plain':!![]});_0xdbcf11[_0x9bcb('0x7')]=0x0;_0xdbcf11[_0x9bcb('0x29')]=0x0;_0xdbcf11[_0x9bcb('0x6')]=0x0;_0xdbcf11[_0x9bcb('0x5')]=0x0;_0xdbcf11[_0x9bcb('0x8')]=0x0;if(_0x1eacf6===_0x9bcb('0x1f')){_0xdbcf11[_0x9bcb('0xf')]=0x0;_0xdbcf11[_0x9bcb('0x9')]=0x0;if(_0x27b15e===_0x9bcb('0x2a')){_0xdbcf11[_0x9bcb('0x2b')]=0x0;_0xdbcf11[_0x9bcb('0x12')]=0x0;}}var _0x22f3bf=_[_0x9bcb('0x2c')](_0x34fb7a,['id',_0xdbcf11['id']]);if(_0x22f3bf){_['merge'](_0xdbcf11,_[_0x9bcb('0x2d')](_0x22f3bf,_0x3fd84a));}return _0xdbcf11;});}exports[_0x9bcb('0x2e')]=initializeQueues;
\ No newline at end of file
+var _0x33fd=['ringing','ringInUse','unavailable','unknown','pTalking','message','statusMessage','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice','request','startCase','then','error','format','result','catch','getRealtimeQueues','inbound','concat','get','loggedIn','talking','busy','outbound','find','merge','pick','initializeQueues','lodash','jayson/promise','client','http','available','paused','waiting','inUse','invalid','loggedInDb','notInUse','onHold'];(function(_0x2dc7d3,_0x371453){var _0x989910=function(_0x319b09){while(--_0x319b09){_0x2dc7d3['push'](_0x2dc7d3['shift']());}};_0x989910(++_0x371453);}(_0x33fd,0x93));var _0xd33f=function(_0x3e614e,_0x27fdbd){_0x3e614e=_0x3e614e-0x0;var _0x45fedd=_0x33fd[_0x3e614e];return _0x45fedd;};'use strict';var _=require(_0xd33f('0x0'));var jayson=require(_0xd33f('0x1'));var util=require('util');var amiClient=jayson[_0xd33f('0x2')][_0xd33f('0x3')]({'port':0x232a});var routingClient=jayson[_0xd33f('0x2')][_0xd33f('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xd33f('0x4'),'loggedIn',_0xd33f('0x5'),_0xd33f('0x6')];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xd33f('0x7'),_0xd33f('0x8'),_0xd33f('0x9'),_0xd33f('0xa'),_0xd33f('0xb'),_0xd33f('0xc'),_0xd33f('0xd'),'talking',_0xd33f('0xe'),_0xd33f('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0xd33f('0x10'),'originated',_0xd33f('0x11'),_0xd33f('0x12'),_0xd33f('0x13'),_0xd33f('0x14'),_0xd33f('0x15'),'startPredictive',_0xd33f('0x16'),_0xd33f('0x17'),_0xd33f('0x18'),'erlangAbandonmentRate',_0xd33f('0x19'),'dialPredictiveInterval',_0xd33f('0x1a'),_0xd33f('0x1b'),_0xd33f('0x1c'),'predictiveIntervalTotalCalls',_0xd33f('0x1d'),_0xd33f('0x1e'),_0xd33f('0x1f'),'predictiveIntervalAvgHoldtime',_0xd33f('0x20')];function getRealtimeQueues(_0x5c13ce,_0x49399d){var _0x28abb5=_0x49399d===_0xd33f('0x21')?amiClient:routingClient;return _0x28abb5[_0xd33f('0x22')](_[_0xd33f('0x23')](_0x49399d)+'Queues',_0x5c13ce)[_0xd33f('0x24')](function(_0x11dc5b){if(_0x11dc5b[_0xd33f('0x25')])throw new Error(util[_0xd33f('0x26')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x49399d));return _0x11dc5b[_0xd33f('0x27')];})[_0xd33f('0x28')](function(_0x35fada){throw _0x35fada;});}exports[_0xd33f('0x29')]=getRealtimeQueues;function initializeQueues(_0x2c6a7d,_0x50e431,_0xf1c99d,_0xdf9646){var _0x902165=DEFAULT_QUEUE_ATTRIBUTES;if(_0xf1c99d===_0xd33f('0x21')){if(_0xdf9646===_0xd33f('0x2a')){_0x902165=_0x902165[_0xd33f('0x2b')](VOICE_QUEUE_ATTRIBUTES);}else if(_0xdf9646==='outbound'){_0x902165=_0x902165[_0xd33f('0x2b')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2c6a7d['map'](function(_0x205fa5){var _0x190e32=_0x205fa5[_0xd33f('0x2c')]({'plain':!![]});_0x190e32[_0xd33f('0x5')]=0x0;_0x190e32[_0xd33f('0x9')]=0x0;_0x190e32[_0xd33f('0x2d')]=0x0;_0x190e32[_0xd33f('0x4')]=0x0;_0x190e32[_0xd33f('0x6')]=0x0;if(_0xf1c99d==='voice'){_0x190e32[_0xd33f('0x2e')]=0x0;_0x190e32[_0xd33f('0x2f')]=0x0;if(_0xdf9646===_0xd33f('0x30')){_0x190e32[_0xd33f('0x10')]=0x0;_0x190e32['originated']=0x0;}}var _0x58117a=_[_0xd33f('0x31')](_0x50e431,['id',_0x190e32['id']]);if(_0x58117a){_[_0xd33f('0x32')](_0x190e32,_[_0xd33f('0x33')](_0x58117a,_0x902165));}return _0x190e32;});}exports[_0xd33f('0x34')]=initializeQueues;
\ No newline at end of file