Built motion from commit ae138b72.|2.6.28
[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 _0x0bd6=['FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4cf59a,_0x3d3fb0){var _0x513f00=function(_0x4c4ef9){while(--_0x4c4ef9){_0x4cf59a['push'](_0x4cf59a['shift']());}};_0x513f00(++_0x3d3fb0);}(_0x0bd6,0xcd));var _0x60bd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0bd6[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x60bd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60bd('0x1'));var rs=require(_0x60bd('0x2'));var fs=require('fs');var Redis=require(_0x60bd('0x3'));var db=require(_0x60bd('0x4'))['db'];var utils=require(_0x60bd('0x5'));var logger=require(_0x60bd('0x6'))(_0x60bd('0x7'));var config=require(_0x60bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x60bd('0x9')][_0x60bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x989cf0,_0x42473c,_0x3752b4){return new BPromise(function(_0x55a568,_0x5e281e){return client['request'](_0x989cf0,_0x3752b4)[_0x60bd('0xb')](function(_0x2e78c2){logger['info'](_0x60bd('0xc'),_0x42473c,_0x60bd('0xd'));logger[_0x60bd('0xe')](_0x60bd('0xf'),_0x42473c,'request\x20sent',JSON[_0x60bd('0x10')](_0x2e78c2));if(_0x2e78c2[_0x60bd('0x11')]){if(_0x2e78c2[_0x60bd('0x11')][_0x60bd('0x12')]===0x1f4){logger[_0x60bd('0x11')](_0x60bd('0xc'),_0x42473c,_0x2e78c2['error'][_0x60bd('0x13')]);return _0x5e281e(_0x2e78c2[_0x60bd('0x11')][_0x60bd('0x13')]);}logger[_0x60bd('0x11')](_0x60bd('0xc'),_0x42473c,_0x2e78c2[_0x60bd('0x11')][_0x60bd('0x13')]);return _0x55a568(_0x2e78c2[_0x60bd('0x11')][_0x60bd('0x13')]);}else{logger[_0x60bd('0x14')](_0x60bd('0xc'),_0x42473c,_0x60bd('0xd'));_0x55a568(_0x2e78c2['result'][_0x60bd('0x13')]);}})[_0x60bd('0x15')](function(_0xe6d744){logger[_0x60bd('0x11')](_0x60bd('0xc'),_0x42473c,_0xe6d744);_0x5e281e(_0xe6d744);});});}