Built motion from commit ddca4d0d.|2.5.47
[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 _0x2738=['jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x217a6f,_0x3ecd8b){var _0x5553f3=function(_0x24b9c0){while(--_0x24b9c0){_0x217a6f['push'](_0x217a6f['shift']());}};_0x5553f3(++_0x3ecd8b);}(_0x2738,0x195));var _0x8273=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0x2738[_0x17406a];return _0x1501ff;};'use strict';var _=require('lodash');var util=require(_0x8273('0x0'));var moment=require(_0x8273('0x1'));var BPromise=require(_0x8273('0x2'));var rs=require(_0x8273('0x3'));var fs=require('fs');var Redis=require(_0x8273('0x4'));var db=require(_0x8273('0x5'))['db'];var utils=require(_0x8273('0x6'));var logger=require('../../config/logger')(_0x8273('0x7'));var config=require(_0x8273('0x8'));var jayson=require(_0x8273('0x9'));var client=jayson[_0x8273('0xa')][_0x8273('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x475b46,_0x49ca98,_0x52efe9){return new BPromise(function(_0x4acb6f,_0x3fd2c2){return client[_0x8273('0xc')](_0x475b46,_0x52efe9)[_0x8273('0xd')](function(_0x7a75c4){logger[_0x8273('0xe')](_0x8273('0xf'),_0x49ca98,'request\x20sent');logger[_0x8273('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x49ca98,'request\x20sent',JSON['stringify'](_0x7a75c4));if(_0x7a75c4[_0x8273('0x11')]){if(_0x7a75c4[_0x8273('0x11')][_0x8273('0x12')]===0x1f4){logger[_0x8273('0x11')](_0x8273('0xf'),_0x49ca98,_0x7a75c4[_0x8273('0x11')]['message']);return _0x3fd2c2(_0x7a75c4[_0x8273('0x11')][_0x8273('0x13')]);}logger[_0x8273('0x11')](_0x8273('0xf'),_0x49ca98,_0x7a75c4[_0x8273('0x11')][_0x8273('0x13')]);return _0x4acb6f(_0x7a75c4[_0x8273('0x11')][_0x8273('0x13')]);}else{logger[_0x8273('0xe')](_0x8273('0xf'),_0x49ca98,_0x8273('0x14'));_0x4acb6f(_0x7a75c4[_0x8273('0x15')][_0x8273('0x13')]);}})[_0x8273('0x16')](function(_0x4f7fc2){logger[_0x8273('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x49ca98,_0x4f7fc2);_0x3fd2c2(_0x4f7fc2);});});}