Esato

Forum > Sony Ericsson / Sony > Symbian phones > Tariff Monitor software dev - Tariff config file format (help please!)

123  Next
Author Tariff Monitor software dev - Tariff config file format (help please!)
julianmclean
P800
Joined: Mar 11, 2003
Posts: 118
PM
Posted: 2003-06-12 17:41
Reply with quoteEdit/Delete This PostPrint this post
Hi all,

As some of you know, I've been working on a P800 application to monitor the calls you make and then give you a view on what you've used/spent against your tariff. As such, I have developed a format for tariff configuration files which will contain all the information required by the program to map all your calls/sms/etc to the correct allowances, pricings that make up your particular tariff.

Below is the format for the tariff config files that I have come up with. This is still subject to change, but I am releasing it here to try and get some feedback on whether it is flexible enough to cope with all the tariffs out there. I have designed it with knowledge of UK tariffs, but it will be interesting to see if it meets the needs of tariffs in other countries!

Here is a description of how the file should look (only the e.g. lines should actually appear in a real file as shown further down):

Filename = .trf
e.g. YP700.trf

<<<<<<<<<<<<<<<<<< START OF FILE >>>>>>>>>>>>>>>>>>>

///////////////////////////////////
Main Details

format:
A|Tariff Name|Network|Country|Peak Time Start|Peak Time End

descriptions:
Tariff Name - descriptive name of the tariff
Network - the name of the network the tariff is under
Country - the country in which the tariff is valid
Peak Time Start - the time at which peak rate comes into effect (Mon-Fri), format = hhmm
Peak Time End - the time at which peak rate ends (Mon-Fri), format = hhmm

e.g.
A|YP700|Orange|UK|0700|1900

///////////////////////////////////
Version Details

format:
V|Author|Version|Created Date

descriptions:
Author - your name!
Version - the version of this tariff file (to allow tariff changes to be versioned)
Created Date - the date the tariff was created (so that you can be sure of getting the latest configs)

e.g.
V|Julian Mclean|0.1|06/06/2003

///////////////////////////////////
Bucket Details

format:
B|Bucket ID|Butcket Type|Rollover?|Max Rollover Months|Bucket Name|Units Per Month


descriptions:
Bucket ID - unique id number for this bucket used to link usage types to buckets (must be unique!)
Bucket Type - bucket type (1 = voice call, 2 = data call, 3 = SMS, 4 = MMS, 5 = GPRS)
Rollover? - (Y/N) do the units in this bucket rollover into the next month if they are unused
Max Rollover Months - The maximum amount of months that rollover minutes remain for
Bucket Name - descriptive name for this bucket
Units Per Month - the allowance of units in this bucket per month (-1 = unlimited)

e.g.
B|1|1|Y|3|Free Calls|700
B|2|2|N|0|Unlimited WAP|-1
B|3|3|N|0|SMS Bundle|60
B|4|4|N|0|MMS Bbundle|20
B|5|5|N|0|GPRS Data|1024

///////////////////////////////////
Usage Type Details

format:
C|Usage Type ID|Usage Type Type(!)|Usage Type Name|Include Same-net?|Exclude Same-net?|
Peak?|Off-Peak?|Weekends?|Usage Mask|Assigned Bucket|Cost Per Unit

descriptions:
Usage Type ID - unique id for this usage type (must be unique!)
Usage Type Type(!) - usage type (1 = voice call, 2 = data call, 3 = SMS, 4 = MMS, 5 = GPRS)
Usage Type Name - descriptive name for this usage type
Include Same Net? - (Y/N) if 'Y' then if a particular usage appears in the user's same network numbers list,
then include it in this bucket (used to collect all same net calls into this usage type)
Exclude Same Net? - (Y/N) if 'Y'then even if a particular usage matches this usage type, exclude it if it
appears in the user's same network numbers list
Peak? - (Y/N) does this usage type apply in the peak hour periods
Off-Peak? - (Y/N) does this usage type apply in the off-peak hour periods
Weekends? - (Y/N) does this usage type apply at the weekends (Sat/Sun)
Usage Mask - the mask to which a particular usage destination must fit to be mapped to this usage
type (e.g. in UK 0800 will match 0800123456, 0800555555, etc)
Assigned Bucket - the ID of the bucket to which usages mapped to this usage type will be decucted
whilst units remain (0 = no bucket assignment)
Cost Per Unit - the cost per unit of usages in this usage type (e.g. SMS price, call cost per minute)

