Using a shell script to call a web service

Hello,

Im running a shell script using the agi comand in the dialplan but it does not seem to work. I returns cero but when I use the variable TIpo it does not exists.

exten => s,n,eagi,envioDocumento.sh|${documento}
;exten => s,n,System(sh /var/lib/asterisk/agi-bin/envioDocumento.sh ${documento})
exten => s,n,NoOp(${Tipo})
exten => s,n,NoOp(${DAY_1})
exten => s,n,Goto(tipo${Tipo},s,1)

when I run this I get:
 – Executing [s@confirmardoc:3] Set(“Zap/1-1”, “CDR(userfield)=1236669”) in new stack
 – Executing [s@confirmardoc:4] EAGI(“Zap/1-1”, “envioDocumento.sh|1236669”) in new stack
 – Launched AGI Script /var/lib/asterisk/agi-bin/envioDocumento.sh
– AGI Script envioDocumento.sh completed, returning 0
 – Executing [s@confirmardoc:5] NoOp(“Zap/1-1”, “”) in new stack
 – Executing [s@confirmardoc:6] NoOp(“Zap/1-1”, “”) in new stack
 – Executing [s@confirmardoc:7] Goto(“Zap/1-1”, “tipo|s|1”) in new stack
 – Goto (tipo,s,1)

As you can see Tipo is empty…But when I run it from /var/lib/asterisk/agi-bin I get:
[root@ivr agi-bin]# ./envioDocumento.sh 1236669
SET VARIABLE Tipo 3
SET VARIABLE DAY_1 10
SET VARIABLE MONTH_1 2
SET VARIABLE YEAR_1 2009
SET VARIABLE HOUR_1 0
SET VARIABLE MIN_1 0
SET VARIABLE DAY_2 11
SET VARIABLE MONTH_2 2
SET VARIABLE YEAR_2 2009
SET VARIABLE HOUR_2 0
SET VARIABLE MIN_2 0
[root@ivr agi-bin]#

So TIpo is not empty.

Anyone can help me?? Thanks in advance!!!