This is related to DTMF,
connect mobile headphone output to DTMF decoder
User MT8870 dtmf decoder IC
go through the datasheet,
you will find that there are total 4 output pins,
connect those output pins to microcontroller
I would suggest 89s51, if you are a beginner.
Now run a program inside microcontroller to read the input ports and then take respective action.
Use relays at the output
It would be like this:
Mobile ==> DTMF Decoder ==> Microcontroller ==> Relays ==> Devices