Hardware Reference
In-Depth Information
So, once the message has arrived, you must process it. In the case of e-mail, you can use Procmail as you saw
earlier to process the following into something useful with a simple regular expression:
##You have a new message from 012345678 saying Null This is my test.
Note that the word Null is a symptom of the free protocol and the specific provider, as mentioned earlier.
The web page request is the easier method, because the SMS gateway invokes a predetermined URL containing
all the necessary parameters. Each company has a different format, so it is a good idea to create a script called
echo.php for testing purposes.
<?php
$rt.= "Get:\n";
$rt.= print_r($_GET, TRUE);
$rt.= "Post:\n";
$rt.= print_r($_POST, TRUE);
file_put_contents( '/tmp/log.txt', $rt, FILE_APPEND );
?>
Because the SMS gateway ignores all output from the web pages it requests, you'll never see this data, which is
why you've redirected its output into a log file. You can have a rolling update of this file with the following:
tail -f /tmp/log.txt
Then send a text message and have it redirected to echo.php , and you'll see exactly what arguments are supplied.
Using the earlier examples, IntelliSoftware provides the following:
Get:
Array
(
)
Post:
Array
(
[from] => 012345678
[text] => This is my last test tonight
[msgid] => 50011005000001624552
[type] => 1
)
Txtlocal gives this:
Get:
Array
(
)
Post:
Array
Search WWH ::




Custom Search