Detecting if call came from mobile call forwarding/voicemail

Google voice has an option to enable it as the voicemail for a mobile phone. It basically has it forward the call to the gv number but any other normal call to the gv still rings the desired numbers.

How does that work and can I perform this with asterisk? I have a DID that I would like to use for this but I also want this number to be used normally and not lock it to only be a voicemail. Not sure how GV does that to detect and follow the right rules.

I believe I ended up find it: RDNIS. Haven’t totally jumped and tried it out but looks like that should be it.

Probably can delete this thread.