Built motion from commit (unavailable).|2.5.2
[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 _0x6972=['UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','UserChatQueue,\x20%s,\x20%s','debug'];(function(_0x372855,_0x162b6a){var _0x212c6f=function(_0x3afb07){while(--_0x3afb07){_0x372855['push'](_0x372855['shift']());}};_0x212c6f(++_0x162b6a);}(_0x6972,0x103));var _0x2697=function(_0x6742ac,_0x51fd22){_0x6742ac=_0x6742ac-0x0;var _0x30730a=_0x6972[_0x6742ac];return _0x30730a;};'use strict';var _=require(_0x2697('0x0'));var util=require(_0x2697('0x1'));var moment=require('moment');var BPromise=require(_0x2697('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2697('0x3'));var db=require(_0x2697('0x4'))['db'];var utils=require(_0x2697('0x5'));var logger=require(_0x2697('0x6'))(_0x2697('0x7'));var config=require(_0x2697('0x8'));var jayson=require(_0x2697('0x9'));var client=jayson['client'][_0x2697('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb78a9b,_0x391305,_0x3133e9){return new BPromise(function(_0x703fb0,_0x2e92e6){return client['request'](_0xb78a9b,_0x3133e9)[_0x2697('0xb')](function(_0x4d10a1){logger['info'](_0x2697('0xc'),_0x391305,'request\x20sent');logger[_0x2697('0xd')](_0x2697('0xe'),_0x391305,_0x2697('0xf'),JSON[_0x2697('0x10')](_0x4d10a1));if(_0x4d10a1['error']){if(_0x4d10a1['error'][_0x2697('0x11')]===0x1f4){logger[_0x2697('0x12')](_0x2697('0xc'),_0x391305,_0x4d10a1[_0x2697('0x12')][_0x2697('0x13')]);return _0x2e92e6(_0x4d10a1[_0x2697('0x12')][_0x2697('0x13')]);}logger['error'](_0x2697('0xc'),_0x391305,_0x4d10a1[_0x2697('0x12')][_0x2697('0x13')]);return _0x703fb0(_0x4d10a1[_0x2697('0x12')][_0x2697('0x13')]);}else{logger['info'](_0x2697('0xc'),_0x391305,_0x2697('0xf'));_0x703fb0(_0x4d10a1[_0x2697('0x14')][_0x2697('0x13')]);}})['catch'](function(_0x2662e3){logger[_0x2697('0x12')](_0x2697('0xc'),_0x391305,_0x2662e3);_0x2e92e6(_0x2662e3);});});}