4e2b4ecf396069a8b04529e50cf043da29f408d3
[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 _0xc3f4=['util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1ad346,_0x4788a4){var _0x19c508=function(_0xbc072e){while(--_0xbc072e){_0x1ad346['push'](_0x1ad346['shift']());}};_0x19c508(++_0x4788a4);}(_0xc3f4,0x18f));var _0x4c3f=function(_0x34e9a0,_0x3dc08a){_0x34e9a0=_0x34e9a0-0x0;var _0x2a1f4b=_0xc3f4[_0x34e9a0];return _0x2a1f4b;};'use strict';var _=require(_0x4c3f('0x0'));var util=require(_0x4c3f('0x1'));var moment=require('moment');var BPromise=require(_0x4c3f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4c3f('0x3'));var db=require(_0x4c3f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c3f('0x5'))(_0x4c3f('0x6'));var config=require('../../config/environment');var jayson=require(_0x4c3f('0x7'));var client=jayson[_0x4c3f('0x8')][_0x4c3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553fae,_0x1cf00d,_0x1100cc){return new BPromise(function(_0x59b4c8,_0x5d56d0){return client[_0x4c3f('0xa')](_0x553fae,_0x1100cc)[_0x4c3f('0xb')](function(_0x287675){logger[_0x4c3f('0xc')](_0x4c3f('0xd'),_0x1cf00d,'request\x20sent');logger['debug'](_0x4c3f('0xe'),_0x1cf00d,'request\x20sent',JSON[_0x4c3f('0xf')](_0x287675));if(_0x287675[_0x4c3f('0x10')]){if(_0x287675[_0x4c3f('0x10')][_0x4c3f('0x11')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x1cf00d,_0x287675[_0x4c3f('0x10')][_0x4c3f('0x12')]);return _0x5d56d0(_0x287675[_0x4c3f('0x10')][_0x4c3f('0x12')]);}logger[_0x4c3f('0x10')](_0x4c3f('0xd'),_0x1cf00d,_0x287675[_0x4c3f('0x10')][_0x4c3f('0x12')]);return _0x59b4c8(_0x287675[_0x4c3f('0x10')]['message']);}else{logger[_0x4c3f('0xc')](_0x4c3f('0xd'),_0x1cf00d,'request\x20sent');_0x59b4c8(_0x287675[_0x4c3f('0x13')][_0x4c3f('0x12')]);}})['catch'](function(_0x5b885f){logger[_0x4c3f('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x1cf00d,_0x5b885f);_0x5d56d0(_0x5b885f);});});}