Built motion from commit (unavailable).|2.4.7
[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 _0x4427=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x151418,_0x2cbffa){var _0x40e29a=function(_0xec4d7){while(--_0xec4d7){_0x151418['push'](_0x151418['shift']());}};_0x40e29a(++_0x2cbffa);}(_0x4427,0x193));var _0x7442=function(_0x7abcd6,_0x36548c){_0x7abcd6=_0x7abcd6-0x0;var _0x329aea=_0x4427[_0x7abcd6];return _0x329aea;};'use strict';var _=require(_0x7442('0x0'));var util=require(_0x7442('0x1'));var moment=require(_0x7442('0x2'));var BPromise=require(_0x7442('0x3'));var rs=require(_0x7442('0x4'));var fs=require('fs');var Redis=require(_0x7442('0x5'));var db=require(_0x7442('0x6'))['db'];var utils=require(_0x7442('0x7'));var logger=require(_0x7442('0x8'))(_0x7442('0x9'));var config=require('../../config/environment');var jayson=require(_0x7442('0xa'));var client=jayson[_0x7442('0xb')][_0x7442('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e4aee,_0x165b85,_0x549513){return new BPromise(function(_0x2cfc8e,_0x14d272){return client[_0x7442('0xd')](_0x4e4aee,_0x549513)['then'](function(_0x441ce1){logger['info'](_0x7442('0xe'),_0x165b85,_0x7442('0xf'));logger[_0x7442('0x10')](_0x7442('0x11'),_0x165b85,_0x7442('0xf'),JSON[_0x7442('0x12')](_0x441ce1));if(_0x441ce1[_0x7442('0x13')]){if(_0x441ce1['error'][_0x7442('0x14')]===0x1f4){logger[_0x7442('0x13')](_0x7442('0xe'),_0x165b85,_0x441ce1[_0x7442('0x13')][_0x7442('0x15')]);return _0x14d272(_0x441ce1[_0x7442('0x13')][_0x7442('0x15')]);}logger[_0x7442('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x165b85,_0x441ce1['error']['message']);return _0x2cfc8e(_0x441ce1[_0x7442('0x13')][_0x7442('0x15')]);}else{logger[_0x7442('0x16')](_0x7442('0xe'),_0x165b85,_0x7442('0xf'));_0x2cfc8e(_0x441ce1['result'][_0x7442('0x15')]);}})[_0x7442('0x17')](function(_0x40cf48){logger[_0x7442('0x13')](_0x7442('0xe'),_0x165b85,_0x40cf48);_0x14d272(_0x40cf48);});});}