Commit Graph

2105 Commits

Author SHA1 Message Date
ionutboangiu
d8464ce023 Update libraries 2023-05-03 10:02:15 +02:00
ionutboangiu
85cc7e03f0 Enable bijson support for SessionSv1 service
Add bidirectional support for sessions while maintaining changing the
current rpc service registration method. Modified methods in
sessionsbirpc.go file to satisfy the birpc.ClientConnector interface
and removed BiRPC prefix before creating the service that's to be
registered.
2023-05-03 10:02:15 +02:00
ionutboangiu
259fb83c47 Add the implementation for Sleep api in sessions/sessions.go
Before the implementation was done directly in the SessionSv1 method. The argument definition
was also moved from apier/v1 to utils.
2023-05-03 10:02:15 +02:00
ionutboangiu
cb7ea790de Update rpcclient library to latest version
Replace all instances of rpcclient.ClientConnector with birpc.ClientConnector.

Pass context, maxReconnectInterval, delayFunc and birpcClient to rpcclient
constructors.

Remove redundant time.Duration conversions (e.g. time.Duration(1*time.Second)
now becomes time.Second.

Add context where needed (context.Background() for tests, context.TODO()
for places where it should be passed from somewhere else).

Implement that functionality of the SessionSv1.Sleep call, in sessions/sessions
instead of apier/v1.

Make changes in utils/server.go (replacing the old rpc2 library with github.com/cgrates/birpc).

Change the way we register birpc methods for sessions in services, using a helper function
defined in engine/libengine.go.
2023-05-03 10:02:15 +02:00
ionutboangiu
4cd2dc3de8 Revise CDR rerating
The (*CDRServer).processEvent function is now called processEvents and can
be passed an array of CGREvents instead of only one. This was done because
when calling the RateCDRs API we want to first refund all CDRs before
starting to debit again.

The rerate parameter is now no longer hardcoded to true for the RateCDRs API.If
required, the "*rerate" flag must be provided by the caller.

Now, the refundEventCost function returns an additional boolean, that signals
whether the refund occured or didn't.

If the reRate parameter is set to true, also set refund to true.

In case CostDetails is not populated, retrieve it from StorDB if possible
and add it to the CGREvent before converting to CDRs. Set CostDetails back
to nil once the refund goes through.

Remove the refund logic from within the store block.

Now that the refund happens before the debit, revise the expected values for
the "testV1CDRsProcessEventWithRefund" subtest within the
apier/v1/cdrs_it_test.go file.

Add an integration test for the following scenario:
 -create one account with one balance of 1 free minute and rating for the rest.
 -send one CDR of two minutes with ProcessEvent. This should consume 60s out of
the free balance and charge 60s. The SetupTime in the CDR should be 1 hour after
the second CDR.
 -send the second CDR with an usage of 2m. This should be charged entirely.
 -send a RateCDR API call with OrderBy: "SetupTime". This should rerate the two
CDRs from above and change their order of rating.
2023-04-20 20:05:00 +02:00
ionutboangiu
15b404e8cf Revise randomly failing tests 2023-03-28 17:59:32 +02:00
ionutboangiu
ee7a0d131a Revise kafka poster integration test
When verifying whether the export was successful, read message by message instead of reading in batches.
2023-03-19 19:32:25 +01:00
ionutboangiu
01556a299f Revise it tests 2023-03-10 14:07:59 +01:00
ionutboangiu
24d5a654e5 Get rid of logs from kafka cdre test 2023-03-10 14:07:59 +01:00
gezimbll
7dcbd09a1f replacing non-meta constants for storage types 2023-03-08 19:14:24 +01:00
ionutboangiu
dbd497c4d4 Update to latest amqp 1.0 package version and fix compilation errors 2023-02-22 18:19:47 +01:00
ionutboangiu
edcb7d6e6b Update amqpv1 library and fix compilation errors 2023-02-21 18:26:01 +01:00
ionutboangiu
6a7fde0c99 Add integration tests for amqpv1 exporter 2023-02-20 19:45:08 +01:00
ionutboangiu
c9ec5e53c8 Leave exportPath unprocessed for kafka + tests 2023-02-20 19:45:08 +01:00
ionutboangiu
40943dda09 Add test for *amqp_json_cdr exporter 2023-02-20 19:45:08 +01:00
ionutboangiu
6f91f027c8 Leave exportPath unprocessed for s3&sqs + tests 2023-02-17 12:19:22 +01:00
gezimbll
5557cde746 IT test for setting balance uuid 2023-02-17 11:30:30 +01:00
ionutboangiu
c2a824a94b Leave export_path as is when exporting (AMQP) + tests 2023-02-16 11:25:20 +01:00
gezimbll
682904ad9d replacing streadway/amqp with rabbitmq/amqp091-go 2023-02-02 17:49:05 +01:00
adi
a551488cab Updated internal drv 2023-01-13 16:27:10 +01:00
adi
132d206266 Finished updates for mongo driver and tests 2023-01-07 17:49:13 +01:00
adi
c94ed8d123 Improved soME tests and driver 2022-12-27 18:29:32 +02:00
adi
d857079890 Dispatcher reverse filter indexes 2022-12-20 18:28:20 +02:00
adi
7ea41a6bc7 Added reverse filter indexes for attributes 2022-12-15 12:05:10 +02:00
adi
ae62ff3b1c Added reverse filter indexes for stats 2022-12-15 12:05:10 +02:00
adi
db4912e330 Added supplier filter indexes 2022-12-15 12:05:10 +02:00
adi
0139f213fc Added resource reverse indexes code 2022-12-13 17:10:47 +02:00
adi
4c3d1b60a0 Improved reverse idx code + thresholds implementation and tests 2022-12-12 11:15:43 +02:00
adi
5914213c96 Update filters without computing when overwriting + chargers case 2022-12-09 13:27:28 +02:00
adi
4ec5e420b0 Remove reverse filter indexes 2022-12-07 17:32:20 +02:00
adi
c9a9857152 Added relevant paratheses 2022-12-02 18:39:29 +02:00
ionutboangiu
1436bac61c Remove unnecessary paranthesis 2022-12-02 14:24:18 +02:00
ionutboangiu
a748ab629e Apply gofmt simplify code 2022-12-02 14:24:18 +02:00
ionutboangiu
82468c580d Replace deprecated ioutil library, remove redundant statements + small optimizations 2022-12-02 14:24:18 +02:00
ionutboangiu
bcd0a47268 Update radius library 2022-11-21 11:04:21 +01:00
ionutboangiu
758a94280a Apply project wide fmt 2022-11-16 10:13:44 +01:00
adi
a6445f641e Displays messages for agents when connect + fixes on call tests 2022-11-11 17:04:59 +01:00
ionutboangiu
22f9ec262e Update most of the libraries 2022-11-09 14:04:58 +01:00
andronache
428cd37b8e Replaced header in multiple places 2021-11-01 13:50:23 +02:00
andronache
a402f9f41f Fixed integration test for filter index cache 2021-09-28 20:40:15 +02:00
andronache
6d70abaebe Fixed integration test for filter index cache 2021-09-28 20:40:15 +02:00
Trial97
0dd7a37f9b Updated EventCost Rounding. Fixes #3018 2021-09-23 11:49:17 +02:00
porosnicuadrian
d9d8df250f Fixed tests for the ComputeID case 2021-09-15 10:06:34 +02:00
porosnicuadrian
2d36afe34f New constructor for FilterIndexes with old idx to avoid overwrite at ComputeID 2021-09-15 10:06:34 +02:00
porosnicuadrian
235d3f58ad Started debuging for set indexes in mongo/mysql 2021-09-13 16:09:59 +02:00
Trial97
db3bf9f40d Updated build tags 2021-08-30 17:55:51 +03:00
porosnicuadrian
f67f52ac76 Added multiple fltrs and profile on index tests 2021-08-24 19:52:05 +02:00
Trial97
a2a340f251 Updated ApierV1.SetRatingProfile and ApierV1.RemoveRatingProfile. Fixes #3186 2021-08-19 17:47:23 +02:00
porosnicuadrian
027e0e1f7c Tested different cases for index health 2021-08-18 17:45:26 +02:00
nickolasdaniel
ce5a52f84a Added tenant flag for cgr-loader 2021-08-18 16:35:48 +02:00