Change in osmo-mgw[master]: Improve logging on AMR OA<->BWE conversion failure
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29877 ) Change subject: Improve logging on AMR OA<->BWE conversion failure ...................................................................... Improve logging on AMR OA<->BWE conversion failure Change-Id: I7c7dd10650c1d249c723d6781585b343004bd64d --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 9 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/77/29877/1 diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 72d97fd..d93e695 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -737,6 +737,7 @@ struct rtp_hdr *rtp_hdr; unsigned int payload_len; int rc; + bool orig_is_oa; if (msgb_length(msg) < sizeof(struct rtp_hdr)) { LOGPENDP(endp, DRTP, LOGL_ERROR, "AMR RTP packet too short (%d < %zu)\n", msgb_length(msg), sizeof(struct rtp_hdr)); @@ -744,10 +745,10 @@ } rtp_hdr = (struct rtp_hdr *)msgb_data(msg); - payload_len = msgb_length(msg) - sizeof(struct rtp_hdr); + orig_is_oa = osmo_amr_is_oa(rtp_hdr->data, payload_len); - if (osmo_amr_is_oa(rtp_hdr->data, payload_len)) { + if (orig_is_oa) { if (!target_is_oa) /* Input data is oa an target format is bwe * ==> convert */ @@ -769,7 +770,10 @@ } if (rc < 0) { LOGPENDP(endp, DRTP, LOGL_ERROR, - "AMR RTP packet conversion failed\n"); + "RTP AMR packet conversion %s->%s failed: %s\n", + orig_is_oa ? "OA" : "BWE", + target_is_oa ? "OA" : "BWE", + osmo_hexdump(rtp_hdr->data, payload_len)); return -EINVAL; } @@ -1226,7 +1230,8 @@ conn_dst->end.codec->param.amr_octet_aligned); if (rc < 0) { LOGPENDP(endp, DRTP, LOGL_ERROR, - "Error in AMR octet-aligned <-> bandwidth-efficient mode conversion\n"); + "Error in AMR octet-aligned <-> bandwidth-efficient mode conversion (target=%s)\n", + conn_dst->end.codec->param.amr_octet_aligned ? "octet-aligned" : "bandwidth-efficient"); break; } } else if (rtp_end->rfc5993_hr_convert && -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29877 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I7c7dd10650c1d249c723d6781585b343004bd64d Gerrit-Change-Number: 29877 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-MessageType: newchange
participants (1)
-
pespin