Commit Graph

1094 Commits

Author SHA1 Message Date
ionutboangiu
b3d0b8ffbe Revise tests failing due to configuration changes 2024-03-14 17:12:43 +01:00
ionutboangiu
843eee3b8d Pass clone of original acc for *cdrlog actions 2024-03-13 18:25:06 +01:00
ionutboangiu
5ac08799e1 Update *remove actions to support multiple balance types at once 2024-03-12 18:11:34 +01:00
ionutboangiu
58c1d639f3 Update handling of ees event after processing attributes 2024-03-11 16:41:09 +01:00
ionutboangiu
c9b6c1fbb7 Add support for sending *dmr template via APIOpts 2024-03-07 17:20:23 +01:00
ionutboangiu
41b9b719d5 Ensure AccountSummary is of *AccountSummary type when parsing ddp 2024-03-07 17:20:23 +01:00
ionutboangiu
49d6b8d565 Ensure CostDetails is of *EventCost type when parsing dynamicDP
CGREventWithEeIDs has also been optimized and properly tested. Comments
have been added explaining the process.

When sending a request to AttributeS from EEs, CostDetails from the reply
will now be overwritten by the original CostDetails to preserve its type.
The downside is that we are assuming that CostDetails was not altered by
AttributeS. We might consider adding a type check against *engine.EventCost
to at least stay backwards compatible with *gob and *internal connections.

general_tests/ees_it_test.go has been updated to ensure changes are working
properly.
2024-03-04 09:49:15 +01:00
ionutboangiu
221f6e2c91 Update *transfer_balance action
Now it creates the destination balance if it doesn't exist.
2024-03-04 09:49:15 +01:00
ionutboangiu
f1ad73b902 Add support for filtering to *remove_expired action 2024-03-04 09:49:15 +01:00
ionutboangiu
3269393141 Retrieve BalanceFactorID from Event
It will be added to CallDescriptor in ExtraFields.

Ensure CDR ExtraFields are passed to CallDescriptor before
sending it to RALs.

Ensure Clone function of CallDescriptor also clones the
ExtraFields map.
2024-03-04 09:49:15 +01:00
ionutboangiu
0aea8ac641 Revert "Move CGREvent from utils to engine"
This reverts commit 02195c47ed.
2024-03-04 09:49:15 +01:00
gezimbll
0c99cf1df5 fixes in integration test 2024-02-28 12:46:17 +01:00
ionutboangiu
02195c47ed Move CGREvent from utils to engine 2024-02-27 17:16:57 +01:00
ionutboangiu
7510c07612 Add tests for *destinations filters and attributes arith operations 2024-02-27 16:29:49 +01:00
ionutboangiu
a9079154da Add possibility to pass conn cfg to actions 2024-02-27 16:28:48 +01:00
ionutboangiu
e50d71808a Optimize TransferBalanceAPI and test *cdrlog functionality 2024-02-20 11:11:39 +01:00
ionutboangiu
87da08f7fd Revise *transfer_balance action and its API
Ensure parameter fields are not abbreviated.

The action will not depend on balance type anymore. It will go through all
balances.

*default balance from source balance can go negative during transfer.
2024-02-19 11:28:52 +01:00
ionutboangiu
0c32f1761c Implement APIerSv1.TransferBalance API 2024-02-19 11:28:52 +01:00
ionutboangiu
41976e5721 Update *cdrlog action to support *remove_expired actions
Will also be able to process more than one CDR per
action.
2024-02-19 11:28:52 +01:00
arberkatellari
e730ef4eb2 Update integration tests 2024-02-15 17:02:41 +01:00
ionutboangiu
c5b197db6f Simplify event cloning (ees) 2024-02-09 17:36:24 +01:00
ionutboangiu
0dc1567a7a Ensure event is cloned before being sent to attributes
Also the exporter ID has been added in APIOpts under the *exporterID
key.
2024-02-09 15:57:25 +01:00
ionutboangiu
d182d6f601 Revise behaviour of balance factor
Now it multiplies instead of dividing.
2024-02-06 10:06:30 +01:00
ionutboangiu
f01ae9fb37 Add compatibility support between *remove_balance and *cdrlog actions 2024-01-30 18:46:48 +01:00
ionutboangiu
8c0bee1a1a Add error constant for INSUFFICIENT_CREDIT_BALANCE_BLOCKER 2024-01-29 09:57:49 +01:00
ionutboangiu
c4899cc01b Update blocker tests and add test for balance factor 2024-01-29 09:57:49 +01:00
gezimbll
823b1ac37a integration tests for *http type of filter and attributes 2024-01-26 12:11:46 +01:00
ionutboangiu
36bdc41e97 Add support for kafka ssl encryption
For both poster and reader.
Added integration test.
2024-01-23 14:12:33 +01:00
DanB
e0d15f1a9e Prevent balance Blocker to partially debit 2024-01-19 16:28:09 +01:00
ionutboangiu
2fab0b92c5 Update balance blocker test (incomplete) 2024-01-19 10:35:18 +01:00
ionutboangiu
b76d61281c Implement new *transfer_balance action
Added possibility to mock datamanager account functions.

