Built motion from commit 6362bb75.|2.6.13
[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 _0x956a=['message','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3a3051,_0xa76b99){var _0x40e6f4=function(_0xf08381){while(--_0xf08381){_0x3a3051['push'](_0x3a3051['shift']());}};_0x40e6f4(++_0xa76b99);}(_0x956a,0xb6));var _0xa956=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x956a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0xa956('0x0'));var moment=require(_0xa956('0x1'));var BPromise=require(_0xa956('0x2'));var rs=require(_0xa956('0x3'));var fs=require('fs');var Redis=require(_0xa956('0x4'));var db=require(_0xa956('0x5'))['db'];var utils=require(_0xa956('0x6'));var logger=require(_0xa956('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa956('0x8'));var client=jayson[_0xa956('0x9')][_0xa956('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f1684,_0xdaa956,_0x1318ea){return new BPromise(function(_0x1265dd,_0x10f0e3){return client[_0xa956('0xb')](_0x5f1684,_0x1318ea)[_0xa956('0xc')](function(_0x380479){logger['info'](_0xa956('0xd'),_0xdaa956,_0xa956('0xe'));logger['debug'](_0xa956('0xf'),_0xdaa956,_0xa956('0xe'),JSON['stringify'](_0x380479));if(_0x380479['error']){if(_0x380479[_0xa956('0x10')][_0xa956('0x11')]===0x1f4){logger[_0xa956('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0xdaa956,_0x380479[_0xa956('0x10')][_0xa956('0x12')]);return _0x10f0e3(_0x380479[_0xa956('0x10')]['message']);}logger['error'](_0xa956('0xd'),_0xdaa956,_0x380479['error']['message']);return _0x1265dd(_0x380479[_0xa956('0x10')][_0xa956('0x12')]);}else{logger[_0xa956('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0xdaa956,'request\x20sent');_0x1265dd(_0x380479['result'][_0xa956('0x12')]);}})['catch'](function(_0x36e181){logger[_0xa956('0x10')](_0xa956('0xd'),_0xdaa956,_0x36e181);_0x10f0e3(_0x36e181);});});}