Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / api / openchannelTransferReport / openchannelTransferReport.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 _0x3595=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0x3595,0x147));var _0x5359=function(_0x23f496,_0x23a578){_0x23f496=_0x23f496-0x0;var _0x570e2f=_0x3595[_0x23f496];return _0x570e2f;};'use strict';var _=require(_0x5359('0x0'));var util=require(_0x5359('0x1'));var moment=require(_0x5359('0x2'));var BPromise=require('bluebird');var rs=require(_0x5359('0x3'));var fs=require('fs');var Redis=require(_0x5359('0x4'));var db=require(_0x5359('0x5'))['db'];var utils=require(_0x5359('0x6'));var logger=require(_0x5359('0x7'))(_0x5359('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5359('0x9')][_0x5359('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b6f48,_0x29a776,_0x39fcd8){return new BPromise(function(_0x51b2fb,_0x400db4){return client[_0x5359('0xb')](_0x1b6f48,_0x39fcd8)[_0x5359('0xc')](function(_0x15e2c6){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x29a776,'request\x20sent');logger['debug'](_0x5359('0xd'),_0x29a776,_0x5359('0xe'),JSON[_0x5359('0xf')](_0x15e2c6));if(_0x15e2c6[_0x5359('0x10')]){if(_0x15e2c6[_0x5359('0x10')][_0x5359('0x11')]===0x1f4){logger[_0x5359('0x10')](_0x5359('0x12'),_0x29a776,_0x15e2c6[_0x5359('0x10')][_0x5359('0x13')]);return _0x400db4(_0x15e2c6[_0x5359('0x10')][_0x5359('0x13')]);}logger[_0x5359('0x10')](_0x5359('0x12'),_0x29a776,_0x15e2c6['error']['message']);return _0x51b2fb(_0x15e2c6[_0x5359('0x10')][_0x5359('0x13')]);}else{logger[_0x5359('0x14')](_0x5359('0x12'),_0x29a776,_0x5359('0xe'));_0x51b2fb(_0x15e2c6[_0x5359('0x15')]['message']);}})['catch'](function(_0x267d4c){logger[_0x5359('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x29a776,_0x267d4c);_0x400db4(_0x267d4c);});});}