$config['smsbox']['scheme'] = 'http'; // URL scheme, http or https.
$config['smsbox']['port'] = '80'; // Port number on which SMSBox host receives requests.
$config['smsbox']['user'] = ''; // SMSBox username.
$config['smsbox']['password'] = ''; // SMSBox password.
$config['smsbox']['from'] = ''; // Phone number of sender, usually overridden by SMSC.
Then i edited the file /opt/observium/includes/alerting/smsbox.inc.php as follows:
<?php
$message = $message_tags['ALERT_STATE'] . " " . $message_tags['DEVICE_HOSTNAME'] .": " . $message_tags['ENTITY_NAME'] . "\n" . $message_tags['ALERT_MESSAGE'];
$context_data = array (
'method' => 'GET',
'header' => "Connection: close\r\n"
);
$url = sprintf('%s://%s/smsapi/index.php?To=%s&Meassage=%s',
$config['smsbox']['scheme'], $config['smsbox']['host'], urlencode($endpoint['phone']),urlencode($message));
$response = get_http_request($url, $context_data);
if (strpos($response, "Accepted") || strpos($response, "Queued"))
{
$notify_status['success'] = TRUE;
} else {
$notify_status['success'] = FALSE;
}
unset($message);
// EOF
But still i am not able to get SMS alerts on my mobile phone. Please note that the SMS gateway has given IP based access to my machine on which observium is runnning so i do not need username and password fileds while posting message to the API.
Please help me resolve this issue .
Thanks
--
|
| Vikas Kumar | Hospitality & PR Coordinator |
|