106f0d1f10aae6538cdf3ec31fd06f03643869a0
[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 _0x7225=['error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x7225,0x13a));var _0x5722=function(_0x1bdd35,_0x36f9fd){_0x1bdd35=_0x1bdd35-0x0;var _0x5b4294=_0x7225[_0x1bdd35];return _0x5b4294;};'use strict';var _=require(_0x5722('0x0'));var util=require('util');var moment=require(_0x5722('0x1'));var BPromise=require('bluebird');var rs=require(_0x5722('0x2'));var fs=require('fs');var Redis=require(_0x5722('0x3'));var db=require(_0x5722('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5722('0x5'))(_0x5722('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5722('0x7')][_0x5722('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53c272,_0x434368,_0x81d2a1){return new BPromise(function(_0x5b1e7c,_0x260fd5){return client[_0x5722('0x9')](_0x53c272,_0x81d2a1)[_0x5722('0xa')](function(_0x554d70){logger['info'](_0x5722('0xb'),_0x434368,_0x5722('0xc'));logger[_0x5722('0xd')](_0x5722('0xe'),_0x434368,_0x5722('0xc'),JSON[_0x5722('0xf')](_0x554d70));if(_0x554d70['error']){if(_0x554d70[_0x5722('0x10')][_0x5722('0x11')]===0x1f4){logger[_0x5722('0x10')](_0x5722('0xb'),_0x434368,_0x554d70['error'][_0x5722('0x12')]);return _0x260fd5(_0x554d70[_0x5722('0x10')][_0x5722('0x12')]);}logger[_0x5722('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x434368,_0x554d70[_0x5722('0x10')][_0x5722('0x12')]);return _0x5b1e7c(_0x554d70[_0x5722('0x10')][_0x5722('0x12')]);}else{logger[_0x5722('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x434368,_0x5722('0xc'));_0x5b1e7c(_0x554d70[_0x5722('0x14')]['message']);}})[_0x5722('0x15')](function(_0x33442f){logger[_0x5722('0x10')](_0x5722('0xb'),_0x434368,_0x33442f);_0x260fd5(_0x33442f);});});}