Gosub error in macro-dial-one

You’re on the right track as far as using the func-set-sipheader gosub to add headers, but it’s not clear how exactly you’re editing the macro-dial-one context. That context is not intended to be edited directly. Check out this post on using the dialplan hooks: