Enabling direct RTP streams between SIP phones in Asterisk

By default, asterisk installations will instruct SIP phones to pass their media streams (RTP streams) through the asterisk server itself. That is to say, the RTP stream would look something like this:

(phone 1) <—–> (asterisk) <——> (phone 2)

However, for performance reasons, especially in non-NAT environments, it is preferable to have the RTP streams pass directly between phones. That is to say, SIP control messages will still pass to/from the Asterisk server, but RTP streams will pass directly between phones like so:

(phone 1) <——–> (phone 2)

This is certainly possible on both freepbx and the older trixbox.

Trixbox

Freepbx:

  • Settings > Advanced Settings:
    • canreinvite: yes
    • sip nat: no
    • asterisk dial options: clear the options here
  • Settings > Asterisk sip settings:
    • nat : no
  • Applications > Extensions:
    • canreinvite: yes
    • nat: no

Ensure that no phones have an “outbound proxy” enabled in their SIP settings.

 

References:

http://www.voip-info.org/wiki/view/Asterisk+sip+canreinvite

http://www.dslreports.com/forum/r27852319-Can-I-get-Asterisk-to-not-proxy-media-