A barebone SMS to email gateway can be written like this:
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
Edit: see the updated list instead.
At present the function list is rather short, but there is all what it needs to read SM's:
This is a first try at writing a PHP extension to use gnokii.
Some ideas:
See attached archive. Edit: this is now in gnokii-extras' git repository.