Change in ...osmo-mgw[master]: mgcp_send(): stop looping on conversion error

neels gerrit-no-reply at lists.osmocom.org
Tue Aug 20 01:15:53 UTC 2019


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/15243


Change subject: mgcp_send(): stop looping on conversion error
......................................................................

mgcp_send(): stop looping on conversion error

If mgcp_send() runs a transcoder loop, break the loop if rfc5993_hr_convert()
or amr_oa_bwe_convert() return with error. Possibly fixes an infinite loop
situation for erratic packets? (Didn't check for that in detail.)

Change-Id: Iba115a0b1d74e7cefba5dcdd777e98ddea9eba8c
---
M src/libosmo-mgcp/mgcp_network.c
1 file changed, 13 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/43/15243/1

diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c
index d5f197d..190ccd4 100644
--- a/src/libosmo-mgcp/mgcp_network.c
+++ b/src/libosmo-mgcp/mgcp_network.c
@@ -871,13 +871,23 @@
 						     addr, buf, buflen);
 
 			if (amr_oa_bwe_convert_indicated(conn_dst->end.codec)) {
-				amr_oa_bwe_convert(endp, buf, &buflen,
-						   conn_dst->end.codec->param.amr_octet_aligned);
+				rc = amr_oa_bwe_convert(endp, buf, &buflen,
+							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");
+					break;
+				}
 			}
 			else if (rtp_end->rfc5993_hr_convert
 			    && strcmp(conn_src->end.codec->subtype_name,
 				      "GSM-HR-08") == 0)
-				rfc5993_hr_convert(endp, buf, &buflen);
+				rc = rfc5993_hr_convert(endp, buf, &buflen);
+				if (rc < 0) {
+					LOGPENDP(endp, DRTP, LOGL_ERROR, "Error while converting to GSM-HR-08\n");
+					break;
+				}
+			}
 
 			LOGPENDP(endp, DRTP, LOGL_DEBUG,
 				 "process/send to %s %s "

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/15243
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Iba115a0b1d74e7cefba5dcdd777e98ddea9eba8c
Gerrit-Change-Number: 15243
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190820/fd111fc8/attachment.html>


More information about the gerrit-log mailing list