f2b3ab7c320fd57126c096866005179ce849d47d
[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 _0x0775=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xf56b46,_0x4e32e8){var _0x583cea=function(_0x4ce708){while(--_0x4ce708){_0xf56b46['push'](_0xf56b46['shift']());}};_0x583cea(++_0x4e32e8);}(_0x0775,0x19c));var _0x5077=function(_0x4cc927,_0x402bed){_0x4cc927=_0x4cc927-0x0;var _0x16cc66=_0x0775[_0x4cc927];return _0x16cc66;};'use strict';var _=require(_0x5077('0x0'));var util=require('util');var moment=require(_0x5077('0x1'));var BPromise=require(_0x5077('0x2'));var rs=require(_0x5077('0x3'));var fs=require('fs');var Redis=require(_0x5077('0x4'));var db=require(_0x5077('0x5'))['db'];var utils=require(_0x5077('0x6'));var logger=require(_0x5077('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5077('0x8'));var client=jayson[_0x5077('0x9')][_0x5077('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x420401,_0x216b4f,_0x4a2a01){return new BPromise(function(_0x2a043f,_0x4b1379){return client[_0x5077('0xb')](_0x420401,_0x4a2a01)[_0x5077('0xc')](function(_0x1b9fc8){logger['info'](_0x5077('0xd'),_0x216b4f,_0x5077('0xe'));logger['debug'](_0x5077('0xf'),_0x216b4f,'request\x20sent',JSON[_0x5077('0x10')](_0x1b9fc8));if(_0x1b9fc8['error']){if(_0x1b9fc8[_0x5077('0x11')][_0x5077('0x12')]===0x1f4){logger['error'](_0x5077('0xd'),_0x216b4f,_0x1b9fc8[_0x5077('0x11')][_0x5077('0x13')]);return _0x4b1379(_0x1b9fc8['error'][_0x5077('0x13')]);}logger[_0x5077('0x11')](_0x5077('0xd'),_0x216b4f,_0x1b9fc8[_0x5077('0x11')]['message']);return _0x2a043f(_0x1b9fc8['error']['message']);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x216b4f,_0x5077('0xe'));_0x2a043f(_0x1b9fc8[_0x5077('0x14')][_0x5077('0x13')]);}})[_0x5077('0x15')](function(_0x301813){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x216b4f,_0x301813);_0x4b1379(_0x301813);});});}