Built motion from commit 1ea47bf4.|2.6.34
[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 _0xf6b8=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xf6b8,0x121));var _0x8f6b=function(_0x445cb6,_0x57cc15){_0x445cb6=_0x445cb6-0x0;var _0x38c54f=_0xf6b8[_0x445cb6];return _0x38c54f;};'use strict';var _=require(_0x8f6b('0x0'));var util=require(_0x8f6b('0x1'));var moment=require(_0x8f6b('0x2'));var BPromise=require(_0x8f6b('0x3'));var rs=require(_0x8f6b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8f6b('0x5'));var logger=require('../../config/logger')(_0x8f6b('0x6'));var config=require(_0x8f6b('0x7'));var jayson=require(_0x8f6b('0x8'));var client=jayson[_0x8f6b('0x9')][_0x8f6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x452e49,_0x5b0ee9,_0x3a8722){return new BPromise(function(_0x4aa394,_0x30519e){return client['request'](_0x452e49,_0x3a8722)[_0x8f6b('0xb')](function(_0x537dac){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x5b0ee9,_0x8f6b('0xc'));logger[_0x8f6b('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x5b0ee9,_0x8f6b('0xc'),JSON[_0x8f6b('0xe')](_0x537dac));if(_0x537dac[_0x8f6b('0xf')]){if(_0x537dac[_0x8f6b('0xf')]['code']===0x1f4){logger[_0x8f6b('0xf')](_0x8f6b('0x10'),_0x5b0ee9,_0x537dac[_0x8f6b('0xf')][_0x8f6b('0x11')]);return _0x30519e(_0x537dac[_0x8f6b('0xf')][_0x8f6b('0x11')]);}logger[_0x8f6b('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x5b0ee9,_0x537dac[_0x8f6b('0xf')]['message']);return _0x4aa394(_0x537dac[_0x8f6b('0xf')][_0x8f6b('0x11')]);}else{logger[_0x8f6b('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x5b0ee9,_0x8f6b('0xc'));_0x4aa394(_0x537dac[_0x8f6b('0x13')][_0x8f6b('0x11')]);}})[_0x8f6b('0x14')](function(_0x58ac27){logger[_0x8f6b('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x5b0ee9,_0x58ac27);_0x30519e(_0x58ac27);});});}