i dont know if im wrong but we are doing it now here ni our ofc.
we have our own what they call an assigned telco number sample is 2322
when the cellphone user text messages from his/her cellphone it will go directly to the telephone company and look where it will going to dump either send it to the user or just sent it to another server.
so what happening to use is they dump a value in our server with the filename like this SMS_IN_1_20030704145834_0001.DAT and thats the time your program or script will read and parse the DAT file and do what the program or script you have made.
just to make it mor clear
from the SMS it will send SMS_IN_1_20030704145834_0001.DAT and if you going to read the value of that file it is like this
09171234567|20030704145800|20030704145801|2311|cellphone user message.
hope this help.
better to have your own gateway