Fixed typo in SubtractValue function name.

Added unit & integration tests.
2024-01-15 16:15:18 +01:00
arberkatellari
29698051b0 Merge branch 'master' into TMPmaster 2024-01-09 02:45:45 -05:00
arberkatellari
0cfc4b5658 Continue caching_delay implementation & tests 2024-01-08 11:00:10 -05:00
ionutboangiu
17fbc2d51b Rename mongoScheme opt to mongoConnScheme 2023-12-12 10:10:26 +01:00
ionutboangiu
24cbe49d90 Add support for mongodb+srv conn format
Option can be found in db opts under the name 'mongoSchema'.
2023-12-11 17:15:40 +01:00
ionutboangiu
1154cad0df Rename max_recursion_depth cfg param to fallback_depth 2023-12-07 17:08:22 +01:00
ionutboangiu
ff53446e41 Make recursion_max_depth a configurable option
Also added an integration test checking the recursion depth functionality.
2023-12-07 17:08:22 +01:00
arberkatellari
20f2f7353e Add tests for SSv1AuthorizeEvent with *sms & *data 2023-11-16 11:17:54 +01:00
gezimbll
bf89dd7650 Add default evencost when it's nil for ees
it fixes the panic on scenario  when  we define  a template containing *ec fields and exported cdr doesn't contain
a costdetails field.
2023-11-15 10:25:21 +01:00
ionutboangiu
22d7ecf784 Add test for multiple groups pricing +testsuite update 2023-11-14 18:26:05 +01:00
gezimbll
42892eff01 Updated gocs_it_test for debiting account of au_site only by replication 2023-11-13 17:11:30 +01:00
arberkatellari
054c584775 Create APIerSV1GetAccountCost 2023-11-09 09:37:34 +01:00
arberkatellari
681cd3c58a Add dryrun for CDRsV2ProcessEvent 2023-11-09 09:37:34 +01:00
arberkatellari
8781b968ac Remove unnecessary LazySanityCheck 2023-11-09 09:37:34 +01:00
arberkatellari
ec8058cd29 Adapt test to new RadiusAgent changes 2023-11-09 09:37:34 +01:00
ionutboangiu
c282d40201 Implement reconnect logic for AMQP EventReader
Implemented functionality that handles reconnecting to the amqp server
and reinitializing the amqp channel in case of errors and timeouts. This
is handled by a goroutine created in the client constructor (it also
handles the initial connect/init).

Reconnects and reinits will use a fibonacci backoff strategy, and the
attempt amount and max waiting interval can be adjusted by the
'reconnects' and 'max_reconnect_interval' config options.

Messages that fail processing are now dropped instead of being requeued,
preventing infinite processing loops. However, this means that the
messages are lost. Handling failed messages will need to be addressed
separately.

'concurrent_requests' will now set the prefetch count. Setting the
prefetch count using the Qos function was able to replace our old
approach that was using channels. Default value is 1024 which,
according to the rabbitmq docs, 'runs into the law of diminishing
returns'. The recommended value is between 100-300. Source:
https://www.rabbitmq.com/confirms.html#channel-qos-prefetch-throughput

Fix test compilation errors and failing tests caused by these changes.

References #4160
2023-11-08 18:31:07 +01:00
ionutboangiu
9b18816b51 Make sure required analyzers db file exists in test 2023-11-08 17:11:40 +01:00
gezimbll
529430bd4d added tests for debiting data units without ratingsubject 2023-11-08 17:04:41 +01:00
ionutboangiu
d241f5deee Add test for balance blocker functionality
References issue #4163 and PR #4178.
2023-11-02 19:38:24 +01:00
ionutboangiu
3e852be287 Update it test to set up environment using setupTest()
This has been done in order to check the newly implemented helpers'
functionality.
2023-11-02 19:38:24 +01:00