If you know the rate and the balance for the call, you may calculate the maximum time for the call as max_time = balance/rate. Then you may schedule a hangup for that call max_time in the future, something like this:<div><br>
</div><div>sched_hangup +&quot; + max_time + &quot; &quot;+ call_uuid +&quot; &#39;ALLOTED_TIMEOUT&#39;<br><div><br></div><div>That way the balance shouldn&#39;t go below 0, since you are hanging up the call before it does, with hangup cause ALLOTED_TIMEOUT.</div>
<div><br></div><div><br><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 2:44 PM, David Villasmil <span dir="ltr">&lt;<a href="mailto:david.villasmil.work@gmail.com">david.villasmil.work@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<div><br></div><div>I do the route selecting with a lua script. overflow and load distribution with mod_distributor loaded via curl.</div>
<div><br></div><div>the prepaid side is done with nibble, yes. But i don&#39;t like it too much, i might just deduct the balance when the call disconnects and let the authorization block new calls, so the balance might go under 0 a little... </div>


<div><br></div><div><br></div><div><br><br><div class="gmail_quote"><div><div></div><div class="h5">On Sun, Feb 27, 2011 at 9:06 PM, Saeed Ahmed <span dir="ltr">&lt;<a href="mailto:saeedahmad1981@gmail.com" target="_blank">saeedahmad1981@gmail.com</a>&gt;</span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">press sent too quick..<br><br>what did you use for routing? curl? esl?<br>
<br>did you use nibble bill for prepaid app?<div>

<div></div><div><br><br><div class="gmail_quote">On Sun, Feb 27, 2011 at 9:05 PM, Saeed Ahmed <span dir="ltr">&lt;<a href="mailto:saeedahmad1981@gmail.com" target="_blank">saeedahmad1981@gmail.com</a>&gt;</span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Great!<div><br></div><div>want to see it soon.</div>
</blockquote></div><br>
</div></div><br></div></div><div class="im">_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>