If you're coughing up a little bit of blood in your phlegm then it's probably just due to a small bacterial infection that should clear up on it's own within a week or 2.
If it lasts longer than 2 weeks then I would go see a doctor.
The only time you should really be concerned and call an ambulance is when you're coughing up a huge amount of blood then that is cause for concern because something more serious is going on and you need medical attention to stop the coughing up of blood.