A barebone SMS to email gateway can be written like this:
La release 0.0.9 dell'estensione di PHP per utilizzare libgnokii permette:
Altre funzionalità come la possibilità di inviare SMS verranno aggiunta nelle prossime versioni.
Con l'estensione phpgnokii che sto collaudando è possibile creare in maniera molto semplice un sistema per inoltrare tramite email gli SMS ricevuti (gateway SMS->email).
Al giorno d'oggi tutti gli operatori telefonici forniscono la possibilità di scrivere un SMS e di farlo recapitare ad un indirizzo email, ma usando un vecchio cellulare come un 3210 e un cavetto che ormai costa pochi euro è possibile realizzare un sistema più flessibile, che oltre all'email possa gestire funzioni più complesse, adatto ad una famiglia o ad un'azienda, come applicazioni nel campo della domotica, se il computer può comandare dei relé.
Uno script PHP di esempio:
I. How To Compile and install
II. Note about Apache
I. How To Compile and install
0. Uninstall PHP
1. Download gnokii 0.6.14 *sources* or later from gnokii.org; compile and install
2. Get PHP 4 *sources* from php.net
3. If you plan to debug this extension then configure PHP using
--enable-debug --enable-experimental-zts
If you plan to use PHP with Apache then add --with-apxs
./configure --with-apxs --enable-debug --enable-experimental-zts --prefix=/usr
make && sudo make install
Compiling this beta version has been tested only after installing
PHP 4 from source with debug options enabled.
Edit: find the updated version with more functions in gnokii-extras git repository.
I just added gnokii_open() and gnokii_close().
gnokii_open() has two optional arguments, just like command line gnokii: path of config file and name of phone section
gnokii_close() is optional since PHP will close for you at the end of the script