IVR + 2 stage dialing

I am looking for most simple solution to provide such a functionality:
There is a voip gateway connected to the pstn line. I am dialing number of this line, gw sends the call to asterisk. Asterisk picks up the call, plays the announcements and gives you option to dial certain extensions. This is relatively easy, but also I want to get a secret option, for example, when pressed ‘#1’ or whatever, after which it will provide second dial tone, gather DTMF and send it to another asterisk. This second part is causing me trouble. I would be grateful for any help, also for any webpages that would be useful regarding this options.