From fe4a25903c999b9dc02a65d6ee16dbf4b7df0609 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 27 Oct 2022 23:38:43 +0200 Subject: [PATCH] RAB Assignment: add more SDUs for more AMR modes Change-Id: I61e0e9e75e3239662846fd797532acdefa9f73dc --- src/ranap_msg_factory.c | 60 ++++++++++++++++++++++++++++++++++++----- src/tests/test-ranap.ok | 32 +++++++++++++--------- 2 files changed, 73 insertions(+), 19 deletions(-) diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c index b871343b..25209c2e 100644 --- a/src/ranap_msg_factory.c +++ b/src/ranap_msg_factory.c @@ -545,16 +545,31 @@ static RANAP_SDU_ParameterItem_t *new_sdu_par_item(enum sdu_par_profile profile) switch (profile) { case SDUPAR_P_VOICE0: - sdui->sDU_ErrorRatio = new_sdu_error_ratio(1, 5); + sdui->sDU_ErrorRatio = new_sdu_error_ratio(7, 3); sdui->residualBitErrorRatio.mantissa = 1; - sdui->residualBitErrorRatio.exponent = 6; + sdui->residualBitErrorRatio.exponent = 4; sdui->deliveryOfErroneousSDU = RANAP_DeliveryOfErroneousSDU_yes; sdui->sDU_FormatInformationParameters = fmtip; fmti = new_format_info_pars(81); ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(65); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(75); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(61); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(58); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(55); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(49); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(42); + ASN_SEQUENCE_ADD(fmtip, fmti); fmti = new_format_info_pars(39); ASN_SEQUENCE_ADD(fmtip, fmti); - /* FIXME: could be 10 SDU descriptors for AMR! */ + fmti = new_format_info_pars(0); + ASN_SEQUENCE_ADD(fmtip, fmti); break; case SDUPAR_P_VOICE1: sdui->residualBitErrorRatio.mantissa = 1; @@ -563,17 +578,48 @@ static RANAP_SDU_ParameterItem_t *new_sdu_par_item(enum sdu_par_profile profile) sdui->sDU_FormatInformationParameters = fmtip; fmti = new_format_info_pars(103); ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(99); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(84); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(87); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(76); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(63); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(54); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(53); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(0); + ASN_SEQUENCE_ADD(fmtip, fmti); fmti = new_format_info_pars(0); ASN_SEQUENCE_ADD(fmtip, fmti); - /* FIXME: could be 10 SDU descriptors for AMR! */ break; case SDUPAR_P_VOICE2: - sdui->residualBitErrorRatio.mantissa = 5; + sdui->residualBitErrorRatio.mantissa = 1; sdui->residualBitErrorRatio.exponent = 3; sdui->deliveryOfErroneousSDU = RANAP_DeliveryOfErroneousSDU_no_error_detection_consideration; sdui->sDU_FormatInformationParameters = fmtip; fmti = new_format_info_pars(60); ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(40); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(0); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(0); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(0); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(0); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(0); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(0); + ASN_SEQUENCE_ADD(fmtip, fmti); + fmti = new_format_info_pars(0); + ASN_SEQUENCE_ADD(fmtip, fmti); fmti = new_format_info_pars(0); ASN_SEQUENCE_ADD(fmtip, fmti); /* FIXME: could be 10 SDU descriptors for AMR! */ @@ -639,7 +685,7 @@ static RANAP_RAB_Parameters_t *new_rab_par_voice(long bitrate_guaranteed, sdui = new_sdu_par_item(SDUPAR_P_VOICE2); ASN_SEQUENCE_ADD(&rab->sDU_Parameters, sdui); - rab->transferDelay = new_long(80); + rab->transferDelay = new_long(100); rab->allocationOrRetentionPriority = new_alloc_ret_prio(RANAP_PriorityLevel_no_priority, 0, 1, 0); rab->sourceStatisticsDescriptor = new_long(RANAP_SourceStatisticsDescriptor_speech); @@ -745,7 +791,7 @@ struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, uint32_t rtp_ip, memset(&first, 0, sizeof(first)); assign_new_ra_id(&first.rAB_ID, rab_id); first.nAS_SynchronisationIndicator = new_rab_nas_sync_ind(60); - first.rAB_Parameters = new_rab_par_voice(6700, 12200); + first.rAB_Parameters = new_rab_par_voice(4750, 12200); first.userPlaneInformation = new_upi(RANAP_UserPlaneMode_support_mode_for_predefined_SDU_sizes, 1); /* 2? */ rtp_addr.u.sin.sin_family = AF_INET; diff --git a/src/tests/test-ranap.ok b/src/tests/test-ranap.ok index a0ea5214..ebfa2dc8 100644 --- a/src/tests/test-ranap.ok +++ b/src/tests/test-ranap.ok @@ -88,11 +88,15 @@ Decoded Cause Misc=115 53 - 78 02 CD 80 10 2F A7 20 1A 2C 00 00 F4 4C 08 0A - 02 80 00 51 40 00 27 20 28 14 00 67 40 00 00 22 - 28 14 00 3C 40 00 00 00 50 3D 02 00 02 27 C0 35 - 00 01 0A 0B 0C 0D 00 00 00 00 00 00 00 00 00 00 - 00 00 00 40 09 26 00 00 + 78 02 CD 80 10 2F A7 20 12 8E 00 00 F4 4C 64 06 + 12 80 00 51 40 00 41 40 00 4B 40 00 3D 40 00 3A + 40 00 37 40 00 31 40 00 2A 40 00 27 40 00 00 20 + 28 94 00 67 40 00 63 40 00 54 40 00 57 40 00 4C + 40 00 3F 40 00 36 40 00 35 40 00 00 40 00 00 20 + 28 94 00 3C 40 00 28 40 00 00 40 00 00 40 00 00 + 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 00 + 64 3D 02 00 02 27 C0 35 00 01 0A 0B 0C 0D 00 00 + 00 00 00 00 00 00 00 00 00 00 00 40 09 26 00 00 00 @@ -101,15 +105,19 @@ Decoded Cause Misc=115 54 - 00 00 01 00 35 00 48 78 02 CD 80 10 2F A7 20 1A - 2C 00 00 F4 4C 08 0A 02 80 00 51 40 00 27 20 28 - 14 00 67 40 00 00 22 28 14 00 3C 40 00 00 00 50 - 3D 02 00 02 27 C0 35 00 01 0A 0B 0C 0D 00 00 00 - 00 00 00 00 00 00 00 00 00 00 40 09 26 00 00 40 - 01 00 + 00 00 01 00 35 00 80 90 78 02 CD 80 10 2F A7 20 + 12 8E 00 00 F4 4C 64 06 12 80 00 51 40 00 41 40 + 00 4B 40 00 3D 40 00 3A 40 00 37 40 00 31 40 00 + 2A 40 00 27 40 00 00 20 28 94 00 67 40 00 63 40 + 00 54 40 00 57 40 00 4C 40 00 3F 40 00 36 40 00 + 35 40 00 00 40 00 00 20 28 94 00 3C 40 00 28 40 + 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 + 00 40 00 00 40 00 00 00 64 3D 02 00 02 27 C0 35 + 00 01 0A 0B 0C 0D 00 00 00 00 00 00 00 00 00 00 + 00 00 00 40 09 26 00 00 40 01 00 -00 00 00 59 00 00 01 00 36 40 52 00 00 01 00 35 00 48 78 02 cd 80 10 2f a7 20 1a 2c 00 00 f4 4c 08 0a 02 80 00 51 40 00 27 20 28 14 00 67 40 00 00 22 28 14 00 3c 40 00 00 00 50 3d 02 00 02 27 c0 35 00 01 0a 0b 0c 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 40 09 26 00 00 40 01 00 +00 00 00 80 a3 00 00 01 00 36 40 80 9b 00 00 01 00 35 00 80 90 78 02 cd 80 10 2f a7 20 12 8e 00 00 f4 4c 64 06 12 80 00 51 40 00 41 40 00 4b 40 00 3d 40 00 3a 40 00 37 40 00 31 40 00 2a 40 00 27 40 00 00 20 28 94 00 67 40 00 63 40 00 54 40 00 57 40 00 4c 40 00 3f 40 00 36 40 00 35 40 00 00 40 00 00 20 28 94 00 3c 40 00 28 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 00 64 3d 02 00 02 27 c0 35 00 01 0a 0b 0c 0d 00 00 00 00 00 00 00 00 00 00 00 00 00 40 09 26 00 00 40 01 00 ==> RAB ASSIGNMENT COMMAND (DATA)