This varies from airline to airline. Since you're asking about AA, check the AA forum - using the Search feature for the phrase "original routing credit" if you don't see an active thread near the top. I'm fairly sure the question has already been asked and answered there.