Compare commits

...

2 Commits

Author SHA1 Message Date
Neels Hofmeyr
bebcef4844 fu
Change-Id: I8cb7a05b583894a5edfb27421c0dcca14ebf099a
2018-12-28 04:18:31 +01:00
Neels Hofmeyr
f174dd641d wip hack
Change-Id: I9d4bcf34d75bf606c3f145ca0056ac1e51cc301a
2018-12-28 03:48:08 +01:00
3 changed files with 11 additions and 2 deletions

View File

@@ -92,6 +92,10 @@ static int rx_data(struct osmo_iuup_cn *cn, struct msgb *pdu,
((uint8_t*)hdr)[3] = 0x3c;
msgb_pull(pdu, sizeof(*hdr) - 2);
struct rtp_hdr *h = (struct rtp_hdr*)pdu->data;
if (h->payload_type == 96)
h->payload_type = 112;
LOGP(DIUUP, LOGL_DEBUG, "(%s) IuUP stripping IuUP header from RTP data\n", cn->name);
cn->cfg.rx_payload(pdu, cn->cfg.node_priv);
@@ -212,5 +216,9 @@ int osmo_iuup_cn_tx_payload(struct osmo_iuup_cn *cn, struct msgb *pdu)
LOGP(DIUUP, LOGL_DEBUG, "(%s) IuUP inserting IuUP header in RTP data (frame nr %u)\n",
cn->name, iuup_hdr->frame_nr);
struct rtp_hdr *h = (struct rtp_hdr*)pdu->data;
if (h->payload_type == 112)
h->payload_type = 96;
return cn->cfg.tx_msg(pdu, cn->cfg.node_priv);
}

View File

@@ -107,11 +107,12 @@ void test_cn_session()
"160051673c01270000820000001710000100" /* IuUP params */));
#define RTP_HEADER "8060944c6256042c00010102"
#define RTP_HEADER_PT112 "8070944c6256042c00010102"
#define IUUP_HEADER "0100e2b3"
#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_PT112 "f03c" RTP_PAYLOAD;
rx_pdu(cn,
msgb_from_hex("IuUP-Data",
RTP_HEADER IUUP_HEADER RTP_PAYLOAD));

View File

@@ -15,7 +15,7 @@ i.e. should strip away 0100e2b3
8060944c6256042c000101020100e2b36cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
rx_payload() invoked by iuup_cn!
[IuUP] -RTP->
8060944c6256042c00010102f03c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
8070944c6256042c00010102f03c6cfb23bc46d18180c3e5ffe040045600005a7d35b625b80005fff03214ced0
node_priv=0x2342
ok: matches expected msg
rc=0