Built motion from commit (unavailable).|2.5.6
[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 _0x6dd3=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x157539,_0x3e9729){var _0x4d3340=function(_0x15495a){while(--_0x15495a){_0x157539['push'](_0x157539['shift']());}};_0x4d3340(++_0x3e9729);}(_0x6dd3,0x17a));var _0x36dd=function(_0x2c63f7,_0x49ec00){_0x2c63f7=_0x2c63f7-0x0;var _0xeeaa93=_0x6dd3[_0x2c63f7];return _0xeeaa93;};'use strict';var _=require('lodash');var util=require(_0x36dd('0x0'));var moment=require(_0x36dd('0x1'));var BPromise=require(_0x36dd('0x2'));var rs=require(_0x36dd('0x3'));var fs=require('fs');var Redis=require(_0x36dd('0x4'));var db=require(_0x36dd('0x5'))['db'];var utils=require(_0x36dd('0x6'));var logger=require(_0x36dd('0x7'))(_0x36dd('0x8'));var config=require(_0x36dd('0x9'));var jayson=require(_0x36dd('0xa'));var client=jayson[_0x36dd('0xb')][_0x36dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5675f3,_0x372b9d,_0x49ddc4){return new BPromise(function(_0x38335d,_0x3b4093){return client[_0x36dd('0xd')](_0x5675f3,_0x49ddc4)[_0x36dd('0xe')](function(_0x402d0e){logger[_0x36dd('0xf')](_0x36dd('0x10'),_0x372b9d,_0x36dd('0x11'));logger[_0x36dd('0x12')](_0x36dd('0x13'),_0x372b9d,_0x36dd('0x11'),JSON[_0x36dd('0x14')](_0x402d0e));if(_0x402d0e[_0x36dd('0x15')]){if(_0x402d0e[_0x36dd('0x15')]['code']===0x1f4){logger['error'](_0x36dd('0x10'),_0x372b9d,_0x402d0e[_0x36dd('0x15')][_0x36dd('0x16')]);return _0x3b4093(_0x402d0e['error']['message']);}logger[_0x36dd('0x15')](_0x36dd('0x10'),_0x372b9d,_0x402d0e[_0x36dd('0x15')][_0x36dd('0x16')]);return _0x38335d(_0x402d0e['error'][_0x36dd('0x16')]);}else{logger[_0x36dd('0xf')](_0x36dd('0x10'),_0x372b9d,_0x36dd('0x11'));_0x38335d(_0x402d0e[_0x36dd('0x17')]['message']);}})[_0x36dd('0x18')](function(_0x139e96){logger[_0x36dd('0x15')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x372b9d,_0x139e96);_0x3b4093(_0x139e96);});});}