summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-06-25 16:40:48 +0200
committerHarald Welte <laforge@gnumonks.org>2018-06-25 19:55:09 +0000
commit11a5894165b27e11495d7766694c9e37be84194c (patch)
tree1ac041b5cdef7e8e54b9905bb2330b0c76d255e2 /library
parent04fc4bcc18bd2aa9d81f63576134c0ccbd1a6a0b (diff)
BSC_Tests: use correct payload types and encoding names on MGCP
The test currently use a hardcoded payload type and encoding name. This does mean in practice that even when an assignment with EFR is happeining. The MGCP responses to the BSC tell that the codec is AMR. This is not correct. The testcases should always pick a suitable payload type / encoding name in the MGCP response - Add constants for IANA/3GPP assigned payload types - Add function to lookup the right encoding name for a payload type - Initalize the encoding name and payload type in g_media according to the BSSAP PDU. Change-Id: I2735267091059e2f2169da80bdcd30abc2b1554b Realted: OS#2728
Diffstat (limited to 'library')
-rw-r--r--library/MGCP_Emulation.ttcn21
-rw-r--r--library/MGCP_Types.ttcn11
2 files changed, 32 insertions, 0 deletions
diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn
index b02dc06..0863511 100644
--- a/library/MGCP_Emulation.ttcn
+++ b/library/MGCP_Emulation.ttcn
@@ -441,5 +441,26 @@ runs on MGCP_Emulation_CT return template MgcpMessage {
return omit;
}
+/* Determine encoding name for a specified payload type number */
+function f_encoding_name_from_pt(SDP_FIELD_PayloadType pt) return charstring {
+ if (pt == PT_PCMU) {
+ return "PCMU";
+ } else if (pt == PT_GSM) {
+ return "GSM";
+ } else if (pt == PT_PCMA) {
+ return "PCMA";
+ } else if (pt == PT_GSMEFR) {
+ return "GSM-EFR";
+ } else if (pt == PT_GSMHR) {
+ return "GSM-HR-08";
+ } else if (pt == PT_AMR) {
+ return "AMR";
+ } else if (pt == PT_AMRWB) {
+ return "AMR-WB";
+ }
+
+ setverdict(fail);
+ return "";
+}
}
diff --git a/library/MGCP_Types.ttcn b/library/MGCP_Types.ttcn
index 9d1a4e1..6bb266e 100644
--- a/library/MGCP_Types.ttcn
+++ b/library/MGCP_Types.ttcn
@@ -121,5 +121,16 @@ module MGCP_Types {
external function dec_MgcpMessage(in charstring id) return MgcpMessage
with { extension "prototype(convert) decode(TEXT)" };
+ /* IANA / 3gpp assigned payload type numbers */
+ type enumerated SDP_FIELD_PayloadType {
+ PT_PCMU(0),
+ PT_GSM(3),
+ PT_PCMA(8),
+ PT_G729(18),
+ PT_GSMEFR(110),
+ PT_GSMHR(111),
+ PT_AMR(112),
+ PT_AMRWB(113)
+ }
} with { encode "TEXT" }