<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Lucian,<br>
    <br>
    somehow I forgot to follow up on this. But we need to get sorted out
    soon, before we release, so it works as expected with the new
    version. See more comments inline.<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 17/09/14 18:09, Lucian Balaceanu
      wrote:<br>
    </div>
    <blockquote cite="mid:5419B240.5000005@1and1.ro" type="cite">
      <meta content="text/html; charset=windows-1252"
        http-equiv="Content-Type">
      Hi Daniel,<br>
      <br>
      Please forgive me for my delay in responding to your mail.<br>
      Please find attached a second version of the onsend_route_reply
      patch (which again has some problems). As per your previous
      indications I did the following:<br>
      <br>
      <b>Issue1</b><br>
      <blockquote cite="mid:53FDC46E.7050909@gmail.com" type="cite">
        From performances point of view, there can be added a config
        parameter to enable running of onsend_route for replies:<br>
        <br>
        onsend_route_reply = 0|1<br>
      </blockquote>
      <br>
      Following <a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.asipto.com/pub/kamailio-devel-guide/#c08add_parameters">http://www.asipto.com/pub/kamailio-devel-guide/#c08add_parameters</a>
      I have tried to add onsend_route_reply parameter. The code
      compiles, but when trying to start kamailio with this parameter
      inside, the parsing fails with syntax errors signaling:<br>
      <br>
      <i> 0(1321) :<core> [cfg.y:3423]: yyerror_at(): parse error
        in config file kamailio-basic.cfg.4.1, from line 107, column 1
        to line 108, column 0: syntax error<br>
         0(1321) : <core> [cfg.y:3423]: yyerror_at(): parse error
        in config file kamailio-basic.cfg.4.1, from line 107, column 1
        to line 108, column 0: <br>
        ERROR: bad config file (2 errors)</i><br>
    </blockquote>
    <br>
    The issue is:<br>
    <br>
    <pre wrap="">+<INITIAL>{ONSEND_RT_REPLY}      {  yylval.intval=atoi(yytext);
+                                               yy_number_str=yytext; return NUMBER; }

It should be:

+<INITIAL>{ONSEND_RT_REPLY}       {  yylval.intval=atoi(yytext);
+                                               yy_number_str=yytext; return ONSEND_RT_REPLY; }
</pre>
    <br>
    <blockquote cite="mid:5419B240.5000005@1and1.ro" type="cite"> <br>
      <b>Issue2</b><br>
      <blockquote cite="mid:53FDC46E.7050909@gmail.com" type="cite">
        #define onsend_enabled(rtype)
(onsend_rt.rlist[DEFAULT_RT]?((rtype==SIP_REPLY)?onsend_route_reply:1):0)<br>
      </blockquote>
      That is to say you see it best to take the chek for
      onsend_rt.list[DEFAULT_RT] from inside run_onsend() function and
      call this onsend_enabled(...) before the run_onsend()? <br>
    </blockquote>
    <br>
    This is to detect whether the onsend_route should be executed for
    SIP replies. The condition being:<br>
    <br>
    - if is a sip reply and onsend_route is set and the
    onsend_route_reply parameter is 1<br>
    <blockquote cite="mid:5419B240.5000005@1and1.ro" type="cite"> <br>
      <b>Issue3</b><br>
      <blockquote cite="mid:53FDC46E.7050909@gmail.com" type="cite"> On
        the other hand, is onsend_route also executed for local
        requests? I had in mind it is only for received requests that
        are forwarded ... Iirc, on onsend_route, the sip message is the
        one received, the outgoing content being accessible via
        $snd(buf).<br>
        <br>
      </blockquote>
      I agree with you with taking out the locally generated requests
      and only left the run_onsend call in do_forward_reply function
      (inside forward.c).<br>
      Could you point me to the reply relaying function that is called
      for state-full processing? <br>
    </blockquote>
    Stateful processing for replies is mainly done in t_reply.c from tm
    module. At some point there should be a send buffer function call.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <blockquote cite="mid:5419B240.5000005@1and1.ro" type="cite"> <br>
      Thank you and sorry again for my late answer,<br>
      Lucian<br>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<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>