The extinction and persistence of a stochastic SIR model