Built motion from commit 936e8062.|2.5.33
[motion2.git] / server / api / userOpenchannelQueue / userOpenchannelQueue.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 _0xc471=['message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x50a004,_0x193d84){var _0x5e9992=function(_0x3c8c37){while(--_0x3c8c37){_0x50a004['push'](_0x50a004['shift']());}};_0x5e9992(++_0x193d84);}(_0xc471,0x164));var _0x1c47=function(_0x18c218,_0x29fdc8){_0x18c218=_0x18c218-0x0;var _0x546fa6=_0xc471[_0x18c218];return _0x546fa6;};'use strict';var _=require(_0x1c47('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1c47('0x1'));var rs=require(_0x1c47('0x2'));var fs=require('fs');var Redis=require(_0x1c47('0x3'));var db=require(_0x1c47('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c47('0x5'))(_0x1c47('0x6'));var config=require(_0x1c47('0x7'));var jayson=require(_0x1c47('0x8'));var client=jayson['client'][_0x1c47('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a3cec,_0x12731c,_0x53cbd9){return new BPromise(function(_0x9b4f93,_0x235ae1){return client['request'](_0x2a3cec,_0x53cbd9)[_0x1c47('0xa')](function(_0x264459){logger['info'](_0x1c47('0xb'),_0x12731c,'request\x20sent');logger[_0x1c47('0xc')](_0x1c47('0xd'),_0x12731c,_0x1c47('0xe'),JSON[_0x1c47('0xf')](_0x264459));if(_0x264459['error']){if(_0x264459[_0x1c47('0x10')][_0x1c47('0x11')]===0x1f4){logger[_0x1c47('0x10')](_0x1c47('0xb'),_0x12731c,_0x264459['error']['message']);return _0x235ae1(_0x264459[_0x1c47('0x10')][_0x1c47('0x12')]);}logger[_0x1c47('0x10')](_0x1c47('0xb'),_0x12731c,_0x264459['error'][_0x1c47('0x12')]);return _0x9b4f93(_0x264459[_0x1c47('0x10')][_0x1c47('0x12')]);}else{logger[_0x1c47('0x13')](_0x1c47('0xb'),_0x12731c,_0x1c47('0xe'));_0x9b4f93(_0x264459[_0x1c47('0x14')][_0x1c47('0x12')]);}})[_0x1c47('0x15')](function(_0x451e16){logger[_0x1c47('0x10')](_0x1c47('0xb'),_0x12731c,_0x451e16);_0x235ae1(_0x451e16);});});}