Built motion from commit (unavailable).|2.4.20
[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 _0x3a95=['error','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a95,0x9c));var _0x53a9=function(_0x48d659,_0x4dca0e){_0x48d659=_0x48d659-0x0;var _0x3989e2=_0x3a95[_0x48d659];return _0x3989e2;};'use strict';var _=require(_0x53a9('0x0'));var util=require('util');var moment=require(_0x53a9('0x1'));var BPromise=require('bluebird');var rs=require(_0x53a9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53a9('0x3'))['db'];var utils=require(_0x53a9('0x4'));var logger=require('../../config/logger')(_0x53a9('0x5'));var config=require(_0x53a9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x53a9('0x7')][_0x53a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19bf52,_0x17f12c,_0x4e3fd5){return new BPromise(function(_0x4c5e64,_0x2731a1){return client[_0x53a9('0x9')](_0x19bf52,_0x4e3fd5)[_0x53a9('0xa')](function(_0xa0be72){logger['info'](_0x53a9('0xb'),_0x17f12c,_0x53a9('0xc'));logger[_0x53a9('0xd')](_0x53a9('0xe'),_0x17f12c,_0x53a9('0xc'),JSON['stringify'](_0xa0be72));if(_0xa0be72[_0x53a9('0xf')]){if(_0xa0be72[_0x53a9('0xf')]['code']===0x1f4){logger[_0x53a9('0xf')](_0x53a9('0xb'),_0x17f12c,_0xa0be72[_0x53a9('0xf')][_0x53a9('0x10')]);return _0x2731a1(_0xa0be72['error'][_0x53a9('0x10')]);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x17f12c,_0xa0be72[_0x53a9('0xf')][_0x53a9('0x10')]);return _0x4c5e64(_0xa0be72['error']['message']);}else{logger['info'](_0x53a9('0xb'),_0x17f12c,_0x53a9('0xc'));_0x4c5e64(_0xa0be72[_0x53a9('0x11')][_0x53a9('0x10')]);}})[_0x53a9('0x12')](function(_0x23eba9){logger[_0x53a9('0xf')](_0x53a9('0xb'),_0x17f12c,_0x23eba9);_0x2731a1(_0x23eba9);});});}