53229ecf99c23ec7e41fec2f2b8db2fa4aa617d2
[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 _0xc21e=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x551146,_0x272ebf){var _0x3894f6=function(_0x368e63){while(--_0x368e63){_0x551146['push'](_0x551146['shift']());}};_0x3894f6(++_0x272ebf);}(_0xc21e,0x1ca));var _0xec21=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xc21e[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xec21('0x0'));var moment=require(_0xec21('0x1'));var BPromise=require(_0xec21('0x2'));var rs=require(_0xec21('0x3'));var fs=require('fs');var Redis=require(_0xec21('0x4'));var db=require(_0xec21('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec21('0x6'))(_0xec21('0x7'));var config=require(_0xec21('0x8'));var jayson=require(_0xec21('0x9'));var client=jayson[_0xec21('0xa')][_0xec21('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x406b66,_0x2f15e7,_0x51f6dc){return new BPromise(function(_0x2b1396,_0x3d74a2){return client[_0xec21('0xc')](_0x406b66,_0x51f6dc)[_0xec21('0xd')](function(_0x4d478){logger['info'](_0xec21('0xe'),_0x2f15e7,_0xec21('0xf'));logger[_0xec21('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x2f15e7,'request\x20sent',JSON[_0xec21('0x11')](_0x4d478));if(_0x4d478[_0xec21('0x12')]){if(_0x4d478['error'][_0xec21('0x13')]===0x1f4){logger[_0xec21('0x12')](_0xec21('0xe'),_0x2f15e7,_0x4d478[_0xec21('0x12')][_0xec21('0x14')]);return _0x3d74a2(_0x4d478['error'][_0xec21('0x14')]);}logger['error'](_0xec21('0xe'),_0x2f15e7,_0x4d478[_0xec21('0x12')][_0xec21('0x14')]);return _0x2b1396(_0x4d478['error'][_0xec21('0x14')]);}else{logger[_0xec21('0x15')](_0xec21('0xe'),_0x2f15e7,_0xec21('0xf'));_0x2b1396(_0x4d478[_0xec21('0x16')][_0xec21('0x14')]);}})[_0xec21('0x17')](function(_0x350a53){logger['error'](_0xec21('0xe'),_0x2f15e7,_0x350a53);_0x3d74a2(_0x350a53);});});}