bf69ee948907a4e7b0ded502d07e6348f4a9eebf
[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 _0x7aa3=['../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x37f57e,_0x31dc0f){var _0x1b3177=function(_0x486857){while(--_0x486857){_0x37f57e['push'](_0x37f57e['shift']());}};_0x1b3177(++_0x31dc0f);}(_0x7aa3,0x1ca));var _0x37aa=function(_0xad1cdc,_0x24e0eb){_0xad1cdc=_0xad1cdc-0x0;var _0x1e0a91=_0x7aa3[_0xad1cdc];return _0x1e0a91;};'use strict';var _=require('lodash');var util=require(_0x37aa('0x0'));var moment=require(_0x37aa('0x1'));var BPromise=require(_0x37aa('0x2'));var rs=require(_0x37aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x37aa('0x4'))['db'];var utils=require(_0x37aa('0x5'));var logger=require('../../config/logger')(_0x37aa('0x6'));var config=require('../../config/environment');var jayson=require(_0x37aa('0x7'));var client=jayson['client'][_0x37aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f1931,_0x3e1f19,_0x1e1944){return new BPromise(function(_0xe71b3f,_0x1b5a50){return client[_0x37aa('0x9')](_0x5f1931,_0x1e1944)[_0x37aa('0xa')](function(_0x2dcffe){logger[_0x37aa('0xb')](_0x37aa('0xc'),_0x3e1f19,_0x37aa('0xd'));logger[_0x37aa('0xe')](_0x37aa('0xf'),_0x3e1f19,_0x37aa('0xd'),JSON['stringify'](_0x2dcffe));if(_0x2dcffe[_0x37aa('0x10')]){if(_0x2dcffe[_0x37aa('0x10')][_0x37aa('0x11')]===0x1f4){logger[_0x37aa('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x3e1f19,_0x2dcffe[_0x37aa('0x10')][_0x37aa('0x12')]);return _0x1b5a50(_0x2dcffe['error'][_0x37aa('0x12')]);}logger[_0x37aa('0x10')](_0x37aa('0xc'),_0x3e1f19,_0x2dcffe[_0x37aa('0x10')][_0x37aa('0x12')]);return _0xe71b3f(_0x2dcffe['error']['message']);}else{logger[_0x37aa('0xb')](_0x37aa('0xc'),_0x3e1f19,_0x37aa('0xd'));_0xe71b3f(_0x2dcffe[_0x37aa('0x13')][_0x37aa('0x12')]);}})[_0x37aa('0x14')](function(_0xd162b2){logger[_0x37aa('0x10')](_0x37aa('0xc'),_0x3e1f19,_0xd162b2);_0x1b5a50(_0xd162b2);});});}