Skip to content
tenzap edited this page Mar 2, 2022 · 1 revision

Traditionally Kalkun was a web-based front-end to gammu. In some situations it is desirable to use Kalkun for SMS creation and a different technology for sending-out. Due to this reason we have "Alternate gateways" in Kalkun.

Supported alternate gateways

Configuration

In your application/config/kalkun_settings.php you need to select the right gateway type. Default configuration shows gammu:

/*
|--------------------------------------------------------------------------
| Gateway Engine (Default to Gammu)
|--------------------------------------------------------------------------
|
| Valid engine are:
| gammu <http://wammu.eu>
| kannel <http://kannel.org> - Experimental
| clickatell <http://clickatell.com> - Experimental
| ozeking <http://ozekisms.com> - Experimental
| nowsms <http://nowsms.com> - Experimental
| way2sms <http://way2sms.com> - Experimental
| tmobilecz <https://sms.t-mobile.cz/closed.jsp> - Experimental
*/
$config['gateway']['engine'] = 'gammu';

For specific gateway types you need to configure additional settings. See documentation for that gateway. For postponed sending (at a later time) you need to start a queue processing script scripts/outbox_queue.sh from crontab or by other means. This script sends all postponed messages that are due.

Implementation Status

Support for Alternate gateways was started as a fork on Github in Kalkun 0.6 by back2arie - tracked in issue #60. It was a Proof-of-Concept. Over time back2arie wrote more gateways. Others contributed too. Since pull #149 it is back in Master and supports:

  • Immediate sending of a message and saving a copy of the message to sentitems table.
  • Postponed sending of a massage, queueing the message to outbox table.
  • Queue processing script (must be periodically started from crontab) that sends postponed messages at the right time.
  • In case of sending failure the message is saved in sentitems table with a flag. Such messages are visible in Kalkun in special subfolder "Sent Items / Sending Error". Error message is appended to message text too.

Known limitations

  • Alternate gateways can only send messages out. No receive of messages is possible. This is not a bug in Kalkun, it is just not supported by the other service providers.
  • Some properties of the message are simply ignored. Not all service providers support features such as flash SMS or WAP push link.
  • If you send a message to multiple recipients it is always sent to each recipient separately. Even though some service providers support multiple recipients natively, the core of Kalkun calls Alternate gateway scripts on a one-by-one basis.
  • Immediate sending to multiple recipients may take some time. During this time the web interface is waiting for the webserver to finish its work. Please be patient.
  • Postponed sending only works if you periodically start the queue processing script (from crontab or by other means). The messages may be sent later than requested if you don't start the script every minute.
  • You can only use one type of gateway in a single Kalkun installation. You cannot use more of them. Multiple modem feature is only applicable to original gammu backend.

Implementation background

All source files can be found in /application/models/gateway subdirectory. There is a helper Class Nongammu_model that inherits mostly from Gammu_model and implements the common database handling, message queueing and queue processing for all Alternate gateways. For every service provider there is a Class that implements

function really_send_messages($data)
{

}

Argument $data is an array describing the SMS.

Return value can be a string or NULL. String value is an Error message - means sending has failed. Such a message is appended to SMS text before saving to database.

Clone this wiki locally