27f88fa8e6437177087ecf30c52d416d720e0620
[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 _0x6748=['info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x44b7cd,_0x396d64){var _0x1b9258=function(_0x270c35){while(--_0x270c35){_0x44b7cd['push'](_0x44b7cd['shift']());}};_0x1b9258(++_0x396d64);}(_0x6748,0x196));var _0x8674=function(_0x1f4083,_0x130f9e){_0x1f4083=_0x1f4083-0x0;var _0x389439=_0x6748[_0x1f4083];return _0x389439;};'use strict';var _=require(_0x8674('0x0'));var util=require(_0x8674('0x1'));var moment=require(_0x8674('0x2'));var BPromise=require('bluebird');var rs=require(_0x8674('0x3'));var fs=require('fs');var Redis=require(_0x8674('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8674('0x5'));var logger=require(_0x8674('0x6'))(_0x8674('0x7'));var config=require('../../config/environment');var jayson=require(_0x8674('0x8'));var client=jayson[_0x8674('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50413b,_0x4434d5,_0x5851f2){return new BPromise(function(_0x5369e9,_0x4b8461){return client[_0x8674('0xa')](_0x50413b,_0x5851f2)[_0x8674('0xb')](function(_0x4eda7c){logger[_0x8674('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x4434d5,'request\x20sent');logger[_0x8674('0xd')](_0x8674('0xe'),_0x4434d5,_0x8674('0xf'),JSON['stringify'](_0x4eda7c));if(_0x4eda7c[_0x8674('0x10')]){if(_0x4eda7c[_0x8674('0x10')][_0x8674('0x11')]===0x1f4){logger[_0x8674('0x10')](_0x8674('0x12'),_0x4434d5,_0x4eda7c[_0x8674('0x10')][_0x8674('0x13')]);return _0x4b8461(_0x4eda7c[_0x8674('0x10')][_0x8674('0x13')]);}logger[_0x8674('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x4434d5,_0x4eda7c[_0x8674('0x10')][_0x8674('0x13')]);return _0x5369e9(_0x4eda7c['error'][_0x8674('0x13')]);}else{logger[_0x8674('0xc')](_0x8674('0x12'),_0x4434d5,_0x8674('0xf'));_0x5369e9(_0x4eda7c[_0x8674('0x14')][_0x8674('0x13')]);}})[_0x8674('0x15')](function(_0x1d1ab7){logger['error'](_0x8674('0x12'),_0x4434d5,_0x1d1ab7);_0x4b8461(_0x1d1ab7);});});}