e.g.
C|1|1|X-net Peak|N|Y|Y|N|N|07|1|40
C|2|1|X-net Off-Peak|N|Y|N|Y|N|07|1|20
C|3|1|X-net Weekend|N|Y|N|N|Y|07|1|20
C|4|1|Same-net Peak|Y|N|Y|N|N|07|1|20
C|5|1|Same-net Off-Peak|Y|N|N|Y|N|07|1|10
C|6|1|Same-net Weekend|Y|N|N|N|Y|07|1|10
C|7|1|Landline Peak|N|Y|Y|N|N|0|1|20
C|8|1|Landline Off-Peak|N|Y|N|Y|N|0|1|10
C|9|1|Landline Weekend|N|Y|N|N|Y|0|1|10
C|10|1|0800 Freephone|N|Y|Y|Y|Y|0800|0|10
C|11|1|0808 Freephone|N|Y|Y|Y|Y|0800|0|10
C|12|1|Local Rate|N|Y|Y|Y|Y|0845|0|10
C|13|1|National Rate|N|Y|Y|Y|Y|0870|0|10
C|14|2|WAP Dial-up|N|N|Y|Y|Y|+4407973100500|2|10
C|15|3|SMS|Y|N|Y|Y|Y|0|3|10

///////////////////////////////////

<<<<<<<<<<<<<<<<<< END OF FILE >>>>>>>>>>>>>>>>>>>

So here would be an example contents of a file:

A|YP700|Orange|UK|0700|1900
V|Julian Mclean|0.1|05/06/2003
B|1|1|Y|3|Calls|700
B|2|2|N|0|WAP|-1
B|3|3|N|0|SMS|60
B|4|4|N|0|MMS|20
B|5|5|N|0|GPRS|1024
B|6|5|N|0|WAP GPRS|1024
C|1|1|X-net Peak|N|Y|Y|N|N|07|1|40
C|2|1|X-net Off-Peak|N|Y|N|Y|N|07|1|20
C|3|1|X-net Weekend|N|Y|N|N|Y|07|1|20
C|4|1|Same-net Peak|Y|N|Y|N|N|07|1|20
C|5|1|Same-net Off-Peak|Y|N|N|Y|N|07|1|10
C|6|1|Same-net Weekend|Y|N|N|N|Y|07|1|10
C|7|1|Landline Peak|N|Y|Y|N|N|0|1|20
C|8|1|Landline Off-Peak|N|Y|N|Y|N|0|1|10
C|9|1|Landline Weekend|N|Y|N|N|Y|0|1|10
C|10|1|0800 Freephone|N|Y|Y|Y|Y|0800|0|10
C|11|1|0808 Freephone|N|Y|Y|Y|Y|0800|0|10
C|12|1|Local Rate|N|Y|Y|Y|Y|0845|0|10
C|13|1|National Rate|N|Y|Y|Y|Y|0870|0|10
C|14|2|WAP Dial-up|N|N|Y|Y|Y|+4407973100500|2|10
C|15|3|SMS|Y|N|Y|Y|Y|0|3|10

Anyway, if anyone is interested in this program, please take a look at the file format and see if it is missing anything. Please also try writing the configuration for your tariff and send it to me at mail@julianmclean.com so I can begin to build up a number of tariffs to test against.

Your help is much appreciated, hopefully by involving the potential users I can develop something that is usefull to many people!

Cheers,

Jules

[ This Message was edited by: julianmclean on 2003-06-12 16:43 ]
Air
P800 no flip
Joined: Jun 11, 2003
Posts: 138
From: Brighton UK
PM
Posted: 2003-06-12 17:45
Reply with quoteEdit/Delete This PostPrint this post
Great Idea mate!

