Commit Graph

13089 Commits

Author SHA1 Message Date
ionutboangiu
a362511d7a Define param struct for ErSv1.RunReader API + refactoring
Rename dir field to sourceDir in file event readers for clarity.
2024-04-04 12:31:18 +03:00
ionutboangiu
3f5956ab1b Use correct subsys const when dispatching to EEs
Before *core was mistakenly used instead of *ees
2024-04-04 12:31:18 +03:00
ionutboangiu
0626b050c1 Add ERs apis to apier package
Now the ErSv1 object methods are registered instead when
starting the ERs service.
2024-04-04 12:31:18 +03:00
ionutboangiu
5116a23f5b Set ChargerProfile through TPs instead of API in tests
Only for agents/ers tests. Done to prevent cyclic imports when
adding ers APIs to apier package.

In case of v2.AttrSetAccount, use a literal struct instead.
2024-04-04 12:31:18 +03:00
ionutboangiu
b9a39e233f Implement ErSv1.ProcessDir api
cores.Server, analyzer object and internal conn channel specific to ERs
are now part of the ERService struct and are passed to its constructor.
2024-04-04 12:31:18 +03:00
ionutboangiu
b924fc9e0c Add method on ERsCfg to retrieve reader by ID 2024-04-04 12:31:18 +03:00
ionutboangiu
b9b07dc561 Remove redundant dir parameter from processFile methods
Applies to both file readers and loader (for loader, the blank statement
was used anyway).

It's redundant because for file readers, the rdr.dir value was always
passed as the parameter when it was already part of the method's object.

Parameter had to also be removed from the WatchDir function and the
functions it depends on.
2024-04-04 12:31:18 +03:00
ionutboangiu
85864ccaa3 Extract common dir processing logic to a func
It will be reused for all file readers.
Rename rdrDir field to dir (redundant prefix).
2024-04-04 12:31:18 +03:00
ionutboangiu
9c004b069d Ignore factors equal to 1 when creating EventCost 2024-04-01 20:48:57 +03:00
ionutboangiu
6db11e87bc Rename Factor to BalanceFactor inside Accounting 2024-04-01 20:48:57 +03:00
ionutboangiu
50d0103c7b Move BalanceFactor value from Increments to Accounting
Retrieve the Accounting BalanceCharge inside a new variable and reuse
that instead of repeatedly indexing the map. It is always assumed that
the BalanceCharge exists in the map and is non-nil. A comment was
added as a reminder.

TotalCost cannot be calculated anymore from ChargingIncrement alone.
The function is not used, so it will not be causing any issues for
now.

BalanceCharge clone function now handles the case where it is nil
to avoid any possible nil pointer dereference.
2024-04-01 20:48:57 +03:00
ionutboangiu
bdbcc1ce58 Use different rates based on ToR in balance tests
TestBalanceFactor will now test refunding to mixed balanced types.

A sleep of 10ms is called before initial acc retrieval to wait for
tps to finish loading.
2024-04-01 20:48:57 +03:00
ionutboangiu
a7ca167039 Add BalanceFactor value to Increments
For both the Increment and ChargingIncrement types.
2024-04-01 20:48:57 +03:00
ionutboangiu
22fb6236b1 Add test for refunding with factors 2024-04-01 20:48:57 +03:00
ionutboangiu
cc72aa92d9 Slightly optimize debit for balances with non-nil Factor
Factor will be computed only once at the start of the function, instead
of doing it on every Increments iteration.

