aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-10-27 23:38:43 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2023-06-10 00:19:18 +0200
commit6cccd2e29570ed27b1dc0eb189a7219f29b44166 (patch)
tree7cfd045b1a406cf336d72689c40038cf1fc1b9a2
parentd6bde3f6a6ec05fcc53e5a2a38a155a8fece67d6 (diff)
RAB Assignment: add more SDUs for more AMR modesneels/codecs
-rw-r--r--src/ranap_msg_factory.c60
-rw-r--r--tests/test-ranap.ok32
2 files changed, 73 insertions, 19 deletions
diff --git a/src/ranap_msg_factory.c b/src/ranap_msg_factory.c
index 44b879f..2606e12 100644
--- a/src/ranap_msg_factory.c
+++ b/src/ranap_msg_factory.c
@@ -561,16 +561,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;
@@ -579,17 +594,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! */
@@ -655,7 +701,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);
@@ -761,7 +807,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/tests/test-ranap.ok b/tests/test-ranap.ok
index a0ea521..ebfa2dc 100644
--- a/tests/test-ranap.ok
+++ b/tests/test-ranap.ok
@@ -88,11 +88,15 @@ Decoded Cause Misc=115
<id>53</id>
<firstCriticality><reject/></firstCriticality>
<firstValue>
- 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
</firstValue>
<secondCriticality><ignore/></secondCriticality>
<secondValue>00</secondValue>
@@ -101,15 +105,19 @@ Decoded Cause Misc=115
<id>54</id>
<criticality><ignore/></criticality>
<value>
- 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
</value>
</RANAP_IE>
-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)
<RANAP_ProtocolIE-FieldPair>