Built motion from commit d5e4af8c.|2.6.23
[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 _0xfac8=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x38dea7,_0x4627c6){var _0x5c26fc=function(_0x1132c0){while(--_0x1132c0){_0x38dea7['push'](_0x38dea7['shift']());}};_0x5c26fc(++_0x4627c6);}(_0xfac8,0xc6));var _0x8fac=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0xfac8[_0x3dc538];return _0x72c2fd;};'use strict';var _=require(_0x8fac('0x0'));var util=require(_0x8fac('0x1'));var moment=require(_0x8fac('0x2'));var BPromise=require(_0x8fac('0x3'));var rs=require(_0x8fac('0x4'));var fs=require('fs');var Redis=require(_0x8fac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8fac('0x6'));var logger=require(_0x8fac('0x7'))(_0x8fac('0x8'));var config=require(_0x8fac('0x9'));var jayson=require(_0x8fac('0xa'));var client=jayson[_0x8fac('0xb')][_0x8fac('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c4c10,_0x4872dc,_0x358874){return new BPromise(function(_0x41f968,_0x4f8f49){return client[_0x8fac('0xd')](_0x1c4c10,_0x358874)[_0x8fac('0xe')](function(_0x1a5f58){logger[_0x8fac('0xf')](_0x8fac('0x10'),_0x4872dc,_0x8fac('0x11'));logger[_0x8fac('0x12')](_0x8fac('0x13'),_0x4872dc,_0x8fac('0x11'),JSON[_0x8fac('0x14')](_0x1a5f58));if(_0x1a5f58[_0x8fac('0x15')]){if(_0x1a5f58[_0x8fac('0x15')][_0x8fac('0x16')]===0x1f4){logger[_0x8fac('0x15')](_0x8fac('0x10'),_0x4872dc,_0x1a5f58[_0x8fac('0x15')][_0x8fac('0x17')]);return _0x4f8f49(_0x1a5f58['error'][_0x8fac('0x17')]);}logger[_0x8fac('0x15')](_0x8fac('0x10'),_0x4872dc,_0x1a5f58[_0x8fac('0x15')][_0x8fac('0x17')]);return _0x41f968(_0x1a5f58[_0x8fac('0x15')][_0x8fac('0x17')]);}else{logger[_0x8fac('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x4872dc,_0x8fac('0x11'));_0x41f968(_0x1a5f58['result'][_0x8fac('0x17')]);}})['catch'](function(_0x74a299){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x4872dc,_0x74a299);_0x4f8f49(_0x74a299);});});}