From 7daaa654877f12a035719c20376cee962c1884f4 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 5 Mar 2023 12:12:47 +0100 Subject: [PATCH] Keep hook-flash timer when CC-DISC-REQ or DTMF is received The timer must be kept, so that call gets released when it times out. --- src/pstn/pstn.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/pstn/pstn.c b/src/pstn/pstn.c index c2d6304..e2d16f2 100644 --- a/src/pstn/pstn.c +++ b/src/pstn/pstn.c @@ -623,10 +623,10 @@ void recv_dtmf(void *priv, char digit, dtmf_meas_t __attribute__((unused)) *meas pulse_off(pstn); /* stop tone */ tone_off(pstn); - /* stop timer */ - timer_off(pstn); /* if we are receiving digits en block */ if (pstn->call[PSTN_CALL_ACTIVE]->state == CALL_STATE_ENBLOCK) { + /* stop timer */ + timer_off(pstn); if (digit == '#') { PDEBUG(DTEL, DEBUG_DEBUG, "Digit '#' received, number is complete, send setup\n"); /* setup (en block) */ @@ -1206,8 +1206,11 @@ void cc_message(osmo_cc_endpoint_t *ep, uint32_t callref, osmo_cc_msg_t *msg) release_call(pstn, hold, isdn_cause); break; } - /* stop timer */ - timer_off(pstn); + /* keep hookflash timer running */ + if (pstn->timer_ident != TIMER_IDENT_HOOKFLASH) { + /* stop timer */ + timer_off(pstn); + } /* release ringing call (or call that rings because it is on hold) */ if (pstn_call->state == CALL_STATE_ALERTING_SUB || pstn_call->state == CALL_STATE_HOLD) { @@ -1239,8 +1242,11 @@ void cc_message(osmo_cc_endpoint_t *ep, uint32_t callref, osmo_cc_msg_t *msg) release_call(pstn, hold, isdn_cause); break; } - /* stop timer */ - timer_off(pstn); + /* keep hookflash timer running */ + if (pstn->timer_ident != TIMER_IDENT_HOOKFLASH) { + /* stop timer */ + timer_off(pstn); + } /* negotiate audio */ rc = osmo_cc_helper_audio_negotiate(msg, &pstn_call->cc_session, &pstn_call->codec); if (rc < 0) {