We consider a stochastic EOQ-type model, with demand operating in a two-state random environment. This environment alternates between exponentially distributed periods of high demand and generally distributed periods of low demand. The inventory level starts at some level q, and decreases according to different compound Poisson processes during the periods of high demand and of low demand. Refilling of the inventory level to level q is required when level 0 is hit or when an expiration date is reached, whichever comes first. If such an event occurs during a high demand period, an order is instantaneously placed; otherwise, ordering is postponed until the beginning of the next high demand period. We determine various performance measures of interest, like the distribution of the inventory level at time t and of the inventory demand up to time t, the distribution of the time until refilling is required, the expected time between two refillings, the expected amount of discarded material and the expected total amount of material held in between two refillings, and the expected values of various kinds of shortages. For a given cost/revenue structure, we can thus determine the long-run average profit.