-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes: implemented poc for clickatell sendsms (Issue: #60)
- Loading branch information
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 */ |
43e47de
There was a problem hiding this comment.
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