<div dir="auto">Greetings,<div dir="auto"><br></div><div dir="auto">I did some testing and onsend route is not executed on local generated requests. </div><div dir="auto"><br></div><div dir="auto">I asked if they work the same way because for relayed requests, the on send is the last route before sending the packet. </div><div dir="auto"><br></div><div dir="auto">I'm asking this because I'm trying to debug an issue with my probings via dispatcher, where some OPTIONS requests are not being sent to its destination. I got a log on local-request and all OPTIONS are logging there correctly. However, if i do a pcap capture on the kamailio machine, not all options are there.  That being said, i want to make sure that the problem is not in my Kamailio configuration and it is sending the correct number of packets.</div><div dir="auto"><br></div><div dir="auto">Best regards</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">A terça, 27/08/2019, 08:24, Daniel-Constantin Mierla <<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Hello,<br>
    </p>
    <div class="m_-1126953947831966216moz-cite-prefix">On 26.08.19 18:26, Duarte Rocha wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="auto">
        <div dir="auto">Greetings, </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">Does  "event_route[tm:local-request]" works like
          onsend route ?</div>
      </div>
    </blockquote>
    no, event_route[tm:local-request] is for requests initiated by
    Kamailio via tm module (but other modules can be the source of the
    requests, as they use internally tm module, like msilo, uac, ...).<br>
    <blockquote type="cite">
      <div dir="auto">
        <div dir="auto"><br>
        </div>
        <div dir="auto">I'm having some problems and i'm using
          local-request to debug and i found this on the documentation :
          "Executed after the tm module has sent a local generated,
          transaction stateful request."</div>
      </div>
    </blockquote>
    <p><br>
    </p>
    <p>That was misleading indeed and wrong, because it is executed
      before sending out the request. The content of the request can
      still be changed there.<br>
    </p>
    <blockquote type="cite">
      <div dir="auto">
        <div dir="auto"><br>
        </div>
        <div dir="auto">I'm logging all the requests that go through
          this route. Is this really the last place before kamailio send
          the request?</div>
      </div>
    </blockquote>
    <p><br>
    </p>
    <p>I am not sure if the onsend_route is executed for local generated
      requests -- it was desinged initially to be executed for requests
      that are received and forwarded by kamailio. So you may need both
      event_route[tm:local-request] and onsend_route to catch all
      outgoing requests. In other words, the onsend_route is the last
      one executed before sending out, where the content of what is
      going to be sent cannot be changed, but you can still drop the
      request. If you don't see there the local generated requests, then
      you have to use also event_route[tm:local-request].</p>
    <blockquote type="cite">
      <div dir="auto">
        <div dir="auto"> If the request is logged here, is there
          anything more in kamailio that can stop the request
          (pipelimit, etc) ?</div>
      </div>
    </blockquote>
    <p><br>
    </p>
    <p>Stopping the request in event_route[tm:local-request] and
      onsend_route can be done by using 'drop'. When you do it, being it
      based on pipelimit, userblacklist, etc ..., it is up to you.<br>
    </p>
    <blockquote type="cite">
      <div dir="auto">
        <div dir="auto"><br>
        </div>
        <div dir="auto">If a packet gets logged on this route does that
          mean that it was already sent? <br>
        </div>
      </div>
    </blockquote>
    <p>No. Afaik, there is no event_route executed after the request was
      already sent. Although it might be useful for doing some ops that
      should not add delay to routing the request...</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <blockquote type="cite">
      <div dir="auto">
        <div dir="auto"><br>
        </div>
        <div dir="auto">Best Regards, </div>
        <div dir="auto"><br>
        </div>
        <div dir="auto">Duarte Rocha</div>
      </div>
      <br>
      <fieldset class="m_-1126953947831966216mimeAttachmentHeader"></fieldset>
      <pre class="m_-1126953947831966216moz-quote-pre">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="m_-1126953947831966216moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org" target="_blank" rel="noreferrer">sr-users@lists.kamailio.org</a>
<a class="m_-1126953947831966216moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" rel="noreferrer">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <pre class="m_-1126953947831966216moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="m_-1126953947831966216moz-txt-link-abbreviated" href="http://www.asipto.com" target="_blank" rel="noreferrer">www.asipto.com</a>
<a class="m_-1126953947831966216moz-txt-link-abbreviated" href="http://www.twitter.com/miconda" target="_blank" rel="noreferrer">www.twitter.com/miconda</a> -- <a class="m_-1126953947831966216moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda" target="_blank" rel="noreferrer">www.linkedin.com/in/miconda</a></pre>
  </div>

</blockquote></div>