Built motion from commit bab6f49e.|2.6.17
[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 _0x50cc=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','randomstring','ioredis','../../mysqldb'];(function(_0xf19d92,_0x3d4ae2){var _0x3960d7=function(_0x59cae3){while(--_0x59cae3){_0xf19d92['push'](_0xf19d92['shift']());}};_0x3960d7(++_0x3d4ae2);}(_0x50cc,0x9c));var _0xc50c=function(_0x4a5f87,_0x1e6fac){_0x4a5f87=_0x4a5f87-0x0;var _0x1aa867=_0x50cc[_0x4a5f87];return _0x1aa867;};'use strict';var _=require('lodash');var util=require(_0xc50c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc50c('0x1'));var fs=require('fs');var Redis=require(_0xc50c('0x2'));var db=require(_0xc50c('0x3'))['db'];var utils=require(_0xc50c('0x4'));var logger=require(_0xc50c('0x5'))(_0xc50c('0x6'));var config=require(_0xc50c('0x7'));var jayson=require(_0xc50c('0x8'));var client=jayson[_0xc50c('0x9')][_0xc50c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4de65d,_0x185aaa,_0xb08dc2){return new BPromise(function(_0x139ec4,_0x4ca957){return client['request'](_0x4de65d,_0xb08dc2)['then'](function(_0x5a424a){logger[_0xc50c('0xb')](_0xc50c('0xc'),_0x185aaa,_0xc50c('0xd'));logger[_0xc50c('0xe')](_0xc50c('0xf'),_0x185aaa,_0xc50c('0xd'),JSON['stringify'](_0x5a424a));if(_0x5a424a[_0xc50c('0x10')]){if(_0x5a424a[_0xc50c('0x10')][_0xc50c('0x11')]===0x1f4){logger[_0xc50c('0x10')](_0xc50c('0xc'),_0x185aaa,_0x5a424a[_0xc50c('0x10')]['message']);return _0x4ca957(_0x5a424a[_0xc50c('0x10')][_0xc50c('0x12')]);}logger['error'](_0xc50c('0xc'),_0x185aaa,_0x5a424a[_0xc50c('0x10')][_0xc50c('0x12')]);return _0x139ec4(_0x5a424a[_0xc50c('0x10')][_0xc50c('0x12')]);}else{logger[_0xc50c('0xb')](_0xc50c('0xc'),_0x185aaa,'request\x20sent');_0x139ec4(_0x5a424a['result'][_0xc50c('0x12')]);}})[_0xc50c('0x13')](function(_0x535d8a){logger[_0xc50c('0x10')](_0xc50c('0xc'),_0x185aaa,_0x535d8a);_0x4ca957(_0x535d8a);});});}