From 39e66c6e31b9901886a987743bb391f8cf6dfd10 Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Wed, 22 Feb 2023 19:09:31 +0100 Subject: [PATCH] Register recall signal is now handled correctly Active call will be put on hold. During dialing, active call will be retrieved. This also applies to on-hook pulse, if it is used by AN. (No AN I have seen uses this pulse.) --- src/pstn/pstn.c | 13 ++++++++++++- src/pstn/pstn.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/pstn/pstn.c b/src/pstn/pstn.c index bc93f80..66389da 100644 --- a/src/pstn/pstn.c +++ b/src/pstn/pstn.c @@ -1546,9 +1546,20 @@ static void v5_sig_ind(pstn_t *pstn, uint8_t *data, int len) break; case PSTN_V5_IE_PULSED_SIGNAL: switch ((data[2] & 0x7f)) { + case PSTN_V5_PULSED_SIGNAL_REG_RECAL: + PDEBUG(DTEL, DEBUG_INFO, "Received register recall signal.\n"); + if (pstn->recall && (pstn->call[PSTN_CALL_ACTIVE]->state == CALL_STATE_ACTIVE + || pstn->call[PSTN_CALL_ACTIVE]->state == CALL_STATE_ENBLOCK + || pstn->call[PSTN_CALL_ACTIVE]->state == CALL_STATE_OVERLAP_NET)) { + PDEBUG(DTEL, DEBUG_INFO, "Performing hookflash, register recall signal was received.\n"); + hookflash(pstn); + } + break; case PSTN_V5_PULSED_SIGNAL_ON_HOOK: PDEBUG(DTEL, DEBUG_INFO, "Received pulsed on-kook signal.\n"); - if (pstn->recall && pstn->call[PSTN_CALL_ACTIVE]->state == CALL_STATE_ACTIVE) { + if (pstn->recall && (pstn->call[PSTN_CALL_ACTIVE]->state == CALL_STATE_ACTIVE + || pstn->call[PSTN_CALL_ACTIVE]->state == CALL_STATE_ENBLOCK + || pstn->call[PSTN_CALL_ACTIVE]->state == CALL_STATE_OVERLAP_NET)) { PDEBUG(DTEL, DEBUG_INFO, "Performing hookflash, on-hook pulse was received.\n"); hookflash(pstn); } diff --git a/src/pstn/pstn.h b/src/pstn/pstn.h index a1fd35b..467f473 100644 --- a/src/pstn/pstn.h +++ b/src/pstn/pstn.h @@ -46,6 +46,7 @@ enum pstn_v5_signal { PSTN_V5_STEADY_SIGNAL_ON_HOOK = 0x05, PSTN_V5_STEADY_SIGNAL_STOP_RING = 0x0e, PSTN_V5_PULSED_SIGNAL_INIT_RING = 0x79, + PSTN_V5_PULSED_SIGNAL_REG_RECAL = 0x76, PSTN_V5_PULSED_SIGNAL_ON_HOOK = 0x7c, };