From dnadares@gmail.com Mon Dec 26 21:57:01 2016 From: Diego Nadares To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] set_body_multipart and append_body_part Date: Mon, 26 Dec 2016 17:56:54 -0300 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1184933028==" --===============1184933028== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I made it work but I have to set multipart always in request route (as the manual says) to apply the changes. Just a comment. If I don't apply changes after append_body_part, kamailio crashes. if (is_method("INVITE") && !has_totag()) { set_body_multipart(); msg_apply_changes(); $var(gtd) =3D "IAM,\r\nCPC,"+$avp("ch")+"\r\nGCI,asdfasd\r\n\r\n"; append_body_part("$var(gtd)", "application/gtd", "signal;handling=3Doptional"); msg_apply_changes(); } I know that this is the way as it works (just apply changes in request route) but with rtjson and the evapi module I decide if it has to have or not multipart later and not in the first invite. Is It possible to add in new versions of kamailio to apply the changes in branch route too? (this would be a new request) Cheers. Diego. 2016-12-26 13:21 GMT-03:00 Diego Nadares : > Hi Sergey, > > Thanks for your reply. You are right. > > I added a test with results in the second email calling only > set_body_multipart. > > Do you have any idea what is happening? > > Thanks again! > > Diego > > El El lun, 26 de dic. de 2016 a las 13:10, Sergey Basov < > sergey.v.basov(a)gmail.com> escribi=C3=B3: > >> Hi. >> >> As from textopsx module doc: "This function can be used from >> REQUEST_ROUTE or ONREPLY_ROUTE." >> >> And you have error in your log: "Dec 26 11:36:22 dwrfsd01 >> ./kamailio[8847]: ERROR: textopsx [textopsx.c:159]: msg_apply_changes_f(): >> invalid usage - not in request route" >> >> -- >> Sergey Basov >> >> >> 26 =D0=B4=D0=B5=D0=BA. 2016 =D0=B3. 5:05 PM =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7= =D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Diego Nadares" >> =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: >> >> 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: