0a1a36d27d70128cb716d0cfc1f1240e17917ab0
[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 _0x6153=['catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','result'];(function(_0x5a78a5,_0x288800){var _0x223e33=function(_0x4c57d0){while(--_0x4c57d0){_0x5a78a5['push'](_0x5a78a5['shift']());}};_0x223e33(++_0x288800);}(_0x6153,0x1cf));var _0x3615=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6153[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3615('0x0'));var util=require(_0x3615('0x1'));var moment=require(_0x3615('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3615('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3615('0x4'));var logger=require(_0x3615('0x5'))(_0x3615('0x6'));var config=require(_0x3615('0x7'));var jayson=require(_0x3615('0x8'));var client=jayson['client'][_0x3615('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x228e0b,_0x2d34b7,_0x3ee84b){return new BPromise(function(_0x11a971,_0x5aed2a){return client[_0x3615('0xa')](_0x228e0b,_0x3ee84b)[_0x3615('0xb')](function(_0x10c0f6){logger[_0x3615('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x2d34b7,_0x3615('0xd'));logger['debug'](_0x3615('0xe'),_0x2d34b7,'request\x20sent',JSON[_0x3615('0xf')](_0x10c0f6));if(_0x10c0f6['error']){if(_0x10c0f6['error']['code']===0x1f4){logger[_0x3615('0x10')](_0x3615('0x11'),_0x2d34b7,_0x10c0f6['error'][_0x3615('0x12')]);return _0x5aed2a(_0x10c0f6['error'][_0x3615('0x12')]);}logger[_0x3615('0x10')](_0x3615('0x11'),_0x2d34b7,_0x10c0f6[_0x3615('0x10')][_0x3615('0x12')]);return _0x11a971(_0x10c0f6[_0x3615('0x10')]['message']);}else{logger[_0x3615('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x2d34b7,_0x3615('0xd'));_0x11a971(_0x10c0f6[_0x3615('0x13')]['message']);}})[_0x3615('0x14')](function(_0x310b78){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x2d34b7,_0x310b78);_0x5aed2a(_0x310b78);});});}