Hi George,

i use something like that (shameless stolen from other configuration files within request-route).

Thats for answering options to my internal kamailio.
But Alex Balashov wrote an nice blog poste about NAT/OPTION Pings 
with kamailio: http://www.evaristesys.com/blog/server-side-nat-traversal-with-kamailio-the-definitive-guide/

    ### only initial requests (no To tag)
    if (is_method("OPTIONS"))
    {
        if (uri=~"sip:.*[@]+.*")  {
            sl_send_reply("501", "Not Implemented");
        }
        else {
            options_reply();
            exit;
        }
    }

Cheers Karsten

Am Do., 4. Juli 2019 um 10:29 Uhr schrieb George Diamantopoulos <georgediam@gmail.com>:
Hello all,

I've been trying to handle OPTIONS statelessly, but proper handling fails for UACs behind NAT without ALG. I thought I'd overcome this by setting the $du pseudovariable, but apparently I'm missing something. The following does not work:

        if ($Rp == "6050") {
            force_send_socket(udp:10.10.10.10:6050);
        }
        $du = "sip:" + $si + ":" + $sp;
        sl_send_reply("200","OK");
        exit;

I'm now realising that I put this in request_route() so force_send_socket() and $du have no use whatsoever, since the request is not forwarded anywhere. Is this the reason?

So the question is, how can I do the following things for a stateless reply: a) choose a sending socket for the reply and b) change the destination for the reply to something other than the URI in the first Via header.

Thanks!

BR,
George
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


--
Mit freundlichen Grüßen
*Karsten Horsmann*