External Incoming Calls from PSTN lines. NO Audio Internal Incoming Call from same ISP trunk Provider Full Sound

HI. I have fix the problem for a remote extension. However now When a Incoming PSTN call Ring then I answer then there is no Audio Both Sides, then after some secs I can ear them but they can not listen at all.

My configs

Rtp.cfg 10000-20000 same as router and forward to asterisk IP (192.168.2.109)
SIP 5004-5080 routes to asterisk IP (192.168.2.109)

Sip_custom.cfg--------------------------------------------------

I use the script that automatic each 5 minutes check the ip address and overwrite if a chance is detected
so it is
something like this

externip=185.x.x.x
localnet=192.168.2.0/255.255.255.0
nat=yes


Sip_general_custom.cfg is

;placeholder for future expansion PIAF Dev Team
rtptimeout=120
insecure=invite
promiscredir=yes
alwaysauthreject=yes
defaultexpirey = 600
dtmfmode = rfc2833
port = 5060
bindaddr = 0.0.0.0
disallow = all
allow = g729
allow = alaw
allow = ulaw
allow = gsm
allow = g723

NOTE: I originally has this extra conf allowguest=no but when it was set. asterisk didnt allow incoming calls. therefore asterisk didnt sound in calls and the caller receive disconect sound


sip_nat.cfg
is empty due the script for update external ip. is set to overwrite in sip_custom.conf

etc/Hosts is set

127.0.0.1 pbx.localdomain pbx localhost.localdomain localhost


any help with this pstn calls arriving and no audio, I can listen after some secs. but they can listen at all

thanks for any help

What codecs are you using?

Maybe try taking out the disallow=all to see if it is not listed.

these is set on sip_general_Custom.cfg
the codecs are in order g729,alaw, ulaw, gsm, g723
the extensions have not set the codecs since they take codecs from sip-general_custom that way they avoid translations between codecs

port = 5060
bindaddr = 0.0.0.0
disallow = all
allow = g729
allow = alaw
allow = ulaw
allow = gsm
allow = g723
alwaysauthreject=yes

I take off disallow=all but the problem persist

I take off all the configs in sip_nat , sip_general_custom and Sip_custom they are blank

then the call goes fine both sides with audio the problem is when I set this (for remote extension works fine both audio)
but the calls in and out have only one side audio. My side has audio. the other side can not heard me.
this simple config it giving trouble. I tried to change from one sip config to other all with same result one way audio.

externip=189.169.28.244
localnet=192.168.2.0/255.255.255.0
nat=yes

Note asterisk box is behind two routers

Internet-----2wireISP-------DD-WRT router-------asterisk box

2wireISP has these port forwarding RTP 10000-20000 and SIP 5004-5080 to DDWRT router by his client internal ip assigned
by 2wire router

then

DDWRT has these port forwarding RTP 10000-20000 and SIP 5004-5080 to Asterisk box that have internal ip 192.168.2.109

then

asterisk box
has rtp.cfg with 10000-20000 all these are set to be UDP

hope someone can help me to make it work with externip= due a remote extension

the problem seems to be the first router

I have these setup

Internet-----2wireISP-------DD-WRT router-------asterisk box

2wire is the router that supply the internet
If I do a port forwarding to DD-WRT with
sip 5004-5080 UDP and RTP - 10000-20000 UDP
and in asterisk put externip=xxx.xxx.xxx.xxx. in sip-custom then one way audio problem on sip-trunks but the remote extension works fine both ways audio.

If I put the DMZ in ip where DD-WRT is set on 2wire router
then SIP trunks work fine both ways audio but remote extension can not register and find asterisk
so the problem seems to be the first router 2wire
but i dont know why since sip and rtp ports are forwarding fine. do I need to open other range port in order to disable DMZ and fix one audio problem ???