neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/30112 )
Change subject: rtp_stream_commit: check missing MGW ep only when ready for RTP
......................................................................
rtp_stream_commit: check missing MGW ep only when ready for RTP
Change-Id: I24a81a926b97c9f0fb31df782d1cf931eaff9db1
---
M src/libmsc/rtp_stream.c
1 file changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/12/30112/1
diff --git a/src/libmsc/rtp_stream.c b/src/libmsc/rtp_stream.c
index 2902520..c86d0be 100644
--- a/src/libmsc/rtp_stream.c
+++ b/src/libmsc/rtp_stream.c
@@ -361,10 +361,6 @@
* least one of them has not yet been sent to the MGW in a previous CRCX or MDCX. */
int rtp_stream_commit(struct rtp_stream *rtps)
{
- if (!rtps->ci) {
- LOG_RTPS(rtps, LOGL_DEBUG, "Not committing: no MGW endpoint CI set up\n");
- return -1;
- }
if (!osmo_sockaddr_str_is_nonzero(&rtps->remote)) {
LOG_RTPS(rtps, LOGL_DEBUG, "Not committing: no remote RTP address known\n");
return -1;
@@ -377,6 +373,10 @@
LOG_RTPS(rtps, LOGL_DEBUG, "Not committing: both remote RTP address and codec already set up at MGW\n");
return 0;
}
+ if (!rtps->ci) {
+ LOG_RTPS(rtps, LOGL_DEBUG, "Not committing: no MGW endpoint CI set up\n");
+ return -1;
+ }
LOG_RTPS(rtps, LOGL_DEBUG, "Committing: Tx MDCX to update the MGW: updating%s%s%s\n",
rtps->remote_sent_to_mgw ? "" : " remote-RTP-IP-port",
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/30112
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I24a81a926b97c9f0fb31df782d1cf931eaff9db1
Gerrit-Change-Number: 30112
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/30109 )
Change subject: add some comments to sdp_msg.c,h
......................................................................
add some comments to sdp_msg.c,h
Related: SYS#5066
Change-Id: I68aa4af5d84eaaa08a567377687b6292cce0ce94
---
M include/osmocom/msc/sdp_msg.h
M src/libmsc/sdp_msg.c
2 files changed, 14 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/09/30109/1
diff --git a/include/osmocom/msc/sdp_msg.h b/include/osmocom/msc/sdp_msg.h
index 98d1892..cf1e560 100644
--- a/include/osmocom/msc/sdp_msg.h
+++ b/include/osmocom/msc/sdp_msg.h
@@ -10,6 +10,7 @@
int sdp_subtype_name_to_payload_type(const char *subtype_name);
struct sdp_audio_codec {
+ /* Payload type number, like 3 for GSM-FR. */
unsigned int payload_type;
/* Like "GSM", "AMR", "EFR", ... */
char subtype_name[16];
diff --git a/src/libmsc/sdp_msg.c b/src/libmsc/sdp_msg.c
index 040d32d..0aa5763 100644
--- a/src/libmsc/sdp_msg.c
+++ b/src/libmsc/sdp_msg.c
@@ -163,6 +163,13 @@
codec->fmtp[0] ? codec->fmtp : NULL);
}
+/* Find or create an entry for the given payload_type number in the given list of codecs.
+ * If the given payload_type number is already present in ac, return the first matching entry.
+ * If no such payload_type number is present: a) return NULL if create == false;
+ * b) If create == true, add a mostly empty codec entry to the end of ac with the given payload_type number, and return
+ * the created entry.
+ * If create == true, a NULL return value means that there was no unused entry left in ac to add this payload_type.
+ */
struct sdp_audio_codec *sdp_audio_codecs_by_payload_type(struct sdp_audio_codecs *ac, unsigned int payload_type,
bool create)
{
@@ -294,6 +301,7 @@
#define A_RECVONLY "recvonly"
if (osmo_str_startswith(src, A_RTPMAP)) {
+ /* "a=rtpmap:3 GSM/8000" */
char *audio_name;
unsigned int channels = 1;
if (sscanf(src, A_RTPMAP "%u", &payload_type) != 1)
@@ -315,6 +323,7 @@
}
else if (osmo_str_startswith(src, A_FMTP)) {
+ /* "a=fmtp:112 octet-align=1;mode-set=0,1,2,3" */
char *fmtp_str;
const char *line_end = sdp_msg_line_end(src);
if (sscanf(src, A_FMTP "%u", &payload_type) != 1)
@@ -336,6 +345,7 @@
}
else if (osmo_str_startswith(src, A_PTIME)) {
+ /* "a=ptime:20" */
if (sscanf(src, A_PTIME "%u", &sdp->ptime) != 1)
return -EINVAL;
@@ -346,14 +356,17 @@
}
else if (osmo_str_startswith(src, A_SENDRECV)) {
+ /* "a=sendrecv" */
/* TODO? */
}
else if (osmo_str_startswith(src, A_SENDONLY)) {
+ /* "a=sendonly" */
/* TODO? */
}
else if (osmo_str_startswith(src, A_RECVONLY)) {
+ /* "a=recvonly" */
/* TODO? */
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/30109
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I68aa4af5d84eaaa08a567377687b6292cce0ce94
Gerrit-Change-Number: 30109
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange