5761e39c77712fba618b6dd27f8c55a56b6f377a
[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 _0xb6f1=['result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','code','FaxTransferReport,\x20%s,\x20%s','message','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6f1,0x158));var _0x1b6f=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0xb6f1[_0x576e2b];return _0x46461a;};'use strict';var _=require(_0x1b6f('0x0'));var util=require('util');var moment=require(_0x1b6f('0x1'));var BPromise=require(_0x1b6f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b6f('0x3'));var db=require(_0x1b6f('0x4'))['db'];var utils=require(_0x1b6f('0x5'));var logger=require(_0x1b6f('0x6'))(_0x1b6f('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b6f('0x8'));var client=jayson[_0x1b6f('0x9')][_0x1b6f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130631,_0x30530a,_0xf295ca){return new BPromise(function(_0x3ffb1e,_0x34b3dd){return client['request'](_0x130631,_0xf295ca)['then'](function(_0x4de722){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x30530a,'request\x20sent');logger['debug'](_0x1b6f('0xb'),_0x30530a,_0x1b6f('0xc'),JSON['stringify'](_0x4de722));if(_0x4de722['error']){if(_0x4de722['error'][_0x1b6f('0xd')]===0x1f4){logger['error'](_0x1b6f('0xe'),_0x30530a,_0x4de722['error'][_0x1b6f('0xf')]);return _0x34b3dd(_0x4de722[_0x1b6f('0x10')]['message']);}logger[_0x1b6f('0x10')](_0x1b6f('0xe'),_0x30530a,_0x4de722[_0x1b6f('0x10')][_0x1b6f('0xf')]);return _0x3ffb1e(_0x4de722[_0x1b6f('0x10')]['message']);}else{logger['info'](_0x1b6f('0xe'),_0x30530a,_0x1b6f('0xc'));_0x3ffb1e(_0x4de722[_0x1b6f('0x11')][_0x1b6f('0xf')]);}})[_0x1b6f('0x12')](function(_0x4d8557){logger['error'](_0x1b6f('0xe'),_0x30530a,_0x4d8557);_0x34b3dd(_0x4d8557);});});}