137c0edf0648e06bf85c56c407b69a8d55b83a4c
[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 _0x2127=['client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0x2127,0xdf));var _0x7212=function(_0x4b563f,_0x2a1057){_0x4b563f=_0x4b563f-0x0;var _0x214f20=_0x2127[_0x4b563f];return _0x214f20;};'use strict';var _=require('lodash');var util=require(_0x7212('0x0'));var moment=require('moment');var BPromise=require(_0x7212('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7212('0x2'));var db=require(_0x7212('0x3'))['db'];var utils=require(_0x7212('0x4'));var logger=require(_0x7212('0x5'))(_0x7212('0x6'));var config=require('../../config/environment');var jayson=require(_0x7212('0x7'));var client=jayson[_0x7212('0x8')][_0x7212('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x127fab,_0xe31b93,_0x3aca49){return new BPromise(function(_0x5d1e6e,_0x4721d9){return client[_0x7212('0xa')](_0x127fab,_0x3aca49)[_0x7212('0xb')](function(_0x4552c7){logger['info'](_0x7212('0xc'),_0xe31b93,_0x7212('0xd'));logger[_0x7212('0xe')](_0x7212('0xf'),_0xe31b93,_0x7212('0xd'),JSON[_0x7212('0x10')](_0x4552c7));if(_0x4552c7[_0x7212('0x11')]){if(_0x4552c7['error']['code']===0x1f4){logger[_0x7212('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0xe31b93,_0x4552c7[_0x7212('0x11')][_0x7212('0x12')]);return _0x4721d9(_0x4552c7['error']['message']);}logger[_0x7212('0x11')](_0x7212('0xc'),_0xe31b93,_0x4552c7[_0x7212('0x11')]['message']);return _0x5d1e6e(_0x4552c7['error']['message']);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0xe31b93,_0x7212('0xd'));_0x5d1e6e(_0x4552c7[_0x7212('0x13')][_0x7212('0x12')]);}})[_0x7212('0x14')](function(_0x58fe54){logger[_0x7212('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0xe31b93,_0x58fe54);_0x4721d9(_0x58fe54);});});}