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.)
This commit is contained in:
Andreas Eversberg 2023-02-22 19:09:31 +01:00
parent f2500899b8
commit 39e66c6e31
2 changed files with 13 additions and 1 deletions

View File

@ -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);
}

View File

@ -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,
};