[SR-Users] add a=fmtp: if it does not exist in sdp

Krzysztof Drewicz kdrewicz at cludo.pl
Thu Mar 10 22:26:14 CET 2022


czw., 10 mar 2022 o 17:05 Henning Westerholt <hw at gilawa.com> napisał(a):
>
> Hello,
>
> already tried this one?
>
> https://kamailio.org/docs/modules/5.5.x/modules/sdpops.html#sdpops.f.remove_line_by_prefix

Hi  - i need to _add_ :) so more like: (it works, but it looks like a
13 year old me - programming in BASIC on 8 bit Atari)

        if (is_method("INVITE") && search_body('a=rtpmap:[0-9]+
telephone-event/8000')) {
                xlog("L_INFO","DD BlahFIX: found CID:$ci\n");
                if (! search_body('a=fmtp:[0-9]+ 0-15')) {
                        xlog("L_INFO","DD BLAH2 FIX: not found fmtp:
CID:$ci\n");
                        subst('/a=rtpmap:([0-9]+)
telephone-event\/8000/a=rtpmap:\1 telephone-event\/8000\r\na=fmtp:\1
0-15/i');
                          rewritehostport("172.23.133.4:5062");
##                        loose_route();

                }
        }

but - maybe someone already has this issue, rtpengine and remove
codecs and rewrite them and do RTP anchoring - too much, overkill for
this simple task,

as -> 'a=fmtp:XXX 0-15'

is not a mandatory in SDP, and XXX is dynamic, so 1st i search for
telephone-event, use ( ) and \1 group in RE,  and then - add static
text, but it looks like i'm reinventing something that is common with
some broken scenarios / end-points that insist on having rtpmap ant
fmtp for well-defined codecs / payloads.

BR

-- 
Krzysztof Drewicz
Senior Infrastructure Administrator
CLUDO | ul. Grochowska 306/308, 03-840 Warszawa
t+48221223977

kdrewicz at cludo.pl | www.cludo.pl



More information about the sr-users mailing list