Hello everybody,

 

we have got a problem with sdp-nat on retries of a 200 OK packet. Due to slow response of our trunk the 200 ok is resend (up to 3 times) but sdp-nat is only done on the first two packets. We are running Kamailio 4.1.0 with the following setup:

 

Trunk  --> NAT --> Kamailio --> Voip Bridge

 

The rtp stream from the trunk (public ip) is supposed to go to one of our media gateways (behind 1:1 nat). We use sdp_mangle_ip to replace the private IPs of our Mediagateway with the public ones. This goes well with the first 200 OK packet but not with a retry.

 

A.A.A.A (public trunk media IP)

B.B.B.B (our public media IP – 1:1 natted to I.I.I.I)

 

INVITE Trunk --> Kamailio

Connection Information (c): IN IP4 A.A.A.A

INVITE                  Kamailio --> Voip Bridge

                               Connection Information (c): IN IP4 A.A.A.A

 

200 OK                 Kamailio <--       Voip Bridge

                                Connection Information (c): IN IP4 I.I.I.I

200 OK Trunk <-- Kamailio

Connection Information (c): IN IP4 B.B.B.B

 

200 OK                 Kamailio <--       Voip Bridge

                                Connection Information (c): IN IP4 I.I.I.I

200 OK Trunk <-- Kamailio

Connection Information (c): IN IP4 I.I.I.I

 

ACK Trunk --> Kamailio --> Voip Bridge

                              

 

Our configuration used is the following:

 

route[RELAY] {

        xlog("L_INFO"," In route Block RELAY \n");

        # enable additional event routes for forwarded requests

        if (is_method("INVITE|SUBSCRIBE|UPDATE")) {

                if(!t_is_set("onreply_route")) t_on_reply("MANAGE_REPLY");

        }

 

        if (!t_relay()) {

                xlog("L_NOTICE", " (ROUTE_RELAY) Relay failed, sending error \n");

                sl_reply_error();

        }

        exit;

}

 

onreply_route[MANAGE_REPLY] {

        xlog("L_INFO"," In route Block MANAGE_REPLY \n");

        if ( isflagset(20) ) { -- we have to do nat

                route(SDP_NAT);

                force_send_socket(KAMAILIO_TO_TRUNK_IP);

        } else {

                force_send_socket(KAMAILIO_TO_BRIDGE_IP);

        }

}

 

 

How can we handle the 200 OK retry? Is there a way to do this?

 

 

Kind regards

Timo Klecker