[PATCH] osmo-ttcn3-hacks[master]: MSC_Tests: Add CC sequence no. test with DTMF

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

daniel gerrit-no-reply at lists.osmocom.org
Thu Feb 15 09:35:16 UTC 2018


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6301

to look at the new patch set (#3).

MSC_Tests: Add CC sequence no. test with DTMF

Change-Id: I9674343acc18187b9e016bd8e0be470d5424046f
---
M library/L3_Templates.ttcn
M msc/BSC_ConnectionHandler.ttcn
M msc/MSC_Tests.ttcn
3 files changed, 104 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/01/6301/3

diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index cfbf96b..b506865 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -882,6 +882,30 @@
 	}
 }
 
+template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_START_DTMF(integer tid, charstring number) := {
+	discriminator := '0011'B,
+	tiOrSkip := {
+		transactionId := {
+			tio := int2bit(tid, 3),
+			tiFlag := '0'B,
+			tIExtension := omit
+		}
+	},
+	msgs := {
+		cc := {
+			startDTMF := {
+				messageType := '110101'B,
+				nsd := '00'B,
+				keypadFacility := {
+					elementIdentifier := '2C'O,
+					keypadInformation := int2bit(char2int(number), 7),
+					spare_1 := '0'B
+				}
+			}
+		}
+	}
+}
+
 template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := {
 	discriminator := '0011'B,
 	tiOrSkip := {
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 2d65a34..97b26d2 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -647,6 +647,67 @@
 	setverdict(pass);
 }
 
+function f_mo_seq_dtmf_dup(inout CallParameters cpars)
+runs on BSC_ConnHdlr {
+
+	timer T := 1.0;
+	var MobileIdentityLV mi;
+	var MNCC_PDU mncc;
+	var MgcpCommand mgcp_cmd;
+	var template PDU_ML3_MS_NW dtmf_dtap;
+
+	/* If we have a TMSI, use TMSI instead of IMSI */
+	if (ispresent(g_pars.tmsi)) {
+		mi := valueof(ts_MI_TMSI_LV(g_pars.tmsi));
+	} else {
+		mi := valueof(ts_MI_IMSI_LV(g_pars.imsi));
+	}
+	f_establish_fully(mi);
+
+	/* Create MNCC and MGCP expect */
+	f_create_mncc_expect(hex2str(cpars.called_party));
+	f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit});
+
+	BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party)));
+	MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc;
+	cpars.mncc_callref := mncc.u.signal.callref;
+
+	/* Send DTMF */
+	dtmf_dtap := ts_ML3_MO_CC_START_DTMF(cpars.transaction_id, "2");
+	dtmf_dtap.msgs.cc.startDTMF.nsd := int2bit(2, 2);
+	BSSAP.send(ts_PDU_DTAP_MO(dtmf_dtap));
+	T.start;
+	alt {
+	[] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "2")) {}
+	[] T.timeout {
+		setverdict(fail, "Timeout waiting for START_DTMF_ind");
+		self.stop;
+		}
+	}
+
+	BSSAP.send(ts_PDU_DTAP_MO(dtmf_dtap));
+	T.start;
+	alt {
+	[] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "2")) {
+		setverdict(fail, "Received duplicate START_DTMF_ind");
+		self.stop;
+		}
+	[] T.timeout { }
+	}
+
+	dtmf_dtap := ts_ML3_MO_CC_START_DTMF(cpars.transaction_id, "3");
+	dtmf_dtap.msgs.cc.startDTMF.nsd := int2bit(3, 2);
+	BSSAP.send(ts_PDU_DTAP_MO(dtmf_dtap))
+	alt {
+	[] MNCC.receive(tr_MNCC_START_DTMF_ind(cpars.mncc_callref, "3")) { }
+	[] T.timeout {
+		setverdict(fail, "Received duplicate START_DTMF_ind");
+		self.stop;
+		}
+	}
+
+	setverdict(pass);
+}
 /* expect a clear command */
 function f_expect_clear(float t := 5.0) runs on BSC_ConnHdlr {
 	timer T := t;
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 1799508..a8d9022 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -1565,6 +1565,24 @@
 	vc_conn.done;
 }
 
+/* Test MO Call SETUP with DTMF */
+private function f_tc_mo_setup_dtmf_dup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr {
+	f_init_handler(pars);
+	var CallParameters cpars := valueof(t_CallParams('12345'H, 0));
+	cpars.bss_rtp_port := 1110;
+	cpars.mgcp_connection_id_bss := '22222'H;
+	cpars.mgcp_connection_id_mss := '33333'H;
+
+	f_perform_lu(true);
+	f_mo_seq_dtmf_dup(cpars);
+}
+testcase TC_mo_setup_and_dtmf_dup() runs on MTC_CT {
+	var BSC_ConnHdlr vc_conn;
+	f_init();
+
+	vc_conn := f_start_handler(refers(f_tc_mo_setup_dtmf_dup), testcasename(), 39);
+	vc_conn.done;
+}
 
 
 
@@ -1614,6 +1632,7 @@
 	execute( TC_mo_crcx_ran_timeout() );
 	execute( TC_mo_crcx_ran_reject() );
 	execute( TC_mt_crcx_ran_reject() );
+	execute( TC_mo_setup_and_dtmf_dup() );
 	//execute( TC_mt_t310() );
 	execute( TC_gsup_cancel() );
 	execute( TC_lu_imsi_auth_tmsi_encr_1_13() );

-- 
To view, visit https://gerrit.osmocom.org/6301
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9674343acc18187b9e016bd8e0be470d5424046f
Gerrit-PatchSet: 3
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>



More information about the gerrit-log mailing list