mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-11-02 13:03:33 +00:00
Compare commits
2 Commits
neels/wip
...
neels/iuup
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e501c5adb | ||
|
|
95b39b5b04 |
@@ -626,6 +626,11 @@ void osmo_mgcpc_ep_ci_request(struct osmo_mgcpc_ep_ci *ci,
|
||||
LOGP(DLMGCP, LOGL_ERROR, "Invalid MGW endpoint request: no ci\n");
|
||||
goto dispatch_error;
|
||||
}
|
||||
if (ci->pending) {
|
||||
LOG_CI(ci, LOGL_ERROR, "verb %s is already pending, wait for notify event before requesting %s\n",
|
||||
osmo_mgcp_verb_name(ci->verb), osmo_mgcp_verb_name(verb));
|
||||
goto dispatch_error;
|
||||
}
|
||||
if (!verb_info && verb != MGCP_VERB_DLCX) {
|
||||
LOG_CI(ci, LOGL_ERROR, "Invalid MGW endpoint request: missing verb details for %s\n",
|
||||
osmo_mgcp_verb_name(verb));
|
||||
|
||||
@@ -459,7 +459,6 @@ struct mgcp_rtp_codec *mgcp_codec_find_convertible(struct mgcp_conn_rtp *conn, s
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return codec_convertible;
|
||||
}
|
||||
|
||||
|
||||
@@ -508,14 +508,40 @@ static int mgcp_patch_pt(struct mgcp_conn_rtp *conn_src, struct mgcp_conn_rtp *c
|
||||
|
||||
/* Find the codec information that is used on the source side */
|
||||
codec_src = mgcp_codec_from_pt(conn_src, rtp_hdr->payload_type);
|
||||
if (!codec_src)
|
||||
if (!codec_src) {
|
||||
LOG_CONN_RTP(conn_src, LOGL_ERROR,
|
||||
"Cannot translate payload type nr %d: src has no such payload type defined\n",
|
||||
rtp_hdr->payload_type);
|
||||
if (log_check_level(DLMGCP, LOGL_DEBUG)) {
|
||||
int i;
|
||||
for (i = 0; i < conn_src->end.codecs_assigned; i++) {
|
||||
struct mgcp_rtp_codec *src_codec_i = &conn_src->end.codecs[i];
|
||||
LOGP(DLMGCP, LOGL_DEBUG, "Cannot translate PT %d: mismatches %d %s\n",
|
||||
rtp_hdr->payload_type, src_codec_i->payload_type, src_codec_i->audio_name);
|
||||
}
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Lookup a suitable codec in the destination connection. (The codec must be of the same type or at least
|
||||
* convertible) */
|
||||
codec_dst = mgcp_codec_find_convertible(conn_dst, codec_src);
|
||||
if (!codec_dst)
|
||||
if (!codec_dst) {
|
||||
LOG_CONN_RTP(conn_src, LOGL_ERROR,
|
||||
"Cannot translate payload type number %d = %s: dst has no such codec\n",
|
||||
rtp_hdr->payload_type, codec_src->audio_name);
|
||||
if (log_check_level(DLMGCP, LOGL_DEBUG)) {
|
||||
int i;
|
||||
for (i = 0; i < conn_dst->end.codecs_assigned; i++) {
|
||||
struct mgcp_rtp_codec *dst_codec_i = &conn_dst->end.codecs[i];
|
||||
LOGP(DLMGCP, LOGL_DEBUG,
|
||||
"Cannot translate payload type nr %d = %s: mismatches %d = %s\n",
|
||||
rtp_hdr->payload_type, codec_src->audio_name,
|
||||
dst_codec_i->payload_type, dst_codec_i->audio_name);
|
||||
}
|
||||
}
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rtp_hdr->payload_type = (uint8_t) codec_dst->payload_type;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user