Built motion from commit 00bf23f6.|2.6.16
[motion2.git] / server / api / userChatQueue / userChatQueue.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 _0x05bb=['util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x1188c0,_0xa21f2a){var _0x3b997b=function(_0x21f573){while(--_0x21f573){_0x1188c0['push'](_0x1188c0['shift']());}};_0x3b997b(++_0xa21f2a);}(_0x05bb,0x1b8));var _0xb05b=function(_0x3dbb78,_0x3552c3){_0x3dbb78=_0x3dbb78-0x0;var _0x27d10f=_0x05bb[_0x3dbb78];return _0x27d10f;};'use strict';var _=require(_0xb05b('0x0'));var util=require(_0xb05b('0x1'));var moment=require(_0xb05b('0x2'));var BPromise=require(_0xb05b('0x3'));var rs=require(_0xb05b('0x4'));var fs=require('fs');var Redis=require(_0xb05b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb05b('0x6'))(_0xb05b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb05b('0x8')][_0xb05b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3080cd,_0x3916d1,_0x3f9679){return new BPromise(function(_0xb8d05e,_0x5e3ade){return client['request'](_0x3080cd,_0x3f9679)[_0xb05b('0xa')](function(_0x1339ab){logger[_0xb05b('0xb')](_0xb05b('0xc'),_0x3916d1,_0xb05b('0xd'));logger[_0xb05b('0xe')](_0xb05b('0xf'),_0x3916d1,_0xb05b('0xd'),JSON['stringify'](_0x1339ab));if(_0x1339ab['error']){if(_0x1339ab[_0xb05b('0x10')][_0xb05b('0x11')]===0x1f4){logger[_0xb05b('0x10')](_0xb05b('0xc'),_0x3916d1,_0x1339ab['error'][_0xb05b('0x12')]);return _0x5e3ade(_0x1339ab[_0xb05b('0x10')][_0xb05b('0x12')]);}logger[_0xb05b('0x10')](_0xb05b('0xc'),_0x3916d1,_0x1339ab[_0xb05b('0x10')][_0xb05b('0x12')]);return _0xb8d05e(_0x1339ab['error'][_0xb05b('0x12')]);}else{logger[_0xb05b('0xb')](_0xb05b('0xc'),_0x3916d1,'request\x20sent');_0xb8d05e(_0x1339ab[_0xb05b('0x13')][_0xb05b('0x12')]);}})[_0xb05b('0x14')](function(_0x2c295a){logger[_0xb05b('0x10')](_0xb05b('0xc'),_0x3916d1,_0x2c295a);_0x5e3ade(_0x2c295a);});});}