Built motion from commit (unavailable).|2.5.23
[motion2.git] / server / api / smsTransferReport / smsTransferReport.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 _0x2c33=['SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','then'];(function(_0xee2c7c,_0x2d01e3){var _0x464403=function(_0x327f36){while(--_0x327f36){_0xee2c7c['push'](_0xee2c7c['shift']());}};_0x464403(++_0x2d01e3);}(_0x2c33,0x75));var _0x32c3=function(_0x1c4c64,_0xec753d){_0x1c4c64=_0x1c4c64-0x0;var _0x3a948e=_0x2c33[_0x1c4c64];return _0x3a948e;};'use strict';var _=require(_0x32c3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x32c3('0x1'));var rs=require(_0x32c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x32c3('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x32c3('0x4'));var config=require('../../config/environment');var jayson=require(_0x32c3('0x5'));var client=jayson[_0x32c3('0x6')][_0x32c3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1224ba,_0xdec85,_0x26b016){return new BPromise(function(_0x2770ab,_0x12e63b){return client['request'](_0x1224ba,_0x26b016)[_0x32c3('0x8')](function(_0x27feff){logger['info'](_0x32c3('0x9'),_0xdec85,_0x32c3('0xa'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0xdec85,_0x32c3('0xa'),JSON[_0x32c3('0xb')](_0x27feff));if(_0x27feff[_0x32c3('0xc')]){if(_0x27feff[_0x32c3('0xc')][_0x32c3('0xd')]===0x1f4){logger[_0x32c3('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0xdec85,_0x27feff[_0x32c3('0xc')][_0x32c3('0xe')]);return _0x12e63b(_0x27feff[_0x32c3('0xc')]['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0xdec85,_0x27feff[_0x32c3('0xc')][_0x32c3('0xe')]);return _0x2770ab(_0x27feff[_0x32c3('0xc')][_0x32c3('0xe')]);}else{logger[_0x32c3('0xf')](_0x32c3('0x9'),_0xdec85,_0x32c3('0xa'));_0x2770ab(_0x27feff[_0x32c3('0x10')][_0x32c3('0xe')]);}})[_0x32c3('0x11')](function(_0x5dbd44){logger[_0x32c3('0xc')](_0x32c3('0x9'),_0xdec85,_0x5dbd44);_0x12e63b(_0x5dbd44);});});}