Built motion from commit 3c2ce842.|2.6.31
[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 _0x9fb6=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash','util','bluebird'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9fb6,0x147));var _0x69fb=function(_0x32b231,_0x3f586f){_0x32b231=_0x32b231-0x0;var _0x178508=_0x9fb6[_0x32b231];return _0x178508;};'use strict';var _=require(_0x69fb('0x0'));var util=require(_0x69fb('0x1'));var moment=require('moment');var BPromise=require(_0x69fb('0x2'));var rs=require(_0x69fb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x69fb('0x5'))(_0x69fb('0x6'));var config=require(_0x69fb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x69fb('0x8')][_0x69fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4058ef,_0x6e6fa1,_0x2c7971){return new BPromise(function(_0x28ae75,_0x4b2e2c){return client[_0x69fb('0xa')](_0x4058ef,_0x2c7971)[_0x69fb('0xb')](function(_0x1e5af8){logger['info'](_0x69fb('0xc'),_0x6e6fa1,_0x69fb('0xd'));logger[_0x69fb('0xe')](_0x69fb('0xf'),_0x6e6fa1,'request\x20sent',JSON['stringify'](_0x1e5af8));if(_0x1e5af8['error']){if(_0x1e5af8['error'][_0x69fb('0x10')]===0x1f4){logger[_0x69fb('0x11')](_0x69fb('0xc'),_0x6e6fa1,_0x1e5af8[_0x69fb('0x11')]['message']);return _0x4b2e2c(_0x1e5af8[_0x69fb('0x11')][_0x69fb('0x12')]);}logger[_0x69fb('0x11')](_0x69fb('0xc'),_0x6e6fa1,_0x1e5af8['error']['message']);return _0x28ae75(_0x1e5af8[_0x69fb('0x11')]['message']);}else{logger[_0x69fb('0x13')](_0x69fb('0xc'),_0x6e6fa1,_0x69fb('0xd'));_0x28ae75(_0x1e5af8[_0x69fb('0x14')][_0x69fb('0x12')]);}})[_0x69fb('0x15')](function(_0x393649){logger[_0x69fb('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x6e6fa1,_0x393649);_0x4b2e2c(_0x393649);});});}