I have the exact same problem. I've got the infrastructure to switch between RTMFP and streaming trough FMS, but I've no real method of detecting when RTMFP is not available. I can connect to the Stratus servers on some clients, but the actual UDP connection between the clients won't work. Now I know what ports RTMFP requires, but how can I test if these ports are available. Testing wether connecting to the Stratus server works is not reliable, since the actual connection uses random UDP ports from 1000 and up. Is there any way to test inside a Flash client wether UDP connectivity is available?
if you can't connect to a Stratus server, then you definitely can't make any P2P connections, and you should connect to a regular RTMP server. you can use the various failure events, such as NetConnection.Connect.Close, ...Failed, ...Rejected, or ...InvalidApp, or set a timer if you don't want to wait for the default timeout (like 60-90 seconds).
same thing for P2P connections. you can detect their eventual failure, or set a timer to time out before the normal time.
if you find you're never getting P2P connections, or not even getting connected to Stratus, you could save that in a local shared object to speed up subsequent runs. if you do that though, you should periodically re-try the RTMFP connection, since network conditions may have changed.
there's no way to know for sure whether a connection will work unless you try it.
I've decided to just put a timer on the NetStream event, since the NetConnection always succeeds in the problem cases(there's a timer on that too just to be sure). If NetStream.Play.Start/Reset is not fired within x amount of time, I switch to FMS.
Thanks for the suggestions!