English, php

sms2email with the phpgnokii extension

A barebone SMS to email gateway can be written like this:

PHP extension for gnokii - README draft

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.

PHP extension for gnokii - function list (2)

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

PHP extension for gnokii - function list

At present the function list is rather short, but there is all what it needs to read SM's:

PHP extension for gnokii

This is a first try at writing a PHP extension to use gnokii.

Some ideas:

  • decide which functions to include (no need to duplicate commandline gnokii)
    • [yes] add a "gnokii_" prefix to all functions?
    • [done] --identify
    • --getsms
    • --sendsms / --savesms
    • --getphonebook (useful for backups)
    • --getsecuritycodestatus / --entersecuritycode
  • see if using something like mysql persistent connections makes sense
  • how to handle --config and --phone options when they will be implemented?

See attached archive.

Syndicate content