I have been searching for weeks on a way to route an incoming call based on the following conditions:
1. The incoming call was forwarded.
2. read the originally dialed phone number.
3. Route the incoming call to specific destination based on a match on the originally dialed number.
In short, I want to create a voicemail platform that will recieve busy/unanswered forwarded calls and route them to the proper mailbox from a single DID.
My provider is flowroute and the calls would be forwarded by AT&T Wireless.
What would it take to do this? I have tried looking into Asterisk Logs but the call information does not provide any info that would help divert a call that was forwarded. I suspect that this "detection" would need to be done on the SIP header level.