Built motion from commit 85328c08.|2.5.50
[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 _0x034e=['code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x10c7da,_0x462b67){var _0x418d36=function(_0x54d242){while(--_0x54d242){_0x10c7da['push'](_0x10c7da['shift']());}};_0x418d36(++_0x462b67);}(_0x034e,0x1e4));var _0xe034=function(_0x1131ac,_0x3e329a){_0x1131ac=_0x1131ac-0x0;var _0x2f5c39=_0x034e[_0x1131ac];return _0x2f5c39;};'use strict';var _=require(_0xe034('0x0'));var util=require('util');var moment=require(_0xe034('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe034('0x2'));var db=require(_0xe034('0x3'))['db'];var utils=require(_0xe034('0x4'));var logger=require('../../config/logger')(_0xe034('0x5'));var config=require(_0xe034('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe034('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40e2c5,_0xe7c329,_0x2c46e0){return new BPromise(function(_0x170e5c,_0x45e8c2){return client['request'](_0x40e2c5,_0x2c46e0)[_0xe034('0x8')](function(_0x440e09){logger[_0xe034('0x9')](_0xe034('0xa'),_0xe7c329,'request\x20sent');logger[_0xe034('0xb')](_0xe034('0xc'),_0xe7c329,_0xe034('0xd'),JSON[_0xe034('0xe')](_0x440e09));if(_0x440e09[_0xe034('0xf')]){if(_0x440e09['error'][_0xe034('0x10')]===0x1f4){logger['error'](_0xe034('0xa'),_0xe7c329,_0x440e09[_0xe034('0xf')][_0xe034('0x11')]);return _0x45e8c2(_0x440e09[_0xe034('0xf')][_0xe034('0x11')]);}logger[_0xe034('0xf')](_0xe034('0xa'),_0xe7c329,_0x440e09['error'][_0xe034('0x11')]);return _0x170e5c(_0x440e09['error'][_0xe034('0x11')]);}else{logger['info'](_0xe034('0xa'),_0xe7c329,_0xe034('0xd'));_0x170e5c(_0x440e09[_0xe034('0x12')][_0xe034('0x11')]);}})[_0xe034('0x13')](function(_0x2ad4ba){logger[_0xe034('0xf')](_0xe034('0xa'),_0xe7c329,_0x2ad4ba);_0x45e8c2(_0x2ad4ba);});});}