48121f8a6f18a208223de923032d6c8e526273ec
[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 _0x20cb=['http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x7f98c9,_0x547197){var _0x24b672=function(_0x41ef7c){while(--_0x41ef7c){_0x7f98c9['push'](_0x7f98c9['shift']());}};_0x24b672(++_0x547197);}(_0x20cb,0x14b));var _0xb20c=function(_0x4895ff,_0x3c8a17){_0x4895ff=_0x4895ff-0x0;var _0x30acd6=_0x20cb[_0x4895ff];return _0x30acd6;};'use strict';var _=require(_0xb20c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb20c('0x1'));var fs=require('fs');var Redis=require(_0xb20c('0x2'));var db=require(_0xb20c('0x3'))['db'];var utils=require(_0xb20c('0x4'));var logger=require(_0xb20c('0x5'))(_0xb20c('0x6'));var config=require(_0xb20c('0x7'));var jayson=require(_0xb20c('0x8'));var client=jayson['client'][_0xb20c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd59ea5,_0x5984bd,_0xb66d09){return new BPromise(function(_0x4b48c8,_0x1c5d59){return client['request'](_0xd59ea5,_0xb66d09)[_0xb20c('0xa')](function(_0x5bcee3){logger[_0xb20c('0xb')](_0xb20c('0xc'),_0x5984bd,_0xb20c('0xd'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x5984bd,_0xb20c('0xd'),JSON[_0xb20c('0xe')](_0x5bcee3));if(_0x5bcee3[_0xb20c('0xf')]){if(_0x5bcee3[_0xb20c('0xf')][_0xb20c('0x10')]===0x1f4){logger['error'](_0xb20c('0xc'),_0x5984bd,_0x5bcee3['error']['message']);return _0x1c5d59(_0x5bcee3['error'][_0xb20c('0x11')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x5984bd,_0x5bcee3[_0xb20c('0xf')][_0xb20c('0x11')]);return _0x4b48c8(_0x5bcee3[_0xb20c('0xf')]['message']);}else{logger[_0xb20c('0xb')](_0xb20c('0xc'),_0x5984bd,_0xb20c('0xd'));_0x4b48c8(_0x5bcee3[_0xb20c('0x12')][_0xb20c('0x11')]);}})[_0xb20c('0x13')](function(_0x2a1d5f){logger['error'](_0xb20c('0xc'),_0x5984bd,_0x2a1d5f);_0x1c5d59(_0x2a1d5f);});});}