The first one seems unlikely; it could be understood to mean that the ringing phone was the trigger for you to get busy cooking (which I guess is not what you intend). The second one means that the phone interrupted you while you were cooking. Probably this is what you mean.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.