Built motion from commit (unavailable).|2.5.21
[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 _0xc7f5=['../../config/environment','jayson/promise','client','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0xc7f5,0x15d));var _0x5c7f=function(_0x4498f2,_0x9cfe3d){_0x4498f2=_0x4498f2-0x0;var _0x3a7213=_0xc7f5[_0x4498f2];return _0x3a7213;};'use strict';var _=require('lodash');var util=require(_0x5c7f('0x0'));var moment=require(_0x5c7f('0x1'));var BPromise=require('bluebird');var rs=require(_0x5c7f('0x2'));var fs=require('fs');var Redis=require(_0x5c7f('0x3'));var db=require(_0x5c7f('0x4'))['db'];var utils=require(_0x5c7f('0x5'));var logger=require(_0x5c7f('0x6'))(_0x5c7f('0x7'));var config=require(_0x5c7f('0x8'));var jayson=require(_0x5c7f('0x9'));var client=jayson[_0x5c7f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54d112,_0x29b5b6,_0x3f9191){return new BPromise(function(_0x36af99,_0x33f789){return client[_0x5c7f('0xb')](_0x54d112,_0x3f9191)['then'](function(_0x135fd1){logger['info'](_0x5c7f('0xc'),_0x29b5b6,_0x5c7f('0xd'));logger[_0x5c7f('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x29b5b6,'request\x20sent',JSON[_0x5c7f('0xf')](_0x135fd1));if(_0x135fd1['error']){if(_0x135fd1['error'][_0x5c7f('0x10')]===0x1f4){logger[_0x5c7f('0x11')](_0x5c7f('0xc'),_0x29b5b6,_0x135fd1[_0x5c7f('0x11')][_0x5c7f('0x12')]);return _0x33f789(_0x135fd1[_0x5c7f('0x11')][_0x5c7f('0x12')]);}logger[_0x5c7f('0x11')](_0x5c7f('0xc'),_0x29b5b6,_0x135fd1[_0x5c7f('0x11')][_0x5c7f('0x12')]);return _0x36af99(_0x135fd1[_0x5c7f('0x11')]['message']);}else{logger[_0x5c7f('0x13')](_0x5c7f('0xc'),_0x29b5b6,_0x5c7f('0xd'));_0x36af99(_0x135fd1[_0x5c7f('0x14')][_0x5c7f('0x12')]);}})['catch'](function(_0x552b45){logger['error'](_0x5c7f('0xc'),_0x29b5b6,_0x552b45);_0x33f789(_0x552b45);});});}