I am using outbound socket in dailplan as in https://wiki.freeswitch.org/wiki/Event_socket_outbound#Examples

After issuing a connect\n\n, I have tried getvar.

getvar only returns value if I give a defined variable such

getvar sip_contact_host\n\n

which returns

Content-Type: command/reply
Reply-Text: 192.168.2.82


If I try to set a variable: 

sendmsg 
call-command: set
execute-app-name: foo=bar

getvar foo

returns

Content-Type: command/reply
Reply-Text: -ERR command not found


Thank you,

Valter