0955c05a9e1ab9913aa17d47d8f867e35b8c9c45
[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 _0x9459=['debug','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x53afa6,_0x59e786){var _0x51f86a=function(_0x368385){while(--_0x368385){_0x53afa6['push'](_0x53afa6['shift']());}};_0x51f86a(++_0x59e786);}(_0x9459,0x117));var _0x9945=function(_0x38d53a,_0x2608df){_0x38d53a=_0x38d53a-0x0;var _0xf7d504=_0x9459[_0x38d53a];return _0xf7d504;};'use strict';var _=require(_0x9945('0x0'));var util=require(_0x9945('0x1'));var moment=require('moment');var BPromise=require(_0x9945('0x2'));var rs=require(_0x9945('0x3'));var fs=require('fs');var Redis=require(_0x9945('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9945('0x5'));var logger=require(_0x9945('0x6'))(_0x9945('0x7'));var config=require(_0x9945('0x8'));var jayson=require(_0x9945('0x9'));var client=jayson['client'][_0x9945('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2363c7,_0x242249,_0x5782a7){return new BPromise(function(_0x5257e8,_0x3f760e){return client['request'](_0x2363c7,_0x5782a7)[_0x9945('0xb')](function(_0xe8cc4c){logger[_0x9945('0xc')](_0x9945('0xd'),_0x242249,_0x9945('0xe'));logger[_0x9945('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x242249,_0x9945('0xe'),JSON['stringify'](_0xe8cc4c));if(_0xe8cc4c[_0x9945('0x10')]){if(_0xe8cc4c[_0x9945('0x10')][_0x9945('0x11')]===0x1f4){logger['error'](_0x9945('0xd'),_0x242249,_0xe8cc4c[_0x9945('0x10')][_0x9945('0x12')]);return _0x3f760e(_0xe8cc4c[_0x9945('0x10')][_0x9945('0x12')]);}logger[_0x9945('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x242249,_0xe8cc4c['error'][_0x9945('0x12')]);return _0x5257e8(_0xe8cc4c[_0x9945('0x10')]['message']);}else{logger[_0x9945('0xc')](_0x9945('0xd'),_0x242249,_0x9945('0xe'));_0x5257e8(_0xe8cc4c[_0x9945('0x13')]['message']);}})[_0x9945('0x14')](function(_0x2e4d59){logger[_0x9945('0x10')](_0x9945('0xd'),_0x242249,_0x2e4d59);_0x3f760e(_0x2e4d59);});});}