cdr / cel: Use event time at event creation instead of processing.

When updating times on CDR or CEL records using the time at which
it is done can result in times being incorrect if the system is
heavily loaded and stasis message processing is delayed.

This change instead makes it so CDR and CEL use the time at which
the stasis messages that drive the systems are created. This allows
them to be backed up while still producing correct records.

ASTERISK-28498

Change-Id: I6829227e67aefa318efe5e183a94d4a1b4e8500a
This commit is contained in:
Joshua Colp
2019-08-05 09:23:53 -03:00
parent ec7cd3b0a5
commit 108b1abbd9
3 changed files with 108 additions and 48 deletions

View File

@@ -263,6 +263,28 @@ struct ast_event *ast_cel_create_event(struct ast_channel_snapshot *snapshot,
enum ast_cel_event_type event_type, const char *userdefevname,
struct ast_json *extra, const char *peer_str);
/*!
* \brief Allocate and populate a CEL event structure
*
* \param snapshot An ast_channel_snapshot of the primary channel associated
* with this channel event.
* \param event_type The type of call event being reported.
* \param event_time The time at which the event occurred.
* \param userdefevname Custom name for the call event. (optional)
* \param extra An event-specific opaque JSON blob to be rendered and placed
* in the "CEL_EXTRA" information element of the call event. (optional)
* \param peer_str A list of comma-separated peer channel names. (optional)
*
* \since 13.29.0
* \since 16.6.0
*
* \retval The created ast_event structure
* \retval NULL on failure
*/
struct ast_event *ast_cel_create_event_with_time(struct ast_channel_snapshot *snapshot,
enum ast_cel_event_type event_type, const struct timeval *event_time,
const char *userdefevname, struct ast_json *extra, const char *peer_str);
/*!
* \brief CEL backend callback
*/