Hello community,

 

I work with Kamailio 4.2.0 which is placed between two networks (with two interfaces) and RTPproxy in bridge mode.

The task from Kamailio is to handle the calls from internal networks to internal networks only on the internal Interface without bridging. For external networks vice versa. If the call comes from external to internal, then the RTPproxy should work in bridge mode and vice versa. I adapt the example with IPv4 and IPv6 routing, but this is not working for internal to external calls and vice versa (http://kb.asipto.com/kamailio:kamailio-mixed-ipv4-ipv6). Only external calls and only internal calls works. I think the cause of this behavior is the routing which I implemented to the RTPmanage part in the Kamailio config.

The error message is given by the internal device. (call from external to internal)

If I make a call from internal to external, the RTP stream is only in one direction.

 

Internal Interface IP: 203.207.111.58

External Interface IP: 193.16.163.58

 

The RTPproxy config is:

CONTROL_SOCK=udp:127.0.0.1:9000

EXTRA_OPTS="-l 203.207.111.58/193.16.163.58 -d WARN:LOG_LOCAL1"

 

Kamailio.cfg:

#!define INT_IP 10.96.0.0/14

#!define EXT_IP 193.0.0.0/8

 

# RTPProxy control and singaling updates for NAT traversal

route[NATMANAGE] {

#!ifdef WITH_NAT

        if (is_request()) {

                if(has_totag()) {

                        if(check_route_param("nat=yes")) {

                                setbflag(FLB_NATB);

                        }

                }

        }

        if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))

                return;

 

#       rtpproxy_manage("co");

 

# Start Test routing

 

        if((src_ip==INT_IP && dst_ip==EXT_IP)){

                        rtpproxy_manage("cowie");

                        }

        if((src_ip==EXT_IP && dst_ip==INT_IP)){

                        rtpproxy_manage("cowei");

                        }

 

        if (is_request()) {

                if (!has_totag()) {

                        if(t_is_branch_route()) {

                                add_rr_param(";nat=yes");

                        }

                }

        }

        if (is_reply()) {

                if(isbflagset(FLB_NATB)) {

                        if(is_first_hop())

                                set_contact_alias();

                }

        }

#!endif

        return;

}

 

Can someone help me with the right routing? Do you need some more debugging information?

 

Cheers,

Kai