Built motion from commit d5e4af8c.|2.6.23
[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 _0x207c=['message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x4e936b,_0x193d71){var _0xda6dd6=function(_0x465be7){while(--_0x465be7){_0x4e936b['push'](_0x4e936b['shift']());}};_0xda6dd6(++_0x193d71);}(_0x207c,0x1e8));var _0xc207=function(_0x500439,_0x24b02e){_0x500439=_0x500439-0x0;var _0x476501=_0x207c[_0x500439];return _0x476501;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x314561,_0x3395e4,_0x59ff6f){return new BPromise(function(_0x25cb97,_0xad159b){return client[_0xc207('0x9')](_0x314561,_0x59ff6f)['then'](function(_0xffae6c){logger[_0xc207('0xa')](_0xc207('0xb'),_0x3395e4,_0xc207('0xc'));logger[_0xc207('0xd')](_0xc207('0xe'),_0x3395e4,'request\x20sent',JSON['stringify'](_0xffae6c));if(_0xffae6c['error']){if(_0xffae6c[_0xc207('0xf')]['code']===0x1f4){logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0xad159b(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}logger[_0xc207('0xf')](_0xc207('0xb'),_0x3395e4,_0xffae6c['error'][_0xc207('0x10')]);return _0x25cb97(_0xffae6c[_0xc207('0xf')][_0xc207('0x10')]);}else{logger[_0xc207('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3395e4,'request\x20sent');_0x25cb97(_0xffae6c['result'][_0xc207('0x10')]);}})[_0xc207('0x11')](function(_0x3d9c7b){logger[_0xc207('0xf')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3395e4,_0x3d9c7b);_0xad159b(_0x3d9c7b);});});}