Hello kamailio community,
i know its an unusual query but i would like to know if there is a cleaner/proper.right
way to disable some (or all) media streams in SDP.
i have come with a solution by sdpops module with subst_body function like this.
route[SDP_DISABLE_UNAUTHORIZED_MEDIA]{
# disable text,media and video media streams
subst_body('#^m=(video|text|audio)[ ]+[0-9/]+(.*)$#m=\1 0 \2#ig');
# update originator ip address
subst_body('#^o=([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)[ ]+([^
]+)$#o=\1 \2 \3 \4 \5 7.7.7.7#ig');
# 1 2 2 4
5 6
# name sid snumber network
net-type addr
# update connection ip address
subst_body('#^c=([^ ]+)[ ]+([^ ]+)[ ]+([^ ]+)$#c=\1 \2 7.7.7.7#ig');
# 1 2 3
# network net-type addr
#remove all media attributes
sdp_remove_line_by_prefix("a=fmtp");
sdp_remove_line_by_prefix("a=X-");
sdp_remove_line_by_prefix("a=rtcp");
sdp_remove_line_by_prefix("a=ssrc");
sdp_remove_line_by_prefix("a=sendrecv");
sdp_remove_line_by_prefix("a=sendonly");
sdp_remove_line_by_prefix("a=recvonly");
sdp_remove_line_by_prefix("a=inactive");
sdp_remove_line_by_prefix("b=");
}
is it the right way to do it. if not can someone provide me an alternative solution.
Thanks :)