diff --git a/application/config/kalkun_settings.php b/application/config/kalkun_settings.php index 14ac774c4..0506b16aa 100644 --- a/application/config/kalkun_settings.php +++ b/application/config/kalkun_settings.php @@ -17,11 +17,17 @@ | Gateway Engine (Default to Gammu) |-------------------------------------------------------------------------- | +| Valid engine are: +| gammu +| kannel - Experimental +| clickatell - Experimental +| */ $config['gateway']['engine'] = 'gammu'; $config['gateway']['url'] = 'http://localhost:13013'; $config['gateway']['username'] = 'username'; $config['gateway']['password'] = 'password'; +$config['gateway']['api_id'] = 'xxx1234567890'; /* |-------------------------------------------------------------------------- diff --git a/application/models/gateway/clickatell_model.php b/application/models/gateway/clickatell_model.php new file mode 100644 index 000000000..ce2299f1a --- /dev/null +++ b/application/models/gateway/clickatell_model.php @@ -0,0 +1,61 @@ + + * + * @package Kalkun + * @subpackage Messages + * @category Models + */ +require_once('gammu_model'.EXT); + +class Clickatell_model extends Gammu_model { + + /** + * Constructor + * + * @access public + */ + function __construct() + { + parent::__construct(); + $this->gateway = $this->config->item('gateway'); + + if(empty($this->gateway['url'])) + { + $this->gateway['url'] = 'http://api.clickatell.com'; + } + } + + // -------------------------------------------------------------------- + + /** + * Send Messages (Still POC) + * Using HTTP API + * + * @return void + */ + function send_messages($data) + { + $gateway = $this->gateway; + file_get_contents($gateway['url'].'/http/sendmsg?user='.$gateway['username']. + '&password='.$gateway['password'].'&api_id='.$gateway['api_id'].'&to='.$data['dest'].'&text='.urlencode($data['message'])); + } +} + +/* End of file kannel_model.php */ +/* Location: ./application/models/gateway/clikatell_model.php */ \ No newline at end of file