d5c35f633f460149ce48135f687ed40c410e7589
[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 _0xecf1=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xecf1,0x145));var _0x1ecf=function(_0x154940,_0x4a448a){_0x154940=_0x154940-0x0;var _0x401409=_0xecf1[_0x154940];return _0x401409;};'use strict';var _=require(_0x1ecf('0x0'));var util=require(_0x1ecf('0x1'));var moment=require('moment');var BPromise=require(_0x1ecf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ecf('0x3'));var db=require(_0x1ecf('0x4'))['db'];var utils=require(_0x1ecf('0x5'));var logger=require(_0x1ecf('0x6'))(_0x1ecf('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ecf('0x8')][_0x1ecf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4bd602,_0xb867dd,_0x40c42e){return new BPromise(function(_0x31f3b9,_0x2b9249){return client[_0x1ecf('0xa')](_0x4bd602,_0x40c42e)[_0x1ecf('0xb')](function(_0x21d139){logger[_0x1ecf('0xc')](_0x1ecf('0xd'),_0xb867dd,'request\x20sent');logger[_0x1ecf('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0xb867dd,'request\x20sent',JSON[_0x1ecf('0xf')](_0x21d139));if(_0x21d139[_0x1ecf('0x10')]){if(_0x21d139[_0x1ecf('0x10')][_0x1ecf('0x11')]===0x1f4){logger['error'](_0x1ecf('0xd'),_0xb867dd,_0x21d139[_0x1ecf('0x10')][_0x1ecf('0x12')]);return _0x2b9249(_0x21d139['error']['message']);}logger['error'](_0x1ecf('0xd'),_0xb867dd,_0x21d139['error'][_0x1ecf('0x12')]);return _0x31f3b9(_0x21d139[_0x1ecf('0x10')][_0x1ecf('0x12')]);}else{logger[_0x1ecf('0xc')](_0x1ecf('0xd'),_0xb867dd,_0x1ecf('0x13'));_0x31f3b9(_0x21d139[_0x1ecf('0x14')][_0x1ecf('0x12')]);}})[_0x1ecf('0x15')](function(_0x402ada){logger[_0x1ecf('0x10')](_0x1ecf('0xd'),_0xb867dd,_0x402ada);_0x2b9249(_0x402ada);});});}