ussd: Ignore connection release/clear from the MSC

In case this is a local USSD connection we will ignore
the clear command and respond with a RLC to any RLSD but
will never forward that to the BSC. This way the external
USSD is fully in charge of the connection.
There are theoretical issues if there are multiple transactions
on the same SCCP Connection but this can not be solved properly
right now.
This commit is contained in:
Holger Hans Peter Freyther
2011-04-21 17:13:51 +02:00
parent 71dd06cfcb
commit 0b03f16cdb

View File

@@ -608,6 +608,11 @@ static int forward_sccp_to_bts(struct bsc_msc_connection *msc_con, struct msgb *
goto send_to_all; goto send_to_all;
break; break;
case SCCP_MSG_TYPE_RLSD: case SCCP_MSG_TYPE_RLSD:
if (con && con->con_local == NAT_CON_END_USSD) {
LOGP(DNAT, LOGL_NOTICE, "RLSD for a USSD connection. Ignoring.\n");
con = NULL;
}
/* fall through */
case SCCP_MSG_TYPE_CREF: case SCCP_MSG_TYPE_CREF:
case SCCP_MSG_TYPE_DT1: case SCCP_MSG_TYPE_DT1:
case SCCP_MSG_TYPE_IT: case SCCP_MSG_TYPE_IT:
@@ -623,6 +628,10 @@ static int forward_sccp_to_bts(struct bsc_msc_connection *msc_con, struct msgb *
LOGP(DNAT, LOGL_ERROR, "Failed to assign...\n"); LOGP(DNAT, LOGL_ERROR, "Failed to assign...\n");
} else } else
LOGP(DNAT, LOGL_ERROR, "Assignment command but no BSC.\n"); LOGP(DNAT, LOGL_ERROR, "Assignment command but no BSC.\n");
} else if (con && con->con_local == NAT_CON_END_USSD &&
parsed->gsm_type == BSS_MAP_MSG_CLEAR_CMD) {
LOGP(DNAT, LOGL_NOTICE, "Clear Command for USSD Connection. Ignoring.\n");
con = NULL;
} }
break; break;
case SCCP_MSG_TYPE_CC: case SCCP_MSG_TYPE_CC: