[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.
If you get it implemented somehow then you can share that code with same
way. I will put this feature in wishlist.

<https://mailtrack.io/> Sent with Mailtrack
<https://mailtrack.io/install?source=signature&lang=en&referral=samir.doshi@inextrix.com&idSignature=22>

Best Regards

Samir Doshi
iNextrix Technologies Pvt. Ltd.
http://www.inextrix.com

Disclaimer:
The information contained in this communication is confidential and may be
legally privileged. It is intended solely for the use of the individual or
entity to whom it is addressed and others authorized to receive it. If you
are not the intended recipient you are hereby notified that any disclosure,
copying, distribution or taking action in reliance of the contents of this
information is strictly prohibited and may be unlawful. Please notify the
sender immediately and destroy all copies of this message and any
attachments contained in it.

On Fri, Sep 15, 2017 at 5:14 PM, Stephen Forster <notifications@github.com>
wrote:

> 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']
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/iNextrix/ASTPP/pull/231#issuecomment-329758773>, or mute
> the thread
> <https://github.com/notifications/unsubscribe-auth/AA6gcRpbBpvqHb3r6drQ-i12GF2j_kR6ks5simMVgaJpZM4PYw_M>
> .
>

Generated at Sat Feb 10 07:15:19 CET 2024 using Jira 8.13.3#813003-sha1:22ebedbb75c99b147c66f14e031dd8a2d214753a.