I'll have a bash at doing a config file for my current Orange Tarrif later on tonight.
nlhall
S700
Joined: Mar 19, 2003
Posts: 114
PM
Posted: 2003-06-13 15:35
Reply with quoteEdit/Delete This PostPrint this post
looks good mate, would realy like this software, but 1 question, how can the phone tell if it is the same or differant network ur calling? and also have you thought about the day of the month when ur mins get reset...
but good work so far i'll have a go at a config 4 my tariff's
ole1973
P800 no flip
Joined: Jun 08, 2002
Posts: 140
From: London
PM
Posted: 2003-06-13 17:47
Reply with quoteEdit/Delete This PostPrint this post
HI!

GREAT WORK JULIAN!!!!

How exactly do i make such a file and then what exactly do I d with it so that it will work?

THANKS IN ADVANCE - James
simion_levi
P900
Joined: Feb 20, 2003
Posts: 291
From: London, UK
PM
Posted: 2003-06-13 20:21
Reply with quoteEdit/Delete This PostPrint this post
A|Offpeak500|O2 ONLINE|UK|0700|1900
V|MR ANONYMOUS|0.1|13/06/2003
B|1|1|N|0|Calls|550
B|2|2|N|0|WAP|500
B|3|3|N|0|SMS|500
B|4|4|N|0|MMS|0
B|5|5|N|0|GPRS|0
B|6|5|N|0|WAP GPRS|0
C|1|1|X-net Peak|N|Y|Y|N|N|07|1|40
C|2|1|X-net Off-Peak|N|Y|N|Y|N|07|1|30
C|3|1|X-net Weekend|N|Y|N|N|Y|07|1|30
C|4|1|Same-net Peak|Y|N|Y|N|N|07|1|30
C|5|1|Same-net Off-Peak|Y|N|N|Y|N|07|1|2
C|6|1|Same-net Weekend|Y|N|N|N|Y|07|1|2
C|7|1|Landline Peak|N|Y|Y|N|N|0|1|30
C|8|1|Landline Off-Peak|N|Y|N|Y|N|0|1|2
C|9|1|Landline Weekend|N|Y|N|N|Y|0|1|2
C|13|1|National Rate|N|Y|Y|Y|Y|0870|0|30
C|14|2|WAP Dial-up|N|N|Y|Y|Y|915000|2|10
C|15|3|SMS|Y|N|Y|Y|Y|0|3|10


That's roughly O2 Online's offpeak500 tariff - but there are a few things that don't allow it to fit your formula perfectly. Very interested in this BTW, don't take these comments as personal criticisms - I want to see this thing working as you want! Below are my suggestions - might be worded as what 'should' be done, but there's an imaginary 'IMHO' in front of each one!

a) The offpeak500 tariff includes two sets of voicecalls - 500 to on-net, 50 to Xnet (both offpeak). I can't really add two separate 'inclusive' mins lines to the 'B' grouping, as there is no ON/X- net definition allowed for inclusive mins. Come to that, does that mean that all are assumed to be on-net only, or all are assumed to be X-net? And are they offpeak or on-peak? At the moment, it appears they just come out of the overall bucket, so will deduct X-net & peak calls, even when they should only deduct on-net offpeak calls on many tariffs.

b) Overcomplicated it a bit with local calls & landlines & on-net - don't bother; just class them all as ON-net. All inclusive minutes on all UK tariffs i know charge the same for off-peak on-net, landlines & local, plus they all charge the same out of inclusive too. You can leave the customisable 'C' option for people to add 'national rate' etc if charged differently, so they can still add local rate etc separately if they really want to - but i think there's no need.

I would also suggest that you chop out weekends/evenings for just 'offpeak' - but i know that some tariffs used to differentiate between them. None of mine do now, but i imagine some still could, so might need to be left in?

