Sorry, I forgot to paste two log lines.
.....
Dec 26 11:36:22 dwrfsd01 ./kamailio[8847]: ERROR: textopsx [textopsx.c:159]: msg_apply_changes_f(): invalid usage - not in request route
Dec 26 11:36:22 dwrfsd01 ./kamailio[8847]: ERROR: textops [textops.c:1879]: append_multibody_helper(): Cannot get boundary. Is body multipart?
Dec 26 11:36:22 dwrfsd01 ./kamailio[8847]: INFO: <script>: NATMANAGE 172.16.213.38 172.16.208.11 <null>
Dec 26 11:36:22 dwrfsd01 ./kamailio[8847]: INFO: <script>: NATMANAGE 172.16.208.11 Priv
Dec 26 11:36:22 dwrfsd01 ./kamailio[8847]: INFO: <core> [msg_translator.c:1693]: get_boundary(): Content-Type hdr has no params <application/sdp>
Dec 26 11:36:22 dwrfsd01 ./kamailio[8847]: WARNING: <core> [msg_translator.c:1959]: build_req_buf_from_sip_req(): check_boundaries error
....
For what I can see, it's not applying the changes.
I tested again with just set_body_multipart. The GTD content is set OK but SDP content IS NOT and there is no boundary at the end of the body.
if ($avp(ch)){
$var(gtd) ="IAM,\r\nGCI,asdafsdfasd\r\n\r\n";
set_body_multipart("$var(gtd)", "application/gtd", "uniqueBoundary-1");
}
Dec 26 11:55:19 dwrfsd01 ./kamailio[8916]: INFO: <core> [msg_translator.c:1693]: get_boundary(): Content-Type hdr has no params <application/sdp>
Dec 26 11:55:19 dwrfsd01 ./kamailio[8916]: WARNING: <core> [msg_translator.c:1959]: build_req_buf_from_sip_req(): check_boundaries error
body result:
Content-Length: 501.
Content-Type: multipart/mixed;boundary="uniqueBoundary-1".
Mime-Version: 1.0.
--uniqueBoundary-1.
Content-Type: application/gtd.
.
IAM,.
CPC,.
GCI,sdfasdf.
.
--uniqueBoundary-1.
v=0.
o=user1 53655765 2353687637 IN IP4 172.16.213.38.
s=-.
c=IN IP4 172.16.213.38.
t=0 0.
m=audio 58778 RTP/AVP 8.
a=rtpmap:8 PCMA/8000.
a=sendrecv.
a=rtcp:58779.
a=ice-ufrag:2NRZkfr2.
a=ice-pwd:rzffP1tp831WzYH0PTIOSMoVye.
a=candidate:fw7LZeIomEu5faq4 1 UDP 2130706431 172.16.213.38 58778 typ host.
a=candidate:fw7LZeIomEu5faq4 2 UDP 2130706430 172.16.213.38 58779 typ host.
Thanks!
Diego