<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi,<br>
    <br>
    I am currently trying to understand some kamailio code and came
    across this construct inside do_forward_reply() function (code in
    italics is not part of upstream kamailio):<br>
    <br>
    <b>do_forward_reply(struct sip_msg* msg, int mode){</b><br>
        ...<br>
        ...<br>
        apply_force_send_socket(&dst, msg);<br>
    <br>
        if (msg_send(&dst, new_buf, new_len)<0)<br>
        {<br>
            STATS_RPL_FWD_DROP();<br>
            goto error;<br>
        }<br>
    <i><b>    ...  <br>
            dst.send_sock=get_send_socket(msg, &dst.to, dst.proto);<br>
            ...<br>
            run_onsend(msg, &dst, new_buf, new_len);</b></i><br>
    <b>}</b><br>
    <br>
    Is there really a sense in calling run_onsend() after the msg_send()
    function? In my understanding (based on onsend_route uasge)
    run_onsend() is used to make some last minute changes before a
    message is sent to a destination. <br>
    <br>
    Thank you,<br>
    Lucian Balaceanu<br>
  </body>
</html>