chan_sip.c: Retransmission timeout reached on transmission

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
Had a perfectly working PIAF purple 1.7.5.5 server running Asterisk 1.8.0. Had multiple gvoice accounts, skype as a trunk, and traveling man working all working great.

Had to move this server to a different location with a different IP behind a different router with a different private addressing namespace.

Incoming calls via skype DID or GV DID or sipgate DID all work as far as sending the caller to the correct IVR or voice mail. SIP trunks register properly. External SIP phones register properly.

My problem occurs when I try using an external SIP device to make any sort of call to another external SIP device or to make a call to a phone number using either skype as a trunk or GV.

On my external soft phone (xlite on a desktop) I try to call my cell phone and use my GV trunk. My cell phone rings, I get 2 way audio but after a few seconds the call is dropped. In my log I see this:

Code:
[2011-01-01 09:46:42] WARNING[25890] chan_sip.c: Retransmission timeout reached on transmission MmQyY2I1MjdmODEwODMwYjdjNWFhNGUyNjA3YzM0N2Y. for seqno 2 (Critical Response) -- See doc/sip-retransmit.txt.
Packet timed out after 19392ms with no response
[2011-01-01 09:46:42] WARNING[25890] chan_sip.c: Hanging up call MmQyY2I1MjdmODEwODMwYjdjNWFhNGUyNjA3YzM0N2Y. - no reply to our critical packet (see doc/sip-retransmit.txt).

If I don't answer my cell quickly, the call will still be dropped with a similar timeout error.

If I try using my external desktop xlite to call my laptop xlite, which is also outside the asterisk network, the laptop never rings and I get a similar timeout error on the asterisk server. If I try using my laptop xlite to call my desktop xlite the same error occurs. If I try using either xlite to dial an IVR or voicemail extension, however, it works. So anything internal to the askterisk server seems to work but anything heading out the asterisk network fails.

So what changed?

1. The new location of the asterisk server has a new router (Netgear WNR1000v2) whereas before I had a FreeBSD server acting as a gateway.

This is a brand new router that was purchased. Simple setup cable modem -> netgear -> asterisk server

The netgear has the MAC address of the asterisk server so the netgear's DHCP always assigns the asterisk server the private IP address of 192.168.1.5

The netgear has port forwarding setup of 5060, 10000-20000, and 5222 all to 192.168.1.5. It has some other ports open for SSH and SSL.

2. The private namespace has changed from 10.0.0.x to 192.168.1.x

In sip_custom.conf, I put
Code:
localnet=192.168.1.0/255.255.255.0


3. The old router had a static IP whereas the new one is dynamic. As a result, I am using dyndns.

In sip_custom.conf, I put
Code:
externhost=something.dyndns.biz

I am running ddcleint on the asterisk server. I am NOT using the dynamic DNS feature of the netgear router. On the asterisk server, if I ping my dyndns subdomain I get the correct outside IP.

The configuration for my external SIP extensions includes
Code:
host=dynamic
canreinvite=no
nat=yes

I do not have a sip device internal to the asterisk network and unfortunately it is now in another state so I am trying to resolve this issue remotely.

After researching on google and reading the document the error message recommended, this is a network issue and I can only assume it has to do with the new network topology, or the router, or the new use of dyndns.

I am posting this here for suggestions but also for future reference in case someone else has the same problem.

I have checked everything I can think of to make sure all files have been updated to reflect the new network topology. The fact that calls from external SIP to cellphone sometimes make it, albeit only for a few seconds, has me thinking this may be cause by some sort of quality control mechanism on the asterisk end since if the networking was screwed up, I would think that there would be consistent failure as opposed to sometimes working briefly.

Any recommendations? Should I have my router be handling the dyndns and turn off ddclient on asterisk?
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
Tried moving the dyndns registration off the asterisk server onto the router. No change.

Thought there might be an issue with internal/external IP of the my dyndns hostname. The router is properly registering with dyndns and getting and IP. My dyndns hostname resolves to the outside IP from the asterisk server.

However, same error. External softphone calling my cell ... call went through for a few seconds then I got the same timeout error in my log
 

atsak

