<html><head></head><body><div class="ydp4174ad90yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
        <div>Hi Alex,</div><div><br></div><div>You are not the first person to say I'm working too hard, too fast and need to slow down. But why break the habit of a lifetime!!</div><div><br></div><div>Anyway, I'm already using that function, but the body is empty and content length zero.</div><div><br></div><div>This is what I have in kamailio.cfg:</div><div><br></div><div><span><div>  append_to_reply("Test: This is a custom header\r\n");</div><div>  set_body("This is a custom body\r\n", "text/plain");</div><div>  send_reply("200","OK");</div><div>  exit;</div></span><br></div><div>And this is the response from a packet capture:</div><div><span><div><br></div><div><span><div>  SIP/2.0 200 OK</div><div>  Via: SIP/2.0/TCP 154.20.1.8:48689;branch=z9hG4bK-1711745743;rport=48689;received=2.221.73.230</div><div>  From: <sip:user@domain.com>;tag=1764815333</div><div>  To: <sip:r-ruri.without.username>;tag=0ea7681ffd64b0ffcde1bff3393fd505.3f21</div><div>  Call-ID: ba8cead2-2631-9daa-cda9-12f26524ac99</div><div>  CSeq: 1593640028 INVITE</div><div>  Test: This is a custom header</div><div>  Server: kamailio (5.2.2 (x86_64/linux))</div><div>  Content-Length: 0</div><div><br></div><div>I can see the custom header and custom body being set in the debug logs, so I assume the body is being dropped somewhere within the SL module:</div><div><br></div><div><span><div>kamailio[23307]: 18(23356) exec: {1 1593640028 INVITE ba8cead2-2631-9daa-cda9-12f26524ac99} *** cfgtrace:request_route=[TEST] c=[/etc/kamailio/kamailio.cfg] l=1247 a=25 n=append_to_reply</div><div>kamailio[23307]: 18(23356) exec: {1 1593640028 INVITE ba8cead2-2631-9daa-cda9-12f26524ac99} *** cfgtrace:request_route=[TEST] c=[/etc/kamailio/kamailio.cfg] l=1249 a=26 n=set_body</div><div>kamailio[23307]: 18(23356) DEBUG: {1 1593640028 INVITE ba8cead2-2631-9daa-cda9-12f26524ac99} textops [textops.c:2004]: ki_set_body(): new body: [This is a custom body</div><div>kamailio[23307]: ]18(23356) exec: {1 1593640028 INVITE ba8cead2-2631-9daa-cda9-12f26524ac99} *** cfgtrace:request_route=[TEST] c=[/etc/kamailio/kamailio.cfg] l=1255 a=26 n=send_reply</div><div>kamailio[23307]: 18(23356) DEBUG: {1 1593640028 INVITE ba8cead2-2631-9daa-cda9-12f26524ac99} sl [sl.c:288]: send_reply(): reply in stateless mode (sl)</div><div>kamailio[23307]: 18(23356) DEBUG: {1 1593640028 INVITE ba8cead2-2631-9daa-cda9-12f26524ac99} <core> [core/tcp_main.c:2225]: tcpconn_send_put(): send from reader (23356 (18)), reusing fd</div><div>kamailio[23307]: 18(23356) DEBUG: {1 1593640028 INVITE ba8cead2-2631-9daa-cda9-12f26524ac99} <core> [core/tcp_main.c:2460]: tcpconn_do_send(): sending...</div><div>kamailio[23307]: 18(23356) DEBUG: {1 1593640028 INVITE ba8cead2-2631-9daa-cda9-12f26524ac99} <core> [core/tcp_main.c:2494]: tcpconn_do_send(): after real write: c= 0x7f8d24e74988 n=429 fd=12</div><div>kamailio[23307]: 18(23356) DEBUG: {1 1593640028 INVITE ba8cead2-2631-9daa-cda9-12f26524ac99} <core> [core/tcp_main.c:2495]: tcpconn_do_send(): buf=</div></span><br></div><div><br></div><div>Thanks.</div></span><br></div><div><br></div></span><br></div>
        
        </div><div id="yahoo_quoted_5862187125" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Thursday, 18 April 2019, 19:51:52 BST, Alex Balashov <abalashov@evaristesys.com> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div>David,<br clear="none"><br clear="none">As usual, you are working too hard, too fast, and need to slow down,<br clear="none">breathe, relax, practice some "mindfulness techniques", and take a<br clear="none">meditative stroll through the documentation. :-)<br clear="none"><br clear="none"><a shape="rect" href="https://kamailio.org/docs/modules/5.2.x/modules/textops.html#textops.f.set_reply_body" target="_blank">https://kamailio.org/docs/modules/5.2.x/modules/textops.html#textops.f.set_reply_body</a><br clear="none"><br clear="none">-- Alex<br clear="none"><div class="yqt5433174289" id="yqtfd03713"><br clear="none">On Thu, Apr 18, 2019 at 06:47:52PM +0000, David Dean wrote:<br clear="none"><br clear="none">>  I've been reviewing the code for the sl module to try and see if it can be modified to send the current body with send_reply().<br clear="none">> However I'm not a C programmer so I'm fumbling around in the dark!<br clear="none">> I came across this section in sl_funcs.c<br clear="none">>  /* if that is a redirection message, dump current message set to it */ if (code>=300 && code<400) { dset.s=print_dset(msg, &dset.len, sl_rich_redirect); if (dset.s) { add_lump_rpl(msg, dset.s, dset.len, LUMP_RPL_HDR); } }<br clear="none">> If this was modified to include LUMP_RPL_BODY then could that be made to work?<br clear="none">> Or is there a better way of tweaking this SL module to include the body in the response when using send_reply()?<br clear="none">> Thanks, Dave<br clear="none">>     On Tuesday, 16 April 2019, 23:28:06 BST, David Dean <<a shape="rect" ymailto="mailto:just_bytesize@yahoo.co.uk" href="mailto:just_bytesize@yahoo.co.uk">just_bytesize@yahoo.co.uk</a>> wrote:  <br clear="none">>  <br clear="none">>  Hello Kamailio gurus,<br clear="none">> I'm successfully using send_reply() with append_to_reply() to add some custom headers.<br clear="none">> Now I need to add some text into the reply body.<br clear="none">> How can I add a body to send_reply() ?<br clear="none">> Thx, Dave</div><br clear="none">>   <br clear="none"><br clear="none">> _______________________________________________<br clear="none">> Kamailio (SER) - Users Mailing List<br clear="none">> <a shape="rect" ymailto="mailto:sr-users@lists.kamailio.org" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br clear="none">> <a shape="rect" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br clear="none"><br clear="none"><br clear="none">-- <br clear="none">Alex Balashov | Principal | Evariste Systems LLC<br clear="none"><br clear="none">Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) <br clear="none">Web: <a shape="rect" href="http://www.evaristesys.com/, " target="_blank">http://www.evaristesys.com/, </a><a shape="rect" href="http://www.csrpswitch.com/" target="_blank">http://www.csrpswitch.com/</a><br clear="none"><br clear="none">_______________________________________________<br clear="none">Kamailio (SER) - Users Mailing List<br clear="none"><a shape="rect" ymailto="mailto:sr-users@lists.kamailio.org" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br clear="none"><a shape="rect" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><div class="yqt5433174289" id="yqtfd05403"><br clear="none"></div></div>
            </div>
        </div></body></html>