Check this project its called SMS Box (with source code) :
https://www.elektronika.ba/563/sms-box-project/
This device acts as interface between your microcontroller project and a GSM phone. It handles all modem data communication between the GSM phone and your micro-project. The best thing is that it decodes PDU into TEXT on the fly!
You can easily SMS-enable your any project without need for learning AT commands and parsing complicated data when talking to AT modem inside the phone.
The SMS Box! handles SMS messages in pdu-mode so you don't need to worry about *many* things. You can talk to it over its «4-wire bus» and can be used for:
- Receiving sms messages (PDU -> TEXT conversion!)
- Sending sms messages (TEXT mode)
- Dialling a telephone number
- Hang-up a call
- Query call status
- Receive CLIP string
- Report a RING to microcontroller project (interrupt your uC program)
- Answer a call
- Set phone's date and time – not implemented yet
- Get phone's date and time – not implemented yet
- Check prepaid credit balance
It's based on PIC16F877A microcontroller running on 16MHz at 5V. It has an onboard level converter for serial communication with the gsm phone because PIC's UART RX input pin has a Schmitt trigger triggering at 4,5 - 5V while the phone is sending only approx. 3V from it's TX pin. It also has a zener diode at TX pin so it doesn't kill the phone's network connection when talking to it. Firmware is 100\% written in MPASM assembler.