Failover script bandwith

Hi, i was reading some scripts about failover but i m not sure yet for the best solution.
I m gonna need to failover between two wan’s whenever the bandwith on the one WAN is getting slow.
Lets say with a bandwith test or the response time of the ping. I was thinking maybe with netwatch to ping an ip with an interval some ms whenever it goes more than this number to switch the WAN. Is it possible to make this happen with scripting? If you have any idea. Thank you in advance.

Hi,
i think it’s better and more efficient to use load balancing between your WANs .
testing the bandwidth itself could leads to packet loss due to its fully usage of your bandwidth !! so you never get a real result

thanks for the response…what do you suggest? our situation is that we are having issues with ip phones whenever the internet provider has issues like low bandwith…so i was thinking to have a second wan that it will switch there only whenever the speed is getting low or the response time is getting higher…i know that we can do this when the ping it doesnt respond at all but we dont need this..

something like this it will work?
http://wiki.mikrotik.com/wiki/Failover_via_Netwatch_III_(English)

There are two things you can do. Firstly use routing mark to route all ip phones through the second WAN.

Secondly, you can configure class based QoS by prioritizing sip calls or IP addresses of IP phones.

Let’s me know the route you would like to take before helping you with the configuration

we were thinking to use the second wan only whenever the first one has issues…so to switch to the second one only whenever the first provider has issues…
i am interested also about qos i used it at the past but i m not sure what is the best also…