Built motion from commit (unavailable).|2.5.8
[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 _0x816d=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util'];(function(_0x11c10c,_0x19bb71){var _0x2aa484=function(_0x7311fe){while(--_0x7311fe){_0x11c10c['push'](_0x11c10c['shift']());}};_0x2aa484(++_0x19bb71);}(_0x816d,0x168));var _0xd816=function(_0x14006c,_0x4bd80d){_0x14006c=_0x14006c-0x0;var _0x5b51b9=_0x816d[_0x14006c];return _0x5b51b9;};'use strict';var _=require('lodash');var util=require(_0xd816('0x0'));var moment=require(_0xd816('0x1'));var BPromise=require(_0xd816('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd816('0x3'));var db=require(_0xd816('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd816('0x5'))(_0xd816('0x6'));var config=require(_0xd816('0x7'));var jayson=require(_0xd816('0x8'));var client=jayson['client'][_0xd816('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x80775a,_0xc6bca3,_0x32782d){return new BPromise(function(_0x25973c,_0x1e43eb){return client['request'](_0x80775a,_0x32782d)[_0xd816('0xa')](function(_0x1ea42b){logger[_0xd816('0xb')](_0xd816('0xc'),_0xc6bca3,_0xd816('0xd'));logger[_0xd816('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0xc6bca3,'request\x20sent',JSON[_0xd816('0xf')](_0x1ea42b));if(_0x1ea42b[_0xd816('0x10')]){if(_0x1ea42b[_0xd816('0x10')]['code']===0x1f4){logger[_0xd816('0x10')](_0xd816('0xc'),_0xc6bca3,_0x1ea42b[_0xd816('0x10')][_0xd816('0x11')]);return _0x1e43eb(_0x1ea42b['error'][_0xd816('0x11')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0xc6bca3,_0x1ea42b[_0xd816('0x10')][_0xd816('0x11')]);return _0x25973c(_0x1ea42b['error'][_0xd816('0x11')]);}else{logger[_0xd816('0xb')](_0xd816('0xc'),_0xc6bca3,_0xd816('0xd'));_0x25973c(_0x1ea42b['result'][_0xd816('0x11')]);}})[_0xd816('0x12')](function(_0x134015){logger[_0xd816('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0xc6bca3,_0x134015);_0x1e43eb(_0x134015);});});}