Introduce msc_is_{sccplite,aoip}() helpers
Having the helper makes it easier to read/find for transport type checks. It
will be ifurther re-used in forthcoming commits.
Change-Id: Ic0ee4c472e29ec3092049e5e23b744395613616d
diff --git a/include/osmocom/bsc/bsc_msc_data.h b/include/osmocom/bsc/bsc_msc_data.h
index 4720845..1f9872a 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -191,5 +191,25 @@
return (port - base) / 2;
}
+static inline bool msc_is_aoip(const struct bsc_msc_data *msc)
+{
+ switch (msc->a.asp_proto) {
+ case OSMO_SS7_ASP_PROT_SUA:
+ case OSMO_SS7_ASP_PROT_M3UA:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static inline bool msc_is_sccplite(const struct bsc_msc_data *msc)
+{
+ switch (msc->a.asp_proto) {
+ case OSMO_SS7_ASP_PROT_IPA:
+ return true;
+ default:
+ return false;
+ }
+}
#endif
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index 87ad567..7b9f912 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -1058,14 +1058,7 @@
if (!conn || !conn->sccp.msc)
return false;
- switch (conn->sccp.msc->a.asp_proto) {
- case OSMO_SS7_ASP_PROT_SUA:
- case OSMO_SS7_ASP_PROT_M3UA:
- return true;
-
- default:
- return false;
- }
+ return msc_is_aoip(conn->sccp.msc);
}
bool gscon_is_sccplite(struct gsm_subscriber_connection *conn)
@@ -1073,11 +1066,5 @@
if (!conn || !conn->sccp.msc)
return false;
- switch (conn->sccp.msc->a.asp_proto) {
- case OSMO_SS7_ASP_PROT_IPA:
- return true;
-
- default:
- return false;
- }
+ return msc_is_sccplite(conn->sccp.msc);
}
diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c
index 5d61c32..8303c4f 100644
--- a/src/osmo-bsc/osmo_bsc_sigtran.c
+++ b/src/osmo-bsc/osmo_bsc_sigtran.c
@@ -523,8 +523,7 @@
* an X-Osmo-IGN flag telling osmo-mgw to ignore CallID mismatches for this endpoint.
* If an explicit VTY command has already indicated whether or not to send X-Osmo-IGN, do
* not overwrite that setting. */
- if (msc->a.asp_proto == OSMO_SS7_ASP_PROT_IPA
- && !msc->x_osmo_ign_configured)
+ if (msc_is_sccplite(msc) && !msc->x_osmo_ign_configured)
msc->x_osmo_ign |= MGCP_X_OSMO_IGN_CALLID;
/* If unset, use default local SCCP address */