SMS in modem's memory
I see one problem with the global structure of your program; everytime loop() is run, it: 


checks if an SMS is present, and gets the originating phone number if present, otherwise it just goes on, ie smss() function returns without modifying remoteNumber
send an SMS to remoteNumber


One problem here is that your loop() will repeatedly try to send an SMS to the same remoteNumber even if no SMS was received; actually, to solve this issue, you should modify smss() to:


either wait (forever) for an SMS to be received and return only in this situation
or return a value (eg bool) that indicates whether an SMS was received or not; then an SMS should be sent if and only if an SMS was just received.


Here is an example:

void setup()
{
    GSM and GPRS initialization
    Connection to server
} 

void loop()
{
    if (smss())
    {
        Reading the txt file content in server

        sms.beginSMS(remoteNum);
        sms.print(txtMsg);
        sms.endSMS(); 
    }
}

bool smss() // I just want phone number
{
    if (sms.available())
    {
        Serial.println("Message received from:");
        sms.remoteNumber(remoteNum, 20);
        Serial.println(remoteNum);
        sms.flush();
        Serial.println("MESSAGE DELETED");
        return true;
    }
    return false;
}


Note that this code does not integrate error support as it should; indeed sms.remoteNumber() may return error codes (any value &gt;1), in which case you should consider no SMS was received at all.