Guru
Joined
Sep 7, 2009
Messages
2,385
Reaction score
439
Does the netgear router have uPNP enabled?
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
Does the netgear router have uPNP enabled?

Yup and a current snapshot has an entry for the asterisk server. Here is a snippet from the netgear log just for completeness...


Code:
[UPnP set event: add_nat_rule] from source 192.168.1.5 Saturday, January 01,2011 10:31:14
[UPnP set event: del_nat_rule] from source 192.168.1.5 Saturday, January 01,2011 10:31:12
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
Have you tried any online VoIP testers to test the quality of the new location for delay and jitter?
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
What's your nat settings? /etc/asterisk/sip-nat.conf for the following:

externip=Your External IP
localnet=192.168.1.0/255.255.255.0
nat=yes
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
My sip_nat.conf is empty. For the PIAF install I did, it stuck those settings in sip_custom.conf

Code:
externhost=something.dyndns.biz
localnet=192.168.1.0/255.255.255.0
nat=yes
promiscredir=yes

It didn't have the "nat=yes" line. I added that and restarted asterisk. No change, same error . Thanks for the suggestion though
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
Have you tried any online VoIP testers to test the quality of the new location for delay and jitter?

I have not done this and am beginning to think that quality of connection from the new ISP is the issue since I am getting inconsistent results.

Is there any particular VOIP testing site you would recommend?
 

blanchae

Guru
Joined
Mar 12, 2008
Messages
1,910
Reaction score
9
I've tried this one and if you googe "online VoIP test". You'll find there's quite a few. I would try a few from different servers just to verify.
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
Hmm ok so from that and other voip tests, I am getting inconsistent results on my home network which is where my sip phones are.

The asterisk server is in another state.

EDIT: I did not have port forwarding on my home network, which is not where the asterisk server is locate but my home network is where the external SIP devices are located.

I am now setting up port forwarding on the gateway for my home network following port recommendations for xlite...
 
Joined
Nov 20, 2010
Messages
159
Reaction score
0
You don't specify the severity of your inconsistent results. Are they bad or are they just inconsistent?

Unless your home network tests are bad, your issue stinks of NAT. You've been very thorough in your troubleshooting so far and it all sounds correct.

Check the configuration on the Netgear router. uPNP should not be involved at all as you are manually specifying which ports to forward. I do see that this router has two kinds of NAT (Open and Secure) but the documentation doesn't specify what the difference is. Based on your previous diligence, I suspect you chose Secure NAT and it is interfering with your RTP streams. Try Open NAT and see what you get.
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
Thanks for tip regarding securenat and opennat.. that was a big chunk of the solution.

The other part was configuring xlite clients on my outside network and setting up proper port forwarding on their gateway/routers.

Regarding the severity of inconsistent results. My apologies for such a subjective reference. I think I was half asleep when I posted that. At this time, I am going to dismiss that component of the troubleshooting however, as the aforementioned fixes have solved the problem.

Thanks again, I wasn't even aware netgear had opennat and securenat configuration options.
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
[SOLVED]

Ok there were three items that needed to be changed to this to work.

1) Netgear Router

This is the router that sits between the asterisk server and the Internet. It is a Netgear WNR1000v2. The solution to this part came from Astrosmurfer in this post

The steps I took are as follows:
A) Disable UPNP
B) Change NAT filtering from secure to open. This under "WAN Settings" in the menu

2) Xlite softphone configuration

I have multiple xlite softphones running on my home network. My home network is in a different physical state/province from my asterisk server with its netgear router. My home network uses a FREEBSD server as a gateway and router which is where I handle port forwarding for my home network.

I am using Xlite 4 as the softphone. In Xlite, under "Account Settings" is a "Topology" tab. In that tab you can specify a port range for xlite to use.

I configured a range of 10000-10012 on one xlite phone. I configured a range of 10013-10025 on another xlite phone. This can obviously be continued.

3) Home Network Router

This is the router that sits between my xlite phones and the internet. I set up port forwarding on the router for the ports specified in my previous xlite configuration, forwarding those ports to their respective IP addresses.

