[Asterisk-Users] chan_sip.c:495 retrans_pkt: Maximum retries exceeded on call

Scott James Williamson scott at sjwilliamson.ca
Fri Mar 12 10:24:46 MST 2004


Let me start by saying I have no cisco phones, and no idea how to
configure them. I will speak to the use of asterisk behind a NAT'ing
firewall, which I believe to be your setup.

Asterisk is pretty picky about how SIP and RTP packets are handled by
a NAT firewall. Basically you need to maintain the same udp port for
incoming and outgoing udp packets. I will attempt to illustrate this
from what I have seen with my OpenBSD firewall:

The SIP UA sends a packet registration packet to the Asterisk server,
giving a port number with which it will accept reply packets. Our NAT
however is in the middle and does this.

SIP UA Register my port: 5060 (or 2842) sent to Asterisk port 5060 (or
2842)

Firewall, ah outgoing UDP connection, to Asterisk port 5060, I will
choose a random high port and rewrite the packet with my IP and the
UDP port SomeHighPort.

Asterisk gets this and responds to the ORIGINAL port (5060) and the
firewall expects this to arrive on the UDP port SomeHighPort. For some
resion even if the port 5060 is forwarded to the SIP UA, this packet
gets lost.

So you need to tell your firewall to somehow use the same port as the
UA for the re-written packets. On openbsd I use this directive:

> nat on $ext_if inet proto udp from any to any -> ($ext_if) static-port

(someone please comment on how to do this under linux for our other
readers)

which says do not rewrite UDP port numbers. This is also necessary for
RTP to work properly.

Some people have success with using the qualify= directive in sip.conf
to keep the session alive in the firewall by sending packets before it
times out. But I believe this to be a far better solution, as the path
for the UDP packets always exists, alive or dead.

And this works nice if you have the following setup,

1 Asterisk <-> NAT <-> (n) SIP UA

Since SIP will setup our calls, and Asterisk will assign different RTP
UDP ports for different calls to different SIP UA.

-- 
Best regards,
 Scott                            mailto:scott at sjwilliamson.ca
                                  fwd: 253984

Friday, March 12, 2004, 11:34:51 AM, you wrote:

A> Ok.. Let me start by saying that SJPhone works fine through NAT and the
A> Cisco phones inside the internal network work fine also... It's just the
A> Cisco phones on the outside using NAT.

A> For Testing I opened the Firewall open on the IP for the * Server.  I
A> have done, everything you recommended below, but still no go... When the
A> phone registers with port 2842?  Not the standard 5060?  Any ideas?  I
A> believe this is where my problem sits...

A> Thanks,

A> -gcc


A> -----Original Message-----
A> From: asterisk-users-admin at lists.digium.com
A> [mailto:asterisk-users-admin at lists.digium.com] On Behalf Of James
A> Sizemore
A> Posted At: Friday, March 12, 2004 9:03 AM
A> Posted To: Asterisk User Group
A> Conversation: [Asterisk-Users] chan_sip.c:495 retrans_pkt: Maximum
A> retries exceeded on call
A> Subject: Re: [Asterisk-Users] chan_sip.c:495 retrans_pkt: Maximum
A> retries exceeded on call


A> Make sure your using qualify=500 in the sip.conf along with nat=yes,
A> make sure any firewalls allow 5060 udp and tcp  and random ports above
A> 10000 in form your PBX.

A> If you have all that it should work.

A> AstGrp wrote:

>>Yes ....
>>
>>
>>
>>-----Original Message-----
>>From: asterisk-users-admin at lists.digium.com
>>[mailto:asterisk-users-admin at lists.digium.com] On Behalf Of James 
>>Sizemore Posted At: Thursday, March 11, 2004 10:47 AM
>>Posted To: Asterisk User Group
>>Conversation: [Asterisk-Users] chan_sip.c:495 retrans_pkt: Maximum
>>retries exceeded on call
>>Subject: Re: [Asterisk-Users] chan_sip.c:495 retrans_pkt: Maximum
>>retries exceeded on call
>>
>>
>>You do have :
>>nat_enable: "1"
>>nat_received_processing: "1"
>>
>>On the Ciscos?
>>
>>AstGrp wrote:
>>
>>  
>>
>>>I am having a similar problem... I get the same message, but inbound
>>>calls can go through.... This is only Cisco phones that are behind
A> NAT.
>>>    
>>>
>>
>>  
>>
>>>I have tried your recommendations from below, but still no luck.. User
>>>can make outbound calls, just can't receive any.  Any ideas would be
>>>greatly appreciated.. I even tried to change the timeout value in 
>>>chan_sip, but it just waits longer to fail.. Just dosen't seem to want

>>>to communicate...
>>>
>>>Thanks,
>>>
>>>gcc
>>>
>>>-----Original Message-----
>>>From: asterisk-users-admin at lists.digium.com
>>>[mailto:asterisk-users-admin at lists.digium.com] On Behalf Of John
>>>Bittner Posted At: Tuesday, March 02, 2004 11:46 PM Posted To:
A> Asterisk
>>>    
>>>
>>
>>  
>>
>>>User Group
>>>Conversation: [Asterisk-Users] chan_sip.c:495 retrans_pkt: Maximum
>>>retries exceeded on call
>>>Subject: RE: [Asterisk-Users] chan_sip.c:495 retrans_pkt: Maximum 
>>>retries exceeded on call
>>>
>>>
>>>Are you using Cisco phones. ?
>>>
>>>I had this issue with my cisco phones. I didn't had any issues with
>>>dropped calls. All I did to fix this was set a prefered_codex and set
>>>proxy_register to 0.
>>>
>>>I hope this helps.
>>>
>>>John Bittner
>>>Simlab.net
>>>
>>>
>>> 
>>>
>>>    
>>>
>>>>-----Original Message-----
>>>>From: asterisk-users-admin at lists.digium.com
>>>>[mailto:asterisk-users-admin at lists.digium.com] On Behalf Of dkwok
>>>>Sent: Wednesday, March 03, 2004 7:04 AM
>>>>To: asterisk-users at lists.digium.com
>>>>Subject: [Asterisk-Users] chan_sip.c:495 retrans_pkt: Maximum retries

>>>>exceeded on call
>>>>
>>>>*CLI> Mar  3 12:55:05 WARNING[1150495040]: chan_sip.c:495
>>>>retrans_pkt:
>>>>Maximum retries exceeded on call
>>>>5946b8292887d22017623f85018dcfa4 at 192.168.1.143 for seqno 102
A> (Request)
>>>>
>>>>This has been brought up in the previous post but it does not seem to
>>>>have an answer for it so far.
>>>>
>>>>I cvs the stable v1.0 this morning after compiling and installing I
>>>>have calls drop 1 minutes into the connection with the above message.
>>>>
>>>>If anyone has any idea of this occurrence.
>>>>
>>>>I have set up sip.conf:
>>>>
>>>>canreinvite=no
>>>>
>>>>--
>>>>David Kwok
>>>>Tel: 612 99292086 ext 1002
>>>>Iaxtel/FWD # 17001813482 ext 1002
>>>>








More information about the asterisk-users mailing list