Built motion from commit (unavailable).|2.5.4
[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 _0xe800=['jayson/promise','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xe800,0xb7));var _0x0e80=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe800[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0e80('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e80('0x1'));var db=require(_0x0e80('0x2'))['db'];var utils=require(_0x0e80('0x3'));var logger=require(_0x0e80('0x4'))(_0x0e80('0x5'));var config=require(_0x0e80('0x6'));var jayson=require(_0x0e80('0x7'));var client=jayson['client'][_0x0e80('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x440c35,_0x346bcd,_0x2f0f41){return new BPromise(function(_0x45dde1,_0x5070a4){return client['request'](_0x440c35,_0x2f0f41)[_0x0e80('0x9')](function(_0x30db9c){logger[_0x0e80('0xa')](_0x0e80('0xb'),_0x346bcd,_0x0e80('0xc'));logger[_0x0e80('0xd')](_0x0e80('0xe'),_0x346bcd,'request\x20sent',JSON[_0x0e80('0xf')](_0x30db9c));if(_0x30db9c[_0x0e80('0x10')]){if(_0x30db9c['error'][_0x0e80('0x11')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x346bcd,_0x30db9c['error'][_0x0e80('0x12')]);return _0x5070a4(_0x30db9c[_0x0e80('0x10')]['message']);}logger[_0x0e80('0x10')](_0x0e80('0xb'),_0x346bcd,_0x30db9c[_0x0e80('0x10')][_0x0e80('0x12')]);return _0x45dde1(_0x30db9c[_0x0e80('0x10')][_0x0e80('0x12')]);}else{logger[_0x0e80('0xa')](_0x0e80('0xb'),_0x346bcd,'request\x20sent');_0x45dde1(_0x30db9c['result'][_0x0e80('0x12')]);}})['catch'](function(_0x37aed8){logger[_0x0e80('0x10')](_0x0e80('0xb'),_0x346bcd,_0x37aed8);_0x5070a4(_0x37aed8);});});}