30b35325b4e12d064ed2067116c17d88b158a8f9
[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 _0x714b=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','client','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x714b,0xed));var _0xb714=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x714b[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0xb714('0x0'));var moment=require(_0xb714('0x1'));var BPromise=require(_0xb714('0x2'));var rs=require(_0xb714('0x3'));var fs=require('fs');var Redis=require(_0xb714('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb714('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb714('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb714('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c83e7,_0x1339e5,_0x15c851){return new BPromise(function(_0x53f18a,_0x45cf6d){return client['request'](_0x3c83e7,_0x15c851)[_0xb714('0x8')](function(_0xf92413){logger['info'](_0xb714('0x9'),_0x1339e5,_0xb714('0xa'));logger[_0xb714('0xb')](_0xb714('0xc'),_0x1339e5,'request\x20sent',JSON[_0xb714('0xd')](_0xf92413));if(_0xf92413[_0xb714('0xe')]){if(_0xf92413[_0xb714('0xe')][_0xb714('0xf')]===0x1f4){logger[_0xb714('0xe')](_0xb714('0x9'),_0x1339e5,_0xf92413[_0xb714('0xe')][_0xb714('0x10')]);return _0x45cf6d(_0xf92413[_0xb714('0xe')][_0xb714('0x10')]);}logger[_0xb714('0xe')](_0xb714('0x9'),_0x1339e5,_0xf92413[_0xb714('0xe')][_0xb714('0x10')]);return _0x53f18a(_0xf92413['error']['message']);}else{logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1339e5,_0xb714('0xa'));_0x53f18a(_0xf92413['result'][_0xb714('0x10')]);}})[_0xb714('0x11')](function(_0x388f5d){logger['error'](_0xb714('0x9'),_0x1339e5,_0x388f5d);_0x45cf6d(_0x388f5d);});});}