Built motion from commit b5413ace.|2.6.9
[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 _0xa37e=['../../mysqldb','rpc','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x55e492,_0x398035){var _0x27b6a7=function(_0x3bff20){while(--_0x3bff20){_0x55e492['push'](_0x55e492['shift']());}};_0x27b6a7(++_0x398035);}(_0xa37e,0x199));var _0xea37=function(_0x3e0372,_0x5e3c46){_0x3e0372=_0x3e0372-0x0;var _0xd8abe8=_0xa37e[_0x3e0372];return _0xd8abe8;};'use strict';var _=require(_0xea37('0x0'));var util=require(_0xea37('0x1'));var moment=require(_0xea37('0x2'));var BPromise=require(_0xea37('0x3'));var rs=require(_0xea37('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea37('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea37('0x6'));var config=require('../../config/environment');var jayson=require(_0xea37('0x7'));var client=jayson[_0xea37('0x8')][_0xea37('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27e86d,_0x4e4a40,_0x25f136){return new BPromise(function(_0x380c0e,_0x294b6a){return client[_0xea37('0xa')](_0x27e86d,_0x25f136)[_0xea37('0xb')](function(_0x4ac0ac){logger['info'](_0xea37('0xc'),_0x4e4a40,_0xea37('0xd'));logger[_0xea37('0xe')](_0xea37('0xf'),_0x4e4a40,_0xea37('0xd'),JSON[_0xea37('0x10')](_0x4ac0ac));if(_0x4ac0ac[_0xea37('0x11')]){if(_0x4ac0ac[_0xea37('0x11')][_0xea37('0x12')]===0x1f4){logger[_0xea37('0x11')](_0xea37('0xc'),_0x4e4a40,_0x4ac0ac[_0xea37('0x11')][_0xea37('0x13')]);return _0x294b6a(_0x4ac0ac[_0xea37('0x11')][_0xea37('0x13')]);}logger[_0xea37('0x11')](_0xea37('0xc'),_0x4e4a40,_0x4ac0ac[_0xea37('0x11')][_0xea37('0x13')]);return _0x380c0e(_0x4ac0ac[_0xea37('0x11')][_0xea37('0x13')]);}else{logger[_0xea37('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x4e4a40,_0xea37('0xd'));_0x380c0e(_0x4ac0ac[_0xea37('0x15')]['message']);}})[_0xea37('0x16')](function(_0x47d9a0){logger[_0xea37('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x4e4a40,_0x47d9a0);_0x294b6a(_0x47d9a0);});});}