[OpenSIPS-Users] codec_delete_except_re
Bogdan-Andrei Iancu
bogdan at opensips.org
Thu Feb 13 04:18:58 EST 2020
Hi Alain,
Is is legal to have same codec ID more than once in the the `m` line ??
I see that 18 is mentioned like 3 times :-/.
Anyhow, for what you need, what you should do is:
* iterate through the `a` lines using the {sdp.line} transformation
* use a a regexp to check if the current `a` line contains "annexb=yes"
* if such a line was found, go back (decrementing the index of `a`
lines) and search (backwards) the first `rtpmap` line
* once the rtpmap line found, use the {re.subst,reg_exp} transformation
to get the codec ID from the line
* after that, simply use the codec delete function
Best regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
https://www.opensips-solutions.com
OpenSIPS Summit, Amsterdam, May 2020
https://www.opensips.org/events/Summit-2020Amsterdam/
OpenSIPS Bootcamp, Miami, March 2020
https://opensips.org/training/OpenSIPS_Bootcamp_2020/
On 2/11/20 3:35 PM, Alain Bieuzent wrote:
>
> Hi all,
>
> I received an SDP with several codec G729 (with annexb=yes and annexb=no)
>
> =0
>
> o=HNET 600152000 100017799 IN IP4 0.0.0.0
>
> s=0_CALLMEDIA
>
> i=HNET
>
> c=IN IP4 0.0.0.0
>
> t=0 0
>
> m=audio 64976 RTP/AVP 18 18 18 8 101
>
> a=rtpmap:18 G729/8000
>
> a=fmtp:18 annexb=yes
>
> a=ptime:20
>
> a=rtpmap:18 G729/8000
>
> a=fmtp:18 annexb=no
>
> a=rtpmap:18 G729/8000
>
> a=fmtp:18 annexb=yes
>
> a=rtpmap:8 PCMA/8000
>
> a=rtpmap:101 telephone-event/8000
>
> a=fmtp:101 0-15
>
> a=sendonly
>
> How can I delete codec where annexb=yes ?
>
> Thanks for your help
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20200213/cf2165bc/attachment.html>
More information about the Users
mailing list