SMS/Clickatell.php (view source)
The current release of SMS::Clickatell is version 0.6.2 which was released on the 18th of December 2005. A couple of modifications are underway to ensure that the class conforms with the GSM 03.38 standard so that it correctly ensures that SMS messages are delivered to the Clickatell API server without being dropped for being too long, which may be the case when using characters which count as two characters under the GSM 03.38 character set, which can be problematic for important system notifications which do not go through due to them being too long!
I am also developing a python version of this class which will work in a similar fashion as this PEAR class for those who are using python instead of PHP for developing applications.
SMS::Clickatell has been created for mainly sending SMS messages via a web interface, or even used from shell scripts for server monitoring and notification. It can be integrated into server monitoring software such as Nagios or Netsaint, or even into your own custom home grown scripts. This provides users with unlimited possibilites of where you want to use SMS messaging.
Prior to rolling the next beta of SMS::Clickatell I'm planning on having the following implemented:
| Version | Release Date | Description |
|---|---|---|
| 0.6.2 | 2005-12-18 | * Bug fixes in sendmsg () |
| 0.6.1 | 2005-05-25 | * Check vouchers are numeric else raise a PEAR Error. * All functions requiring to post to the Clickatell API server use SMS_Clickatell::_curl |
| 0.6 | 2005-01-29 | * Added function tokenpay() to spend vouchers generated on the Clickatell Website. |
| 0.5 | 2004-11-13 | * Added function getmsgcharge() to get cost of message delivered via Clickatell gateway. |
| 0.4 | 2004-06-04 |
* Allow users to specify which queue to use. * Added deletemsg() * Allow users to specify if they want to escalate message delivery |
| 0.3 | 2004-04-29 | * Changes for required features which we utilise. |
| 0.2 | 2004-02-16 | * Added init() and getbalance() * Login details no longer hardcoded into script. |
| 0.1 | 2003-12-30 | * Initial release for PEAR proposal |
Download the latest release of SMS::Clickatell over here. Also this class should work with the Vodacom Developer Zone and Airborn Connect as both these sites use white-label versions of the Clickatell website and API interfaces from what I can tell. I have confirmed this fact with Clickatell's support team telephonically.
I will be placing online documentation up shortly for how to use the SMS::Clickatell Class to send messages using your Clickatell account. There are API Documentation online which was generated using phpDocumentator. End user documentation is currently being written.
Resources:
Documentation:
Currently only API documentation generated using phpDocumentator is available. I'm working on getting a docbook solution going with livedocs which shall be made available shortly.
Previous releases of SMS::Clickatell:
Every now and again I receive requests to get sample code to see how one can use this code:
#!/usr/bin/php
<?php
# SMS Balance Checker
#
# @author Jacques Marneweck. <jacques@php.net>
# @copyright 2003-2007 Jacques Marneweck. All rights reserved.
# @version $Id$
require_once 'SMS/Clickatell.php';
$sms = new SMS_Clickatell;
$result = $sms->init (
array (
'user' => 'username',
'pass' => 'password',
'api_id' => 'api_id',
)
);
if (PEAR::isError($result)) {
die ($result->getMessage());
}
$result = $sms->auth();
if (PEAR::isError($result)) {
die ($result->getMessage());
}
$balance = $sms->getBalance();
if (PEAR::isError($balance)) {
die($balance->getMessage());
}
echo "You have " . $balance . " credits remaining.n";
?>