AGI script freezes

I use AGI Bash scripts to access some webservices from the dial plan.
It worked well with an Asterisk V 1.0.9 running in a FC2 Linux.
But, now I’m trying to use the same application in an Asterisk 1.2.18 with a FC4 Linux.
The extensions.conf is the same, and the AGIs too.

This is an AGI example:

/usr/bin/elinks -dump … ?Pager=’$1 > resposta.pager
pinstat=tail resposta.pager
echo “SET VARIABLE pinstat $pinstat”"\n"

I’m passing the variables from the extensions.conf as follows:

exten => 6969,5,Agi(checkpin.agi|${COD})

It freezes just after the elinks execution.
The command executes, the message is sent, and the file “resposta.pager” is created, with the right information returned from the elinks command, but with some AGI variables at the end.

This is the file resposta.pager created by the script:


agi_request: checkpin.agi agi_channel: IAX2/camoura-2 agi_language: pt
agi_type: IAX2 agi_uniqueid: 1179782345.0 agi_callerid: 6001
agi_calleridname: Carlos agi_callingpres: 0 agi_callingani2: 0
agi_callington: 0 agi_callingtns: 0 agi_dnid: 1 agi_rdnis: unknown
agi_context: blk agi_extension: s agi_priority: 5 agi_enhanced: 0.0

The number 96 is the expected answer, but the rest is not expected. I don’t from where it came from.

Then, the CLI interface stops at the line:

– Executing AGI(“IAX2/camoura-2”, “checkpin.agi|1234”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/checkpin.agi

And, that’s it.
Please, anybody could help me?