IVR scripts · advanced · 12 min full read
Set Variable writes a value. Lookup Contact Record reads the contact. Query calls out, and the published example is an XML web service POST whose response groups are mapped with regular expressions into variables. That example uses script variables, not call variables, because the caller is not connected to an agent.
Call variables are a different object, used when you need reporting later. Enabling them does not backfill history. A Query result you never store in a reporting call variable will not appear in a historical call log.