[sr-dev] Set arbitrary destination port for outgoing request/reply
Daniel-Constantin Mierla
miconda at gmail.com
Thu May 17 08:23:30 CEST 2018
Hello,
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.
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.
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.
Cheers,
Daniel
On 10.05.18 21:08, Tsvetomir Dimitrov wrote:
> Hello,
>
> Is it possible to modify the destination UDP port number for outgoing
> SIP request/response?
>
> 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?
>
> Best regards,
> Tsvetomir
>
>
> _______________________________________________
> Kamailio (SER) - Development Mailing List
> sr-dev at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
--
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20180517/e9e87a47/attachment-0001.html>
More information about the sr-dev
mailing list