Built motion from commit 9b156c94.|2.6.22
[motion2.git] / server / components / realtime / queues.js
index e83ef71..74a97df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbe5=['dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','request','Queues','then','result','getRealtimeQueues','inbound','concat','outbound','map','loggedIn','talking','find','merge','initializeQueues','lodash','jayson/promise','util','http','client','available','paused','waiting','busy','invalid','loggedInDb','ringing','unavailable','unknown','pTalking','originated','message','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold'];(function(_0x558b2c,_0x3dbf75){var _0xc58ade=function(_0xdb1b4b){while(--_0xdb1b4b){_0x558b2c['push'](_0x558b2c['shift']());}};_0xc58ade(++_0x3dbf75);}(_0xdbe5,0x17d));var _0x5dbe=function(_0x5406d9,_0x31c8fc){_0x5406d9=_0x5406d9-0x0;var _0x45d372=_0xdbe5[_0x5406d9];return _0x45d372;};'use strict';var _=require(_0x5dbe('0x0'));var jayson=require(_0x5dbe('0x1'));var util=require(_0x5dbe('0x2'));var amiClient=jayson['client'][_0x5dbe('0x3')]({'port':0x232a});var routingClient=jayson[_0x5dbe('0x4')][_0x5dbe('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x5dbe('0x5'),'loggedIn',_0x5dbe('0x6'),_0x5dbe('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x5dbe('0x8'),'inUse',_0x5dbe('0x9'),_0x5dbe('0xa'),'notInUse','onHold',_0x5dbe('0xb'),'ringInUse','talking',_0x5dbe('0xc'),_0x5dbe('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x5dbe('0xe'),_0x5dbe('0xf'),_0x5dbe('0x10'),'statusMessage','dialActive','dialMethod','Trunk',_0x5dbe('0x11'),_0x5dbe('0x12'),_0x5dbe('0x13'),_0x5dbe('0x14'),_0x5dbe('0x15'),_0x5dbe('0x16'),'dialPredictiveInterval',_0x5dbe('0x17'),_0x5dbe('0x18'),_0x5dbe('0x19'),_0x5dbe('0x1a'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x5dbe('0x1b'),_0x5dbe('0x1c'),_0x5dbe('0x1d')];function getRealtimeQueues(_0x2493f2,_0x23fed3){var _0x4e07e1=_0x23fed3===_0x5dbe('0x1e')?amiClient:routingClient;return _0x4e07e1[_0x5dbe('0x1f')](_['startCase'](_0x23fed3)+_0x5dbe('0x20'),_0x2493f2)[_0x5dbe('0x21')](function(_0x3021cd){if(_0x3021cd['error'])throw new Error(util['format']('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x23fed3));return _0x3021cd[_0x5dbe('0x22')];})['catch'](function(_0x5c2b80){throw _0x5c2b80;});}exports[_0x5dbe('0x23')]=getRealtimeQueues;function initializeQueues(_0x30a849,_0x328d58,_0x123c5e,_0x27d948){var _0x26af6d=DEFAULT_QUEUE_ATTRIBUTES;if(_0x123c5e===_0x5dbe('0x1e')){if(_0x27d948===_0x5dbe('0x24')){_0x26af6d=_0x26af6d[_0x5dbe('0x25')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x27d948===_0x5dbe('0x26')){_0x26af6d=_0x26af6d[_0x5dbe('0x25')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x30a849[_0x5dbe('0x27')](function(_0x391924){var _0x16e4a7=_0x391924['get']({'plain':!![]});_0x16e4a7[_0x5dbe('0x6')]=0x0;_0x16e4a7[_0x5dbe('0xa')]=0x0;_0x16e4a7[_0x5dbe('0x28')]=0x0;_0x16e4a7[_0x5dbe('0x5')]=0x0;_0x16e4a7[_0x5dbe('0x7')]=0x0;if(_0x123c5e===_0x5dbe('0x1e')){_0x16e4a7[_0x5dbe('0x29')]=0x0;_0x16e4a7[_0x5dbe('0x8')]=0x0;if(_0x27d948===_0x5dbe('0x26')){_0x16e4a7[_0x5dbe('0xe')]=0x0;_0x16e4a7['originated']=0x0;}}var _0x43628a=_[_0x5dbe('0x2a')](_0x328d58,['id',_0x16e4a7['id']]);if(_0x43628a){_[_0x5dbe('0x2b')](_0x16e4a7,_['pick'](_0x43628a,_0x26af6d));}return _0x16e4a7;});}exports[_0x5dbe('0x2c')]=initializeQueues;
\ No newline at end of file
+var _0x2a22=['loggedIn','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','talking','unavailable','unknown','pTalking','originated','statusMessage','dialActive','dialMethod','Trunk','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','then','format','result','catch','getRealtimeQueues','inbound','concat','outbound','paused','find','merge','pick','initializeQueues','util','client','available'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2a22,0x14d));var _0x22a2=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x2a22[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var util=require(_0x22a2('0x0'));var amiClient=jayson[_0x22a2('0x1')]['http']({'port':0x232a});var routingClient=jayson[_0x22a2('0x1')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x22a2('0x2'),_0x22a2('0x3'),'paused',_0x22a2('0x4')];var VOICE_QUEUE_ATTRIBUTES=[_0x22a2('0x5'),_0x22a2('0x6'),_0x22a2('0x7'),_0x22a2('0x8'),_0x22a2('0x9'),_0x22a2('0xa'),_0x22a2('0xb'),_0x22a2('0xc'),_0x22a2('0xd'),_0x22a2('0xe'),_0x22a2('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x22a2('0x10'),_0x22a2('0x11'),'message',_0x22a2('0x12'),_0x22a2('0x13'),_0x22a2('0x14'),_0x22a2('0x15'),'startPredictive','startProgressive',_0x22a2('0x16'),'erlangCallToSecond',_0x22a2('0x17'),_0x22a2('0x18'),_0x22a2('0x19'),_0x22a2('0x1a'),'dialPredictiveIntervalMinThreshold',_0x22a2('0x1b'),_0x22a2('0x1c'),_0x22a2('0x1d'),_0x22a2('0x1e'),'predictiveIntervalDroppedCallsCallersExit',_0x22a2('0x1f'),_0x22a2('0x20')];function getRealtimeQueues(_0x5f1bc2,_0x382b49){var _0x1d3a2d=_0x382b49===_0x22a2('0x21')?amiClient:routingClient;return _0x1d3a2d['request'](_[_0x22a2('0x22')](_0x382b49)+'Queues',_0x5f1bc2)[_0x22a2('0x23')](function(_0x2e2dd6){if(_0x2e2dd6['error'])throw new Error(util[_0x22a2('0x24')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x382b49));return _0x2e2dd6[_0x22a2('0x25')];})[_0x22a2('0x26')](function(_0xaef275){throw _0xaef275;});}exports[_0x22a2('0x27')]=getRealtimeQueues;function initializeQueues(_0x58cbf5,_0x23044d,_0x2e6d16,_0x2c251d){var _0x5eb103=DEFAULT_QUEUE_ATTRIBUTES;if(_0x2e6d16===_0x22a2('0x21')){if(_0x2c251d===_0x22a2('0x28')){_0x5eb103=_0x5eb103[_0x22a2('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x2c251d===_0x22a2('0x2a')){_0x5eb103=_0x5eb103[_0x22a2('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x58cbf5['map'](function(_0x36efcf){var _0x759478=_0x36efcf['get']({'plain':!![]});_0x759478[_0x22a2('0x2b')]=0x0;_0x759478['loggedInDb']=0x0;_0x759478[_0x22a2('0x3')]=0x0;_0x759478[_0x22a2('0x2')]=0x0;_0x759478[_0x22a2('0x4')]=0x0;if(_0x2e6d16==='voice'){_0x759478[_0x22a2('0xd')]=0x0;_0x759478[_0x22a2('0x5')]=0x0;if(_0x2c251d==='outbound'){_0x759478[_0x22a2('0x10')]=0x0;_0x759478[_0x22a2('0x11')]=0x0;}}var _0x337d16=_[_0x22a2('0x2c')](_0x23044d,['id',_0x759478['id']]);if(_0x337d16){_[_0x22a2('0x2d')](_0x759478,_[_0x22a2('0x2e')](_0x337d16,_0x5eb103));}return _0x759478;});}exports[_0x22a2('0x2f')]=initializeQueues;
\ No newline at end of file