Built motion from commit 3d6333b4.|2.6.31
[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 _0xb529=['jayson/promise','client','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x30e1c7,_0x52ca83){var _0xea9655=function(_0x4b2613){while(--_0x4b2613){_0x30e1c7['push'](_0x30e1c7['shift']());}};_0xea9655(++_0x52ca83);}(_0xb529,0x11d));var _0x9b52=function(_0x50587f,_0x2c704f){_0x50587f=_0x50587f-0x0;var _0x33149d=_0xb529[_0x50587f];return _0x33149d;};'use strict';var _=require('lodash');var util=require(_0x9b52('0x0'));var moment=require(_0x9b52('0x1'));var BPromise=require(_0x9b52('0x2'));var rs=require(_0x9b52('0x3'));var fs=require('fs');var Redis=require(_0x9b52('0x4'));var db=require(_0x9b52('0x5'))['db'];var utils=require(_0x9b52('0x6'));var logger=require(_0x9b52('0x7'))(_0x9b52('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b52('0x9'));var client=jayson[_0x9b52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17e4d0,_0xd48f2,_0x214c54){return new BPromise(function(_0x2f5f8f,_0x2796a3){return client['request'](_0x17e4d0,_0x214c54)[_0x9b52('0xb')](function(_0x195f70){logger[_0x9b52('0xc')](_0x9b52('0xd'),_0xd48f2,_0x9b52('0xe'));logger['debug'](_0x9b52('0xf'),_0xd48f2,_0x9b52('0xe'),JSON['stringify'](_0x195f70));if(_0x195f70['error']){if(_0x195f70[_0x9b52('0x10')][_0x9b52('0x11')]===0x1f4){logger[_0x9b52('0x10')]('UserChatQueue,\x20%s,\x20%s',_0xd48f2,_0x195f70[_0x9b52('0x10')][_0x9b52('0x12')]);return _0x2796a3(_0x195f70[_0x9b52('0x10')][_0x9b52('0x12')]);}logger[_0x9b52('0x10')](_0x9b52('0xd'),_0xd48f2,_0x195f70[_0x9b52('0x10')][_0x9b52('0x12')]);return _0x2f5f8f(_0x195f70['error'][_0x9b52('0x12')]);}else{logger[_0x9b52('0xc')](_0x9b52('0xd'),_0xd48f2,_0x9b52('0xe'));_0x2f5f8f(_0x195f70[_0x9b52('0x13')][_0x9b52('0x12')]);}})[_0x9b52('0x14')](function(_0x5ca498){logger[_0x9b52('0x10')](_0x9b52('0xd'),_0xd48f2,_0x5ca498);_0x2796a3(_0x5ca498);});});}