95f43b82708a0ffaf24ccb36cda388c2b5bf8af3
[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 _0xf767=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x43a9cd,_0x5996bf){var _0x1d644f=function(_0x2fbc32){while(--_0x2fbc32){_0x43a9cd['push'](_0x43a9cd['shift']());}};_0x1d644f(++_0x5996bf);}(_0xf767,0x76));var _0x7f76=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0xf767[_0x5c2e5e];return _0x46a5da;};'use strict';var _=require('lodash');var util=require(_0x7f76('0x0'));var moment=require(_0x7f76('0x1'));var BPromise=require(_0x7f76('0x2'));var rs=require(_0x7f76('0x3'));var fs=require('fs');var Redis=require(_0x7f76('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f76('0x5'));var logger=require(_0x7f76('0x6'))(_0x7f76('0x7'));var config=require(_0x7f76('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7f76('0x9')][_0x7f76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45ddcc,_0x1eeb08,_0x1fc46c){return new BPromise(function(_0x5acfee,_0x8b5dce){return client[_0x7f76('0xb')](_0x45ddcc,_0x1fc46c)[_0x7f76('0xc')](function(_0x15dcd9){logger['info'](_0x7f76('0xd'),_0x1eeb08,'request\x20sent');logger[_0x7f76('0xe')](_0x7f76('0xf'),_0x1eeb08,_0x7f76('0x10'),JSON[_0x7f76('0x11')](_0x15dcd9));if(_0x15dcd9[_0x7f76('0x12')]){if(_0x15dcd9[_0x7f76('0x12')]['code']===0x1f4){logger[_0x7f76('0x12')](_0x7f76('0xd'),_0x1eeb08,_0x15dcd9[_0x7f76('0x12')][_0x7f76('0x13')]);return _0x8b5dce(_0x15dcd9[_0x7f76('0x12')]['message']);}logger[_0x7f76('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1eeb08,_0x15dcd9[_0x7f76('0x12')][_0x7f76('0x13')]);return _0x5acfee(_0x15dcd9['error']['message']);}else{logger['info'](_0x7f76('0xd'),_0x1eeb08,_0x7f76('0x10'));_0x5acfee(_0x15dcd9[_0x7f76('0x14')]['message']);}})[_0x7f76('0x15')](function(_0x522a2c){logger[_0x7f76('0x12')](_0x7f76('0xd'),_0x1eeb08,_0x522a2c);_0x8b5dce(_0x522a2c);});});}