Ensure metering-lr-timer is stopped before issuing V5 disconnect request

This commit is contained in:
Dennis Grunert 2024-01-29 17:42:33 +01:00
parent 6e09a11895
commit b13641ec32
1 changed files with 10 additions and 5 deletions

View File

@ -1850,16 +1850,16 @@ static void v5_disc_cpl_ind_and_cleanup(pstn_t *pstn)
/* stop DTMF */
dtmf_off(pstn);
/* stop line reversal metering */
osmo_timer_del(&pstn->metering_lr_timer);
pstn->metering_units_charged = 0;
pstn->metering_units_sent = 0;
/* release, if not already */
release_call(pstn, PSTN_CALL_ACTIVE, OSMO_CC_ISDN_CAUSE_NORM_CALL_CLEAR);
/* change state */
pstn_new_state(pstn, PSTN_STATE_NULL);
/* stop line reversal metering */
osmo_timer_del(&pstn->metering_lr_timer);
pstn->metering_units_charged = 0;
pstn->metering_units_sent = 0;
}
static void v5_block(pstn_t *pstn)
@ -2030,6 +2030,11 @@ static void v5_disc_req_and_cleanup(pstn_t *pstn)
/* change state */
pstn_new_state(pstn, PSTN_STATE_NULL);
/* stop line reversal metering */
osmo_timer_del(&pstn->metering_lr_timer);
pstn->metering_units_charged = 0;
pstn->metering_units_sent = 0;
if (pstn->reversed) {
pstn->reversed = 0;
LOGP(DTEL, LOGL_DEBUG, "Normal polarity.\n");