[ASTPPCOM-231] Allow post-paid clients to set unlimited calls (No credit limit) Created: 15/Sep/17 Updated: 01/Apr/21 Resolved: 01/Apr/21 |
|
| Status: | Done |
| Project: | ASTPP Community |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | ||
| Reporter: | fozzygo4 | Assignee: | Samir Doshi |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The following code allows the admin to set a post-paid customer credit limit to 0 which then allows the post paid customer to make unlimited calls. The code is in /freeswitch/scripts/astpp/lib/astpp.functions.lua function get_balance(userinfo) balance = (userinfo['balance']) + (userinfo['credit_limit'] * userinfo['posttoexternal']); -- Override balance if call is DID / inbound and coming from provider to avoid provider balance checking upon DID call. if (userinfo['type'] == '3' and call_direction == 'inbound') then balance = 10000 end -- Make Postpaid calls unlimited if credit limit set to 0. if (userinfo['posttoexternal'] == '1' and userinfo['credit_limit'] == '0.00000') then balance = 10000 end return balance end |
| Comments |
| Comment by Samir Doshi [ 15/Sep/17 ] |
|
@FozzyGo4 Thanks for your code contribution but setting default balance when postpaid customer have 0 balance might create unexpected behaviour for some system admins as they will think system is skipping balance checking for postpaid customers. So we cannot directly merge this request. However we can use the idea and give option to admin if they want to allow to postpaid customer to make unlimited calls without balance checking, If they select yes then only skip balance checking else not. What do you think? |
| Comment by fozzygo4 [ 15/Sep/17 ] |
|
Thats actually what I want to do. Add a checkbox to the customer profile to allow unlimited calls. If checked then it should grey out (disable and set to 0) the credit limit text box. Also this should only be available to post-paid customers. |
| Comment by fozzygo4 [ 15/Sep/17 ] |
|
Perhaps the code behind would be: if (userinfo['posttoexternal'] == '1' and userinfo['no_limit'] == '1') then balance = 10000 end Add a no limit checkbox. code behind uses {{ userinfo['no_limit']}} |
| Comment by Samir Doshi [ 15/Sep/17 ] |
|
Exactly. That's the ideal way to do it. <https://mailtrack.io/> Sent with Mailtrack Best RegardsSamir Doshi Disclaimer: On Fri, Sep 15, 2017 at 5:14 PM, Stephen Forster <notifications@github.com> > Perhaps the code behind would be: |