Skip to content

Commit

Permalink
Changes: implemented poc for clickatell sendsms (Issue: #60)
Browse files Browse the repository at this point in the history
  • Loading branch information
back2arie committed Jul 29, 2012
1 parent b3c8b9e commit 43e47de
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/config/kalkun_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@
| Gateway Engine (Default to Gammu)
|--------------------------------------------------------------------------
|
| Valid engine are:
| gammu <http://wammu.eu>
| kannel <http://kannel.org> - Experimental
| clickatell <http://clickatell.com> - Experimental
|
*/
$config['gateway']['engine'] = 'gammu';
$config['gateway']['url'] = 'http://localhost:13013';
$config['gateway']['username'] = 'username';
$config['gateway']['password'] = 'password';
$config['gateway']['api_id'] = 'xxx1234567890';

/*
|--------------------------------------------------------------------------
Expand Down
61 changes: 61 additions & 0 deletions application/models/gateway/clickatell_model.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* Kalkun
* An open source web based SMS Management
*
* @package Kalkun
* @author Kalkun Dev Team
* @license http://kalkun.sourceforge.net/license.php
* @link http://kalkun.sourceforge.net
*/

// ------------------------------------------------------------------------

/**
* Clickatell_model Class
*
* Handle all messages database activity
* for Kannel <http://clickatell.com>
*
* @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 */

1 comment on commit 43e47de

@stevenjohnk
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this but not working,please help

Please sign in to comment.