33bf6441c5294e3435560e9ce002fb4ada128a16
[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 _0x2fe1=['message','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5bc953,_0x531c49){var _0x2d8afc=function(_0x500e0f){while(--_0x500e0f){_0x5bc953['push'](_0x5bc953['shift']());}};_0x2d8afc(++_0x531c49);}(_0x2fe1,0x10b));var _0x12fe=function(_0x4aee35,_0x20a268){_0x4aee35=_0x4aee35-0x0;var _0x36805d=_0x2fe1[_0x4aee35];return _0x36805d;};'use strict';var _=require('lodash');var util=require(_0x12fe('0x0'));var moment=require(_0x12fe('0x1'));var BPromise=require(_0x12fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12fe('0x3'));var db=require(_0x12fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x12fe('0x5'))(_0x12fe('0x6'));var config=require(_0x12fe('0x7'));var jayson=require(_0x12fe('0x8'));var client=jayson['client'][_0x12fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x117b0f,_0x5e60fb,_0x316baf){return new BPromise(function(_0x2050c7,_0x43b869){return client['request'](_0x117b0f,_0x316baf)[_0x12fe('0xa')](function(_0x115b61){logger[_0x12fe('0xb')](_0x12fe('0xc'),_0x5e60fb,_0x12fe('0xd'));logger[_0x12fe('0xe')](_0x12fe('0xf'),_0x5e60fb,_0x12fe('0xd'),JSON[_0x12fe('0x10')](_0x115b61));if(_0x115b61[_0x12fe('0x11')]){if(_0x115b61[_0x12fe('0x11')]['code']===0x1f4){logger[_0x12fe('0x11')](_0x12fe('0xc'),_0x5e60fb,_0x115b61[_0x12fe('0x11')][_0x12fe('0x12')]);return _0x43b869(_0x115b61['error'][_0x12fe('0x12')]);}logger['error'](_0x12fe('0xc'),_0x5e60fb,_0x115b61[_0x12fe('0x11')][_0x12fe('0x12')]);return _0x2050c7(_0x115b61[_0x12fe('0x11')][_0x12fe('0x12')]);}else{logger[_0x12fe('0xb')](_0x12fe('0xc'),_0x5e60fb,_0x12fe('0xd'));_0x2050c7(_0x115b61['result']['message']);}})['catch'](function(_0x2eef4c){logger[_0x12fe('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x5e60fb,_0x2eef4c);_0x43b869(_0x2eef4c);});});}