Hi Vitaliy,
On 05/14/2014 06:51 AM, Vitaliy Aleksandrov wrote:
Hello list,
Can anybody suggest the way to remove a line/attribute from SDP that matches some pattern (regexp), some kind of "grep -v" for SDP ? I'm trying to remove unnecessary ICE candidates from the SDP body and only thing I know is the IP address of the candidate I need to remove.
I was trying to use avp_subst() + set_body() or subst_body() but didn't get valid SDP.
You might be able to pull it off using the various subst and other textops functions:
http://kamailio.org/docs/modules/4.1.x/modules/textops.html
http://kamailio.org/docs/modules/4.1.x/modules/textopsx.html#textopsx.f.remo...
But those may not be sophisticated enough to do the trick, in which case you might just need to pass this SDP body off to a third-party scripting language like Perl or Python. There, you can make the modifications you want, return a new SDP body to Kamailio, remove the old SDP body, and append your new one.
Cheers,
-- Alex