0298fe697da05f78840a79992ad80bdc388d181a
[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 _0xd48c=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x50a1ac,_0xd2c484){var _0x27d1ed=function(_0x44b94d){while(--_0x44b94d){_0x50a1ac['push'](_0x50a1ac['shift']());}};_0x27d1ed(++_0xd2c484);}(_0xd48c,0x145));var _0xcd48=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0xd48c[_0x413b4d];return _0x8b810a;};'use strict';var _=require(_0xcd48('0x0'));var util=require(_0xcd48('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcd48('0x2'));var fs=require('fs');var Redis=require(_0xcd48('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcd48('0x4'))(_0xcd48('0x5'));var config=require(_0xcd48('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcd48('0x7')][_0xcd48('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c3cc0,_0xe864f7,_0x2b0c42){return new BPromise(function(_0x290217,_0x1c1e98){return client[_0xcd48('0x9')](_0x3c3cc0,_0x2b0c42)[_0xcd48('0xa')](function(_0x2db4d1){logger[_0xcd48('0xb')](_0xcd48('0xc'),_0xe864f7,_0xcd48('0xd'));logger[_0xcd48('0xe')](_0xcd48('0xf'),_0xe864f7,_0xcd48('0xd'),JSON[_0xcd48('0x10')](_0x2db4d1));if(_0x2db4d1[_0xcd48('0x11')]){if(_0x2db4d1['error']['code']===0x1f4){logger[_0xcd48('0x11')](_0xcd48('0xc'),_0xe864f7,_0x2db4d1[_0xcd48('0x11')][_0xcd48('0x12')]);return _0x1c1e98(_0x2db4d1[_0xcd48('0x11')][_0xcd48('0x12')]);}logger[_0xcd48('0x11')](_0xcd48('0xc'),_0xe864f7,_0x2db4d1['error'][_0xcd48('0x12')]);return _0x290217(_0x2db4d1[_0xcd48('0x11')][_0xcd48('0x12')]);}else{logger[_0xcd48('0xb')](_0xcd48('0xc'),_0xe864f7,_0xcd48('0xd'));_0x290217(_0x2db4d1['result'][_0xcd48('0x12')]);}})[_0xcd48('0x13')](function(_0x115231){logger[_0xcd48('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0xe864f7,_0x115231);_0x1c1e98(_0x115231);});});}