[SR-Users] How to remove attribute from SDP ?

Alex Balashov abalashov at evaristesys.com
Wed May 14 13:12:21 CEST 2014


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.remove_body

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

-- 
Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0670
Web: http://www.evaristesys.com/, http://www.alexbalashov.com/



More information about the sr-users mailing list