Um, I don't know if there is anything out there for this personally, But I may be able to point you in the right direction if you want to make something like this. You will have to use System.IO.Ports.SerialPort to communicate with your modem, if you google System.IO.Ports.SerialPort you will find alot of great looking tutorials on using this class including this
You will then have to find out what AT Commands your modem supports. Send the modem the AT command and parse the output, Hopefully with anyluck the modem will have an AT command corresponding to the last number that dialed, or something similar.
I have only ever used AT commands to send SMS Messanges so I don't know if what you are asking is possible or not.
root = tkinter.Tk()
buttons=[i for i in range(10)]
#If specific button is pressed, output "YES"
for num in buttons: