Built motion from commit 87cd5f02.|2.5.48
[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 _0x783d=['code','message','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3ee4f7,_0x5942ff){var _0x530471=function(_0x5c661e){while(--_0x5c661e){_0x3ee4f7['push'](_0x3ee4f7['shift']());}};_0x530471(++_0x5942ff);}(_0x783d,0x1e3));var _0xd783=function(_0x46dbe4,_0x4cc4c7){_0x46dbe4=_0x46dbe4-0x0;var _0x1d796f=_0x783d[_0x46dbe4];return _0x1d796f;};'use strict';var _=require('lodash');var util=require(_0xd783('0x0'));var moment=require(_0xd783('0x1'));var BPromise=require('bluebird');var rs=require(_0xd783('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd783('0x3'))['db'];var utils=require(_0xd783('0x4'));var logger=require(_0xd783('0x5'))(_0xd783('0x6'));var config=require(_0xd783('0x7'));var jayson=require(_0xd783('0x8'));var client=jayson[_0xd783('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48299f,_0x46f8bf,_0xba5b83){return new BPromise(function(_0x1f469b,_0x553429){return client[_0xd783('0xa')](_0x48299f,_0xba5b83)[_0xd783('0xb')](function(_0x4cfb4d){logger[_0xd783('0xc')](_0xd783('0xd'),_0x46f8bf,'request\x20sent');logger['debug'](_0xd783('0xe'),_0x46f8bf,_0xd783('0xf'),JSON['stringify'](_0x4cfb4d));if(_0x4cfb4d[_0xd783('0x10')]){if(_0x4cfb4d[_0xd783('0x10')][_0xd783('0x11')]===0x1f4){logger[_0xd783('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x46f8bf,_0x4cfb4d[_0xd783('0x10')][_0xd783('0x12')]);return _0x553429(_0x4cfb4d['error'][_0xd783('0x12')]);}logger['error'](_0xd783('0xd'),_0x46f8bf,_0x4cfb4d[_0xd783('0x10')][_0xd783('0x12')]);return _0x1f469b(_0x4cfb4d[_0xd783('0x10')][_0xd783('0x12')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x46f8bf,_0xd783('0xf'));_0x1f469b(_0x4cfb4d['result'][_0xd783('0x12')]);}})[_0xd783('0x13')](function(_0x3725dd){logger[_0xd783('0x10')](_0xd783('0xd'),_0x46f8bf,_0x3725dd);_0x553429(_0x3725dd);});});}