bddd82908109e273a6f64760892b27873fc8b721
[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 _0x515a=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x244c67,_0x127444){var _0x530f5c=function(_0x3c706b){while(--_0x3c706b){_0x244c67['push'](_0x244c67['shift']());}};_0x530f5c(++_0x127444);}(_0x515a,0x1cb));var _0xa515=function(_0x18201a,_0xf19284){_0x18201a=_0x18201a-0x0;var _0x118972=_0x515a[_0x18201a];return _0x118972;};'use strict';var _=require(_0xa515('0x0'));var util=require(_0xa515('0x1'));var moment=require(_0xa515('0x2'));var BPromise=require(_0xa515('0x3'));var rs=require(_0xa515('0x4'));var fs=require('fs');var Redis=require(_0xa515('0x5'));var db=require(_0xa515('0x6'))['db'];var utils=require(_0xa515('0x7'));var logger=require('../../config/logger')(_0xa515('0x8'));var config=require(_0xa515('0x9'));var jayson=require(_0xa515('0xa'));var client=jayson[_0xa515('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdb5733,_0x278703,_0x5546d1){return new BPromise(function(_0x12dc16,_0x15d888){return client['request'](_0xdb5733,_0x5546d1)[_0xa515('0xc')](function(_0x4aa4b8){logger[_0xa515('0xd')](_0xa515('0xe'),_0x278703,_0xa515('0xf'));logger[_0xa515('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x278703,_0xa515('0xf'),JSON[_0xa515('0x11')](_0x4aa4b8));if(_0x4aa4b8[_0xa515('0x12')]){if(_0x4aa4b8['error'][_0xa515('0x13')]===0x1f4){logger[_0xa515('0x12')](_0xa515('0xe'),_0x278703,_0x4aa4b8[_0xa515('0x12')][_0xa515('0x14')]);return _0x15d888(_0x4aa4b8[_0xa515('0x12')]['message']);}logger[_0xa515('0x12')](_0xa515('0xe'),_0x278703,_0x4aa4b8['error'][_0xa515('0x14')]);return _0x12dc16(_0x4aa4b8['error'][_0xa515('0x14')]);}else{logger[_0xa515('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x278703,'request\x20sent');_0x12dc16(_0x4aa4b8[_0xa515('0x15')][_0xa515('0x14')]);}})[_0xa515('0x16')](function(_0xe23e96){logger[_0xa515('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x278703,_0xe23e96);_0x15d888(_0xe23e96);});});}