Built motion from commit (unavailable).|2.5.11
[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 _0x2d70=['code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x169a50,_0xedbb28){var _0x31e1c9=function(_0x1747c3){while(--_0x1747c3){_0x169a50['push'](_0x169a50['shift']());}};_0x31e1c9(++_0xedbb28);}(_0x2d70,0x1be));var _0x02d7=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0x2d70[_0x21353c];return _0xa99120;};'use strict';var _=require('lodash');var util=require(_0x02d7('0x0'));var moment=require(_0x02d7('0x1'));var BPromise=require(_0x02d7('0x2'));var rs=require(_0x02d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02d7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x02d7('0x5'));var jayson=require(_0x02d7('0x6'));var client=jayson[_0x02d7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x210c4b,_0x4961d5,_0x5c3ab8){return new BPromise(function(_0x43b8e3,_0x1d7ed3){return client[_0x02d7('0x8')](_0x210c4b,_0x5c3ab8)[_0x02d7('0x9')](function(_0xf4a1ee){logger[_0x02d7('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4961d5,_0x02d7('0xb'));logger[_0x02d7('0xc')](_0x02d7('0xd'),_0x4961d5,_0x02d7('0xb'),JSON[_0x02d7('0xe')](_0xf4a1ee));if(_0xf4a1ee[_0x02d7('0xf')]){if(_0xf4a1ee[_0x02d7('0xf')][_0x02d7('0x10')]===0x1f4){logger[_0x02d7('0xf')](_0x02d7('0x11'),_0x4961d5,_0xf4a1ee['error'][_0x02d7('0x12')]);return _0x1d7ed3(_0xf4a1ee[_0x02d7('0xf')][_0x02d7('0x12')]);}logger['error'](_0x02d7('0x11'),_0x4961d5,_0xf4a1ee[_0x02d7('0xf')]['message']);return _0x43b8e3(_0xf4a1ee[_0x02d7('0xf')][_0x02d7('0x12')]);}else{logger[_0x02d7('0xa')](_0x02d7('0x11'),_0x4961d5,_0x02d7('0xb'));_0x43b8e3(_0xf4a1ee[_0x02d7('0x13')][_0x02d7('0x12')]);}})[_0x02d7('0x14')](function(_0x100afe){logger[_0x02d7('0xf')](_0x02d7('0x11'),_0x4961d5,_0x100afe);_0x1d7ed3(_0x100afe);});});}