Flash() on existing zap trunk and IVR menu referencing

I have a project where I’m trying to integrate Asterisk as a VM/AA system with a legacy PBX and I need some help. I have most of the integration working but am getting stuck:

  1. When I have a call in the system and the caller dials an extension (Say for instance from the Directory() app), I need to Flash() the current channel then use SentDTMF(${EXTEN}), then Hangup. How can I tell FreePBX to do this for a specific dial pattern?

I know I can do it with the stock Asterisk config but the FreePBX stuff has my head spinning.

  1. I’ve added some extension handling for the specific integration codes into extensions_custom.conf and 90% of that works. The remaining 10% is sending calls to the IVR menu. How do I reference a specific IVR menu using a Goto from this file?

Thanks for any help!!