Built motion from commit (unavailable).|2.5.14
[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 _0xe18f=['result','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','error','code','message','UserChatQueue,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe18f,0x1b2));var _0xfe18=function(_0x44969c,_0x17151e){_0x44969c=_0x44969c-0x0;var _0x48afb3=_0xe18f[_0x44969c];return _0x48afb3;};'use strict';var _=require('lodash');var util=require(_0xfe18('0x0'));var moment=require('moment');var BPromise=require(_0xfe18('0x1'));var rs=require(_0xfe18('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe18('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe18('0x4'))(_0xfe18('0x5'));var config=require(_0xfe18('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x427a1f,_0xfd3c1e,_0x6a63ee){return new BPromise(function(_0xf9ba5e,_0x4a9846){return client[_0xfe18('0x7')](_0x427a1f,_0x6a63ee)[_0xfe18('0x8')](function(_0x1122f4){logger[_0xfe18('0x9')]('UserChatQueue,\x20%s,\x20%s',_0xfd3c1e,_0xfe18('0xa'));logger[_0xfe18('0xb')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0xfd3c1e,_0xfe18('0xa'),JSON['stringify'](_0x1122f4));if(_0x1122f4[_0xfe18('0xc')]){if(_0x1122f4[_0xfe18('0xc')][_0xfe18('0xd')]===0x1f4){logger[_0xfe18('0xc')]('UserChatQueue,\x20%s,\x20%s',_0xfd3c1e,_0x1122f4[_0xfe18('0xc')][_0xfe18('0xe')]);return _0x4a9846(_0x1122f4[_0xfe18('0xc')][_0xfe18('0xe')]);}logger[_0xfe18('0xc')](_0xfe18('0xf'),_0xfd3c1e,_0x1122f4[_0xfe18('0xc')][_0xfe18('0xe')]);return _0xf9ba5e(_0x1122f4[_0xfe18('0xc')][_0xfe18('0xe')]);}else{logger[_0xfe18('0x9')](_0xfe18('0xf'),_0xfd3c1e,_0xfe18('0xa'));_0xf9ba5e(_0x1122f4[_0xfe18('0x10')]['message']);}})[_0xfe18('0x11')](function(_0x42d90c){logger[_0xfe18('0xc')]('UserChatQueue,\x20%s,\x20%s',_0xfd3c1e,_0x42d90c);_0x4a9846(_0x42d90c);});});}