From 11a5894165b27e11495d7766694c9e37be84194c Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Mon, 25 Jun 2018 16:40:48 +0200 Subject: 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 --- library/MGCP_Emulation.ttcn | 21 +++++++++++++++++++++ library/MGCP_Types.ttcn | 11 +++++++++++ 2 files changed, 32 insertions(+) (limited to 'library') diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index b02dc061..0863511e 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 9d1a4e13..6bb266ea 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" } -- cgit v1.2.3