Inspiration on where to add macro

I am testing a few Asterisk 1.8 features and need to set some channel variables. I have already figured out how to use the shared option on set().

Basically I am setting the variable in macro-dialout-trunk-predial-hook and then need to retrieve this variable just before an extension is dialed as an object of a inbound route, ring group or a queue.

Thanks in advance.