neels has uploaded this change for review.

View Change

fix sdp_msg_to_sdp_str(), never add fmtp for unset codec

Change-Id: I1892efd9360585f98419ebbd0df180f7f3a8160d
---
M src/libmsc/sdp_msg.c
1 file changed, 4 insertions(+), 5 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/30111/1
diff --git a/src/libmsc/sdp_msg.c b/src/libmsc/sdp_msg.c
index 51c92df..e16b7b2 100644
--- a/src/libmsc/sdp_msg.c
+++ b/src/libmsc/sdp_msg.c
@@ -268,11 +268,10 @@

/* Add details for all codecs */
foreach_sdp_audio_codec(codec, &sdp->audio_codecs) {
- if (codec->subtype_name[0]) {
- OSMO_STRBUF_PRINTF(sb, "a=rtpmap:%d %s/%d\r\n", codec->payload_type, codec->subtype_name,
- codec->rate > 0? codec->rate : 8000);
- }
-
+ if (!sdp_audio_codec_is_set(codec))
+ continue;
+ OSMO_STRBUF_PRINTF(sb, "a=rtpmap:%d %s/%d\r\n", codec->payload_type, codec->subtype_name,
+ codec->rate > 0? codec->rate : 8000);
if (codec->fmtp[0])
OSMO_STRBUF_PRINTF(sb, "a=fmtp:%d %s\r\n", codec->payload_type, codec->fmtp);
}

To view, visit change 30111. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I1892efd9360585f98419ebbd0df180f7f3a8160d
Gerrit-Change-Number: 30111
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>
Gerrit-MessageType: newchange