Please explain how to use macro-vm-custom. It appears that macro-vm-custom gets included after macro-vm and all of the extensions in macro-vm hangup so how would any code in macro-vm-custom ever get called?
Previously (piaf on asterisk 1.4) I simply added this to extensions_custom.conf and it was called after a voicemail was left.
A lot has changed in FreePBX and Asterisk in 10? 12? years. I think to do what you want, you will need to add a hangup handler earlier in the call flow and then check to see if it went to vm. See this post: Hooking for fun and income, the section titled " How do I perform a custom action on hangup?"