843fe1c36f2a48221ace4867cb2f199e8d0f1764
[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 _0x37c8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x569998,_0x361b8d){var _0x2f8256=function(_0x3354f1){while(--_0x3354f1){_0x569998['push'](_0x569998['shift']());}};_0x2f8256(++_0x361b8d);}(_0x37c8,0x78));var _0x837c=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0x37c8[_0x4c184d];return _0x23d997;};'use strict';var _=require(_0x837c('0x0'));var util=require(_0x837c('0x1'));var moment=require(_0x837c('0x2'));var BPromise=require(_0x837c('0x3'));var rs=require(_0x837c('0x4'));var fs=require('fs');var Redis=require(_0x837c('0x5'));var db=require(_0x837c('0x6'))['db'];var utils=require(_0x837c('0x7'));var logger=require(_0x837c('0x8'))(_0x837c('0x9'));var config=require(_0x837c('0xa'));var jayson=require(_0x837c('0xb'));var client=jayson[_0x837c('0xc')][_0x837c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2ce3a3,_0x446465,_0x5035d1){return new BPromise(function(_0xb76850,_0x560609){return client[_0x837c('0xe')](_0x2ce3a3,_0x5035d1)[_0x837c('0xf')](function(_0xcd365f){logger[_0x837c('0x10')](_0x837c('0x11'),_0x446465,_0x837c('0x12'));logger[_0x837c('0x13')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x446465,_0x837c('0x12'),JSON[_0x837c('0x14')](_0xcd365f));if(_0xcd365f[_0x837c('0x15')]){if(_0xcd365f['error']['code']===0x1f4){logger['error'](_0x837c('0x11'),_0x446465,_0xcd365f[_0x837c('0x15')]['message']);return _0x560609(_0xcd365f[_0x837c('0x15')]['message']);}logger[_0x837c('0x15')](_0x837c('0x11'),_0x446465,_0xcd365f[_0x837c('0x15')][_0x837c('0x16')]);return _0xb76850(_0xcd365f['error'][_0x837c('0x16')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x446465,_0x837c('0x12'));_0xb76850(_0xcd365f[_0x837c('0x17')]['message']);}})[_0x837c('0x18')](function(_0x45b944){logger[_0x837c('0x15')]('FaxTransferReport,\x20%s,\x20%s',_0x446465,_0x45b944);_0x560609(_0x45b944);});});}