Auto redial

Hi Aterisk Guru

My asterisk needs to dial a password on an established connection,
when the machine on the other end reply with the
voice “you have entered invalid password”, I need to be able to detect
the voice and redial the password

How can I use Dial() command to do that ?

Thank you for the help,