Built motion from commit 47436d59.|2.6.7
[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 _0x9ea9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxTransferReport,\x20%s,\x20%s','info','result','lodash','moment'];(function(_0x3ace61,_0x2d18b0){var _0xdee6c7=function(_0x17dc6c){while(--_0x17dc6c){_0x3ace61['push'](_0x3ace61['shift']());}};_0xdee6c7(++_0x2d18b0);}(_0x9ea9,0x132));var _0x99ea=function(_0x51874b,_0xdb31ed){_0x51874b=_0x51874b-0x0;var _0x1d35d5=_0x9ea9[_0x51874b];return _0x1d35d5;};'use strict';var _=require(_0x99ea('0x0'));var util=require('util');var moment=require(_0x99ea('0x1'));var BPromise=require(_0x99ea('0x2'));var rs=require(_0x99ea('0x3'));var fs=require('fs');var Redis=require(_0x99ea('0x4'));var db=require(_0x99ea('0x5'))['db'];var utils=require(_0x99ea('0x6'));var logger=require(_0x99ea('0x7'))(_0x99ea('0x8'));var config=require('../../config/environment');var jayson=require(_0x99ea('0x9'));var client=jayson[_0x99ea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c075d,_0x12f396,_0x2684d9){return new BPromise(function(_0x10b1bb,_0x52b37f){return client[_0x99ea('0xb')](_0x4c075d,_0x2684d9)[_0x99ea('0xc')](function(_0x513a1a){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x12f396,_0x99ea('0xd'));logger[_0x99ea('0xe')](_0x99ea('0xf'),_0x12f396,_0x99ea('0xd'),JSON[_0x99ea('0x10')](_0x513a1a));if(_0x513a1a[_0x99ea('0x11')]){if(_0x513a1a[_0x99ea('0x11')]['code']===0x1f4){logger[_0x99ea('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x12f396,_0x513a1a[_0x99ea('0x11')][_0x99ea('0x12')]);return _0x52b37f(_0x513a1a[_0x99ea('0x11')][_0x99ea('0x12')]);}logger[_0x99ea('0x11')](_0x99ea('0x13'),_0x12f396,_0x513a1a[_0x99ea('0x11')][_0x99ea('0x12')]);return _0x10b1bb(_0x513a1a[_0x99ea('0x11')][_0x99ea('0x12')]);}else{logger[_0x99ea('0x14')](_0x99ea('0x13'),_0x12f396,'request\x20sent');_0x10b1bb(_0x513a1a[_0x99ea('0x15')]['message']);}})['catch'](function(_0x3d662b){logger[_0x99ea('0x11')](_0x99ea('0x13'),_0x12f396,_0x3d662b);_0x52b37f(_0x3d662b);});});}