Built motion from commit (unavailable).|2.5.11
[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 _0x4e07=['message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0x487f22,_0x2cc035){var _0x5b8880=function(_0x3cdd0f){while(--_0x3cdd0f){_0x487f22['push'](_0x487f22['shift']());}};_0x5b8880(++_0x2cc035);}(_0x4e07,0x1a6));var _0x74e0=function(_0x4f45a7,_0x3fd30f){_0x4f45a7=_0x4f45a7-0x0;var _0x120c93=_0x4e07[_0x4f45a7];return _0x120c93;};'use strict';var _=require(_0x74e0('0x0'));var util=require('util');var moment=require(_0x74e0('0x1'));var BPromise=require(_0x74e0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74e0('0x3'));var db=require(_0x74e0('0x4'))['db'];var utils=require(_0x74e0('0x5'));var logger=require('../../config/logger')(_0x74e0('0x6'));var config=require(_0x74e0('0x7'));var jayson=require(_0x74e0('0x8'));var client=jayson[_0x74e0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d8d51,_0x23a939,_0x1a5840){return new BPromise(function(_0xf704f4,_0x278b51){return client[_0x74e0('0xa')](_0x3d8d51,_0x1a5840)[_0x74e0('0xb')](function(_0x1d3b39){logger[_0x74e0('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23a939,'request\x20sent');logger[_0x74e0('0xd')](_0x74e0('0xe'),_0x23a939,_0x74e0('0xf'),JSON[_0x74e0('0x10')](_0x1d3b39));if(_0x1d3b39['error']){if(_0x1d3b39[_0x74e0('0x11')]['code']===0x1f4){logger[_0x74e0('0x11')](_0x74e0('0x12'),_0x23a939,_0x1d3b39[_0x74e0('0x11')][_0x74e0('0x13')]);return _0x278b51(_0x1d3b39['error'][_0x74e0('0x13')]);}logger[_0x74e0('0x11')](_0x74e0('0x12'),_0x23a939,_0x1d3b39[_0x74e0('0x11')]['message']);return _0xf704f4(_0x1d3b39[_0x74e0('0x11')][_0x74e0('0x13')]);}else{logger[_0x74e0('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x23a939,'request\x20sent');_0xf704f4(_0x1d3b39[_0x74e0('0x14')][_0x74e0('0x13')]);}})['catch'](function(_0x352ace){logger[_0x74e0('0x11')](_0x74e0('0x12'),_0x23a939,_0x352ace);_0x278b51(_0x352ace);});});}