[SR-Users] Prepaid system using dialog and sqlops

Daniel-Constantin Mierla miconda at gmail.com
Wed Aug 3 08:34:35 CEST 2016


Hello,


On 02/08/16 07:36, Infinicalls Infinicalls wrote:
> Hi,
>  I am still struggling to get a prepaid system for my service.
>
> After installing SIREMIS, I am able to get the CDRs updated. But even
> after adding the cron settings, the call duration doesn't get updated.
>
> And also in
>
> http://lists.sip-router.org/pipermail/sr-users/2012-January/071517.html
>
> it has been mentioned that
>
> "If it is the case of 1 call per user at a time, then practically can
> be done from kamailio config only. When call starts, compute the max
> duration for that call based on caller/destination (e.g., call a
> stored procedure via sqlops) and set the dialog timeout to that
> duration. When call ends (BYE in main route or timeout route) update
> the credit accordingly."
>
> Can somebody let me know if my understanding is correct.
>
> 1) Add a field called "credits" in the database. And topup that field.
>
> 2) First compute max permitted duration for that user by multiplying
> the cost for number prefix (say +91) and pulse.
>
> 3) And finally add this value to timeout of dialog. modparam("dialog",
> "default_timeout", 100000)
> $dlg_ctx(timeout_bye) = 1;
>
> Will this work? Any help would be appreciated.
>
That should work, you also need to deduct the used credit when the call
is ended.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.com - http://www.kamailio.org
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-users mailing list