Built motion from commit (unavailable).|2.5.1
[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 _0x5d1c=['debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x25fda9,_0x2530a4){var _0x425e63=function(_0x160676){while(--_0x160676){_0x25fda9['push'](_0x25fda9['shift']());}};_0x425e63(++_0x2530a4);}(_0x5d1c,0x74));var _0xc5d1=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0x5d1c[_0x4a209a];return _0x4b3c20;};'use strict';var _=require(_0xc5d1('0x0'));var util=require(_0xc5d1('0x1'));var moment=require(_0xc5d1('0x2'));var BPromise=require(_0xc5d1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5d1('0x4'));var db=require(_0xc5d1('0x5'))['db'];var utils=require(_0xc5d1('0x6'));var logger=require(_0xc5d1('0x7'))(_0xc5d1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc5d1('0x9')][_0xc5d1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59cb3d,_0x39a969,_0x2ca1e1){return new BPromise(function(_0xe36df2,_0x3aead9){return client[_0xc5d1('0xb')](_0x59cb3d,_0x2ca1e1)[_0xc5d1('0xc')](function(_0x16549e){logger[_0xc5d1('0xd')](_0xc5d1('0xe'),_0x39a969,_0xc5d1('0xf'));logger[_0xc5d1('0x10')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x39a969,'request\x20sent',JSON[_0xc5d1('0x11')](_0x16549e));if(_0x16549e[_0xc5d1('0x12')]){if(_0x16549e[_0xc5d1('0x12')][_0xc5d1('0x13')]===0x1f4){logger['error'](_0xc5d1('0xe'),_0x39a969,_0x16549e[_0xc5d1('0x12')][_0xc5d1('0x14')]);return _0x3aead9(_0x16549e[_0xc5d1('0x12')]['message']);}logger[_0xc5d1('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x39a969,_0x16549e[_0xc5d1('0x12')][_0xc5d1('0x14')]);return _0xe36df2(_0x16549e[_0xc5d1('0x12')][_0xc5d1('0x14')]);}else{logger[_0xc5d1('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x39a969,_0xc5d1('0xf'));_0xe36df2(_0x16549e[_0xc5d1('0x15')][_0xc5d1('0x14')]);}})['catch'](function(_0x2ea6ad){logger['error'](_0xc5d1('0xe'),_0x39a969,_0x2ea6ad);_0x3aead9(_0x2ea6ad);});});}