Žilinská univerzita > Fakulta riadenia a informatiky > Katedra informačných sietí

RTP Proxy with Kamailio 3.2 configuration on Debian Squeeze

This guide describes Kamailio 3.2 configuration with RTP Proxy.

Requirements:

  • RTP Proxy
    • #apt-get install rtpproxy
      #/etc/init.d/rtpproxy stop 

 

Configuration is very easy, because Kamailio 3.2 adds preconfigured parameters and routing logic (all handled within #!ifdef .. #!endif blocks).

We need to add

#!define WITH_NAT

to the defined values section.

Then, in the Route[Registrar] we need to uncomment line "setflag(FLB_NATSIPPING)":

 

# uncomment next line to do SIP NAT pinging
setbflag(FLB_NATSIPPING);

Setting this flag when REGISTER message arrives will cause Kamailio to send keepalives to the user. This is done using sip OPTION request. Client's response (i.e. 200 OK) to this request refreshes the NAT translation.

 

We can also modify the sipping_from parameter of the nathelper module to match out domain:

modparam("nathelper", "sipping_from", "sip:pinger@p3b.sip.uniza.sk")

New design of the kamailio.cfg file provides the default routing logic for RTPproxy support. Route[NAT] and Route[RTPPROXY] have been replaced by Route[NATDETECT] and Route[NATMANAGE]. These new routing logic blocks utilize functions provided by the new RTPPROXY module (see http://www.kamailio.org/docs/modules/3.2.x/modules/rtpproxy.html for documentation).

 

All that remains is to run RTPproxy and Kamailio 3.2.

Start RTPproxy by typing following command:

$rtpproxy -l <your_public_IP> -s udp:localhost:7722

*note: you can not run RTPproxy as superuser, switch to non-privileged user before starting RTPproxy server

 

Start Kamailio 3.2 by:

/etc/init.d/kamailio start

 

If all went well, users behind NAT can now communicate with each other. Kamailio will detect whether they are behind NAT and if they are, their RTP streams will traverse RTPproxy.

 

 

 

Groups: