Dial plan magic needed

Hi all,

I’m hoping someone can help me with a dialplan problem I’ve got. I want to modify dialout-trunk macro so that it checks to see if the accountcode variable has been set for any calls going through the trunk. If it hasn’t I want it to set the variable to the accountcode field set in sip.conf.

Anyone have any ideas how I can achieve this? I can’t seem to find any way to reference the sip.conf file from the dial plan to look up the accountcode I want.