Built motion from commit 9d0783e6.|2.6.13
[motion2.git] / server / api / teamVoiceQueue / teamVoiceQueue.rpc.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xab6a=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','stringify','code','error','message','TeamVoiceQueue,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x8ebb49,_0x4c1190){var _0x34498e=function(_0x41b1ac){while(--_0x41b1ac){_0x8ebb49['push'](_0x8ebb49['shift']());}};_0x34498e(++_0x4c1190);}(_0xab6a,0x177));var _0xaab6=function(_0x21999e,_0x49d08f){_0x21999e=_0x21999e-0x0;var _0xf9f87=_0xab6a[_0x21999e];return _0xf9f87;};'use strict';var _=require(_0xaab6('0x0'));var util=require(_0xaab6('0x1'));var moment=require(_0xaab6('0x2'));var BPromise=require(_0xaab6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaab6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xaab6('0x5'));var logger=require(_0xaab6('0x6'))(_0xaab6('0x7'));var config=require(_0xaab6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaab6('0x9')][_0xaab6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18294a,_0x534ca7,_0x58a14f){return new BPromise(function(_0x35b050,_0x3c9e3d){return client['request'](_0x18294a,_0x58a14f)['then'](function(_0x524832){logger[_0xaab6('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x534ca7,_0xaab6('0xc'));logger[_0xaab6('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x534ca7,'request\x20sent',JSON[_0xaab6('0xe')](_0x524832));if(_0x524832['error']){if(_0x524832['error'][_0xaab6('0xf')]===0x1f4){logger[_0xaab6('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x534ca7,_0x524832[_0xaab6('0x10')][_0xaab6('0x11')]);return _0x3c9e3d(_0x524832[_0xaab6('0x10')][_0xaab6('0x11')]);}logger[_0xaab6('0x10')](_0xaab6('0x12'),_0x534ca7,_0x524832[_0xaab6('0x10')][_0xaab6('0x11')]);return _0x35b050(_0x524832[_0xaab6('0x10')][_0xaab6('0x11')]);}else{logger[_0xaab6('0xb')](_0xaab6('0x12'),_0x534ca7,_0xaab6('0xc'));_0x35b050(_0x524832[_0xaab6('0x13')][_0xaab6('0x11')]);}})[_0xaab6('0x14')](function(_0x295131){logger[_0xaab6('0x10')](_0xaab6('0x12'),_0x534ca7,_0x295131);_0x3c9e3d(_0x295131);});});}