sip_nat.conf help for audio dropout ---UPDATE---

asterisk21st,

Do you have an externip= mypublicipaddress , listing anywhere in your configs?
I may have missed this if you had this listed in your config?
Although you do get an initial connection,I would guess this is not going to do you any good.
May be worth a try to add,though.
Have you done an ‘service iptables stop’ (stop your linux firewall) , and make a call see if it stays connected?

Barry

Yes, I have stopped IPtables with the issue continuing.

Since I am using the asterisk sip settings module, I do not have any info in sip_nat.conf but the ip configuration is set to dynamic IP and I have the dynamic host filled in matching all other files and config I can think of. The local network is set at 192.168.10.0/255.255.254.0.

Does anyone know where the asterisk sip settings are saved to and maybe I can make sure it is rending it correctly.

For the first time ever, there is a notice in the logs:

[2011-02-21 15:24:35] NOTICE[24284] chan_sip.c: Disconnecting call ‘SIP/catjunktrunk-0000004c’ for lack of RTP activity in 31 seconds

How do I run pcap traces?

as mentioned, take a trace to see what is happening. You are spending a lot of time now taking ‘stabs’ at it, a trace, for example, will show you right away if there were a re-invite, etc.

And you would be highly advised to take the trace on both sides of the WAN, you’ll probably see the issue right off.

still working on understanding pcaps & wireshark so I can do those tests. are there any easy to follow instructions on setting up pcap traces?

What I did find out was this:

source: 192.168.10.21 (one of my phones)
destination: 224.168.168.168
protocol: upd
source port: 54321
destination port: x11

Try stopping iptables (service iptables stop)

Thanks for your very informative input.

To test this out, I am going to set the phone to the actual SIP provider and NOT to the asterisk box to see if anything changes. I just need some way to rule out what it could be, either asterisk or my provider. If it looks like the asterisk box, maybe I’ll completely delete/disable fail2ban and if the audio still has issues, maybe its a hardware/centos issue.

Well so far it is not looking like a fail2ban issue because I restarted the server and tested out calling prior to enabling fail2ban. I do not have the modified iptables or fail2ban auto start so this gave me the time to test it out.

This also is not looking like a provider issue since I am able to register the phone directly with the provider and the audio remain well after 1 min 30 seconds. Would this also indicate this is NOT a router issue since I can make/receive calls?

If the audio stream is constant (e.g. no one is put on hold for example) and this happens after some amount of time, but prior to that everything works fine, then it’s almost certainly NOT an Asterisk setting issue.

Once the media streams start to flow, the configuration files don’t matter any longer.

This means one of two issues is almost certainly the root cause. Either a firewall (yours most likely) is cutting off the media stream, or someone signaled a re-invite of the media (your provider?) resulting in your firewall blocking the new stream. (Note the firewall may be an external firewall or iptables, or both. iptables IS what fail2ban uses).

If you don’t have your rtp ports forward (usually UDP/10000-20000) to your PBX that could be related in conjunction with a media stream that started between you and the SIP gateway but got moved to a media proxy with a re-invite.

If the obvious things don’t fix it (e.g. port forwarding not set) then take a pcap trace and see what is actually happening. If possible, take one from both the WAN side and the LAN side.

thanks a lot for the input.

Do you have any other suggestions of files I should look at editing? the ports on the router are still open and the IP address of the asterisk box are the same.

SIP: 5004-5084 : 192.168.10.22
rtp2: 10001-20001: 192.168.10.22

BTW, does anyone know where the asterisk sip settings are saved to? /etc/asterisk/sip_nat.conf is completely empty but when I fill it in, the freepbx module gives big ugly message that my settings will override what’s in the module.

nslookup pbxserver.mydomain.com
yum install lynx
lynx www.ipchicken.com

Do the addresses match?

ipchicken & nslookup have the same IP address, yes, that’s how the pbxserver.mydomain.com loads in the internet browser.

Lynx connects to the site and I can login.

Does the primary issue not seem like a NAT issue?

To re-cap the primary issue: audio becomes one way after 30-60 seconds AFTER the call is answered. the IVR audio is never lost for the caller. I’ve made very few changes that I would think can affect something like this. All extensions are affected.

It’s a NAT issue. The flow doesn’t have continuity and times out.

Usually caused by wrong Asterisk NAT settings and/or SIP ALG’s in the router.

Every file and configuration I can think of has the new hostname but the audio is still one way. I still suspect NAT issue with the change of hostname.

Can anyone provide any kind of information on the files that would need to be edited when you want to change the hostname of your asterisk box?

-bash-3.2# hostname
pbxserver.mydomain.com

host address:
localhost.localdomain
localhost
pbxserver.mydomain.com

/etc/amportal.conf
AMPWEBADDRESS=pbxserver.mydomain.com

asterisk SIP settings:
NAT=yes
ip configuration: dynamic IP
dynamic host: pbxserver.mydomain.com
local networks: 192.168.10.0/255.255.254.0
various codecs checked

Looks like the Download consistency of service can fluctuate because I did another test which measured it at 96%.

I also think one more change I made was changing the dynamic host from a dyndns address to an actual subdomain of mine. I did make the changes in asterisk sip settings and they look correct in the sip_general_custom.conf as well. Where else would I need to make the changes? The RTP timeout is set to pretty much when the audio drops.
rtptimeout=120

Looks like I may be onto this but just need a little help.

I don’t know much about Asterix but I do know how SIP works and the problems it has through NAT. In this case a STUN server is needed but STUN also has issues through certain NATs. The following article explains in great detail why this issue is caused. It may be slightly different for you though as the article says there is one way audio from the beginning…But the reason I am replying to this specific commen is that you say it is using port 50240 which isn’t one you specified. This could be bause of NAT explained in the document. If it is then this will be the cause. http://think-like-a-computer.com/2011/03/14/one-way-audio-sip/

I don’t know much about Asterix but I do know how SIP works and the problems it has through NAT. In this case a STUN server is needed but STUN also has issues through certain NATs. The following article explains in great detail why this issue is caused. It may be slightly different for you though as the article says there is one way audio from the beginning.