Asterisk 11 with public IP call problems

Hello Asterisk community,

I have Asterisk 11 installed on server with public IP address. Here is part of my sip.conf file:

[general]
externip=XXX.XXX.XXX.XXX
bindport=5060
tcpenable=yes
tcpbindaddr=0.0.0.0
bindaddr=0.0.0.0
localnet=XXX.XXX.XXX.XXX/255.255.255.0
;transport=tcp,udp
rtcachefriends=yes
disallow=all
allow=ulaw
allow=alaw
allowguest=no
alwaysauthreject=yes
trustrpid=yes
sendrpid=yes
disallowed_methods=UPDATE
callerid=unknown
context=from-outside
mohinterpret=default
nat=yes
canreinvite=yes
allowsubscribe=yes
notifyhold=yes
notifyringing=yes
callcounter=yes
videosupport=no
t38pt_udptl=no
tos_sip=cs3
tos_audio=ef
tos_video=af41
tos_text=af41
cos_sip=3
cos_audio=5
cos_video=4
cos_text=3
pedantic=no

[30000]
qualify=yes
nat=yes
pickupgroup=1
callerid=test purposes
context=from-inside
canreinvite=yes
secret=XXXXXXX
host=dynamic
callgroup=1
dtmfmode=rfc2833
type=friend
disallow=all
allow=ulaw
allow=alaw

[40000]
qualify=yes
nat=yes
pickupgroup=1
callerid=test purposes
context=from-inside
canreinvite=yes
secret=XXXXXXX
host=dynamic
callgroup=1
dtmfmode=rfc2833
type=friend
disallow=all
allow=ulaw
allow=alaw

I’m able to connect to server with different kinds of phones, as well as making calls through connected SIP-trunk without problems. The only issue I have is to make calls between local extensions. I can hear voice from one phone, but not from another. I tried different types of NAT as comedia and force_rport but it is just not working. Asterisk CLI seems to not show any problems.

I will appreciate any help. Thanks in advance.

You have two deprecated option (one name, one value. You have a not best practice value for type. You have localnet, which is optional, but no NAT settings (nat= does count and may not be needed).

The localnet setting suggest you have a broken dual homed configuration (not mutually routable), which would be incompatible with directmedia (you use an obsolete name for this) being set.

Just tested between two Cisco phones and everything was ok. I need to do more tests.

i think its problem of your sip codec please check properly

Solved. I had to put “udpbindaddr=0.0.0.0” into sip.conf’s general part. Now every kind of phone I could get my hands on as well as sip phones are working fine.