Retrieve a bash variable to pass it in a number asterisk

Hello,

I want to know how to retrieve a variable bash my acted to pass through a number asterisk (557) file.
I made a test like this :

extentions.conf

exten => 557,1,answer() 
exten => 557,n,Read(NUMBER,,1)
exten => 557,n,AGI(/var/lib/asterisk/agi-bin/test.agi,'${NUMBER}')
exten => 557,n,background(/var/lib/asterisk/sounds/en/digits/${NUMBER})
exten => 557,n,agi(googletts.agi,"Hi, this is a test, you call" ${NUMBER} "number of" ${bash_variable_value} ".",en)
exten => 557,n,agi(googletts.agi,"Goodbye.",en)
exten => 557,n,hangup

test.agi

#!/bin/bash 
asterisk=$1

case $asterisk in
1) bash_variable_value="Mr. Mac Arthur" ;;
2) bash_variable_value="Mrs. Ellen Smith" ;;
esac

How can I do?
Thank you.

Don’t use AGI, use the SHELL function.

Don’t use Asterisk General for support questions, use Asterisk Support.