iuup_cn_node.c: use 0x70 instead of 0xf0 in AMR hdr
in the AMR header first 4 bits is CMR (codec mode request). "7" means
AMR 12.2k. And "f" means "no mode request".
See RFC4867 Section 4.3.1.
diff --git a/src/libosmo-mgcp/iuup_cn_node.c b/src/libosmo-mgcp/iuup_cn_node.c
index 6a7e3b5..bb6cf4b 100644
--- a/src/libosmo-mgcp/iuup_cn_node.c
+++ b/src/libosmo-mgcp/iuup_cn_node.c
@@ -91,7 +91,7 @@
int is_comfort_noise = ((pdu->len - pre_hdr_len) == 9);
memmove(pdu->data + sizeof(*hdr) - 2, pdu->data, pre_hdr_len);
- ((uint8_t*)hdr)[2] = 0xf0;
+ ((uint8_t*)hdr)[2] = 0x70;
((uint8_t*)hdr)[3] = is_comfort_noise ? 0x44 : 0x3c;
msgb_pull(pdu, sizeof(*hdr) - 2);
diff --git a/tests/iuup/iuup_test.c b/tests/iuup/iuup_test.c
index 6144ac8..6184161 100644
--- a/tests/iuup/iuup_test.c
+++ b/tests/iuup/iuup_test.c
@@ -111,14 +111,14 @@
#define RTP_PAYLOAD "6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0"
printf("\nReceive payload encapsulated in IuUP. Expecting rx_payload() of just RTP packet\n");
printf("i.e. should strip away " IUUP_HEADER "\n");
- expect_rx_payload = RTP_HEADER "f03c" RTP_PAYLOAD;
+ expect_rx_payload = RTP_HEADER "703c" RTP_PAYLOAD;
rx_pdu(cn,
msgb_from_hex("IuUP-Data",
RTP_HEADER IUUP_HEADER RTP_PAYLOAD));
printf("\nReceive payload encapsulated in IuUP. Expecting rx_payload() of just RTP packet\n");
printf("i.e. should strip away " "0401479e" "\n");
- expect_rx_payload = RTP_HEADER "f044" "26e9b851ee";
+ expect_rx_payload = RTP_HEADER "7044" "26e9b851ee";
rx_pdu(cn,
msgb_from_hex("IuUP-Data",
RTP_HEADER "0401479e" "26e9b851ee"));
@@ -126,18 +126,18 @@
printf("\nTransmit RTP. Expecting tx_msg() with inserted IuUP header\n");
expect_tx_msg = RTP_HEADER "000002b3" RTP_PAYLOAD;
tx_payload(cn,
- msgb_from_hex("RTP data", RTP_HEADER "f03c" RTP_PAYLOAD));
+ msgb_from_hex("RTP data", RTP_HEADER "703c" RTP_PAYLOAD));
printf("\nMore RTP, each time the Frame Nr advances, causing a new header CRC.\n");
expect_tx_msg = RTP_HEADER "0100e2b3" RTP_PAYLOAD;
tx_payload(cn,
- msgb_from_hex("RTP data", RTP_HEADER "f03c" RTP_PAYLOAD));
+ msgb_from_hex("RTP data", RTP_HEADER "703c" RTP_PAYLOAD));
expect_tx_msg = RTP_HEADER "02007eb3" RTP_PAYLOAD;
tx_payload(cn,
- msgb_from_hex("RTP data", RTP_HEADER "f03c" RTP_PAYLOAD));
+ msgb_from_hex("RTP data", RTP_HEADER "703c" RTP_PAYLOAD));
expect_tx_msg = RTP_HEADER "03009eb3" RTP_PAYLOAD;
tx_payload(cn,
- msgb_from_hex("RTP data", RTP_HEADER "f03c" RTP_PAYLOAD));
+ msgb_from_hex("RTP data", RTP_HEADER "703c" RTP_PAYLOAD));
printf("All done.\n");
}
diff --git a/tests/iuup/iuup_test.ok b/tests/iuup/iuup_test.ok
index 8cc4f4f..c0b587e 100644
--- a/tests/iuup/iuup_test.ok
+++ b/tests/iuup/iuup_test.ok
@@ -15,7 +15,7 @@
8060944c6256042c000101020100e2b36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
rx_payload() invoked by iuup_cn!
[IuUP] -RTP->
-8060944c6256042c00010102f03c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
+8060944c6256042c00010102703c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
node_priv=0x2342
ok: matches expected msg
rc=0
@@ -26,14 +26,14 @@
8060944c6256042c000101020401479e26e9b851ee
rx_payload() invoked by iuup_cn!
[IuUP] -RTP->
-8060944c6256042c00010102f04426e9b851ee
+8060944c6256042c00010102704426e9b851ee
node_priv=0x2342
ok: matches expected msg
rc=0
Transmit RTP. Expecting tx_msg() with inserted IuUP header
[IuUP] <-RTP-
-8060944c6256042c00010102f03c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
+8060944c6256042c00010102703c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
tx_msg() invoked by iuup_cn!
<-PDU- [IuUP]
8060944c6256042c00010102000002b36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
@@ -43,7 +43,7 @@
More RTP, each time the Frame Nr advances, causing a new header CRC.
[IuUP] <-RTP-
-8060944c6256042c00010102f03c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
+8060944c6256042c00010102703c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
tx_msg() invoked by iuup_cn!
<-PDU- [IuUP]
8060944c6256042c000101020100e2b36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
@@ -51,7 +51,7 @@
ok: matches expected msg
rc=0
[IuUP] <-RTP-
-8060944c6256042c00010102f03c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
+8060944c6256042c00010102703c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
tx_msg() invoked by iuup_cn!
<-PDU- [IuUP]
8060944c6256042c0001010202007eb36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
@@ -59,7 +59,7 @@
ok: matches expected msg
rc=0
[IuUP] <-RTP-
-8060944c6256042c00010102f03c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
+8060944c6256042c00010102703c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
tx_msg() invoked by iuup_cn!
<-PDU- [IuUP]
8060944c6256042c0001010203009eb36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0