Hi David,
I am always very cautious when using msg_apply_changes() – e.g. there are some implications with Record-Route, afaik
I do it this way:
set_body("--outer\r\nContent-Type:application/sdp\r\n\r\n$rb" +
"\r\n--outer\r\nContent-Type:application/vnd.3gpp.mcptt-info+xml\r\n\r\n" +
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\r\n" +
…………
"\t</list>\r\n</resource-lists>" +"\r\n--outer--\r\n","multipart/mixed;boundary=\"outer\"");
Hope this helps, and sorry for slow reaction. I am scanning the mailing list in rather low frequency.
Kr
From: David Villasmil via sr-users <sr-users@lists.kamailio.org>
Sent: Tuesday, March 5, 2024 7:08 PM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Cc: David Villasmil <david.villasmil.work@gmail.com>
Subject: [SR-Users] Re: Add XML to INVITE
Hello guys,
Anyone on this?
On Sun, Mar 3, 2024 at 4:01 AM David Villasmil <david.villasmil.work@gmail.com> wrote:
Hello guys,
I'm trying to add an xml with a boundary to an outgoing INVITE. But if i do:
set_body_multipart("$rb", "application/sdp", "delimiter");
msg_apply_changes();
append_body_part("$var(something)", "application/pidf+xml");
msg_apply_changes();
but kamailio adds the SDP, but NOT the second $var(something). If i switch them and add firs the var, and then the SDP. kamailio adds the contents of $var(something) but NOT the SDP.... point is it doesn't add the second append
Thanks!!!