[BUG?] Dial immediately exits sometimes with null status


I’ve got problem with Asterisk 1.0.9 and I’m just wondering if somebody experienced the same.

I’ve got DeadAGI script, which dials some PRI line. After that it grabs DIALSTATUS and ANSWEREDTIME variables. From time to time it happens that after executing something like

$res = $AGI->exec('Dial Zap/G1/12345|60|L(3600)");

The Dial command exits immediately, BUT:

  • DIALSTATUS and ANSWEREDTIME variables are empty
  • the call goes on (!)
  • after the call is really hangup, it’s written to CDR with non-zero ANSWEREDTIME and DIALSTATUS (with correct values)

I’ve tried to put Hangup after Dial exits, so I’d sure that no money is lost. It didn’t help. Interesting thing is that it occurs randomly, with no followable pattern. You can imagine that this is a bit problem, because the script does second-level accounting (M$ stuff) which is unfortunatelly necessary.

Any guesses? Any experience?

TNX in advance!