Re: sdp_remove_media() always uses the original message, right?

Henning Westerholt via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <AS8PR07MB810376A88988138BEC8A7816BF6BA@AS8PR07MB8103.eurprd07.prod.outlook.com>
Hello Benoit,

as mentioned e.g. in our FAQ, it's best to apply changes to a specific part of the message only time, or to apply msg_apply_changes() in between.
Otherwise, there is larger change for a possible corruption. Even if it works stable in your specific configuration, it could stop working e.g. after a major update where some internals are changed.

https://www.kamailio.org/wikidocs/tutorials/faq/main/#why-body-or-other-parts-of-the-sip-message-appear-multiple-times

Look to the earlier FAQ topics for an explanation of the technical reasons.

Cheers,

Henning 

> -----Original Message-----
> From: Benoit Panizzon via sr-users <[email protected]>
> Sent: Donnerstag, 19. Februar 2026 08:43
> To: Ihor Olkhovskyi via sr-users <[email protected]>
> Cc: Benoit Panizzon <[email protected]>
> Subject: [SR-Users] Re: sdp_remove_media() always uses the original
> message, right?
> 
> Hi Ihor
> 
> > In theory for every media type you have a separate m= line. So, knowing
> how
> > lumps system in Kamailio is working, it's ok not to
> > call msg_apply_changes() in between, as you are not modifying the SAME
> > lines,
> 
> Ok, so this probably explains the seemingly inconsistend behaviour I
> observed.
> 
> sdp_remove_media("video");
> sdp_remove_media("image");
> 
> without calling msg_apply_change() works!
> 
> But:
> 
> SDP contains: PCMA,PCMU,G729,OPUS,AMR-WB
> 
> Determine we want to remove low quality and US codec form A leg:
> 
> sdp_remove_codecs_by_name(PCMU,G729);
> 
> performing routing, finding out B needs some codecs removed:
> 
> sdp_remove_codecs_by_name(AMR-WB,opus,t38);
> 
> Will revert removal of PCMU and G729 if no msg_apply_changes() is
> called in between, right?
> 
> Mit freundlichen Grüssen
> 
> -Benoît Panizzon-
> --
> I m p r o W a r e   A G    -    Leiter Commerce Kunden
> ______________________________________________________
> 
> Zurlindenstrasse 29             Tel  +41 61 826 93 00
> CH-4133 Pratteln                Fax  +41 61 826 93 01
> Schweiz                         Web  http://www.imp.ch
> ______________________________________________________
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions -- sr-
> [email protected]
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to the
> sender!
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.