But doing this isn't sure that I will overflow the buffer?
SMSs are typically limited to 140 characters. Size the receive buffer appropriately.
Lets say I found the marker and it is on 80 position byte (message is long) , I had overflow it along time ago then and never get it done right?
Depends on the size of the receive buffer. If it's 40 bytes, and the end of record marker is at position 80, then the message won't fit in the buffer. If the buffer is 140 characters, 80 bytes should have ample room.
My idea was when I get something I put it in a incoming array to prevent Serial buffer overflow, then I go on each element and extract it to another parts, getting that way the sender ID and the message.
That's a mighty fine idea.
I know it's stupid solution but it does the job.
It hasn't failed yet, you mean. Receive a long enough text message and it will, if you assume that long enough is less than 140 characters and don't test for overflow.
Here is an example of the intire message the modem gives back:
I routinely get multipart messages, because the text message is too long to fit in one message. Your mileage will vary.
Printing each and every character in that message in HEX format just might give you a clue what the end of message marker is.