aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-08-06 17:39:04 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2022-10-13 16:12:26 +0200
commit84c957f8f093e710906cc88d66df9cd440afbcbd (patch)
treebf2e26f53581f02161ba0978209cc2fd4b573887
parent523d82870ef2d78724dbbfe03ca784b2a2b78054 (diff)
add sdp_audio_codec_is_set
-rw-r--r--include/osmocom/msc/sdp_msg.h1
-rw-r--r--src/libmsc/sdp_msg.c5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/osmocom/msc/sdp_msg.h b/include/osmocom/msc/sdp_msg.h
index 9073e9154..98d189276 100644
--- a/include/osmocom/msc/sdp_msg.h
+++ b/include/osmocom/msc/sdp_msg.h
@@ -36,6 +36,7 @@ struct sdp_msg {
const char *sdp_msg_line_end(const char *src);
+bool sdp_audio_codec_is_set(const struct sdp_audio_codec *a);
int sdp_audio_codec_cmp(const struct sdp_audio_codec *a, const struct sdp_audio_codec *b,
bool cmp_fmtp, bool cmp_payload_type);
int sdp_audio_codecs_cmp(const struct sdp_audio_codecs *a, const struct sdp_audio_codecs *b,
diff --git a/src/libmsc/sdp_msg.c b/src/libmsc/sdp_msg.c
index eda6ac9cc..e96235a5c 100644
--- a/src/libmsc/sdp_msg.c
+++ b/src/libmsc/sdp_msg.c
@@ -30,6 +30,11 @@
#include <osmocom/msc/debug.h>
#include <osmocom/msc/sdp_msg.h>
+bool sdp_audio_codec_is_set(const struct sdp_audio_codec *a)
+{
+ return a && a->subtype_name[0];
+}
+
/* Compare name, rate and fmtp, returning typical cmp result: 0 on match, and -1 / 1 on mismatch.
* If cmp_fmtp is false, do *not* compare the fmtp string; if true, compare fmtp 1:1 as strings.
* If cmp_payload_type is false, do *not* compare the payload_type number.