Built motion from commit 67e5df37.|2.0.66
[motion2.git] / server / api / faxTransferReport / faxTransferReport.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 _0x8a18=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch'];(function(_0x2abbb5,_0x4bf675){var _0x2682f0=function(_0xc2ce18){while(--_0xc2ce18){_0x2abbb5['push'](_0x2abbb5['shift']());}};_0x2682f0(++_0x4bf675);}(_0x8a18,0xd2));var _0x88a1=function(_0x3daa6c,_0x1e64bc){_0x3daa6c=_0x3daa6c-0x0;var _0x3f0f8b=_0x8a18[_0x3daa6c];return _0x3f0f8b;};'use strict';var _=require(_0x88a1('0x0'));var util=require(_0x88a1('0x1'));var moment=require('moment');var BPromise=require(_0x88a1('0x2'));var rs=require(_0x88a1('0x3'));var fs=require('fs');var db=require(_0x88a1('0x4'))['db'];var utils=require(_0x88a1('0x5'));var logger=require(_0x88a1('0x6'))('rpc');var config=require(_0x88a1('0x7'));var jayson=require(_0x88a1('0x8'));var client=jayson[_0x88a1('0x9')][_0x88a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d7a86,_0x359c20,_0x4e7a94){return new BPromise(function(_0x5934db,_0x40d7d3){return client[_0x88a1('0xb')](_0x3d7a86,_0x4e7a94)[_0x88a1('0xc')](function(_0x59a353){logger['info'](_0x88a1('0xd'),_0x359c20,_0x88a1('0xe'));logger['debug'](_0x88a1('0xf'),_0x359c20,_0x88a1('0xe'),JSON['stringify'](_0x59a353));if(_0x59a353[_0x88a1('0x10')]){if(_0x59a353[_0x88a1('0x10')][_0x88a1('0x11')]===0x1f4){logger[_0x88a1('0x10')](_0x88a1('0xd'),_0x359c20,_0x59a353[_0x88a1('0x10')][_0x88a1('0x12')]);return _0x40d7d3(_0x59a353['error'][_0x88a1('0x12')]);}logger[_0x88a1('0x10')](_0x88a1('0xd'),_0x359c20,_0x59a353['error'][_0x88a1('0x12')]);return _0x5934db(_0x59a353[_0x88a1('0x10')][_0x88a1('0x12')]);}else{logger[_0x88a1('0x13')](_0x88a1('0xd'),_0x359c20,'request\x20sent');_0x5934db(_0x59a353['result']['message']);}})[_0x88a1('0x14')](function(_0x4530aa){logger[_0x88a1('0x10')](_0x88a1('0xd'),_0x359c20,_0x4530aa);_0x40d7d3(_0x4530aa);});});}