This home network router is a FREEBSD server that is acting as my gateway. It is very strict. Other routers may be more flexible and might not need port forwarding. Note this follow-up from Astrosmurfer that may provide additional details to people having similar problems but with a setup slightly different from me:
http://pbxinaflash.com/community/th...eout-reached-on-transmission.9137/#post-57063

**Post fix experimentation**

The netgear router which sits in front of the asterisk server has an option under "WAN Settings" to "Disable SIP ALG". I experimented with leaving it on (default) or turning it off. I don't notice any difference, bear it mind that is a qualitative measurement and nothing quantitative also for a load of a external to external call.

In my FREEBSD router which sits between my xlite SIP phones and the internet, I took out the port forwarding rules to see what would happen. The SIP phones still register but they cannot receive connections from the asterisk server.

******

Thanks everyone for the tips. To others that run into a similar problem, you aren't the only one who has bruises on your head from banging it into a wall.
 
Last edited by a moderator:
Joined
Nov 20, 2010
Messages
159
Reaction score
0
Glad you got it working but, there are two things.

1. SIP AGLs are an abomination. They are supposed to resolve NAT issues specific to SIP, rewriting addresses within SIP headers. They always seem to be broken, regard less of manufacturer so, turn them off. I find things work better if Asterisk is configured to write the NATted SIP headers correctly by way of externhost and localnet directives in sip_custom.conf.

2. It should be unnecessary to port forward on the client side. Your x-lite clients "should" be able to register without port forwarding on FreeBSD. It depends on the specific firewall implementation. Also, though your port range configuration is fine as it is, your x-lites should be able to work, even with overlapping port ranges, so long as the ranges are within those that are configured on Asterisk(10,000-20,000).
 

amygrant

Guru
Joined
Apr 4, 2010
Messages
132
Reaction score
3
1. SIP AGLs are an abomination. They are supposed to resolve NAT issues specific to SIP,...

Funny you mention that. After this issue I then had to sort out why my PAP2T on my home network was experiencing similar problems. Turned out to be the SIP AGL of the netgear router. Turned it off and the PAP2T started working again. When trying to figure out I read nothing but people trashing SIP AGL so ... ya ... I think I'll be leaving that off permanently.

It should be unnecessary to port forward on the client side. Your x-lite clients "should" be able to register without port forwarding on FreeBSD. It depends on the specific firewall implementation. Also, though your port range configuration is fine as it is, your x-lites should be able to work, even with overlapping port ranges, so long as the ranges are within those that are configured on Asterisk(10,000-20,000).

The remote xlites did indeed register without port forwarding on their router however they are unable to receive/transmit voice data for more then 6400ms (a default timeout on the asterisk server). Additionally xlite softphones were unable to call each other directly.

I would be able to use a xlite phone to call into the asterisk server and listen to IVR prompts, music on hold... anything that didn't require the asterisk server connecting me with another endpoint. If I tried making a call, however, I would have bidirectional audio for a brief time (6400ms) but then the call would drop and the logs would reflect a timeout on what was considered a critical packet.

As soon as I put in explicit forwarding on the FREEBSD router the calls would not drop because the timeouts did not happen on the asterisk end. Essentially, asterisk was transmitting something to the xlite phone that wasn't making it to the xlite phone.

I'm not using any sort of UPNP on the FREEBSD server. The routing is very strict and everything needs to be explicitly stated. I actually should edit my solution post to make that more clear for future readers.
 

jucha

New Member
Joined
Mar 12, 2008
Messages
29
Reaction score
0
:confused5:Hello. I have the same problem.

[2011-04-28 17:47:00] WARNING[713] chan_sip.c: Retransmission timeout reached on transmission [email protected]:5060 for seqno 6574 (Critical Response) -- See doc/sip-retransmit.txt.
Packet timed out after 31999ms with no response

All deployment is one LAN.
Asterix box: 200.1.X.X
PIAF 1.8.2.3 64bits
4 PRI Digiurm
Softphone: Lan 192.168.X.X

nat=yes
internal router 200.1.1.1 (Default)
router for internet access 200.1.1.9 (for updates)

Please help me.
 

Members online

Forum statistics

Threads
25,811
Messages
167,759
Members
19,240
Latest member
nikko
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top