A Realtime Dynamic Traffic Control System Based on Wireless Sensor Network