'amount' variable will be updated and rounded only when the computed
balances factor is different from its default value (1).
2024-04-01 20:48:57 +03:00
ionutboangiu
bd4aa99458 Refactor balance's Factor field name with its plural form
Stored balances previous to this commit, that had a non-nil Factors map, will
now have Factors nil due to field name mismatch.
2024-04-01 19:58:04 +03:00
ionutboangiu
45066b2d2f Rename Factor field to Factors in BalanceSummaries 2024-04-01 19:58:04 +03:00
ionutboangiu
ea9b6ae83d Remove unused parameters from fs reload func 2024-04-01 19:58:04 +03:00
ionutboangiu
94429d8f76 Update a couple of failing tests 2024-04-01 19:58:04 +03:00
ionutboangiu
6d61fd479d Add Factor map and Weight to BalanceSummaries
Added additional tests + updated old ones.
2024-04-01 19:58:04 +03:00
gezimbll
699989a336 removing cncReqs global variables 2024-03-30 16:36:30 +02:00
gezimbll
05e6e2660c updated CommitDate to fallback into default time 2024-03-25 15:09:00 +01:00
ionutboangiu
109739d64d Update fsock library to latest version 2024-03-22 20:07:51 +01:00
ionutboangiu
ca66480c52 Add reply_timeout field for FS event socket conns 2024-03-22 15:12:04 +01:00
ionutboangiu
1e44d213ee Add integration build tags to stir shaken it test 2024-03-22 15:12:04 +01:00
ionutboangiu
e987139e9c Revert to supporting *asm for ThresholdS acc publish 2024-03-22 15:12:04 +01:00
ionutboangiu
619a1efa50 Revise ers integration tests
They also do not depend on nats server dependency anymore.
2024-03-22 15:12:04 +01:00
DanB
a7653d942a Updating FSock module to improve thread safety 2024-03-17 14:30:13 +01:00
ionutboangiu
b3d0b8ffbe Revise tests failing due to configuration changes 2024-03-14 17:12:43 +01:00
gezimbll
cff5d22913 fixing unit tests on ersCfg 2024-03-13 18:26:01 +01:00
gezimbll
66940db0b0 changed concurrentEvents naming in ers 2024-03-13 18:26:01 +01:00
gezimbll
21d65b3810 added concurrent event processing for ers 2024-03-13 18:26:01 +01:00
ionutboangiu
51c3e15f1e Fix docs typo 2024-03-13 18:25:06 +01:00
ionutboangiu
843eee3b8d Pass clone of original acc for *cdrlog actions 2024-03-13 18:25:06 +01:00
ionutboangiu
b457768a33 Update actions to share Time ref variable 2024-03-13 18:25:06 +01:00
DanB
25e2b1d418 Doc correction 2024-03-13 11:37:08 +01:00
DanB
c18fd40c62 Updating Debian installation instructions with tabs for Bookworkm/Boolseye 2024-03-13 11:09:16 +01:00
ionutboangiu
5ac08799e1 Update *remove actions to support multiple balance types at once 2024-03-12 18:11:34 +01:00
DanB
fe39eec4d9 Updating debian installation documentation 2024-03-12 15:30:31 +01:00
ionutboangiu
bf939a47ac Rename chan_delimiter cfg field to active_session_delimiter 2024-03-11 16:59:31 +01:00
arberkatellari
7c04cf8c61 Add coverage tests for radius agent 2024-03-11 16:41:46 +01:00
ionutboangiu
58c1d639f3 Update handling of ees event after processing attributes 2024-03-11 16:41:09 +01:00
ionutboangiu
afe03ac5fd Revise xmldp sanity check test to account for previous update 2024-03-11 16:41:09 +01:00
ionutboangiu
51a3c933d7 Add chan_delimiter option within freeswitch_agent section
Used for 'show_channels' requests and responses.
2024-03-11 16:39:45 +01:00
arberkatellari
f7cbec3b41 Update kamevapi to new version 2024-03-08 16:39:44 +01:00
ionutboangiu
28e53cecc9 Add requests_cache_key field to radagent cfg 2024-03-07 17:20:23 +01:00
ionutboangiu
87db26b4ec Implement *force_disconnect_sessions action 2024-03-07 17:20:23 +01:00
ionutboangiu
03eff44767 Cache RADIUS packets during accounting instead of auth 2024-03-07 17:20:23 +01:00
ionutboangiu
c9b6c1fbb7 Add support for sending *dmr template via APIOpts 2024-03-07 17:20:23 +01: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