Thank you, Mikko,

I need to perform this actions inside my module (I don't want to use config files and config functions to perform this actions) because the module performs more actions than that ;-)
Also this means that it is not possible for me to just work on top of the sdpops.

But thanks I will look at data lumps. It's shame that all useful functions such as `msg_apply_changes()` (https://github.com/kamailio/kamailio/blob/fcdf5f9cfff634ebfa736d7084d5e5483a36355b/modules/textopsx/textopsx.c#L149) are static so it means that I need to copy&paste them when I want to use them within module.

Also it is even possible to add SDP attribute by adding new data_lump? Isn't data_lumps dedicated to manage SIP message headers?

I just need a solid answer for question: "Is the adding attribute to SDP body implemented in Kamailio? If yes where can I find it and how can I use it?"
If it is not implemented yet how can I contribute? It is easy as modifying `buf` of `sip_msg`?

I am sorry maybe the subject of this email is not clear enough. I mentioned changing SIP message but not SDP body.




On Wed, Apr 29, 2015 at 9:00 AM, Mikko Lehto <mslehto@iki.fi> wrote:
Cockhootec Yahrabee <cockootec@gmail.com>:

> I have function where I cast `sip_msg`'s `body` to `sdp_info` structure and
> within this function I am changing some fields in `sessions` and `streams`
> list.
>
> I am able to see changes when I am printing them after message leaves the
> function but Kamailio sends the original message not the changed one. Do I
> need somehow let the Kamailio know that the message was changed and it
> should rebuild `buf` field? Or I need to change directly `buf` field within
> `sip_msg`?

You need to handle message modifications as data lumps.
Have a look at Kamailio development guide:
http://www.asipto.com/pub/kamailio-devel-guide/#c14datalump

Also, look if you can extend sdpops module instead of baking new one:
http://kamailio.org/docs/modules/devel/modules/sdpops.html

Hope this helps :)

--
Mikko Lehto

_______________________________________________
sr-dev mailing list
sr-dev@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev