Built motion from commit (unavailable).|2.5.14
[motion2.git] / server / api / userOpenchannelQueue / userOpenchannelQueue.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 _0x536a=['error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify'];(function(_0x4ddd44,_0x3c9683){var _0x4327e3=function(_0x490587){while(--_0x490587){_0x4ddd44['push'](_0x4ddd44['shift']());}};_0x4327e3(++_0x3c9683);}(_0x536a,0xd7));var _0xa536=function(_0x28d095,_0x532bd8){_0x28d095=_0x28d095-0x0;var _0x355c30=_0x536a[_0x28d095];return _0x355c30;};'use strict';var _=require(_0xa536('0x0'));var util=require(_0xa536('0x1'));var moment=require('moment');var BPromise=require(_0xa536('0x2'));var rs=require(_0xa536('0x3'));var fs=require('fs');var Redis=require(_0xa536('0x4'));var db=require(_0xa536('0x5'))['db'];var utils=require(_0xa536('0x6'));var logger=require('../../config/logger')(_0xa536('0x7'));var config=require(_0xa536('0x8'));var jayson=require(_0xa536('0x9'));var client=jayson[_0xa536('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd6779f,_0x2a8054,_0x1501b9){return new BPromise(function(_0xe29fc8,_0xfd0a34){return client[_0xa536('0xb')](_0xd6779f,_0x1501b9)['then'](function(_0x16de18){logger[_0xa536('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2a8054,_0xa536('0xd'));logger[_0xa536('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2a8054,_0xa536('0xd'),JSON[_0xa536('0xf')](_0x16de18));if(_0x16de18[_0xa536('0x10')]){if(_0x16de18[_0xa536('0x10')][_0xa536('0x11')]===0x1f4){logger['error'](_0xa536('0x12'),_0x2a8054,_0x16de18[_0xa536('0x10')]['message']);return _0xfd0a34(_0x16de18['error'][_0xa536('0x13')]);}logger[_0xa536('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2a8054,_0x16de18['error'][_0xa536('0x13')]);return _0xe29fc8(_0x16de18[_0xa536('0x10')][_0xa536('0x13')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2a8054,_0xa536('0xd'));_0xe29fc8(_0x16de18[_0xa536('0x14')]['message']);}})['catch'](function(_0x58f472){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2a8054,_0x58f472);_0xfd0a34(_0x58f472);});});}