A: Mohammad, thank you for your email. Please note that I can not offer dedicated IoT / M2M support free of charge. However, I will answer and share my knowledge.
The MCU (e.g. Raspberry Pi) will listen or poll on incoming SMS or voice call. In the case of a voice call you can detect the caller ID by AT commands. If you detect a valid ID then you start to set up the GPRS connection. More secure is it to pick up the phone by AT command and to listen to incoming DTMF. If you detect valid tones then you go ahead with set up the GPRS connection and to access to your server by plain TCP/IP or by HTPP.
With SMS the process is the same. You check the incoming SMS by AT commands and it the text of the SMS is valid, then you go ahead to set up the GPRS connection.
A Raspberry PI is, in my opinion, the wrong device for a professional IooT / M2M device. It is too expensive and is charging to much power. An ARM Cortex on an STM32 Nucleo is much cheaper and can be migrated on chip level in mass production.
If you plan something which will move to mass production from a few hundred to 100K+ then it makes sense to read my IoT / M2M Cookbook. An excerpt of my book you will get here free of charge: http://www.gsm-modem.de/M2M/m2m_iot_cookbook/