Built motion from commit (unavailable).|2.5.5
[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 _0xdc95=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3a8e93,_0x373a01){var _0xa93612=function(_0x12c3b8){while(--_0x12c3b8){_0x3a8e93['push'](_0x3a8e93['shift']());}};_0xa93612(++_0x373a01);}(_0xdc95,0x15a));var _0x5dc9=function(_0x1a1aec,_0x4a35c8){_0x1a1aec=_0x1a1aec-0x0;var _0x34dab1=_0xdc95[_0x1a1aec];return _0x34dab1;};'use strict';var _=require(_0x5dc9('0x0'));var util=require(_0x5dc9('0x1'));var moment=require('moment');var BPromise=require(_0x5dc9('0x2'));var rs=require(_0x5dc9('0x3'));var fs=require('fs');var Redis=require(_0x5dc9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dc9('0x5'));var logger=require(_0x5dc9('0x6'))(_0x5dc9('0x7'));var config=require(_0x5dc9('0x8'));var jayson=require(_0x5dc9('0x9'));var client=jayson['client'][_0x5dc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7ef24e,_0x3feaff,_0x19de0b){return new BPromise(function(_0x3b6c08,_0x561c61){return client[_0x5dc9('0xb')](_0x7ef24e,_0x19de0b)[_0x5dc9('0xc')](function(_0x104997){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x3feaff,_0x5dc9('0xd'));logger[_0x5dc9('0xe')](_0x5dc9('0xf'),_0x3feaff,_0x5dc9('0xd'),JSON[_0x5dc9('0x10')](_0x104997));if(_0x104997['error']){if(_0x104997[_0x5dc9('0x11')]['code']===0x1f4){logger[_0x5dc9('0x11')](_0x5dc9('0x12'),_0x3feaff,_0x104997['error'][_0x5dc9('0x13')]);return _0x561c61(_0x104997['error'][_0x5dc9('0x13')]);}logger[_0x5dc9('0x11')](_0x5dc9('0x12'),_0x3feaff,_0x104997[_0x5dc9('0x11')]['message']);return _0x3b6c08(_0x104997[_0x5dc9('0x11')][_0x5dc9('0x13')]);}else{logger[_0x5dc9('0x14')](_0x5dc9('0x12'),_0x3feaff,_0x5dc9('0xd'));_0x3b6c08(_0x104997['result']['message']);}})[_0x5dc9('0x15')](function(_0x3afa3a){logger[_0x5dc9('0x11')](_0x5dc9('0x12'),_0x3feaff,_0x3afa3a);_0x561c61(_0x3afa3a);});});}