diff --git a/include/re_sdp.h b/include/re_sdp.h index 8ad3ab774..c5a84044b 100644 --- a/include/re_sdp.h +++ b/include/re_sdp.h @@ -131,6 +131,8 @@ const char *sdp_media_rattr(const struct sdp_media *m, const char *name); const char *sdp_media_session_rattr(const struct sdp_media *m, const struct sdp_session *sess, const char *name); +const char *sdp_media_lattr_apply(const struct sdp_media *m, const char *name, + sdp_attr_h *attrh, void *arg); const char *sdp_media_rattr_apply(const struct sdp_media *m, const char *name, sdp_attr_h *attrh, void *arg); const char *sdp_media_name(const struct sdp_media *m); diff --git a/src/sdp/media.c b/src/sdp/media.c index 19ae3cc3c..7ac0182a4 100644 --- a/src/sdp/media.c +++ b/src/sdp/media.c @@ -911,6 +911,26 @@ const char *sdp_media_session_rattr(const struct sdp_media *m, } +/** + * Apply a function handler to all matching local attributes + * + * @param m SDP Media line + * @param name Attribute name + * @param attrh Attribute handler + * @param arg Handler argument + * + * @return Attribute value if match + */ +const char *sdp_media_lattr_apply(const struct sdp_media *m, const char *name, + sdp_attr_h *attrh, void *arg) +{ + if (!m) + return NULL; + + return sdp_attr_apply(&m->lattrl, name, attrh, arg); +} + + /** * Apply a function handler to all matching remote attributes *