We present an approach for the learning of stochastic dialog models using a technique of automatic generation of dialogs. We have applied it to achieve a better performance in our dialog system, which answers telephone queries about train timetables in Spanish. Besides interacting with real users, the stochastic dialog manager can now interact with other module, in the role of the user, developing a large number of dialogs at a very low cost. From this interaction, the dialog manager is able to dynamically adapt its stochastic model, adding new transitions or modifying their probabilities, when a simulation ends satisfactorily. We expect that the modified model provides the dialog manager with a better strategy for answering real users than the strategy given by the initial model estimated from real dialogs.