Built motion from commit (unavailable).|2.5.31
[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 _0x0a3e=['request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0x51c879,_0x2bf32b){var _0x1d9635=function(_0x455b2b){while(--_0x455b2b){_0x51c879['push'](_0x51c879['shift']());}};_0x1d9635(++_0x2bf32b);}(_0x0a3e,0x10e));var _0xe0a3=function(_0x313893,_0x1c5310){_0x313893=_0x313893-0x0;var _0x166588=_0x0a3e[_0x313893];return _0x166588;};'use strict';var _=require(_0xe0a3('0x0'));var util=require(_0xe0a3('0x1'));var moment=require(_0xe0a3('0x2'));var BPromise=require(_0xe0a3('0x3'));var rs=require(_0xe0a3('0x4'));var fs=require('fs');var Redis=require(_0xe0a3('0x5'));var db=require(_0xe0a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0a3('0x7'))(_0xe0a3('0x8'));var config=require(_0xe0a3('0x9'));var jayson=require(_0xe0a3('0xa'));var client=jayson['client'][_0xe0a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ac303,_0x5958ac,_0x489bfb){return new BPromise(function(_0x4ee691,_0x1d710b){return client[_0xe0a3('0xc')](_0x4ac303,_0x489bfb)[_0xe0a3('0xd')](function(_0x118f30){logger[_0xe0a3('0xe')](_0xe0a3('0xf'),_0x5958ac,_0xe0a3('0x10'));logger[_0xe0a3('0x11')](_0xe0a3('0x12'),_0x5958ac,_0xe0a3('0x10'),JSON[_0xe0a3('0x13')](_0x118f30));if(_0x118f30[_0xe0a3('0x14')]){if(_0x118f30[_0xe0a3('0x14')]['code']===0x1f4){logger[_0xe0a3('0x14')](_0xe0a3('0xf'),_0x5958ac,_0x118f30[_0xe0a3('0x14')][_0xe0a3('0x15')]);return _0x1d710b(_0x118f30[_0xe0a3('0x14')][_0xe0a3('0x15')]);}logger[_0xe0a3('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5958ac,_0x118f30[_0xe0a3('0x14')][_0xe0a3('0x15')]);return _0x4ee691(_0x118f30['error'][_0xe0a3('0x15')]);}else{logger[_0xe0a3('0xe')](_0xe0a3('0xf'),_0x5958ac,_0xe0a3('0x10'));_0x4ee691(_0x118f30['result'][_0xe0a3('0x15')]);}})['catch'](function(_0x574576){logger['error'](_0xe0a3('0xf'),_0x5958ac,_0x574576);_0x1d710b(_0x574576);});});}