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).
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.
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.
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).