Built motion from commit (unavailable).|2.5.12
[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 _0x107f=['request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x107f,0x1af));var _0xf107=function(_0x3c7703,_0x52f3a9){_0x3c7703=_0x3c7703-0x0;var _0x3d810c=_0x107f[_0x3c7703];return _0x3d810c;};'use strict';var _=require('lodash');var util=require(_0xf107('0x0'));var moment=require(_0xf107('0x1'));var BPromise=require(_0xf107('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf107('0x3'));var db=require(_0xf107('0x4'))['db'];var utils=require(_0xf107('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf107('0x6'));var jayson=require(_0xf107('0x7'));var client=jayson[_0xf107('0x8')][_0xf107('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x328e84,_0x529e1a,_0x41b5af){return new BPromise(function(_0x54ea38,_0x215db3){return client[_0xf107('0xa')](_0x328e84,_0x41b5af)[_0xf107('0xb')](function(_0x43c389){logger[_0xf107('0xc')](_0xf107('0xd'),_0x529e1a,_0xf107('0xe'));logger[_0xf107('0xf')](_0xf107('0x10'),_0x529e1a,_0xf107('0xe'),JSON[_0xf107('0x11')](_0x43c389));if(_0x43c389[_0xf107('0x12')]){if(_0x43c389['error'][_0xf107('0x13')]===0x1f4){logger['error'](_0xf107('0xd'),_0x529e1a,_0x43c389['error'][_0xf107('0x14')]);return _0x215db3(_0x43c389[_0xf107('0x12')][_0xf107('0x14')]);}logger[_0xf107('0x12')](_0xf107('0xd'),_0x529e1a,_0x43c389[_0xf107('0x12')][_0xf107('0x14')]);return _0x54ea38(_0x43c389[_0xf107('0x12')][_0xf107('0x14')]);}else{logger[_0xf107('0xc')](_0xf107('0xd'),_0x529e1a,_0xf107('0xe'));_0x54ea38(_0x43c389['result'][_0xf107('0x14')]);}})['catch'](function(_0x532df5){logger[_0xf107('0x12')](_0xf107('0xd'),_0x529e1a,_0x532df5);_0x215db3(_0x532df5);});});}