pespin has uploaded this change for review.

View Change

osmux: Allow forwarding AMR NO_DATA frames

Related: SYS#6161
Change-Id: If8baebc532090ba9808af7f3dd0afec86f40a7d6
---
M src/osmux_input.c
M src/osmux_output.c
2 files changed, 9 insertions(+), 5 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/98/30698/1
diff --git a/src/osmux_input.c b/src/osmux_input.c
index 284f08e..120f95f 100644
--- a/src/osmux_input.c
+++ b/src/osmux_input.c
@@ -196,9 +196,11 @@
link->osmuxh->amr_f = state->amrh->f;
link->osmuxh->amr_q = state->amrh->q;

- memcpy(state->out_msg->tail, osmo_amr_get_payload(state->amrh),
- state->amr_payload_len);
- msgb_put(state->out_msg, state->amr_payload_len);
+ if (state->amr_payload_len > 0) {
+ memcpy(state->out_msg->tail, osmo_amr_get_payload(state->amrh),
+ state->amr_payload_len);
+ msgb_put(state->out_msg, state->amr_payload_len);
+ }

/* Update circuit state of last transmitted incoming RTP seqnum/ts: */
state->circuit->last_transmitted_rtp_seq = rtp_seqnum;
diff --git a/src/osmux_output.c b/src/osmux_output.c
index c240578..f48e1c9 100644
--- a/src/osmux_output.c
+++ b/src/osmux_output.c
@@ -158,8 +158,10 @@
msgb_put(out_msg, sizeof(struct amr_hdr));

/* add AMR speech data */
- memcpy(out_msg->tail, payload, payload_len);
- msgb_put(out_msg, payload_len);
+ if (payload_len > 0) {
+ memcpy(out_msg->tail, payload, payload_len);
+ msgb_put(out_msg, payload_len);
+ }

/* bump last RTP sequence number and timestamp that has been used */
h->rtp_seq++;

To view, visit change 30698. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: If8baebc532090ba9808af7f3dd0afec86f40a7d6
Gerrit-Change-Number: 30698
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-MessageType: newchange