Built motion from commit d1eab355.|2.6.28
[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 _0xfead=['request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','client','request','then','info','debug','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x1bcc25,_0x1e8842){var _0x299ca6=function(_0xbd52ef){while(--_0xbd52ef){_0x1bcc25['push'](_0x1bcc25['shift']());}};_0x299ca6(++_0x1e8842);}(_0xfead,0x8f));var _0xdfea=function(_0x56e020,_0x5a9f1a){_0x56e020=_0x56e020-0x0;var _0x1d8931=_0xfead[_0x56e020];return _0x1d8931;};'use strict';var _=require(_0xdfea('0x0'));var util=require(_0xdfea('0x1'));var moment=require(_0xdfea('0x2'));var BPromise=require(_0xdfea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdfea('0x4'));var db=require(_0xdfea('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdfea('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdfea('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb0b58b,_0xa16301,_0x20b3ce){return new BPromise(function(_0x5bb312,_0x3410dd){return client[_0xdfea('0x8')](_0xb0b58b,_0x20b3ce)[_0xdfea('0x9')](function(_0x15e937){logger[_0xdfea('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xa16301,'request\x20sent');logger[_0xdfea('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xa16301,'request\x20sent',JSON[_0xdfea('0xc')](_0x15e937));if(_0x15e937[_0xdfea('0xd')]){if(_0x15e937[_0xdfea('0xd')][_0xdfea('0xe')]===0x1f4){logger[_0xdfea('0xd')](_0xdfea('0xf'),_0xa16301,_0x15e937[_0xdfea('0xd')][_0xdfea('0x10')]);return _0x3410dd(_0x15e937[_0xdfea('0xd')]['message']);}logger[_0xdfea('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xa16301,_0x15e937[_0xdfea('0xd')]['message']);return _0x5bb312(_0x15e937[_0xdfea('0xd')][_0xdfea('0x10')]);}else{logger[_0xdfea('0xa')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xa16301,_0xdfea('0x11'));_0x5bb312(_0x15e937[_0xdfea('0x12')][_0xdfea('0x10')]);}})[_0xdfea('0x13')](function(_0x857600){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0xa16301,_0x857600);_0x3410dd(_0x857600);});});}