ed30ccdb4016c1cdc9ae5a45fbc75b550dc044d1
[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 _0xf8cd=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0xf8cd,0x1c6));var _0xdf8c=function(_0x217fdb,_0x57826d){_0x217fdb=_0x217fdb-0x0;var _0x4cb03e=_0xf8cd[_0x217fdb];return _0x4cb03e;};'use strict';var _=require(_0xdf8c('0x0'));var util=require(_0xdf8c('0x1'));var moment=require('moment');var BPromise=require(_0xdf8c('0x2'));var rs=require(_0xdf8c('0x3'));var fs=require('fs');var Redis=require(_0xdf8c('0x4'));var db=require(_0xdf8c('0x5'))['db'];var utils=require(_0xdf8c('0x6'));var logger=require(_0xdf8c('0x7'))('rpc');var config=require(_0xdf8c('0x8'));var jayson=require(_0xdf8c('0x9'));var client=jayson[_0xdf8c('0xa')][_0xdf8c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41f67e,_0x5b4948,_0x4b7787){return new BPromise(function(_0xd9319b,_0x3a10fc){return client[_0xdf8c('0xc')](_0x41f67e,_0x4b7787)[_0xdf8c('0xd')](function(_0x1e6e30){logger['info'](_0xdf8c('0xe'),_0x5b4948,_0xdf8c('0xf'));logger[_0xdf8c('0x10')](_0xdf8c('0x11'),_0x5b4948,'request\x20sent',JSON[_0xdf8c('0x12')](_0x1e6e30));if(_0x1e6e30[_0xdf8c('0x13')]){if(_0x1e6e30[_0xdf8c('0x13')]['code']===0x1f4){logger[_0xdf8c('0x13')](_0xdf8c('0xe'),_0x5b4948,_0x1e6e30[_0xdf8c('0x13')][_0xdf8c('0x14')]);return _0x3a10fc(_0x1e6e30[_0xdf8c('0x13')][_0xdf8c('0x14')]);}logger[_0xdf8c('0x13')](_0xdf8c('0xe'),_0x5b4948,_0x1e6e30['error']['message']);return _0xd9319b(_0x1e6e30[_0xdf8c('0x13')][_0xdf8c('0x14')]);}else{logger[_0xdf8c('0x15')]('FaxTransferReport,\x20%s,\x20%s',_0x5b4948,'request\x20sent');_0xd9319b(_0x1e6e30[_0xdf8c('0x16')]['message']);}})[_0xdf8c('0x17')](function(_0x410607){logger['error'](_0xdf8c('0xe'),_0x5b4948,_0x410607);_0x3a10fc(_0x410607);});});}