[SR-Users] Prepaid system using dialog and sqlops

Infinicalls Infinicalls infinicalls at gmail.com
Tue Aug 2 07:36:07 CEST 2016


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.

regards
Ganesh Kumar



More information about the sr-users mailing list