Built motion from commit (unavailable).|2.5.2
[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 _0xf8e6=['info','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','catch','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then'];(function(_0x48ec98,_0x4c5c78){var _0x55b458=function(_0x1146dc){while(--_0x1146dc){_0x48ec98['push'](_0x48ec98['shift']());}};_0x55b458(++_0x4c5c78);}(_0xf8e6,0x108));var _0x6f8e=function(_0x1bc0cc,_0x512ab){_0x1bc0cc=_0x1bc0cc-0x0;var _0x29b6e1=_0xf8e6[_0x1bc0cc];return _0x29b6e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f8e('0x0'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f8e('0x1'));var logger=require(_0x6f8e('0x2'))(_0x6f8e('0x3'));var config=require('../../config/environment');var jayson=require(_0x6f8e('0x4'));var client=jayson[_0x6f8e('0x5')][_0x6f8e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xbb1a06,_0x26f30e,_0x58b1f2){return new BPromise(function(_0x396769,_0x41e8f8){return client['request'](_0xbb1a06,_0x58b1f2)[_0x6f8e('0x7')](function(_0x1ecbc8){logger[_0x6f8e('0x8')]('FaxTransferReport,\x20%s,\x20%s',_0x26f30e,'request\x20sent');logger[_0x6f8e('0x9')](_0x6f8e('0xa'),_0x26f30e,_0x6f8e('0xb'),JSON[_0x6f8e('0xc')](_0x1ecbc8));if(_0x1ecbc8[_0x6f8e('0xd')]){if(_0x1ecbc8[_0x6f8e('0xd')]['code']===0x1f4){logger[_0x6f8e('0xd')](_0x6f8e('0xe'),_0x26f30e,_0x1ecbc8[_0x6f8e('0xd')]['message']);return _0x41e8f8(_0x1ecbc8[_0x6f8e('0xd')][_0x6f8e('0xf')]);}logger['error'](_0x6f8e('0xe'),_0x26f30e,_0x1ecbc8['error'][_0x6f8e('0xf')]);return _0x396769(_0x1ecbc8[_0x6f8e('0xd')][_0x6f8e('0xf')]);}else{logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x26f30e,_0x6f8e('0xb'));_0x396769(_0x1ecbc8['result'][_0x6f8e('0xf')]);}})[_0x6f8e('0x10')](function(_0x312fae){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x26f30e,_0x312fae);_0x41e8f8(_0x312fae);});});}