Dial timeout not functioning correctly

I have a very strange problem with the dial timeout on a server running Asterisk on FreeBSD 8. I can update the Asterisk version if it’s likely to fix the issue although I’m trying to see if there’s a possible fix at the moment as any problems with an upgrade would cause much larger problems.

Basically, this system makes fairly high usage of dialplans where the call rings on one or more phones for a short time, then is moved to other phones, before going to voicemail. According to the users this has supposedly been working until recently, but now the call never** moves from the first dial command.

I currently have a test extension that looks like the following in AEL.

66 => { Dial("SIP/245",2,""); Dial("SIP/245",10,""); switch(${DIALSTATUS}) { case BUSY: Voicemail(245,b); break; case CHANUNAVAIL: Playback(invalid); break; case CANCEL: case ANSWER: break; default: Voicemail(245,u); break; }; Hangup(); }

If I try the above extension (even internally from a local sip user), I get the following:

-- Executing [66@call_flows:3] Dial("SIP/245-00000057", ""SIP/245",2,""") in new stack == Using SIP RTP TOS bits 184 -- Called 245 -- SIP/245-00000058 is ringing ...over a minute later... [Sep 10 15:38:32] WARNING[78732]: chan_sip.c:17969 handle_response_invite: Re-invite to non-existing call leg on other UA. SIP dialog '0efa1af178d371c17b54214958475af0@X.X.X.X'. Giving up. -- SIP/245-00000058 is circuit-busy == Everyone is busy/congested at this time (1:0/1/0)

Basically it rings for over a minute and then finally moves on to the second dial command.
The strange this is that if any other SIP call comes in or out during this time, it springs to life and the timeout works (or if it’s already gone past that amount of time, immediately goes to the next command).