Commit Graph

5189 Commits

Author SHA1 Message Date
armirveliaj
6f65f09e4f Add new unit tests on engine 2024-08-12 18:37:15 +02:00
ionutboangiu
73fc386036 Add stordb pgSSLCertMode option 2024-08-12 18:36:45 +02:00
ionutboangiu
d0183597f1 Add postgres stor_db SSL opts 2024-08-09 09:13:10 +02:00
gezimblliku
22b96ca1e3 added tests for filter statmetric 2024-08-04 21:10:50 +02:00
armirveliaj
3d9a94c5c5 Add new unit tests 2024-08-04 21:04:41 +02:00
armirveliaj
f6f49f47a2 Add new unit tests on engine 2024-08-02 09:36:54 +02:00
arberkatellari
5ccb77c5dc Add mongo support for sessions backup 2024-07-22 15:31:02 +02:00
ionutboangiu
4cba4a699d Implement SharedActionsData for action groups
- holds common relevant data between actions.
- currently supports only *cdrlog, making the process more reliable
and less repetitive. It also provides access to more information about
actions when creating CDRs.
- easier to scale.
- removes the need for cloning accounts before executing a group of
actions.
- added Actions method to check if specific action types exist inside.
2024-07-21 19:04:53 +02:00
arberkatellari
dd5e5b1147 Revise debitCreditBalance 2024-07-14 14:11:16 +02:00
armirveliaj
54a90fe543 Add new unit test on engine 2024-07-14 14:07:21 +02:00
armirveliaj
fb04c28dab Add new unit tests on engine 2024-07-14 14:07:21 +02:00
gezimbll
85bd7a50e7 updated sags service name to ranking 2024-07-14 13:39:20 +02:00
gezimbll
4d4392d196 revised comments && renamed sars to trends 2024-07-14 13:39:20 +02:00
gezimbll
6c2fbbec28 added sars model,tp,api 2024-07-14 13:39:20 +02:00
ionutboangiu
9d7fcdc0c6 Ensure refund flag is not ignored when rerate is true
By default setting rerate to true also sets refund to true, but
flags should take precedence over defaults.

If rerate is true and refund is false, remove any previous
CostDetails from event to force rerate.

Centralize the configuration of processing args.
2024-07-14 13:28:18 +02:00
ionutboangiu
435e4f59b5 Add set_versions flag to cgr-engine
If set to true, it sets/overwrites all versions to the
current ones.
2024-07-14 13:27:09 +02:00
ionutboangiu
eb3bd5cc1d Add redisPoolPipelineLimit configuration field for datadb
Sets the maximum number of commands that can be pipelined before flushing.
0 means no limit and pipelines will only be limited by the time window.
2024-07-05 11:21:16 +02:00
ionutboangiu
ed3fa0d294 Add redisPoolPipelineWindow configuration field for datadb
Sets the duration after which internal pipelines are flushed.
0 disabled implicit pipelining.
2024-07-02 19:58:03 +02:00
armirveliaj
8447bbb084 Add new unit tests on engine 2024-07-01 20:37:09 +02:00
arberkatellari
b88602cdf3 Update rpcclient revising error handling 2024-06-30 17:55:09 +02:00
armirveliaj
9ba8feeb71 Add new unit tests on engine 2024-06-30 17:51:59 +02:00
armirveliaj
09ec973a92 Add new unit tests on engine 2024-06-30 17:51:59 +02:00
armirveliaj
6c7c54ab58 Add unit tests on engine 2024-06-30 17:51:59 +02:00
armirveliaj
a945fccad6 Add new unit tests on engine 2024-06-30 17:51:59 +02:00
gezimbll
777d4f0a28 added caching for sagprofile 2024-06-30 17:45:06 +02:00
gezimbll
dd7e1f9a0c tests for loading sagprofiles from csvreader 2024-06-30 17:45:06 +02:00
gezimbll
0012477d52 added stat aggregator profile,models,tps and apis 2024-06-30 17:45:06 +02:00
ionutboangiu
49f6c5982e Add reference value functionality to *transfer_balance action
The *transfer_balance action can now use a reference value to ensure
the destination balance reaches a specified amount. If the destination
balance exceeds the reference value, the excess is transferred back
to the source balance. If the destination balance is below the
reference value, the required amount is transferred from the source
balance to the destination balance to reach the specified reference
value. An error is returned if the transfer cannot achieve the
specified reference value.

