Built motion from commit 9d0783e6.|2.6.13
[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 _0x2599=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x277107,_0x3420dc){var _0x1da046=function(_0x47122d){while(--_0x47122d){_0x277107['push'](_0x277107['shift']());}};_0x1da046(++_0x3420dc);}(_0x2599,0xb8));var _0x9259=function(_0x4fa383,_0x53118f){_0x4fa383=_0x4fa383-0x0;var _0x2b4153=_0x2599[_0x4fa383];return _0x2b4153;};'use strict';var _=require(_0x9259('0x0'));var util=require(_0x9259('0x1'));var moment=require(_0x9259('0x2'));var BPromise=require(_0x9259('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9259('0x4'));var db=require(_0x9259('0x5'))['db'];var utils=require(_0x9259('0x6'));var logger=require(_0x9259('0x7'))(_0x9259('0x8'));var config=require(_0x9259('0x9'));var jayson=require(_0x9259('0xa'));var client=jayson[_0x9259('0xb')][_0x9259('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46c11c,_0x51f246,_0x32ed3b){return new BPromise(function(_0x363db9,_0x2ca01f){return client[_0x9259('0xd')](_0x46c11c,_0x32ed3b)[_0x9259('0xe')](function(_0x1188cd){logger[_0x9259('0xf')](_0x9259('0x10'),_0x51f246,_0x9259('0x11'));logger[_0x9259('0x12')](_0x9259('0x13'),_0x51f246,_0x9259('0x11'),JSON[_0x9259('0x14')](_0x1188cd));if(_0x1188cd[_0x9259('0x15')]){if(_0x1188cd[_0x9259('0x15')][_0x9259('0x16')]===0x1f4){logger['error'](_0x9259('0x10'),_0x51f246,_0x1188cd[_0x9259('0x15')][_0x9259('0x17')]);return _0x2ca01f(_0x1188cd[_0x9259('0x15')][_0x9259('0x17')]);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x51f246,_0x1188cd['error']['message']);return _0x363db9(_0x1188cd['error'][_0x9259('0x17')]);}else{logger[_0x9259('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x51f246,_0x9259('0x11'));_0x363db9(_0x1188cd['result'][_0x9259('0x17')]);}})['catch'](function(_0x54bce9){logger[_0x9259('0x15')](_0x9259('0x10'),_0x51f246,_0x54bce9);_0x2ca01f(_0x54bce9);});});}