Built motion from commit da617fac.|2.6.6
[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 _0xa20e=['request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x317947,_0x2f339d){var _0x56a4d6=function(_0x58b6f7){while(--_0x58b6f7){_0x317947['push'](_0x317947['shift']());}};_0x56a4d6(++_0x2f339d);}(_0xa20e,0xb7));var _0xea20=function(_0x326d35,_0x4f65b3){_0x326d35=_0x326d35-0x0;var _0xd3f8f3=_0xa20e[_0x326d35];return _0xd3f8f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xea20('0x0'));var BPromise=require(_0xea20('0x1'));var rs=require(_0xea20('0x2'));var fs=require('fs');var Redis=require(_0xea20('0x3'));var db=require(_0xea20('0x4'))['db'];var utils=require(_0xea20('0x5'));var logger=require(_0xea20('0x6'))(_0xea20('0x7'));var config=require(_0xea20('0x8'));var jayson=require(_0xea20('0x9'));var client=jayson[_0xea20('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7a18f8,_0x5080da,_0x528275){return new BPromise(function(_0x65d82b,_0x5efa21){return client[_0xea20('0xb')](_0x7a18f8,_0x528275)[_0xea20('0xc')](function(_0x10202b){logger[_0xea20('0xd')](_0xea20('0xe'),_0x5080da,_0xea20('0xf'));logger['debug'](_0xea20('0x10'),_0x5080da,_0xea20('0xf'),JSON['stringify'](_0x10202b));if(_0x10202b[_0xea20('0x11')]){if(_0x10202b[_0xea20('0x11')][_0xea20('0x12')]===0x1f4){logger[_0xea20('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x5080da,_0x10202b[_0xea20('0x11')]['message']);return _0x5efa21(_0x10202b[_0xea20('0x11')][_0xea20('0x13')]);}logger['error'](_0xea20('0xe'),_0x5080da,_0x10202b['error'][_0xea20('0x13')]);return _0x65d82b(_0x10202b[_0xea20('0x11')][_0xea20('0x13')]);}else{logger[_0xea20('0xd')](_0xea20('0xe'),_0x5080da,_0xea20('0xf'));_0x65d82b(_0x10202b[_0xea20('0x14')][_0xea20('0x13')]);}})[_0xea20('0x15')](function(_0x3d3b8e){logger[_0xea20('0x11')](_0xea20('0xe'),_0x5080da,_0x3d3b8e);_0x5efa21(_0x3d3b8e);});});}