Used by specifying DestinationReferenceValue inside ExtraParameters.

Other *transfer_balance changes:
- used json tags when unmarshaling ExtraParameters in order to be
able to shorten the names of the fields
- lock the destination account only if it's different from the
source account. It is still passed to the Guard function but
without a lock key and with 0 timeout.
- if the transfer happens within the same account, update the
account and execute its ActionTriggers only once.
- moved transfer units validation after retrieving/creating the
destination balance

*cdrlog action has been updated to create cdrs for reference
*transfer_balance actions, although improvements are needed and
the functionality is not completely tested.

APIerSv1.TransferBalance has been updated to take into account the
ReferenceValue parameter.

Added new *transfer_balance action unit tests to account for the
new changes.

Added integration tests (incomplete for now, but functionality
has been tested manually).
2024-06-13 13:56:40 +02:00
arberkatellari
f46b37bdf8 Make minor improvements to sessions backup 2024-06-12 18:21:50 +02:00
arberkatellari
f356695f6f Add active sessions backup functionalitiy 2024-06-12 18:21:50 +02:00
armirveliaj
ed9ac8965f Add unit tests on engine 2024-06-10 18:52:59 +02:00
gezimbll
7a32176f09 update rals flag to false when using refund 2024-06-10 13:00:02 +02:00
armirveliaj
a4edc5dfca Revise and add new test case on engine 2024-06-07 17:17:54 +02:00
armirveliaj
336b85e5dc Add new unit tests on engine 2024-06-07 17:17:54 +02:00
ionutboangiu
c32de12cee Reduce client connection attempts to test engine status (tests)
200 -> 16

Previously, considering the fibonacci back off strategy, if engine failed to
start it would have tried to attempt connections for 2.862799e+33 years.

Now, the amount of attempts is 16, equivalent to around 2 and a half seconds.
Should be more than enough, considering that usually 6-7 attempts are enough.
2024-06-06 13:30:14 +02:00
armirveliaj
f1d0be170d Revise and Add new unit tests on engine 2024-06-06 13:17:59 +02:00
armirveliaj
36c623599e Add new unit tests on engine 2024-06-06 13:17:59 +02:00
armirveliaj
044e56a6a4 Add unit tests on engine 2024-06-06 13:17:59 +02:00
armirveliaj
0e82785173 Add unit tests on engine 2024-06-06 13:17:59 +02:00
armirveliaj
39e3d04fe5 Add new unit tests in engine 2024-06-06 13:17:59 +02:00
armirveliaj
58dc0f0ae2 Revise unit tests in engine 2024-06-06 13:17:59 +02:00
armirveliaj
70f4f44421 Add Unit Tests for Engine 2024-06-06 13:17:59 +02:00
armirveliaj
cc98314426 Add unit tests for Dispatcher,Engine,Agents 2024-06-06 13:17:59 +02:00
gezimbll
a8b8c84dda updated check on cost details
changed the check of cdr usage to  be less or equal with usage in event cost
2024-05-16 17:40:10 +02:00
gezimbll
624aa2b3f2 update threshold to set snooze time after actions 2024-05-09 12:34:42 +02:00
DanB
5cf5032fe0 CDRs rals_conns will rate by default 2024-05-03 18:14:58 +02:00
ionutboangiu
5c1e65256c Don't trim single digit values when parsing cron
Fixes an issue where 0 values would become empty inside the cron
expressions.

Added unit tests for the edge cases and grouped them together with
the previous ones under the same table test.

When creating the StartTime field, assign time.Now() to a centralised
variable and reuse it instead of calling time.Now() repeatedly.
2024-04-20 12:21:57 +02:00
ionutboangiu
4964a462cf Add flaky constraint to random routes unit tests
Also increase margin of error for guardian tests 5ms->10ms.
2024-04-16 21:10:13 +02:00
ionutboangiu
73c54cdcf2 Add test & benchmarks for msgpack library update
Check test comment for complete steps.
2024-04-16 21:10:13 +02:00
ionutboangiu
1a1ba55b25 Switch to ugorji/go/codec
Should be equivalent to ugocodec if enabling TimeNotBuiltin.
2024-04-16 21:10:13 +02:00