28c62894630b8b935241326b23c87b90081ce7e8
[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 _0xa23b=['../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xa23b,0x114));var _0xba23=function(_0x12f576,_0xd32564){_0x12f576=_0x12f576-0x0;var _0x1cb5a5=_0xa23b[_0x12f576];return _0x1cb5a5;};'use strict';var _=require(_0xba23('0x0'));var util=require('util');var moment=require(_0xba23('0x1'));var BPromise=require(_0xba23('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba23('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xba23('0x4'))(_0xba23('0x5'));var config=require(_0xba23('0x6'));var jayson=require(_0xba23('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe5cc0c,_0x1fd945,_0x1db2e1){return new BPromise(function(_0x587398,_0x429dfc){return client[_0xba23('0x8')](_0xe5cc0c,_0x1db2e1)[_0xba23('0x9')](function(_0x385846){logger[_0xba23('0xa')](_0xba23('0xb'),_0x1fd945,'request\x20sent');logger['debug'](_0xba23('0xc'),_0x1fd945,_0xba23('0xd'),JSON[_0xba23('0xe')](_0x385846));if(_0x385846['error']){if(_0x385846['error'][_0xba23('0xf')]===0x1f4){logger[_0xba23('0x10')](_0xba23('0xb'),_0x1fd945,_0x385846['error']['message']);return _0x429dfc(_0x385846['error']['message']);}logger[_0xba23('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x1fd945,_0x385846[_0xba23('0x10')][_0xba23('0x11')]);return _0x587398(_0x385846[_0xba23('0x10')]['message']);}else{logger['info'](_0xba23('0xb'),_0x1fd945,_0xba23('0xd'));_0x587398(_0x385846[_0xba23('0x12')][_0xba23('0x11')]);}})[_0xba23('0x13')](function(_0x25094c){logger[_0xba23('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x1fd945,_0x25094c);_0x429dfc(_0x25094c);});});}