Built motion from commit (unavailable).|2.5.13
[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 _0x498e=['moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','error','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x498e,0x98));var _0xe498=function(_0xbed746,_0x495929){_0xbed746=_0xbed746-0x0;var _0x381012=_0x498e[_0xbed746];return _0x381012;};'use strict';var _=require(_0xe498('0x0'));var util=require('util');var moment=require(_0xe498('0x1'));var BPromise=require(_0xe498('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe498('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe498('0x4'))(_0xe498('0x5'));var config=require(_0xe498('0x6'));var jayson=require(_0xe498('0x7'));var client=jayson['client'][_0xe498('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x539a9f,_0xb54a30,_0x1a6456){return new BPromise(function(_0x5c4310,_0x1697e7){return client['request'](_0x539a9f,_0x1a6456)[_0xe498('0x9')](function(_0x382832){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0xb54a30,_0xe498('0xa'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0xb54a30,_0xe498('0xa'),JSON['stringify'](_0x382832));if(_0x382832[_0xe498('0xb')]){if(_0x382832[_0xe498('0xb')]['code']===0x1f4){logger[_0xe498('0xb')](_0xe498('0xc'),_0xb54a30,_0x382832[_0xe498('0xb')][_0xe498('0xd')]);return _0x1697e7(_0x382832['error'][_0xe498('0xd')]);}logger[_0xe498('0xb')](_0xe498('0xc'),_0xb54a30,_0x382832[_0xe498('0xb')][_0xe498('0xd')]);return _0x5c4310(_0x382832[_0xe498('0xb')][_0xe498('0xd')]);}else{logger[_0xe498('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0xb54a30,_0xe498('0xa'));_0x5c4310(_0x382832[_0xe498('0xf')][_0xe498('0xd')]);}})[_0xe498('0x10')](function(_0x1ee97e){logger[_0xe498('0xb')](_0xe498('0xc'),_0xb54a30,_0x1ee97e);_0x1697e7(_0x1ee97e);});});}