The new codec functions in textops are awesome. However there is one feature I would like to see.
Currently there is codec_delete_re() and codec_exists_re that lets you delete and check for any codecs that match a regular expression.
If would be nice if there was the ability to also delete codecs that do NOT match an expression, perhaps through a option. This would allow you to enforce a list of supported codecs only. Right now to remove all other codecs would need an exhaustive list of what to remove (or some really awful inverse regex that would be confusing to write/read, if it is even possible to write)
For example, if you only want to permit G711 and G729 you could do something like the following to remove any other codecs:
And the only codecs left would be G711 and G729 in the message. Or if it had only g711 and say speex, you would be left with only g711.
One would of course have to be careful to not remove telephony-events as well, but that should be up to the script writer.
I think this would be useful only for the codec_exists_re and codec_delete_re, so you could check for, and remove any foreign codecs.
codec_move_up_re and codec_move_down_re are already their inverses (for the most part).
Also a case insensitive option for the regex might be nice. But that would just be more icing on the cake.
Log in to post a comment.