Handle forwarded calls differently than internal calls

Hi,
we have set up our Free-PBX so that internal calls get terminated and external ones get to a ringgroup after 5 seconds (via a dynamic route (AGI)).

How can I change it so that forwarded calls from another extension are not handled as internal ones?

Thanks in advance,
Eric