limitasteriskbillingelastix

Elastix A2Billing Limit Access


I want to create some limit access for A2Billing on Elastix. Here is some of the limit I need to apply [don't know how to display the table directly :) ]

<table>
  <tbody>
    <tr>
      <th>Group</th>
      <th>Days of Week</th>
      <th>Balance</th>
      <th>Talktime Limit</th>
      <th>Active Hours</th>
      <th>Destination Limit</th>
    </tr>
    <tr>
      <td>Management</td>
      <td>Monday - Saturday</td>
      <td>300,000</td>
      <td>Unlimited</td>
      <td>08.00-20.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Management</td>
      <td>Monday - Saturday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-20.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Management</td>
      <td>Monday - Saturday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-20.00</td>
      <td>Local,Mobile,SLJJ</td>
    </tr>
    <tr>
      <td>Production</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local</td>
    </tr>
    <tr>
      <td>Production</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Custumer Relation</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Custumer Relation</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Advisor</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Claim</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-20.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Provider</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Case Management</td>
      <td>Monday - Friday</td>
      <td>500,000</td>
      <td>10 minutes</td>
      <td>24 H</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Call Center</td>
      <td>Monday - Sunday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>24 H</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
    <tr>
      <td>Marketing</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,Mobile</td>
    </tr>
    <tr>
      <td>Marketing</td>
      <td>Monday - Friday</td>
      <td>300,000</td>
      <td>10 minutes</td>
      <td>08.00-18.00</td>
      <td>Local,SLJJ,Mobile</td>
    </tr>
  </tbody>
</table>

Is it possible with Elastix or A2Billing to create that kind of limit per account that already created before? Any help would be appreciated.


Solution

  • First of all your question have bad example(same destinations, same time, different limit), so it not doable without data re-think/rewrite on any system.

    Elastix have no any rating engine at all

    A2Billing have free minutes packages, you can allow create via freepbx custom context module context which allow call "free minutes" trunk to a2billing, something like this:

    trunk type custom with dialstring Local/$OUTNUM$@managment_a2b/n

    in extensions_custom.conf

    [managment_a2b]
    exten => _X.,1,GotoIFtime(8-20,Mon-Sat,*,*?choice1)
    exten => _X.,n,GotoIFtime(20-23,Mon-Sat,*,*?choice2)
    ; other choices here
    exten => _X,n(choice1),Set(CDR(accountcode)=123456789);account for managment call out at choice1 time.
    exten => _X.,n,Goto(a2billing,${exten},1);context a2billing have be context which allow call with account
    exten => _X,n(choice2),Set(CDR(accountcode)=123456780);account for managment call out at choice2 time.
    exten => _X.,n,Goto(a2billing,${exten},1);context a2billing have be context which allow call with account
    

    Sure you have setup in a2billing callplan for that account acordinly(with free minutes limit).

    Setup require understanding of a2billing and asterisk internals and quite complex.

    But such dialplan will be very complex if you expect setup limit per person. So will be simpler just ask some expert create custom billing for this case(or build complex dialplan tree with all choices you have)

    Different account for different calling destination can be done by using prefixes.

    For example this one

    exten => _590X.,1,Set(CDR(accountcode)=1)
    exten => _800X.,1,Set(CDR(accountcode)=2)
    

    will do different account for different prefixes(please note, it have same prio, will be choosed best fit)

    For more info read any book about asterisk(ORelly "The future of telephony" recommended) and a2billing manuals/source code.