Actually instead of `subst_body()` from textops, which I suggested in the previous comment, the sdpops module offers a more convenient function to remove lines from sdp that match a prefix:
* https://www.kamailio.org/docs/modules/stable/modules/sdpops.html#sdpops.f.re...