Built motion from commit ff78e754.|2.6.29
[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 _0xf53f=['code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x121d98,_0x49424c){var _0x55d9a8=function(_0xd8fe24){while(--_0xd8fe24){_0x121d98['push'](_0x121d98['shift']());}};_0x55d9a8(++_0x49424c);}(_0xf53f,0x1e7));var _0xff53=function(_0x4a6d7c,_0x5bc780){_0x4a6d7c=_0x4a6d7c-0x0;var _0x44375f=_0xf53f[_0x4a6d7c];return _0x44375f;};'use strict';var _=require(_0xff53('0x0'));var util=require('util');var moment=require(_0xff53('0x1'));var BPromise=require(_0xff53('0x2'));var rs=require(_0xff53('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff53('0x4'))['db'];var utils=require(_0xff53('0x5'));var logger=require(_0xff53('0x6'))(_0xff53('0x7'));var config=require(_0xff53('0x8'));var jayson=require(_0xff53('0x9'));var client=jayson['client'][_0xff53('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x112f7f,_0x407bce,_0x2fde0c){return new BPromise(function(_0x5c7352,_0xf33c9b){return client[_0xff53('0xb')](_0x112f7f,_0x2fde0c)['then'](function(_0x5ebdea){logger[_0xff53('0xc')](_0xff53('0xd'),_0x407bce,_0xff53('0xe'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x407bce,_0xff53('0xe'),JSON[_0xff53('0xf')](_0x5ebdea));if(_0x5ebdea[_0xff53('0x10')]){if(_0x5ebdea[_0xff53('0x10')][_0xff53('0x11')]===0x1f4){logger[_0xff53('0x10')](_0xff53('0xd'),_0x407bce,_0x5ebdea[_0xff53('0x10')][_0xff53('0x12')]);return _0xf33c9b(_0x5ebdea[_0xff53('0x10')][_0xff53('0x12')]);}logger[_0xff53('0x10')](_0xff53('0xd'),_0x407bce,_0x5ebdea['error'][_0xff53('0x12')]);return _0x5c7352(_0x5ebdea[_0xff53('0x10')][_0xff53('0x12')]);}else{logger[_0xff53('0xc')](_0xff53('0xd'),_0x407bce,_0xff53('0xe'));_0x5c7352(_0x5ebdea[_0xff53('0x13')]['message']);}})[_0xff53('0x14')](function(_0x159fd2){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x407bce,_0x159fd2);_0xf33c9b(_0x159fd2);});});}