Commit Graph

10101 Commits

Author SHA1 Message Date
ionutboangiu
189a8dee7b Revise .readthedocs.yaml cfg file 2023-05-10 10:39:53 +02:00
ionutboangiu
609a9a129d Revise doc for fs install + warning fixes 2023-05-07 19:25:19 +02:00
ionutboangiu
4bc85329c5 Add ansible role for kamailio 2023-05-07 19:25:19 +02:00
ionutboangiu
d22df1736b Update asterisk installation docs 2023-05-07 19:25:19 +02:00
ionutboangiu
41cb903515 Use ansible roles for reusable tasks 2023-05-07 19:25:19 +02:00
ionutboangiu
25fa01fee0 Solve compilation errors after library update 2023-05-07 19:25:19 +02:00
gezimbll
e142f5efd7 Improving coverage tests 2023-05-03 10:03:35 +02:00
gezimbll
f62dea0768 Improving coverage for unit tests 2023-05-03 10:03:35 +02:00
gezimbll
a86d01be6b Improving coverage tests at engine 2023-05-03 10:03:35 +02:00
gezimbll
569c59af53 Improving coverage of unit tests 2023-05-03 10:03:35 +02:00
gezimbll
47e1d470cd Improving coverage of unit test 2023-05-03 10:03:35 +02:00
gezimbll
9f56532a4c Improving coverage of unit tests 2023-05-03 10:03:35 +02:00
gezimbll
c4ca1d1315 Improving coverage of unit test 2023-05-03 10:03:35 +02:00
ionutboangiu
82c13639b0 Revise test after tp update 2023-05-03 10:02:15 +02:00
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
DanB
0560fa63f8 Updating tutorial2 sample .csvs and few of the docs for installing with OpenSIPS 2023-04-20 20:07:24 +02:00
ionutboangiu
3ea21e43d7 Add inline filter validation before writing to database
Implement a function that takes as parameters a list of filters
and it checks only whether the inline filters are valid.

Add it inside the functions that load the profiles inside
the TPReader. This prevents the case where it returns error
after indexing had already started when it is already too
late.

Add unit tests for the implemented function.
2023-04-20 20:05:00 +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
gezimbll
425590d733 Add packit.yaml for automated RPM builds 2023-04-19 16:10:04 +02:00
gezimbll
5b0bc1d90b Improving coverage of unit tests 2023-04-17 11:23:46 +02:00
gezimbll
ddfded6c05 Improving unit tests coverage 2023-04-17 11:23:46 +02:00
gezimbll
8a6d262521 Improving coverage of unit tests 2023-04-17 11:23:46 +02:00
gezimbll
11d2b10423 Improving coverage of unit tests 2023-04-17 11:23:46 +02:00
gezimbll
ff8b23e93f Improving coverage of unit tests 2023-04-17 11:23:46 +02:00
gezimbll
ae037931d0 Improving coverage tests at engine 2023-04-06 11:49:37 +02:00
gezimbll
68b06d573a Improving Unit Test Coverage for Engine 2023-04-06 11:49:37 +02:00
gezimbll
4673b0023f Improving coverage of unit tests 2023-04-06 11:49:37 +02:00
gezimbll
3ef4dc693e Improving coverage tests at engine 2023-04-06 11:49:37 +02:00
gezimbll
65b07db6da Improving and adding unit tests 2023-03-28 17:59:51 +02:00
gezimbll
454c611b51 Improving unit tests 2023-03-28 17:59:51 +02:00
gezimbll
9e48ba08f9 Improving unit tests at engine 2023-03-28 17:59:51 +02:00
gezimbll
abc1285262 Adding test for ratingprofiles 2023-03-28 17:59:51 +02:00
gezimbll
2b52938bfb Adding and improving unit tests at engine 2023-03-28 17:59:51 +02:00
ionutboangiu
15b404e8cf Revise randomly failing tests 2023-03-28 17:59:32 +02:00
ionutboangiu
3fac828218 Remove responder from the list of services managed by the ServiceManager
Since Responder can be started/reloaded/shut down through RALs, there is no need for ServiceManager to also be responsible for it. It also solves an issue where the RALs service would not be properly started because the manager had already started Responder before, and when RALs would try to do it as well, it returned with a 'service already running' error.
2023-03-28 17:59:32 +02:00
ionutboangiu
0473e66555 Revise config reload tests in services
A time.Sleep() of 10 milliseconds has been added after starting the services in order to wait for the goroutine that handles reloads to get instantiated. This solves the occasional deadlock that happens when a reload signal is sent to a subsystem that requires storDB before sending it to storDB itself. One consequence of waiting is that where we previously expected the DataDB service to not be running yet, now it has enough time.
2023-03-28 17:59:32 +02:00
gezimbll
8a18eb87ec Changed path for git repo 2023-03-21 16:22:50 +01:00
gezimbll
3b64bb4fef Updated paths for copr ansible scripts 2023-03-21 16:22:50 +01:00
gezimbll
9adc103dff Improving & Adding unit tests at engine 2023-03-20 17:52:04 +01:00
gezimbll
39393aecb7 Improving coverage for unit tests 2023-03-19 20:48:14 +01:00
gezimbll
35091a5538 Adding unit tests at engine 2023-03-19 20:48:14 +01:00
ionutboangiu
5bf525d4c0 Revise failing integration tests from general_tests
The time it takes to register RPC methods is quite long and sometimes it is causing errors when methods that are not yet registered are being called. Therefore, the 'waitRater' default value has been increased from 100ms to 500ms.

For 'cdrs_onlexp_it_test.go':
- 2 functions have been added that create and delete the kafka topic relevant to the test. This ensures that the topic exists before export and also that it is deleted to avoid the data from within to influence subsequent tests;
- the maximum duration that we are waiting for the amqp messages to be consumed has been increased. Since it usually takes anywhere between 300ms and 1.9s to read a message, it has been increased to 2 seconds;
- amqp queues are now deleted once we are done verifying the exports.

For 'cdrs_post_failover_it_test.go', we now make sure that the failed posts directories exist and are empty before starting the engine.

For 'cdrs_processevent_it_test.go':
- some of the stat queue items were expiring too quickly, causing the test for fail sometimes. In order to solve the issue, I had to modify increase the TTL, but since the 'testit' tariff plan is also used by other tests, I decided to create the .csv files within the test, taking from 'testit' only the relevant information;
- same issue as in the previous test was occuring here. Was fixed in the same way;
- removed some useless calls.
2023-03-19 19:32:25 +01: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
gezimbll
e822a5ae63 Improving coverage test at engine 2023-03-15 17:44:46 +01:00
gezimbll
c5abf600cf Improving coverage tests at engine 2023-03-15 11:43:43 +01:00
gezimbll
51af0635b0 Improving coverage test at engine 2023-03-15 11:43:43 +01:00
gezimbll
67d9c634f6 Improving coverage tests engine 2023-03-10 14:14:16 +01:00