I have Kamailio in a local network with RTPPROXY and NAT MANAGE 

I have seen an issue with ACK as show when Asterisk sends ACK to Kamailio, it sends to advertised Address instead to Kamailio IP address. 

What could i add to solve this?

route[WITHINDLG] {

        if (has_totag()) {  

                # sequential request withing a dialog should

                # take the path determined by record-routing

                if (loose_route()) {

                        if (is_method("BYE")) {

                                setflag(FLT_ACC); # do accounting ...

                                setflag(FLT_ACCFAILED); # ... even if the transaction fails

                                dlg_manage();   

                        }

                        if ( is_method("ACK") ) {

                                # ACK is forwarded statelessy

                                route(NATMANAGE);   

                        }

                        route(RELAY);

                } else {

                        if (is_method("SUBSCRIBE") && uri == myself) {

                                # in-dialog subscribe requests

                                route(PRESENCE);

                                exit;

                        }

                        if ( is_method("ACK") ) {

                                if ( t_check_trans() ) {

                                        # no loose-route, but stateful ACK;

                                        # must be an ACK after a 487

                                        # or e.g. 404 from upstream server

                                        t_relay();

                                        exit;

                                } else {   

                                        # ACK without matching transaction ... ignore and discard

                                        exit;

                                }

                        }

                        sl_send_reply("404","Not here");

                }

                exit;

        }

}


BR