Dear All
When I get INVITE (received in UDP), I send it to another proxy in TLS.
For this purpose I have modified kamailio.cfg route section , please refer the lines in red.
Just before sending in TLS, I modify the IP address in SDP, so that media packets will pass through RTP proxy running
When INVITE is reached the next proxy, I see the IP address is changed . So far so good.

Next I am trying to modify the IP address in 200 OK to INVITE.
However it is not taking effect.

I hope we need to modify in onreply_route function. Something is wrong here. I am receiving 200 OK for INVITE in TLS. Next I am sending 200 OK for INVITE to endpoints using UDP. Not sure if onreply_route is being executed or not. Can somebody give me pointer whats wrong here.

# Sample onreply route
onreply_route[REPLY_ONE] {

        xdbg("incoming reply\n");
#!ifdef WITH_NAT
        if ((isflagset(FLT_NATS) || isbflagset(FLB_NATB))
                        && status=~"(183)|(2[0-9][0-9])") {
                force_rtp_proxy("r");
        }
        if (isbflagset(FLB_NATB)) {
                fix_nated_contact();
        }
#!endif
}



# Main SIP request routing logic
# - processing of any incoming SIP request starts with this route
route {

        # per request initial checks
        route(REQINIT);
        setflag(FLT_NATS);
        # NAT detection
        route(NAT);

        if(is_method("PUBLISH"))
        {
                loose_route();
                t_relay();
                exit;
        }


        if(is_method("REGISTER"))
        {
                t_relay_to("tls:115.114.48.75:443");
                exit();
        }

        if(is_method("INVITE|BYE|CANCEL|SUBSCRIBE|REFER|NOTIFY"))
        {
                xdbg("incoming request\n");

                route(RTPPROXY);
                t_relay_to("tls:115.114.48.75:443");
                exit();

        }

Thannks
Kamal