Thanks for the question. The common variable here is your Wi-Fi router. Let’s check to see if the commonly used ports are being blocked by a firewall on your router:
well, I faced the similar problem. There's 2 AppleTV in my office area. My MacBook Pro, iPad and iPod touch were fine in terms of Airplay function on Apple TV #1. Just not my iPhone 4S, it's always showing Apple TV #2 in the airplay option. Occasionally it picks up Apple TV #1, so I tapped it, but the airplay didn't deliver.
power cycles (switch off - wait 10 secs - power on) on iPhone.
power cycle on the Apple TV.
Soft restart via Apple TV's menu.
Finally, i tried something and it worked.
Step 1: connect iPhone to MacBook Pro. It should do a normal syncing.
Step 2: after sync, power off iPhone.
Step 3: power on iPhone.
Step 4: Results - Airplay on Apple TV #1.
i'm no iOS or Mac OS expert. If someone is able to explain why it worked, and why i didn't work, that will be great!