From 6a812616a4e4e8f809072242dd73dddf2688220a Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Tue, 3 Jan 2023 11:23:21 +0100 Subject: [PATCH] Fixed handling of call collision An establishment is received from AN (access network), while establishment request was sent to AN. The call is answered. --- src/pstn/pstn.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pstn/pstn.c b/src/pstn/pstn.c index a6b34a1..a2a19f0 100644 --- a/src/pstn/pstn.c +++ b/src/pstn/pstn.c @@ -1542,8 +1542,15 @@ static void v5_receive(pstn_t *pstn, uint8_t *data, int len) break; case PSTN_EVENT_EST_IND: /* in case of collision, just treat as ACK and proceed outgoing call */ - if (pstn->state != PSTN_STATE_EST_LE - && pstn->state != PSTN_STATE_NULL) { + if (pstn->state == PSTN_STATE_EST_LE) { + PDEBUG(DTEL, DEBUG_INFO, " -> Handle establish collision, send ACK.\n"); + /* send ack message to V5 */ + v5_est_ack_req(pstn); + /* treat as establish acknowledgement from PSTN interface */ + v5_est_ack_ind(pstn, data, len); + break; + } + if (pstn->state != PSTN_STATE_NULL) { PDEBUG(DTEL, DEBUG_NOTICE, "Received %s message in state %s, ignoring!\n", pstn_event_name(event), pstn_state_name(pstn->state)); break; }