Good morning Henning
one really effective way is the topos module. If you can not use this, you could switch to compact sip header. This way you save some bytes per header-field. But this is something that needs to be supported from the user agent as well. You could remove not needed headers and SDP inside the Kamailio, but this will probably not help you a lot. In the end the user agents need to be fixed, probably.
topos requires database but not dialog, right?
I remember I ran into issues with topos which I was unable to solve.
We have a CPE <=> Registrar(kamailio) <=> Routing Core(kamailio) <=> IC topology
Topology shall be hidden towards the CPE, not towards the core. But I didn't manage to achieve this, sometimes topology was hidden towards core causing call failure and incorrect restoring of Route/Via header. As I recall this happened in call forwarding scenarios (initiated on the registrar).
Btw, is there a way to convert all header to compact header? I'm not sure if our CPE would support them, but it's worth a try.
Is there a function returning, or PV containing the sip packet size to try to take actions like removing unnecessary header and codecs if a packet is over a certain size?
Mit freundlichen Grüssen
-Benoît Panizzon-