Built motion from commit bab6f49e.|2.6.17
[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 _0x197a=['client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x197a,0x1d8));var _0xa197=function(_0x23428f,_0x288620){_0x23428f=_0x23428f-0x0;var _0x4a1f23=_0x197a[_0x23428f];return _0x4a1f23;};'use strict';var _=require(_0xa197('0x0'));var util=require(_0xa197('0x1'));var moment=require('moment');var BPromise=require(_0xa197('0x2'));var rs=require(_0xa197('0x3'));var fs=require('fs');var Redis=require(_0xa197('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa197('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa197('0x6'));var jayson=require(_0xa197('0x7'));var client=jayson[_0xa197('0x8')][_0xa197('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57337a,_0x332504,_0x532d6e){return new BPromise(function(_0x5e7f46,_0x5adb8f){return client['request'](_0x57337a,_0x532d6e)[_0xa197('0xa')](function(_0x179bbf){logger[_0xa197('0xb')](_0xa197('0xc'),_0x332504,_0xa197('0xd'));logger['debug'](_0xa197('0xe'),_0x332504,_0xa197('0xd'),JSON[_0xa197('0xf')](_0x179bbf));if(_0x179bbf['error']){if(_0x179bbf[_0xa197('0x10')]['code']===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x332504,_0x179bbf[_0xa197('0x10')][_0xa197('0x11')]);return _0x5adb8f(_0x179bbf[_0xa197('0x10')][_0xa197('0x11')]);}logger[_0xa197('0x10')](_0xa197('0xc'),_0x332504,_0x179bbf[_0xa197('0x10')][_0xa197('0x11')]);return _0x5e7f46(_0x179bbf['error']['message']);}else{logger[_0xa197('0xb')](_0xa197('0xc'),_0x332504,_0xa197('0xd'));_0x5e7f46(_0x179bbf[_0xa197('0x12')][_0xa197('0x11')]);}})[_0xa197('0x13')](function(_0x245b09){logger[_0xa197('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x332504,_0x245b09);_0x5adb8f(_0x245b09);});});}