mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-02 10:22:46 +00:00
Merge "res_pjsip_outbound_registration.c: Filter redundant statsd reporting." into 13
This commit is contained in:
6
CHANGES
6
CHANGES
@@ -25,6 +25,12 @@ res_pjproject
|
|||||||
* Added new pjproject.conf startup section "log_level' option to set the
|
* Added new pjproject.conf startup section "log_level' option to set the
|
||||||
initial maximum PJPROJECT logging level.
|
initial maximum PJPROJECT logging level.
|
||||||
|
|
||||||
|
res_pjsip_outbound_registration
|
||||||
|
------------------
|
||||||
|
* Statsd no longer logs redundant status PJSIP.registrations.state changes
|
||||||
|
for internal state transitions that don't change the reported public status
|
||||||
|
state.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
--- Functionality changes from Asterisk 13.12.0 to Asterisk 13.13.0 ----------
|
--- Functionality changes from Asterisk 13.12.0 to Asterisk 13.13.0 ----------
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|
@@ -627,15 +627,30 @@ static void schedule_registration(struct sip_outbound_registration_client_state
|
|||||||
|
|
||||||
static void update_client_state_status(struct sip_outbound_registration_client_state *client_state, enum sip_outbound_registration_status status)
|
static void update_client_state_status(struct sip_outbound_registration_client_state *client_state, enum sip_outbound_registration_status status)
|
||||||
{
|
{
|
||||||
|
const char *status_old;
|
||||||
|
const char *status_new;
|
||||||
|
|
||||||
if (client_state->status == status) {
|
if (client_state->status == status) {
|
||||||
|
/* Status state did not change at all. */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
status_old = sip_outbound_registration_status_str(client_state->status);
|
||||||
|
status_new = sip_outbound_registration_status_str(status);
|
||||||
|
client_state->status = status;
|
||||||
|
|
||||||
|
if (!strcmp(status_old, status_new)) {
|
||||||
|
/*
|
||||||
|
* The internal status state may have changed but the status
|
||||||
|
* state we tell the world did not change at all.
|
||||||
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GAUGE, "-1", 1.0,
|
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GAUGE, "-1", 1.0,
|
||||||
sip_outbound_registration_status_str(client_state->status));
|
status_old);
|
||||||
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GAUGE, "+1", 1.0,
|
ast_statsd_log_string_va("PJSIP.registrations.state.%s", AST_STATSD_GAUGE, "+1", 1.0,
|
||||||
sip_outbound_registration_status_str(status));
|
status_new);
|
||||||
client_state->status = status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! \brief Callback function for unregistering (potentially) and destroying state */
|
/*! \brief Callback function for unregistering (potentially) and destroying state */
|
||||||
|
Reference in New Issue
Block a user