[SR-Users] Cannot hear voice with symmetric NAT and STUN

Daniel Tryba d.tryba at pocos.nl
Wed Feb 8 11:01:45 CET 2017

On Wed, Feb 08, 2017 at 01:12:05AM -0700, Arsen Semionov wrote:
> good question from 2013 :)
> Maybe someone has experience and can confirm this?

The answer to the 2013 question is: if you can depend on this (I have
never seen it) you can script kamailio to make use of it.
> My main question: is it possible to determine when it's required to use RTP
> proxy ? In other words can we know that the client is behind symmetric NAT
> device or we just use rtpproxy as a silver bullet?

The "default" config has rtpproxy on detected NAT as an example. But
personally I go for the always proxy option, it never failed so far
(except for misconfigured client side firewalls that wouldn't have
permitted p2p rtp anyway but now can easily fixed by permitting the
traffic from the rtp range of udp ports from the rtpengine/proxy

NAT detect example below (so take a look at nat_uac_test to see what
kind of tests there are):

route[NATDETECT] {
#!ifdef WITH_NAT
        if (nat_uac_test("19")) {
                if (is_method("REGISTER")) {
                } else {

route[NATMANAGE] {
#!ifdef WITH_NAT
        if (is_request()) {
                if(has_totag()) {
                        if(check_route_param("nat=yes")) {
        if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))


More information about the sr-users mailing list