mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 13:03:33 +00:00
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
This commit is contained in:
@@ -868,13 +868,23 @@ int mgcp_send(struct mgcp_endpoint *endp, int is_rtp, struct sockaddr_in *addr,
|
||||
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);
|
||||
"GSM-HR-08") == 0) {
|
||||
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 "
|
||||
|
||||
Reference in New Issue
Block a user