c) The on-net/Xnet thing is very tricky. Actually 077 = O2 is a very good generalisation, especially for me (who'd be using such a program with O2). You can then say 079 = T-bag mobile, since i've had three with that - but then it falls apart, because i've also got bills for an 07909 Voda and a 0796 Orange in front of me right now.

This might work for O2, and then call anything 07 != 077 X-Net, (can't recall anything but ported O2 077's on other networks in all of my life - possible, but certainly rare amongst my contacts). But for anyone but O2, you're either going to grossly under or over-estimate usage if you do this. It would be far better if you could somehow tag contacts in your phonebook with the networks they are on (could make people setup folders for ORANGE, O2, T-BAG... etc - but could the program read which folder the contact resides in?) or else ask you at the start/end of each call to pick which network you were calling.

Otherwise it's a data array with log file for people to enter every number they call and whether it's on or X-net. Whilst tedious at first, at least once the majority of their phonebook was logged in the program, it would be very accurate (depending on user, of course! )

Or else you just abandon the idea of X-net, and simply give people a total number of calls, maybe let them put in an 'average' price for x-net to on-net per unit, depending upon their normal ratio of call usage?




Errm, that's it for now, sure i'll come up with something else - but definitely sounds promising and i'd be glad to help you test the application, should you need it!

_________________
>>>Current: P800 (+BT200) & T610

Previous: 6610; A830 (3G); 7210 + HS-1C; 7650; 6310i + HDW-2; 8310; 6210; 3310; 5110; Analogue Moto.

[ This Message was edited by: simion_levi on 2003-06-13 19:24 ]
ole1973
P800 no flip
Joined: Jun 08, 2002
Posts: 140
From: London
PM
Posted: 2003-06-14 14:16
Reply with quoteEdit/Delete This PostPrint this post
Hi Julian,
I've sent you an email with my configuration for my tariff.
It's the address you posted earlier in this thread that I sent it to.

Cheers - keep up the good work,
James
ultimatemobiles
K800 Black
Joined: May 18, 2002
Posts: 328
From: London
PM, WWW
Posted: 2003-06-14 14:27
Reply with quoteEdit/Delete This PostPrint this post
Quote:

On 2003-06-13 20:21:51, simion_levi wrote:

Actually 077 = O2 is a very good generalisation,



Dont think its a very good generalisation at all, Im on UK Voda and my number starts with 077 and its not ported from anywhere!

I think x-net will be very hard to get right!

Simon
Eleventy7
K800 Black
Joined: Jul 05, 2002
Posts: > 500
From: the rotten oasis
PM, WWW
Posted: 2003-06-14 14:31
Reply with quoteEdit/Delete This PostPrint this post
this is getting interesting, i posted in the original thread saying i thought it'd never be possible, but it seems like i mite soon be proved wrong! maybe it's time i spent an hour decipering my contract and converting it into that format
ole1973
P800 no flip
Joined: Jun 08, 2002
Posts: 140
From: London
PM
Posted: 2003-06-14 15:27
Reply with quoteEdit/Delete This PostPrint this post
MAY I BE SO BOLD AS TO SAY THAT I : DISAGREE TOTALY

I think Julian' app is great - I MOSTLY call people on my contacts list - so for me it's perfect as all i've got to do to determine any mobile number on my contacts list as X-net or Same-Net is to put them into the "X-Net Contacts" list in the application!

Simple, effective and for OTHER numbers I add it's simple - ask them what network - and simply add thier name & number and then go to the application and add them to same/x-net contact list!

AND if I don't intend for this person to be a permanent contact perhaps thier might be an option to select after the call on the application screen whether the call was x-net or same-net.

Perhaps it could be made (if it's not allready) that the app presumes SAME NETWORK as DEFAULT for NON FILED (non-contact) numbers ad therefore you only have to set the X-Net calls. Or perhaps as there are MORE x-net than same net naturally for ANY user the default should be automatic x-net .... also the advantage of that would be that you couldn't have a bill UNDERESTIMATED and so never caught out by the amount of your bill.

At the end of the day the app will be great to give you a decent estimate of your bill so you know what to expect - nobody should expect such a complicated app to be PERFECT for EVERYONE straight away!

Anyway give the guy some credit he's done some amazing work!

Keep it up.

And i'm sure he appreciates ALL the comments.
julianmclean
P800
Joined: Mar 11, 2003
Posts: 118
PM
Posted: 2003-06-14 16:38
Reply with quoteEdit/Delete This PostPrint this post
Cheers for all the ideas, comments, support, etc in this thread so far. I'll post some proper thoughts tomorrow when i'm back at work (i.e. when I'm being paid for it! ;o)

Anyway, I've not had a lot of time to progress this much further recently and to make it worse (for you guys at least) I go on holiday on Tuesday for 2 weeks to sun myself on a beach. This weekend is also shot as I'm going out boozing in 5 mins! So unfortunately it is going to be a while before I can get a decent working version ready for testing. There is still a big problem with getting at the phone records - not even started looking at this - so far it is all nice easy standard Java. This may take a long while to sort out. I may have to release a pre-beta version which "doesn't actually work", but will show the interface, how the program operates and maybe a test harness that can be used to simulate calls and see the effect.

Sorry I can't write this stuff any quicker - I need to be a student again...!
ole1973
P800 no flip
Joined: Jun 08, 2002
Posts: 140
From: London
PM
Posted: 2003-06-14 22:57
Reply with quoteEdit/Delete This PostPrint this post
OH good thing I didn't say anything earlier on - as I was gonna say "he's done the hard part (geting the application to access the calls list"

Well anyway good luc still and let us know when you'll be needing testers etc ... maybe it'll be ready by my NEXT months bill start date (15th July I think)

Cheers
julianmclean
P800
Joined: Mar 11, 2003
Posts: 118
PM
Posted: 2003-06-16 10:37
Reply with quoteEdit/Delete This PostPrint this post
Right then, to answer a few queries posted above...

@nlhall
Q>>how can the phone tell if it is the same or differant network ur calling?
A>>Yes, this is a bit messy, but current thinking is to maintain a list of same network numbers within the app. This list will probably be able to be built up manually by entering numbers, or preferably by selecting from your list of contacts. Another, probably slicker option is to give the app a mask which identifies all mobiles (e.g 07 in the UK) and then everytime the app is calculating what type of call it is, it will ask you whether it is on-net or x-net. Of course, the answer will be stored from then on and after a few weeks, hopefully the list will be fairly complete (depending on how you use your phone)

Q>>and also have you thought about the day of the month when ur mins get reset...
A>>Yeah, this is stored within the user specific Contract object which defines things like the start/end of your contract, and the billing day which together are used to calculate which period the user is in and therefore identify the calls made in this period.

@simion_levi
Q>>The offpeak500 tariff includes two sets of voicecalls - 500 to on-net, 50 to Xnet (both offpeak). I can't really add two separate 'inclusive' mins lines to the 'B' grouping, as there is no ON/X- net definition allowed for inclusive mins.
A>>I think this can be done by doing the following; 2 different buckets, and then a few different call types:

//set up 2 buckets with different names like below
B|1|1|N|0|On-net Off-Peak Calls|500
B|2|1|N|0|X-net Off-Peak Calls|50

// 3 call types (usage types):
//first catches 07 for off-peak, excludes on-net, assigned to bucket 2
//second gets 07 for off-peak, includes on-net*, assigned to bucket 1
//third gets 0 (landline) for off-peak, no overrides, bucket 1 also
C|1|1|X-net Off-Peak|N|Y|N|Y|N|07|2|30
C|2|1|On-net Off-Peak|Y|N|N|Y|N|07|1|2
C|2|1|Landline Off-Peak||N|N|Y|N|0|1|2
*my description of "includes same-net?" wasn't correct sorry: if this flag is set, then ONLY calls in the same-net numbers list will be caught by this call type, AND NO OTHERS.
Does this fit your requirements now?

Q>>Overcomplicated it a bit with local calls & landlines & on-net - don't bother; just class them all as ON-net. All inclusive minutes on all UK tariffs i know charge the same for off-peak on-net
A>>True, I was just trying to make the object as flexible as possible. By configuring the tariff in different ways, it is up to the user how complicated the breakdown is. In its simplest form, for things like Orange YP700, the user can have one bucket, one usage type and will basically just give a view on how many minutes have been used in one particular period. Some tariffs (like yours!) however, can get very complicated.

Q>>I would also suggest that you chop out weekends/evenings for just 'offpeak' - but i know that some tariffs used to differentiate between them
A>>Again, as above, its just there in case people want to use it, the tariff can be simplified if it is not needed; merge the 2 calls types into one by setting both flags for off-peak and weekend. I've written alot of logic already for working out whether a particular call "fits" into a usage type. There's some polishing to be done, but this is some of the easier stuff to achieve. I'm trying to accommodate all tariffs - basically every call you make that has a different price needs a different usage type.

Anyway, I hope this has answered some of your questions. Its all good though, keep the thoughts coming as it is helping a great deal to define things in my head. All constructive criticism is welcomed.
ole1973
P800 no flip
Joined: Jun 08, 2002
Posts: 140
From: London
PM
Posted: 2003-06-16 18:41
Reply with quoteEdit/Delete This PostPrint this post
THIS PROGRAM IS A FUKIN NIGHTMARE - IT'S BULLSHIT - IT's ALL CRAP ....

oops- gotta be constructive with the ol' criticism!

Arf!

Anywayz cheers for keeping us up to date Julian - and I think I speak for everyone in saying thanks for all your efforts in this crucial program!! Gd Luck - Enjoy your holiday!
randomyachtie
P900 no flip
Joined: Jun 09, 2003
Posts: 101
From: Plymouth UK
PM, WWW
Posted: 2003-06-17 00:28
Reply with quoteEdit/Delete This PostPrint this post
Hi,

I really like the idea of this program, have done ever since I saw the first post which gave birth to the whole idea.

My only concern is that if you are going to keep a separate list of numbers for working out who's on what network, won't the pogram get very bulky for people with large phone books. Is there not a way of amending the current phonebook.

I know that mobile numbers are distinguished from home numbers in the phonebook by having /m after the number, in the same way home numbers have /h and work numbers have /w. Is it possible to add another /, so that say an orange mobile number could be 078794571234/m/o.?

This is just a thought and could be totally impossible!

I look forward to further developments.
julianmclean
P800
Joined: Mar 11, 2003
Posts: 118
PM
Posted: 2003-06-17 11:58
Reply with quoteEdit/Delete This PostPrint this post
@randomyachtie

Hmmm, yep I like your thinking - I had a similar idea before about using one of the fields within the contact information to store their network allegiance - probably something that no-one uses like "home fax number" (don't start bleating about using this field - fax machines went out with stoneage!) Even better I suppose would be to let the user choose which field they want to use.

I like your idea with the /m/o though - I don't know anything about the internal workings of the phonebook - maybe you could shed some light on it if you know about these things? I just tried adding a "/o" to one of my contacts to see what happened - I was still able to call the number correctly, but the /o appears in the field all the time. Not really a big problem I suppose.

The only problem I can see with storing this info in the contacts on the phone is that the app has to do more work in looking up every number in the contacts db first to determine which network he/she is on - if this list is local, it will be a much easier check.

One thing I did notice though was that the call register on the phone seems to store the name of the contact you are calling too (i.e. hard stored, not a link that is built from the contacts db when you view the list). I think it is like this as I called someone I know before I put them in the contacts and the list forever says 07887XXXXXX Unknown. But after I have put him in the phone book it says 07887XXXXXX Mr Smith.
I remember noticing that other phones I have get this link at the time of viewing the list, but not the P800 it seems. It could prove useful if some contact info is laid down in the call list - maybe an identifier in the contact name could be used to identify on-net?

This is a key part of the program, so maybe it will be good to have a few options and the use can choose which one they want to use.
This message was posted from a Pea
Access the forum with a mobile phone via esato.mobi