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