Built motion from commit 20b39a97.|2.6.29
[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 _0x9b7e=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x2bf47f,_0x4ab9ff){var _0x3fc18d=function(_0x3aa9d2){while(--_0x3aa9d2){_0x2bf47f['push'](_0x2bf47f['shift']());}};_0x3fc18d(++_0x4ab9ff);}(_0x9b7e,0xc8));var _0xe9b7=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x9b7e[_0x3a7634];return _0x23bbe9;};'use strict';var _=require(_0xe9b7('0x0'));var util=require(_0xe9b7('0x1'));var moment=require(_0xe9b7('0x2'));var BPromise=require(_0xe9b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9b7('0x4'));var db=require(_0xe9b7('0x5'))['db'];var utils=require(_0xe9b7('0x6'));var logger=require(_0xe9b7('0x7'))(_0xe9b7('0x8'));var config=require(_0xe9b7('0x9'));var jayson=require(_0xe9b7('0xa'));var client=jayson[_0xe9b7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b045d,_0x3abf68,_0x63e756){return new BPromise(function(_0x2a8b10,_0x3d9bee){return client[_0xe9b7('0xc')](_0x5b045d,_0x63e756)[_0xe9b7('0xd')](function(_0x266c98){logger['info'](_0xe9b7('0xe'),_0x3abf68,'request\x20sent');logger[_0xe9b7('0xf')](_0xe9b7('0x10'),_0x3abf68,_0xe9b7('0x11'),JSON[_0xe9b7('0x12')](_0x266c98));if(_0x266c98[_0xe9b7('0x13')]){if(_0x266c98['error'][_0xe9b7('0x14')]===0x1f4){logger[_0xe9b7('0x13')](_0xe9b7('0xe'),_0x3abf68,_0x266c98[_0xe9b7('0x13')][_0xe9b7('0x15')]);return _0x3d9bee(_0x266c98[_0xe9b7('0x13')]['message']);}logger[_0xe9b7('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x3abf68,_0x266c98[_0xe9b7('0x13')]['message']);return _0x2a8b10(_0x266c98[_0xe9b7('0x13')][_0xe9b7('0x15')]);}else{logger[_0xe9b7('0x16')](_0xe9b7('0xe'),_0x3abf68,_0xe9b7('0x11'));_0x2a8b10(_0x266c98[_0xe9b7('0x17')][_0xe9b7('0x15')]);}})[_0xe9b7('0x18')](function(_0x2f29fd){logger[_0xe9b7('0x13')](_0xe9b7('0xe'),_0x3abf68,_0x2f29fd);_0x3d9bee(_0x2f29fd);});});}