Leviathan confirmed her story at the request of both fishes, and then Jonah was ejected from one fish into the over-filled belly of the other. Cramped for room and otherwise made miserable, Jonah finally prayed, acknowledging the futility of his efforts to escape from God. But he was not answered until he had promised to redeem his pledge to capture Leviathan.
Jonah confirmed her story after both fish asked for confirmation, and then he was expelled from one fish into the overcrowded stomach of another. Jonah was severely cramped and miserable in this situation, but eventually prayed, acknowledging that his efforts to escape God were futile. He wasn't answered until he had promised to fulfill his obligation to capture Leviathan.