<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Hello,</p>
    <p>for sip request, just set the $du to the address you want to
      send, I guess the port you know, doesn't really has to be randomly
      generated by Kamailio -- however, if yes, then there is a variable
      that should help, iirc it is named $RANDOM, but you can check the
      pv cookbook in the wiki or the cfgutils module.</p>
    <p>For sip replies, try also with $du, although it might not work
      and then something needs to be coded in the core to make it work
      -- I expect to be something trivial to check if $du is set for the
      reply and use that for sending out instead of via address.</p>
    <p>There is likely even now a chance to work with onsend_route
      enabled for replies (see global parameters in the core cookbook)
      where you can use send_data() function with the first parameter
      being the address where you want to send it and the second
      $snd(buf), then do drop() not to let response be sent again by
      core.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 10.05.18 21:08, Tsvetomir Dimitrov
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAD=dief-JyDxLJLtJnYcB6i1itSEHJw1f3PKK3opaNPiLRykzg@mail.gmail.com">
      <div dir="ltr">Hello,
        <div><br>
        </div>
        <div>Is it possible to modify the destination UDP port number
          for outgoing SIP request/response?</div>
        <div><br>
        </div>
        <div>I am working on a sec-agree extension implementation for
          Kamailio and after negotiating the IPSec tunnel parameters I
          need to redirect the messages to the new port number. I
          checked the code and looks like the destination port is
          determined mainly by the VIA headers, which doesn't work for
          me. Is it possible to achieve this without messing up with the
          core?</div>
        <div><br>
        </div>
        <div>Best regards,</div>
        <div>Tsvetomir</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Kamailio (SER) - Development Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.kamailio.org">sr-dev@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev">https://lists.kamailio.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-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 14-16, 2018 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>