Uploaded image for project: 'ASTPP Community'
  1. ASTPP Community
  2. ASTPPCOM-231

Allow post-paid clients to set unlimited calls (No credit limit)

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Done
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      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
      

        Attachments

          Activity

            People

            Assignee:
            samir.doshi Samir Doshi
            Reporter:
            fozzygo4 fozzygo4
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: