Passing variables between Application and Scripts

I'm working with the advanced queue scripts that allow a user to submit a request for callback. I have had no issues in the past making this work and it's bee a great addition to my toolbox, however I'm having an issue now that I'm stuck on. Here goes:
1. Call comes in on "Main Application" through trigger 9996. Application runs and script sets DNIS, ANI, callType (CSQ) values.
2. Caller selects a callback and inputs the information requested and the call is terminated.
3. Main Application and script continue and make an outbound call to my "CallBack Application" through trigger 9997. Application runs and script does not have any values set for DNIS, ANI, callType (CSQ).
I'm trying to figure out how I can pass the variables from the "Main Application" to the "CallBack Application". Any thoughts would be appericated.
- Forums Topic:

Passing variables
database tables or xml files is the best way to pass variables between applications or scprit.