Askozia Forums
May 21, 2012, 08:57:52 pm *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: 'Critical Packet' Error, Solution: Answers too quickly  (Read 886 times)
benhathaway
Newbie
*

Karma: 1
Posts: 9


View Profile
« on: May 29, 2009, 08:15:46 am »

All,

    There seems to be a bug in Asterisk 1.4.21 which gives the infamous 'Maximum retries exceeded on transmission' error relating to a 'Critical Packet'. A lot of people are seeing this error - and normally it reflects a bad NAT configuration somewhere - but in my case it was something else.

    I am receiving a call from a DID number and bridging the call to another provider (a landline). With all the debugging options switched on, I can see that the ACK response from the provider IS arriving through the NAT without any problems - and is being processed by Asterisk (the right channel being found, and the ACK being acknowledged) - However, asterisk continues to retransmit its Seq 102 messages as if it has not seen the ACK at all.

    Now this took me ages to fix, and I read a lot on the subject. Here are links to the Asterisk bugs that describe the problem:
    https://issues.asterisk.org/view.php?id=12746,
    https://issues.asterisk.org/view.php?id=10332
and https://issues.asterisk.org/view.php?id=13115.

The solution (workaround)

The line is being answered too quickly. I assume there is a race condition somewhere such that asterisk begins sending out it's critical packets before having fully established the connection - and so when the ACKs arrive they are checked against any pending acknowledgment requests - and find the wrong request at the top of the stack. If you call an actual local SIP handset then it works fine and there is a delay while the handset starts ringing. If, however, you forward the call on to an external extension or to an application (Like the MusicOnHold app I used during testing) then asterisk answers too quickly.

I made a custom application to test this looking like this:

Code:
1,Wait(2)
2,Answer()
3,MusicOnHold()
4,Hangup()

... And it works a treat. So there's the solution for all to see - we need to put in a delay before answering. 2 Seconds is probably too much, but I'm being overcautious at this point! If we change the Askozia code slightly to include a Wait() command in the dialplan whenever you are forwarding a provider to either an application or an external phone - then all will work fine.

I hope this is stumbled upon by the next person to smack their head against this issue for a few days, and I hope that the workaround might appear in the next release of Askozia.

Many thanks, and keep up the good work on an excellent project.

Regards,

Ben Hathaway

Logged
slight
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #1 on: May 08, 2010, 08:00:14 pm »

I owe you a beer! (or beverage of your choice Wink

This seems to have solved my problem. In my case it wasn't an early Answer(), it was actually for an outgoing call, but putting a Wait(2) just before the line that forwards the call to the trunk seems to have sorted it. I've only tried two calls so far but they were both fine and previously 9 out of 10 had failed...

Thanks!
Logged
slight
Newbie
*

Karma: 0
Posts: 2


View Profile
« Reply #2 on: May 08, 2010, 08:00:54 pm »

(Incidentally this is with 1.6.1.9 so it seems the problem remains)
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.15 seconds with 18 queries.