[SR-Users] Limiting calls from users in prepaid scenerio

Daniel-Constantin Mierla miconda at gmail.com
Thu Jun 7 13:24:22 CEST 2012


Hello,

On 6/5/12 11:17 AM, Aft nix wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
>
> We are thinking about launching a different "usage policy". The usage
> policy will be prepaid in some sense.
> but instead of limiting "number of minutes" we are thinking about
> limiting "number of calls".
>
> That means if you pay this X amount of doller, you can make Y amount
> of calls. calls can last whatever the
> user wants given that its under 1 hr.
>
> I've seen how to limit concurrent calls using SER, but the usage i
> have described, is not seen by me.
>
> So please help me out with this thing.
>
> My initial understanding about how it can be done :
>
> 1) when a dialog is confirmed with ACK(we have both callid, from tag,
> to tag), we can make an entry to the database
> by increasing "number of calls" field by one.
>
> 2) A field in database will be used as flag for usage limit. when
> "number of calls" exceeds the usage limit, it will flag it
> as "finished usage limit".
>
> 3) when a INVITE arrives, a check will be made with $fU against DB.
>
> With this framework in mind,  I have read "db_mysql" module. And to my
> surprise, no direct the database
> functions are not exported to the cfg.
>
> I don't know if any module in kamailio exports mysql_queury() to cfg,
> which i need for my purpose.
>
> And may be there is some built in module which provides a higher level
> layer which will enable myself achieving
> my goal.
>
> If in the end i need "exported" mysql functions, then i can develop it myself.
>
> So which way i should go?
see the sqlops module that provides sql query interfaces to various 
database systems, including mysql.
http://kamailio.org/docs/modules/stable/modules_k/sqlops.html

Cheers,
Daniel

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Seattle, USA, Sep 23-26, 2012 - http://asipto.com/u/katu
Kamailio Practical Workshop, Netherlands, Sep 10-12, 2012 - http://asipto.com/u/kpw






More information about the sr-users mailing list