summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-06-21 04:18:54 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-06-21 21:58:39 +0700
commit911257ebb24ffc6b657cc0710a13ff74fdf90eab (patch)
treec31bf7468e87f89fd6ab0ab47e4567eebf41f8d5 /library
parent52f8b6ee1dba92677653d2c373ec036ff948ae9e (diff)
library/GSUP_Types.ttcn: SS Info IE is optional for GSUP_PROC_SS_*
The 'SS Info' IE is optional for GSUP_PROC_SS_{REQ|RSP} messages, and is not carried in some cases, e.g. when a subscriber aborts an active transaction by pressing the 'red button'. Change-Id: I20d9028acbe0c457d2a2cf72eff372b749d8dc30
Diffstat (limited to 'library')
-rw-r--r--library/GSUP_Types.ttcn79
1 files changed, 51 insertions, 28 deletions
diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn
index 359e272..6044565 100644
--- a/library/GSUP_Types.ttcn
+++ b/library/GSUP_Types.ttcn
@@ -581,62 +581,85 @@ template GSUP_IE tr_GSUP_IE_SSInfo(template octetstring ss) := {
}
}
-template (value) GSUP_PDU ts_GSUP_PROC_SS_REQ(
+private function f_gen_ts_ss_ies(
hexstring imsi,
OCT4 sid,
GSUP_SessionState state,
- octetstring ss
-) := ts_GSUP(
- OSMO_GSUP_MSGT_PROC_SS_REQUEST,
- {
+ template (omit) octetstring ss
+) return GSUP_IEs {
+ /* Mandatory IEs */
+ var GSUP_IEs ies := {
valueof(ts_GSUP_IE_IMSI(imsi)),
valueof(ts_GSUP_IE_SessionId(sid)),
- valueof(ts_GSUP_IE_SessionState(state)),
- valueof(ts_GSUP_IE_SSInfo(ss))
+ valueof(ts_GSUP_IE_SessionState(state))
+ };
+
+ /* Optional SS payload */
+ if (isvalue(ss)) {
+ ies[3] := valueof(ts_GSUP_IE_SSInfo(valueof(ss)));
}
-);
-template GSUP_PDU tr_GSUP_PROC_SS_REQ(
+
+ return ies;
+}
+private function f_gen_tr_ss_ies(
template hexstring imsi,
template OCT4 sid := ?,
template GSUP_SessionState state := ?,
template octetstring ss := ?
-) := tr_GSUP(
- OSMO_GSUP_MSGT_PROC_SS_REQUEST,
- {
+) return template GSUP_IEs {
+ /* Mandatory IEs */
+ var template GSUP_IEs ies := {
tr_GSUP_IE_IMSI(imsi),
tr_GSUP_IE_SessionId(sid),
- tr_GSUP_IE_SessionState(state),
- tr_GSUP_IE_SSInfo(ss)
+ tr_GSUP_IE_SessionState(state)
+ };
+
+ /* Optional SS payload */
+ if (istemplatekind(ss, "*")) {
+ ies[3] := *;
+ } else if (not istemplatekind(ss, "omit")) {
+ ies[3] := tr_GSUP_IE_SSInfo(ss);
}
+
+ return ies;
+}
+
+template (value) GSUP_PDU ts_GSUP_PROC_SS_REQ(
+ hexstring imsi,
+ OCT4 sid,
+ GSUP_SessionState state,
+ template (omit) octetstring ss := omit
+) := ts_GSUP(
+ OSMO_GSUP_MSGT_PROC_SS_REQUEST,
+ f_gen_ts_ss_ies(imsi, sid, state, ss)
+);
+template GSUP_PDU tr_GSUP_PROC_SS_REQ(
+ template hexstring imsi,
+ template OCT4 sid := ?,
+ template GSUP_SessionState state := ?,
+ template octetstring ss := *
+) := tr_GSUP(
+ OSMO_GSUP_MSGT_PROC_SS_REQUEST,
+ f_gen_tr_ss_ies(imsi, sid, state, ss)
);
template (value) GSUP_PDU ts_GSUP_PROC_SS_RES(
hexstring imsi,
OCT4 sid,
GSUP_SessionState state,
- octetstring ss
+ template (omit) octetstring ss := omit
) := ts_GSUP(
OSMO_GSUP_MSGT_PROC_SS_RESULT,
- {
- valueof(ts_GSUP_IE_IMSI(imsi)),
- valueof(ts_GSUP_IE_SessionId(sid)),
- valueof(ts_GSUP_IE_SessionState(state)),
- valueof(ts_GSUP_IE_SSInfo(ss))
- }
+ f_gen_ts_ss_ies(imsi, sid, state, ss)
);
template GSUP_PDU tr_GSUP_PROC_SS_RES(
template hexstring imsi,
template OCT4 sid := ?,
template GSUP_SessionState state := ?,
- template octetstring ss := ?
+ template octetstring ss := *
) := tr_GSUP(
OSMO_GSUP_MSGT_PROC_SS_RESULT,
- {
- tr_GSUP_IE_IMSI(imsi),
- tr_GSUP_IE_SessionId(sid),
- tr_GSUP_IE_SessionState(state),
- tr_GSUP_IE_SSInfo(ss)
- }
+ f_gen_tr_ss_ies(imsi, sid, state, ss)
);
template (value) GSUP_PDU ts_GSUP_PROC_SS_ERR(