<div><div dir="auto">Hi Carsten,</div></div><div dir="auto"><br></div><div dir="auto">That would be great thanks. I am just playing around at the moment, seeing how it all works!</div><div dir="auto">That information would be great thanks 👍</div><div dir="auto"><br></div><div dir="auto">Steve</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 25 May 2019 at 09:42, Carsten Bock <<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Hi Steven,<div dir="auto"><br></div><div dir="auto">If you want, I can provide you an example config based on ims_charging and ims_ocs without IMS. Even though, we do not use ims_ocs anymore in new deployments, we still have it running in production.</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Carsten</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Stephen Bucklin <<a href="mailto:steve@telcoelectronics.uk" target="_blank">steve@telcoelectronics.uk</a>> schrieb am Sa., 25. Mai 2019, 01:31:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="auto">Alex,</div></div><div dir="auto">Thanks so much for that. A lot to play with in the morning.</div><div dir="auto">I did set up an rtimer that called a route that then did checks if the number of dialogs > 1. </div><div dir="auto">I think I will keep playing with the time slices as the user may divert, conference etc so keeping the charging real time is my goal. There is also the potential of data usage at the same time. The credit is calculated on set up for the dialled path (mo and term costs) if each call and the charging calculator will then "reserve" money for 30 seconds and allow connection. Every 30 seconds it would request another 30 using a uuid passed in set up.</div><div dir="auto">I am hoping this will minimise Balance inconsistency for multiple calls + sms + data, with the actual accounting being done upon completion.</div><div dir="auto">I did not even think of jsonrpc, that will keep me reading tomorrow!</div><div dir="auto">Thanks,</div><div dir="auto">Steve</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 25 May 2019 at 00:17, Alex Balashov <<a href="mailto:abalashov@evaristesys.com" rel="noreferrer" target="_blank">abalashov@evaristesys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Well, the generic answer to the question of how to periodically do<br>
something in the background is 'rtimer':<br>
<br>
<a href="https://kamailio.org/docs/modules/5.2.x/modules/rtimer.html" rel="noreferrer noreferrer" target="_blank">https://kamailio.org/docs/modules/5.2.x/modules/rtimer.html</a><br>
<br>
This can be combined with putting dialogs in an `htable` (perhaps using<br>
the dialog module's start/end event_routes) and walking over the<br>
entries in a background rtimer route:<br>
<br>
<a href="https://kamailio.org/docs/modules/5.2.x/modules/htable.html#htable.f.sht_iterator_start" rel="noreferrer noreferrer" target="_blank">https://kamailio.org/docs/modules/5.2.x/modules/htable.html#htable.f.sht_iterator_start</a><br>
<br>
Alternately, one can use jsonrpc_exec() <br>
<br>
<a href="https://kamailio.org/docs/modules/5.2.x/modules/jsonrpcs.html#jsonrpcs.f.jsonrpc_exec" rel="noreferrer noreferrer" target="_blank">https://kamailio.org/docs/modules/5.2.x/modules/jsonrpcs.html#jsonrpcs.f.jsonrpc_exec</a><br>
<br>
to run 'dlg.list':<br>
<br>
<a href="https://kamailio.org/docs/modules/5.2.x/modules/dialog.html#dlg.r.list" rel="noreferrer noreferrer" target="_blank">https://kamailio.org/docs/modules/5.2.x/modules/dialog.html#dlg.r.list</a><br>
<br>
... and iterate over the output with the help of the 'jansson' module<br>
(JSON parser):<br>
<br>
<a href="https://kamailio.org/docs/modules/5.2.x/modules/jansson.html" rel="noreferrer noreferrer" target="_blank">https://kamailio.org/docs/modules/5.2.x/modules/jansson.html</a><br>
<br>
<br>
But honestly, I'd ask yourself whether this extra layer of complexity is<br>
truly worth it. For a lot of prepaid setups, live balance decrementing<br>
isn't worth the bother. <br>
<br>
An alternate and simpler approach is to just let the call be initiated<br>
if the balance is > 0 at the time the call is made, then deduct from the<br>
balance when the call ends.<br>
<br>
Yeah, it means someone's free to make a 4 hour call without the prepaid<br>
credit to support it, and worse yet, possibly a number of 4 hour calls<br>
initiated simultaneously. But most calls aren't like that, and from a<br>
business perspective, is it really worth the headache of live<br>
decrementing and all the moving parts involved?<br>
<br>
Maybe it is, but I would at least ask the question.<br>
<br>
-- Alex<br>
<br>
On Fri, May 24, 2019 at 06:18:19PM +0100, Steve Bucklin wrote:<br>
<br>
> Hello all (again),<br>
> <br>
> I am looking at a 'good' method to start a call with "chunks" of time<br>
> allocated. I wish the initial call to check a credit, and if credit is good,<br>
> allow a small amount of time (say 30 seconds). I have enabled DIALOG and<br>
> have looked at CNXCC, but am confused!<br>
> <br>
> When the initial 30 seconds runs out, I want to authorise another 30<br>
> seconds, etc, etc, etc. I have started to play and set a dialog timer that<br>
> expires to a route, and then can 'return' allowing the call to continue -<br>
> BUT was not able to reset the dialog timer to trip again after another 30<br>
> seconds.<br>
> <br>
> I tried to 'set_max_time' on cnxcc, but this did not seem to trip the event<br>
> route upon timeout?<br>
> <br>
> Does anyone have a pointer to any examples? I also am unsure of how to<br>
> update the timer and keep a call in play!<br>
> <br>
> Steve<br>
> <br>
> <br>
> <br>
> _______________________________________________<br>
> Kamailio (SER) - Users Mailing List<br>
> <a href="mailto:sr-users@lists.kamailio.org" rel="noreferrer" target="_blank">sr-users@lists.kamailio.org</a><br>
> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br>
-- <br>
Alex Balashov | Principal | Evariste Systems LLC<br>
<br>
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) <br>
Web: <a href="http://www.evaristesys.com/" rel="noreferrer noreferrer" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" rel="noreferrer noreferrer" target="_blank">http://www.csrpswitch.com/</a><br>
<br>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" rel="noreferrer" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" rel="noreferrer" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>
_______________________________________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div></div>