<div dir="auto">This might help you. <div dir="auto"><a href="https://github.com/caruizdiaz/cnxcc-example?files=1">https://github.com/caruizdiaz/cnxcc-example?files=1</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 30 Aug 2017 11:09 am, "Logeshwaran G" <<a href="mailto:logeshwarangs@gmail.com">logeshwarangs@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks Federico! Will try it out.<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-1995652932220210426gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Thanks & Kind Regards,<br></div>Logeshwaran G<br></div></div></div>
<br><div class="gmail_quote">On Wed, Aug 30, 2017 at 11:34 AM, Federico Cabiddu <span dir="ltr"><<a href="mailto:federico.cabiddu@gmail.com" target="_blank">federico.cabiddu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div>yes it's correct, but if you want to deduct the cost at the end of the call you should use dlg_var to store cps etc.</div><div><br></div><div>Regards,</div><div><br></div><div>Federico</div></div><div class="m_-1995652932220210426HOEnZb"><div class="m_-1995652932220210426h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 30, 2017 at 7:16 AM, Logeshwaran G <span dir="ltr"><<a href="mailto:logeshwarangs@gmail.com" target="_blank">logeshwarangs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">Hi,<br><br></div><div class="gmail_extra">Is this the correct way of using the CNXCC for cost deduction, Guide me please.<br><br>route[CNXCC]<br>{<br> $var(customer) = $fU;<br> $var(cps) = "1.00"; # cost per second<br> $var(initial_p) = "1"; # intial pulse<br> $var(final_p) = "1"; #Final_pulse <br> $var(minbal) = 1;<br> $var(ret) = avp_db_query("SELECT credits FROM subscriber where username='$fU'", "$avp(s:credits)");<br> xlog("L_WARN", "CNXCC: var(ret)=$var(ret) avp(s:credits)=$avp(s:credits)<wbr>\n");<br> cnxcc_set_max_credit("$var(cus<wbr>tomer)", "$avp(s:credits)", "$var(cps)", "$var(initial_p)", "$var(final_p)"); <br> if ($avp(s:credits)< $var(minbal)){<br> xlog("L_ALERT", "ALERT: Credit balance is low, sent 403:Forbidden. required=$var(minbal)\n");<br> sl_send_reply("403", "Forbidden: Low balance");<br> drop;<br><br> }<br>}<br><br><br></div><div class="gmail_extra"><span><br><br clear="all"><div><div class="m_-1995652932220210426m_4192352102487230717m_3062531995788132436gmail-m_-4332387908445705936m_-6377922617482737643gmail_signature"><div dir="ltr"><div>Thanks & Kind Regards,<br></div>Logeshwaran G<br></div></div></div>
<br></span><div><div class="m_-1995652932220210426m_4192352102487230717h5"><div class="gmail_quote">On Fri, Aug 25, 2017 at 11:14 AM, Logeshwaran G <span dir="ltr"><<a href="mailto:logeshwarangs@gmail.com" target="_blank">logeshwarangs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thanks For your Input Federico, Will try it .<br></div><div class="gmail_extra"><span><br clear="all"><div><div class="m_-1995652932220210426m_4192352102487230717m_3062531995788132436gmail-m_-4332387908445705936m_-6377922617482737643m_-3691925917691359640gmail_signature"><div dir="ltr"><div>Thanks & Kind Regards,<br></div>Logeshwaran G<br></div></div></div>
<br></span><div><div class="m_-1995652932220210426m_4192352102487230717m_3062531995788132436gmail-m_-4332387908445705936m_-6377922617482737643h5"><div class="gmail_quote">On Wed, Aug 23, 2017 at 5:45 PM, Federico Cabiddu <span dir="ltr"><<a href="mailto:federico.cabiddu@gmail.com" target="_blank">federico.cabiddu@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div>cnxcc doesn't provide this feature. Is not aware of any backend, it just controls subscriber's balance, money or time, as instructed.</div><div>You can calculate the amount to be deducted after the call ends (if you're doing money based accounting) using dlg variables to store the needed information (start_time, end_time, cost per second) and then updating the balance via sqlops module's functions.</div><div><br></div><div>Cheers,</div><div><br></div><div>Federico</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-1995652932220210426m_4192352102487230717m_3062531995788132436gmail-m_-4332387908445705936m_-6377922617482737643m_-3691925917691359640h5">On Wed, Aug 23, 2017 at 7:50 AM, Logeshwaran G <span dir="ltr"><<a href="mailto:logeshwarangs@gmail.com" target="_blank">logeshwarangs@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="m_-1995652932220210426m_4192352102487230717m_3062531995788132436gmail-m_-4332387908445705936m_-6377922617482737643m_-3691925917691359640h5"><div dir="ltr"><div>Hi,<br></div><div><br>How to deduct the call cost or credits for the subscribers with the cnxcc module?<br><br></div>Input Please <br><div><div><br><br clear="all"><div><div class="m_-1995652932220210426m_4192352102487230717m_3062531995788132436gmail-m_-4332387908445705936m_-6377922617482737643m_-3691925917691359640m_-5222160128226862068m_-699297104756348686gmail_signature"><div dir="ltr"><div>Thanks & Kind Regards,<br></div>Logeshwaran G<br></div></div></div>
</div></div></div>
<br></div></div>______________________________<wbr>_________________<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<wbr>-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<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<wbr>-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div></div>
<br>______________________________<wbr>_________________<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<wbr>-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<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<wbr>-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Users Mailing List<br>
<a href="mailto:sr-users@lists.kamailio.org">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/<wbr>cgi-bin/mailman/listinfo/sr-<wbr>users</a><br>
<br></blockquote></div></div>