d4616421da27733ae20e9fb63857b64bdb0248ed
[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 _0xc9f5=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x35625f,_0x51173f){var _0x4c5012=function(_0x5dcafd){while(--_0x5dcafd){_0x35625f['push'](_0x35625f['shift']());}};_0x4c5012(++_0x51173f);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0xc9f5[_0x34f701];return _0x3e2429;};'use strict';var _=require('lodash');var util=require(_0x5c9f('0x0'));var moment=require(_0x5c9f('0x1'));var BPromise=require('bluebird');var rs=require(_0x5c9f('0x2'));var fs=require('fs');var Redis=require(_0x5c9f('0x3'));var db=require(_0x5c9f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5c9f('0x5'));var config=require('../../config/environment');var jayson=require(_0x5c9f('0x6'));var client=jayson['client'][_0x5c9f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a3cc8,_0x420a0c,_0x11e390){return new BPromise(function(_0x3c8444,_0x274b97){return client[_0x5c9f('0x8')](_0x3a3cc8,_0x11e390)[_0x5c9f('0x9')](function(_0x279b07){logger[_0x5c9f('0xa')](_0x5c9f('0xb'),_0x420a0c,_0x5c9f('0xc'));logger[_0x5c9f('0xd')](_0x5c9f('0xe'),_0x420a0c,_0x5c9f('0xc'),JSON[_0x5c9f('0xf')](_0x279b07));if(_0x279b07[_0x5c9f('0x10')]){if(_0x279b07['error'][_0x5c9f('0x11')]===0x1f4){logger[_0x5c9f('0x10')](_0x5c9f('0xb'),_0x420a0c,_0x279b07[_0x5c9f('0x10')][_0x5c9f('0x12')]);return _0x274b97(_0x279b07[_0x5c9f('0x10')]['message']);}logger[_0x5c9f('0x10')](_0x5c9f('0xb'),_0x420a0c,_0x279b07[_0x5c9f('0x10')][_0x5c9f('0x12')]);return _0x3c8444(_0x279b07[_0x5c9f('0x10')][_0x5c9f('0x12')]);}else{logger[_0x5c9f('0xa')](_0x5c9f('0xb'),_0x420a0c,_0x5c9f('0xc'));_0x3c8444(_0x279b07['result']['message']);}})['catch'](function(_0x48feaf){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x420a0c,_0x48feaf);_0x274b97(_0x48feaf);});});}