Problem with direct media

Hi,

I have a problem with setting up direct media between two endpoints. In my configuration both SIP endpoints have public ip address (both clients are outside NAT), but the asterisk itself is behind firewall (port 5060 on firewall with public IP address is forwarded to 5060 of asterisk’s machine).

Im not sure why asterisk is always ignoring direct media attribute.

[general]
disallow=all
allow=g729
allow=vp8
context=incoming
bindaddr=0.0.0.0
videosupport=yes
nat=yes
qualify=yes
externip=
localnet=/255.255.255.0

[1000]
context=internal
secret=1234
host=dynamic
type=friend
canreinvite=no
directmedia=yes

[2000]
context=internal
secret=1234
host=dynamic
type=friend
canreinvite=no
directmedia=yes

Entry in extensions.conf:

[internal]
; Calls between employees (between extensions)
exten => _XXXX,1,Dial(SIP/${EXTEN})

Could someone give me any clues what im doing wrong?

Best regards, Konrad

You have specified both directmedia and no directmedia. However, the no directmedia is before the directmedia, and I think that sip.conf is processed on a last match basis.

You don’t appear to have any option that conflicts with directmedia. I assume vp8 is a video codec.

A router could be messing with the media addresses.

Otherwise, I think you need to crank up the logging.