exetel staff, please provide usage data/plan XML

Queries, errors or glitches regarding Member facilities
tripwu
Posts: 16
Joined: Fri Feb 01, 2008 12:15 pm
Location: NSW

exetel staff, please provide usage data/plan XML

Post by tripwu » Wed Feb 06, 2008 10:58 am

Hi guys, im a software developer and im looking at making some OSX widgets and iphone apps for the exetel SMS and usage meter.

The SMS API is all good.

But for the usage meter...
Any chance of getting a server side generated XML using a simple php query string of username/password, returned data would be offpeak/onpeak data usage, and also plan data allowance, ie 24gb/48gb.
...most other ISPs are doing this, would be a great help to developers like me willing to write apps for free.

James D

Post by James D » Mon Feb 11, 2008 7:50 am

I have asked the sys admin to reply to you.

raymond
Exetel Staff
Posts: 345
Joined: Thu Mar 04, 2004 2:46 pm

Post by raymond » Mon Feb 11, 2008 9:12 am

It can be done.

3lusiv3
Posts: 168
Joined: Mon Jan 07, 2008 9:42 pm
Location: Parramatta, NSW

Post by 3lusiv3 » Mon Feb 11, 2008 10:27 am

In case you don't know, there is a Mac OS X usage widget.

http://www.tamham.com/software/exetel_meter/

tripwu
Posts: 16
Joined: Fri Feb 01, 2008 12:15 pm
Location: NSW

Post by tripwu » Fri Feb 22, 2008 12:26 pm

thanks, yes i have seen this widget... i think there is room for improvement
3lusiv3 wrote:In case you don't know, there is a Mac OS X usage widget.

http://www.tamham.com/software/exetel_meter/

tripwu
Posts: 16
Joined: Fri Feb 01, 2008 12:15 pm
Location: NSW

Post by tripwu » Fri Feb 22, 2008 12:27 pm

thats good news, any idea of the expected timeframe?
raymond wrote:It can be done.

raymond
Exetel Staff
Posts: 345
Joined: Thu Mar 04, 2004 2:46 pm

Post by raymond » Fri Feb 22, 2008 3:32 pm

It is under development list. I will post here early next week.

tripwu
Posts: 16
Joined: Fri Feb 01, 2008 12:15 pm
Location: NSW

Post by tripwu » Fri Feb 22, 2008 3:33 pm

excellent thankyou raymond
raymond wrote:It is under development list. I will post here early next week.

tripwu
Posts: 16
Joined: Fri Feb 01, 2008 12:15 pm
Location: NSW

Post by tripwu » Fri Feb 22, 2008 5:01 pm

here's a quick php script i wrote that might help you get started, its setup for a standard php/mysql server and generates valid XML data.

i realise your database will be more complex, but for testing purposes i have this working with a mysql table with the following structure:

Code: Select all

CREATE TABLE `users` (
  `id` int(5) NOT NULL auto_increment,
  `username` varchar(255) NOT NULL,
  `password` varchar(255) NOT NULL,
  `onpeak_usage` varchar(255) NOT NULL,
  `offpeak_usage` varchar(255) NOT NULL,
  `onpeak_allow` varchar(255) NOT NULL,
  `offpeak_allow` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
so a simple query string like this will generate the XML:
generate-usage.php?username=yourusername&password=yourpassword



code within generate-usage.php

Code: Select all

<?php

$hn = 'localhost';  //replace with the exetel mysql server address
$un = 'root';  //replace with the exetel mysql username
$pw = 'root';  //replace with the exetel mysql password
$db = 'exetel_users';  //replace with the exetel mysql database
$tb = 'users';  //replace with the exetel mysql table

$conn = mysql_connect($hn, $un, $pw);

if (!$conn) {
    echo "Unable to connect to DB: " . mysql_error();
    exit;
}

if (!mysql_select_db($db)) {
    echo "Unable to select ".$db.": " . mysql_error();
    exit;
}

$qUser = $_GET['username'];  //get username from query string
$qPass = $_GET['password'];  //get password from query string

$result = mysql_query("SELECT * FROM ".$tb." WHERE username='".$qUser."' AND password='".$qPass."'");

if (mysql_num_rows($result)) {
	$mes = "success";
} else {
	$mes = "failure";
}

if (!$result) {
    echo "Could not successfully run query ($sql) from DB: " . mysql_error();
    exit;
}

header("Content-Type: text/xml");

echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n";

echo ("<usage>\r\n");

echo ("<authentication>".$mes."</authentication>\r\n");

while ($row = mysql_fetch_assoc($result)) {
	
	echo ("<username>".$row["username"]."</username>\r\n");
	echo ("<onpeak_usage>".$row["onpeak_usage"]."</onpeak_usage>\r\n");
	echo ("<offpeak_usage>".$row["offpeak_usage"]."</offpeak_usage>\r\n");
	echo ("<onpeak_allow>".$row["onpeak_allow"]."</onpeak_allow>\r\n");
	echo ("<offpeak_allow>".$row["offpeak_allow"]."</offpeak_allow>\r\n");
								
}

echo ("</usage>\r\n"); 

mysql_free_result($result);

?>

raymond
Exetel Staff
Posts: 345
Joined: Thu Mar 04, 2004 2:46 pm

Post by raymond » Fri Feb 22, 2008 5:13 pm

Thanks for your script. But, we are developing it using SOAP.

tripwu
Posts: 16
Joined: Fri Feb 01, 2008 12:15 pm
Location: NSW

Post by tripwu » Fri Feb 22, 2008 5:17 pm

no problem, i'll await your SOAP version.

have a good weekend mate. :wink:
raymond wrote:Thanks for your script. But, we are developing it using SOAP.

tripwu
Posts: 16
Joined: Fri Feb 01, 2008 12:15 pm
Location: NSW

Post by tripwu » Thu Mar 06, 2008 1:06 pm

any progress?

raymond
Exetel Staff
Posts: 345
Joined: Thu Mar 04, 2004 2:46 pm

Post by raymond » Thu Mar 06, 2008 1:08 pm

It is still in the development list. We had some other urgent task and put it on hold. But, I will make sure it is completed.

tripwu
Posts: 16
Joined: Fri Feb 01, 2008 12:15 pm
Location: NSW

Post by tripwu » Thu Mar 06, 2008 1:09 pm

cool, thanks ray
raymond wrote:It is still in the development list. We had some other urgent task and put it on hold. But, I will make sure it is completed.

tripwu
Posts: 16
Joined: Fri Feb 01, 2008 12:15 pm
Location: NSW

Post by tripwu » Sun Apr 06, 2008 4:36 pm

a month has passed... any progress so far? thanks

Post Reply