The one-dimensional inverse scattering problem for nonhomogeneous media with discontinuous wavespeed