AGI reading variables from cmd Set()

I’m writing a C++ agi script and I’m having a little trouble reading channel variables. I’m going to let my example explain itself…

exten => 555,1,Answer() same => n,Set(testvar="fooooobarrrr") same => n,NoOp(${testvar}) same => n,AGI(asteriskconnector_cpp) same => n,Hangup

asteriskconnector_cpp prints out all of the channel variables it can find through stdio. Simply put, why is my ‘testvar’ variable not showing up correctly??

[quote]
New AGI Connection!
agi_request: asteriskconnector_cpp
agi_channel: SIP/sambengtson-0000002c
agi_language: en
agi_type: SIP
agi_uniqueid: 1340666066.44
agi_version: SVN-branch-10-r368568
agi_callerid: sambengtson
agi_calleridname: Sam Bengtson
agi_callingpres: 0
agi_callingani2: 0
agi_callington: 0
agi_callingtns: 0
agi_dnid: 555
agi_rdnis: unknown
agi_context: Main
agi_extension: 555
agi_priority: 4
agi_enhanced: 0.0
agi_accountcode:
agi_threadid: 140316495279872

testvar[/quote]

You should read more of the AGI docs. The variables are NOT normally provided on the stdio unless you ask for them. IMHO the easiest way to pass variables to AGI scripts is via parameters:

You get the value on stdin as agi_arg_1

You can also check the get full variable agi command:

[quote]*CLI> agi show commands topic get full variable

-= Info about agi ‘get full variable’ =-

[Syntax]
get full variable []

[Description]
Returns ‘0’ if is not set or channel does not exist. Returns
’1’ if is set and returns the variable in parenthesis.
Understands complex variable names and builtin variables, unlike GET VARIABLE.
Example return code: 200 result=1 (testvariable)

[Synopsis]
Evaluates a channel expression

[Runs Dead]
Yes

[See Also]
Not available

[/quote]