<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    the reason for onsend_route was to get access to outgoing buffer
    (what is sent to network) as well as the local socket and remote
    socket attributes (proto, ip, port). There is no option to make
    changes on the outgoing buffer anymore, the action that could be
    done is stop sending to the network (discarding).<br>
    <br>
    It was done for requests, but there were discussions to make this
    available for replies as well. The code you provided in not in
    public repository, but it seems it aims for that (at least for
    stateless replies). The onsend callback should be indeed called
    before msg_send() to get the behavior expected (to be able to drop
    the reply, for example).<br>
    <br>
    If you get a patch to have the onsend_route for replies, it would be
    welcomed on the public repo.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <div class="moz-cite-prefix">On 04/08/14 15:57, Lucian Balaceanu
      wrote:<br>
    </div>
    <blockquote cite="mid:53DF915C.6030302@1and1.ro" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla - <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
<a class="moz-txt-link-freetext" href="http://twitter.com/#!/miconda">http://twitter.com/#!/miconda</a> - <a class="moz-txt-link-freetext" href="http://www.linkedin.com/in/miconda">http://www.linkedin.com/in/miconda</a></pre>
  </body>
</html>