Commit Graph

513 Commits

Author SHA1 Message Date
gezimbll
777d4f0a28 added caching for sagprofile 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
ionutboangiu
ee98dbe0ca Update AgentV1DisconnectSession api signature
Will accept utils.CGREvent instead of utils.AttrDisconnectSession as a
parameter.

SessionSv1.ForceDisconnect will take utils.SessionFilterWithEvent as a
parameter instead of *utils.SessionFilter.

Added possibility to pass DisconnectCause as an Event parameter.

The forceSTerminate that's called when the session timer expires will
have DisconnectCause 'SESSION_TIMEOUT' instead of 'FORCED_DISCONNECT'.

Added Dispatcher methods for AlterSessions.

Event will be merged with EventStart of the session before being sent to
AgentV1DisconnectSession.
2024-03-07 17:20:23 +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
d8ad760dbb Update both ReAuthorize API signatures
The one from sessions takes an additional event alongside the
SessionFilter, while the one from agents will accept a CGREvent
instead of a simple originID string

The additional event sent to SessionSv1ReAuthorize will be merged
with the EventStart event from the matched session and can be used
when building server initiated requests from the *req map. The
initial packet which was initially inside *req, will be moved to
the *oreq ExtraDP (stands for original request).
2024-02-14 10:15:51 +01:00
gezimbll
5a85c119c8 Replacing IsSliceMember ,CloneStringSlice and SliceStringEqual with slices package equivalent functions 2023-11-01 21:52:50 +01:00
ionutboangiu
6c16ff320f Replace interface{} with any 2023-05-31 10:23:12 +02:00
adi
9c3da4aa21 Integrated CallCache opts for dispatcher 2022-10-10 18:22:03 +02:00
ionutboangiu
895c140209 Port dispatcher changes from 1.0 to v0.11 2022-09-25 12:17:37 +02:00
ionutboangiu
77430ee80a Add maxReconnectInterval for DispatcherHost csv models 2022-05-28 09:50:01 +02:00
ionutboangiu
007cc0e7c8 Replace ArgRSv1ResourceUsage struct with CGREvent and fix tests 2021-11-11 12:22:41 +02:00
Trial97
880dd7f1b1 Updated Action Filters field 2021-10-12 16:49:01 +03:00
Trial97
fb0389abbb Updated ApierV1.SetRatingProfile and ApierV1.RemoveRatingProfile. Fixes #3186 2021-08-20 11:53:43 +02:00
Trial97
c385224171 Updated Cache Reload API 2021-07-29 08:43:49 +02:00
nickolasdaniel
a150a38481 Removed synchronous field from DispatcherHost and RemoteHost 2021-07-25 12:08:40 +02:00
nickolasdaniel
016e913190 Added extra configurable fields for DispatcherHost related structs, corresponding tests and redesigned methods where needed 2021-07-15 18:39:39 +02:00
Trial97
b35f6c3485 Added all Responder Methods to DispatacherS.Fixes #2954 2021-05-19 19:30:51 +02:00
porosnicuadrian
91eda67c4a Updated indexes apis in favor of cache 2021-05-11 20:57:11 +02:00
Trial97
915ede86c9 Updated cache reload 2021-05-07 20:02:17 +02:00
ionutboangiu
05a088fcf0 Implement timings on master 2021-04-29 12:12:51 +02:00
Trial97
3f4e7afba1 Updated configs 2021-04-01 16:33:37 +02:00
Trial97
21d4dd16fa Removed more actions 2021-04-01 16:33:37 +02:00
nickolasdaniel
ce915c77a6 Removing ActionS 2021-04-01 16:33:37 +02:00
ionutboangiu
3197b3a458 Remove RateS 2021-04-01 16:33:37 +02:00
andronache
49f8ffc598 Removing accounts 2021-04-01 16:33:37 +02:00
Trial97
b8437f4a7d Updated utils tests 2021-03-26 13:46:25 +01:00
andronache
0d36b0cecf Changed Opts in structs in apier to APIOpts 2021-03-23 14:35:11 +01:00
andronache
806c8295be Finished changing Opts to APIOpts for structs used in api_interfaces 2021-03-23 14:35:11 +01:00
andronache
32c234a6c7 In CGREvent changed Opts in APIOpts 2021-03-23 14:35:11 +01:00
porosnicuadrian
8b9508c5a2 Fixed tests by adding default usage + covered accounts 2021-03-19 18:50:52 +01:00
porosnicuadrian
5d323f4671 Removed RateProfile from engine package to utils 2021-03-18 18:12:47 +01:00
andronache
c61e2046f3 Changed in multiple structs the field Opts to APIOpts 2021-03-18 16:48:54 +01:00
andronache
804cc12c9e Changed in multiple structs the field Opts to APIOpts 2021-03-18 16:48:54 +01:00
porosnicuadrian
6abcb26e44 New test case for indexing RateProfileRates 2021-03-12 17:12:31 +01:00
porosnicuadrian
4bb2d4c493 Implemented all cases for indexes for the remaining profiles in apier/v1 2021-03-11 17:10:55 +01:00
Trial97
9182696abb Added tests for *add_balance, *set_balance and *rem_balance actions 2021-02-25 18:13:01 +01:00
Trial97
83c26e5fd6 Updated actions 2021-02-25 18:13:01 +01:00
TeoV
f6b6243961 Update RateS to seach for Usage in event in case is not found in Opts 2021-02-17 11:23:59 +01:00
porosnicuadrian
2ab7db86da changed weight/rateWeight into dynamicWeight + tests 2021-02-15 20:28:00 +01:00
porosnicuadrian
f5e7c522bf New fields in accountProfile - Opts and Weights as DynamicWeights 2021-02-12 17:39:22 +01:00
DanB
d6979daa0c DynamicWeight with parser and tests 2021-02-10 20:24:48 +01:00
DanB
e8eac25724 DynamicWeight structure definition 2021-02-10 13:45:34 +01:00
TeoV
34d17d0307 Add RateProfileIDs to Balance struct and rename from CostAttributes to AttributeIDs ( same as from ChargerProfile ) 2021-01-19 13:12:52 +01:00
porosnicuadrian
64290719da Removed RateS connection from RouteS 2021-01-15 09:54:47 +01:00
TeoV
ae146640f4 Start merging CGREventWithOpts with CGREvent 2021-01-14 10:30:35 +01:00
TeoV
66e2b4cd01 Remove RoundingMethod and RoundingDecimals from RateProfile 2021-01-12 20:02:01 +01:00
andronache
1d0a814e42 Changed consts in utils 2021-01-11 10:57:44 +01:00