Built motion from commit (unavailable).|2.4.4
[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 _0x6bc1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x6bc1,0x12b));var _0x16bc=function(_0x3a7d5b,_0x18e69b){_0x3a7d5b=_0x3a7d5b-0x0;var _0xa39fae=_0x6bc1[_0x3a7d5b];return _0xa39fae;};'use strict';var _=require(_0x16bc('0x0'));var util=require(_0x16bc('0x1'));var moment=require(_0x16bc('0x2'));var BPromise=require(_0x16bc('0x3'));var rs=require(_0x16bc('0x4'));var fs=require('fs');var Redis=require(_0x16bc('0x5'));var db=require(_0x16bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x16bc('0x7'))(_0x16bc('0x8'));var config=require(_0x16bc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x16bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x629090,_0x29cdf8,_0x52e6fb){return new BPromise(function(_0x29425f,_0x2d2c31){return client[_0x16bc('0xb')](_0x629090,_0x52e6fb)['then'](function(_0xdb5794){logger[_0x16bc('0xc')](_0x16bc('0xd'),_0x29cdf8,_0x16bc('0xe'));logger[_0x16bc('0xf')](_0x16bc('0x10'),_0x29cdf8,_0x16bc('0xe'),JSON[_0x16bc('0x11')](_0xdb5794));if(_0xdb5794[_0x16bc('0x12')]){if(_0xdb5794['error'][_0x16bc('0x13')]===0x1f4){logger[_0x16bc('0x12')](_0x16bc('0xd'),_0x29cdf8,_0xdb5794['error'][_0x16bc('0x14')]);return _0x2d2c31(_0xdb5794[_0x16bc('0x12')][_0x16bc('0x14')]);}logger['error'](_0x16bc('0xd'),_0x29cdf8,_0xdb5794[_0x16bc('0x12')][_0x16bc('0x14')]);return _0x29425f(_0xdb5794[_0x16bc('0x12')][_0x16bc('0x14')]);}else{logger['info'](_0x16bc('0xd'),_0x29cdf8,_0x16bc('0xe'));_0x29425f(_0xdb5794[_0x16bc('0x15')]['message']);}})[_0x16bc('0x16')](function(_0x18e1ff){logger[_0x16bc('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x29cdf8,_0x18e1ff);_0x2d2c31(_0x18e1ff);});});}