Custom Action on New Voicemail

I’m integrating Asterisk into an existing Comdial system as the voicemail replacement and transitioning to an Asterisk-based VoIP system. My Comdial system’s old voicemail box uses a serial link to the Comdial system to tell the system that the voicemail box is present and also to cycle MWI lights on the digital handsets. However, the Comdial system can also cycle lights via dial codes *3 and #3 (+ extension). So, I’m wondering if there’s a way to trigger Asterisk to dial these feature codes on a particular trunk when either a) a voicemail is left in a voicemail box, or b) all new voicemails are opened on a voicemail box?

Thanks!