Voicemail routing based on DID

We have a situation where we need to be able to route calls coming out of a queue (failover route) to one of three voicemail extensions based on their DIDs.

We have three incoming routes that play an announcement, and then routes the caller into a queue. When the queue times out, we want to send the call to voicemail, but we need to send them to different voicemail boxes. We would really like to stay with one queue to keep agent login/logout simple.

I’m thinking that this could be done through a macro, but I have no experience with Asterisk macros. Does anyone have any suggestions?