RE: Discussion: Prepaid counting

"Rene Kluwen" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
I would handle this "problem" the same way it occurred: With a lot of
imagination :)...

Haha, but I get your point.

-----Original Message-----
From: Nikos Balkanas [mailto:[email protected]] 
Sent: Monday, 02 August, 2010 00:56
To: Alejandro Guerrieri; Rene Kluwen
Cc: [email protected]; [email protected]
Subject: Re: Discussion: Prepaid counting

You have a very good point. Example:

There is a prepaid customer with a total balance of 1000 E. To prevent 
unauthorized use of his account, he poses the constraint never to exceed 100

E or 50000 SMS/week. How do you handle that?

BR,
Nikos
----- Original Message ----- 
From: "Alejandro Guerrieri" <[email protected]>
To: "Rene Kluwen" <[email protected]>
Cc: <[email protected]>; <[email protected]>
Sent: Sunday, August 01, 2010 9:28 PM
Subject: Re: Discussion: Prepaid counting


This patch will definitely have its place for many people's requirement, but

it's not generic enough for general usage imho.

Personally speaking, I don't like the idea of clogging any boxes' code with 
non-generic stuff. The billing approach would work for some people, but 
surely won't be flexible enough for others.

I like Stipe's "plugin approach" on his (commercial) smppbox: messages can 
be routed thru plugins, where you can implement all kind of stuff and 
add/remove them from your message pipeline. Using that approach, all kind of

billing mechanisms could be implemented (along with many other stuff of 
course).

Regards,
--
Alejandro Guerrieri
[email protected]



On 01/08/2010, at 03:08, Rene Kluwen wrote:

> Suppose I add 2 tables to sqlbox:
>
> mysql> describe sms_users;
> +---------+--------------+------+-----+---------+-------+
> | Field   | Type         | Null | Key | Default | Extra |
> +---------+--------------+------+-----+---------+-------+
> | binfo   | varchar(100) | NO   | PRI | NULL    |       |
> | balance | float(10,0)  | NO   |     | 0       |       |
> +---------+--------------+------+-----+---------+-------+
> 2 rows in set (0.00 sec)
>
> And:
>
> mysql> describe sms_rates;
> +---------+--------------+------+-----+---------+-------+
> | Field   | Type         | Null | Key | Default | Extra |
> +---------+--------------+------+-----+---------+-------+
> | prefix  | varchar(100) | NO   | PRI |         |       |
> | smsc    | varchar(100) | NO   | PRI |         |       |
> | rate    | float(10,4)  | NO   |     | 0.0000  |       |
> | country | varchar(255) | YES  |     |         |       |
> +---------+--------------+------+-----+---------+-------+
> 4 rows in set (0.00 sec)
>
> And suppose I match prefix/smsc against sms_rates and draw the variable
> "rate" from it.
>
> Next, I check the sms_users table with the binfo field (not sure if this 
> is
> a good idea or not) and I withdraw "rate" from "balance" if "balance" is 
> big
> enough. Once balance reaches 0, sqlbox will refuse to relay further 
> messages
> to bearerbox.
>
> Attached is a patch that does the trick (for now, only mysql engines). 
> Note:
> This code hasn't been tested yet and probably contains a bug or two.
>
> But I am posting it anyway to see what the almighty Kannel Developers have
> to say about it.
>
> This patch is especially useful if you want your clients to have access to
> an open smppbox with a limited amount of credits. But also it works for
> smsboxes and sqlboxes, as you please.
>
> I made a small patch to open smppbox that allows passing of binfo.
>
> == Rene
>
> <prepaid_1.patch>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.