SIM900 GPS/GPRS

Hi all, I need to know how to make the program starts waiting for an incoming call. This means that the module has sim wait for a communication with a particular telephone number and receive a code and then perform other functions in the program. It is SIM900 send information via the phone that is calling the Arduino.

Home pending ----> - if it gets called ------> read a serial port and send to the terminal that called --------> cut communication and again at the beginning.

Can you give me an idea? thanks Daniel

What do you have done until now?