Built motion from commit e6806ed6.|2.6.0
[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 _0xc4b8=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xc4b8,0x1e4));var _0x8c4b=function(_0x2a47a8,_0x136ca2){_0x2a47a8=_0x2a47a8-0x0;var _0x1466da=_0xc4b8[_0x2a47a8];return _0x1466da;};'use strict';var _=require(_0x8c4b('0x0'));var util=require(_0x8c4b('0x1'));var moment=require('moment');var BPromise=require(_0x8c4b('0x2'));var rs=require(_0x8c4b('0x3'));var fs=require('fs');var Redis=require(_0x8c4b('0x4'));var db=require(_0x8c4b('0x5'))['db'];var utils=require(_0x8c4b('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8c4b('0x7')][_0x8c4b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16b1c3,_0x2dca1f,_0x2b04d5){return new BPromise(function(_0x426d8f,_0x2064ea){return client[_0x8c4b('0x9')](_0x16b1c3,_0x2b04d5)[_0x8c4b('0xa')](function(_0x1d9276){logger[_0x8c4b('0xb')](_0x8c4b('0xc'),_0x2dca1f,_0x8c4b('0xd'));logger[_0x8c4b('0xe')](_0x8c4b('0xf'),_0x2dca1f,_0x8c4b('0xd'),JSON['stringify'](_0x1d9276));if(_0x1d9276[_0x8c4b('0x10')]){if(_0x1d9276['error'][_0x8c4b('0x11')]===0x1f4){logger[_0x8c4b('0x10')](_0x8c4b('0xc'),_0x2dca1f,_0x1d9276['error'][_0x8c4b('0x12')]);return _0x2064ea(_0x1d9276[_0x8c4b('0x10')]['message']);}logger[_0x8c4b('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2dca1f,_0x1d9276['error'][_0x8c4b('0x12')]);return _0x426d8f(_0x1d9276[_0x8c4b('0x10')][_0x8c4b('0x12')]);}else{logger[_0x8c4b('0xb')](_0x8c4b('0xc'),_0x2dca1f,_0x8c4b('0xd'));_0x426d8f(_0x1d9276[_0x8c4b('0x13')][_0x8c4b('0x12')]);}})[_0x8c4b('0x14')](function(_0x33107f){logger[_0x8c4b('0x10')](_0x8c4b('0xc'),_0x2dca1f,_0x33107f);_0x2064ea(_0x33107f);});});}