7fcf7e4713b393c9554381e97119eb94665b9a64
[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 _0x1171=['error','code','message','catch','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4539d7,_0x2ce3e1){var _0x28f5ce=function(_0x301e23){while(--_0x301e23){_0x4539d7['push'](_0x4539d7['shift']());}};_0x28f5ce(++_0x2ce3e1);}(_0x1171,0x11c));var _0x1117=function(_0xc8a598,_0x8ffd7c){_0xc8a598=_0xc8a598-0x0;var _0x2a6225=_0x1171[_0xc8a598];return _0x2a6225;};'use strict';var _=require(_0x1117('0x0'));var util=require(_0x1117('0x1'));var moment=require(_0x1117('0x2'));var BPromise=require(_0x1117('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1117('0x4'));var logger=require('../../config/logger')(_0x1117('0x5'));var config=require(_0x1117('0x6'));var jayson=require(_0x1117('0x7'));var client=jayson[_0x1117('0x8')][_0x1117('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x104a3f,_0x5714ab,_0x10ddec){return new BPromise(function(_0x127918,_0x21f7af){return client[_0x1117('0xa')](_0x104a3f,_0x10ddec)['then'](function(_0x33c7f1){logger[_0x1117('0xb')](_0x1117('0xc'),_0x5714ab,_0x1117('0xd'));logger['debug'](_0x1117('0xe'),_0x5714ab,'request\x20sent',JSON[_0x1117('0xf')](_0x33c7f1));if(_0x33c7f1[_0x1117('0x10')]){if(_0x33c7f1[_0x1117('0x10')][_0x1117('0x11')]===0x1f4){logger[_0x1117('0x10')](_0x1117('0xc'),_0x5714ab,_0x33c7f1[_0x1117('0x10')][_0x1117('0x12')]);return _0x21f7af(_0x33c7f1[_0x1117('0x10')][_0x1117('0x12')]);}logger['error'](_0x1117('0xc'),_0x5714ab,_0x33c7f1[_0x1117('0x10')]['message']);return _0x127918(_0x33c7f1[_0x1117('0x10')][_0x1117('0x12')]);}else{logger[_0x1117('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x5714ab,_0x1117('0xd'));_0x127918(_0x33c7f1['result'][_0x1117('0x12')]);}})[_0x1117('0x13')](function(_0x111018){logger[_0x1117('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x5714ab,_0x111018);_0x21f7af(_0x111018);});});}